R Reynolds Posted March 22, 2012 Posted March 22, 2012 In this thread Robert showed me how I can generate an image suitable for normal decals. The image of a cylinder and sphere on a flat plane is his example. Note that the flat plane RGB value is 128, 128, 255. The image of a series of troughs in a flat plane is my first attempt. The problem is that the RGB value for the flat plane is now 112, 112, 255 which shows up as a difference in shading at the decal edge. So I started to debug this and I got an unexpected result. I moved the cylinder out of the field of view in Robert's example, re-rendered and the flat plane RGB is still 128,128,255 but when I put back the cylinder and moved the sphere, the flat plane is now 118, 118, 255. When moved both the cylinder and sphere and rendered only the flat plane it now has a value of 2,2,255. Now I don't pretend to know the first thing about generating normal buffers but shouldn't a flat plane, normal to an orthogonal camera generate 128, 128, 255 every time? This is not a show-stopper, it's relatively easy to fill in the surrounding with the correct RGB and do some filtering to blur the edges. So I have the decal I want but I'd like to understand this phenomena for potential future work arounds. Quote
Hash Fellow robcat2075 Posted March 22, 2012 Hash Fellow Posted March 22, 2012 Curious. I think we need Yves for this. Someone say his name three times out loud. Quote
Hash Fellow robcat2075 Posted March 22, 2012 Hash Fellow Posted March 22, 2012 Might this have anything to do with a buffer being "normalized"... being stretched so that its high and low are as close to 0 and 1.0 as possible? Not that that is necessarily right for a Normal buffer...? Quote
Simon Edmondson Posted March 22, 2012 Posted March 22, 2012 Pardon my ignorance but what is a normal buffer ? I've used shadows only in the past but have no idea what a normal buffer is or what it would be used for ? regards simon Quote
Fuchur Posted March 22, 2012 Posted March 22, 2012 Pardon my ignorance but what is a normal buffer ? I've used shadows only in the past but have no idea what a normal buffer is or what it would be used for ? regards simon There are more possibilities, but in this case it would be used as a normal-map, which is another type of height-map like Bump- or Displacementmaps. You can use it to create normal maps of very detailed parts of your model and can get rid of many patches afterwards. I am not totally sure when it really will lower rendertimes, but we will see. See you *Fuchur* Quote
ypoissant Posted March 22, 2012 Posted March 22, 2012 Someone called? You are right Rodger that a flat plane should be 128 128 255, no matter what else is in the field of view. Why it isn't? I don't know and this is a case where I would need to trace the code execution through a debugger to figure it. It is either a bug or a kind of tone mapping post process applied to the normal buffer. Try another file format maybe? As a remedy, you can always scale the values using the "Curves" or "Levels" tools in Photoshop. Doing that, you would get better rescaling precision if you could save the normal map in a format that support 16bits per channel. Although, in this case, since the span of the values are larger than the ones you need, I don't think you would loose a lot of normal information by going 8bits per channel. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.