Bump Mapping and Normals Smoothing in CG Rendering

Rashad CarterRashad Carter Posts: 1,799
edited December 1969 in The Commons

Okay, so now we're getting to the point where computer graphics can really turn out some plausible looking renders. As I study these images looking for what still stands out as unreal, I find a very common issue that seems to be independent of rendering software. The issue is that surfaces which have bump mapping applied never seem to be as smooth as they should. Tree trunks are a good example of this, but I often see it on close-ups of human characters as well.

Later when I get home I will upload a few examples, but I wanted to post the question now to see if anyone in the community has any insight on the issue.

If the issue I'm raising seems unclear consider the following.

1. Create an object that has curved edges, either a sphere or a cylinder or even a character's face.

2. Make sure the mesh is smoothed. Often times meshes may be overly smoothed. Generally, a smoothing angle of about 85 degrees does the trick without warping walls that should appear fully flat.

3. Apply a texture of some sort but make certain you do not enable bump mapping in any way. Render the scene for reference. What you are looking for is how smoothly the light progresses from highlight to shadow along the terminator of the shadow. Hopefully everyone knows what the terminator of a shadow is. What you should be seeing is a smooth gradient that doesn't have any distinct lines or breaking points revealing the underlying geometry of the mesh.

4. Now we will go back and enable bump on the material. Re-render. Look once again at the terminator's gradient to see if it remains as smooth as it had been before enabling bump.

For me this test always turns out the same, regardless of the render engine. Bryce, Carrara and as I said before, even Octane and Indigo RT demonstrate the same issue, which is that the bump mapping when enabled somehow corrupts the smoothing of the normals leading to obvious breaks in the shadow gradient which again reveals the underlying mesh ruining the illusion of realism for the viewer.

So, how can one fix such a thing? I was convinced I'd just stop using bump mapping altogether, relying on normal mapping instead. And indeed this may prove to be the better solution, though I have yet to test it very rigorously. I have however tested using increased sharpness from the diffuse texture itself and not using any bump and strangely it actually looks a lot like bump mapping....and it too seemed to break mesh smoothing!!! So odd, right?

Bump mapping breaks smoothing and so does super sharpness from the diffuse map. What can we do? Maybe we need to rethink bump mapping or smoothing. Maybe one idea is to tell the renderer to apply smoothing values only after it has applied bumps.

Considering how common the issue is it must be a difficult one to solve. Maybe the perspective or a programmer will shed some light.

Feedback is greatly appreciated. Thanks.

Comments

  • evilproducerevilproducer Posts: 9,040
    edited December 1969

    I'm not sure what you're seeing Rashad, and you aren't to clear on whether you mean a concave surface, a curved wall or a sphere, so in my test it was easier to just insert a vertex sphere.

    With no bump, the surface has a nice graduated terminus. With a high amplitude bump, the graduation does indeed seem to disappear. With a low amplitude bum, the graduation is back as well as the bump.

    I know with your experience that you know how bump maps or bump functions generally work, but I'll give the crib notes version for people new to 3D and texturing.

    A bump function is an illusion. It is a grayscale function that tells the render that lighter areas of the texture are higher, and darker areas are lower. It does not actually change the underlying geometry of the object. Look at my reference images and you will see that even the sphere with the high amplitude bump has a smooth outer edge. It is a CG optical illusion.

    Displacement works in many ways like the bump function, except that it actually displaces the geometry and makes brighter areas of the displacement texture physically higher and darker areas physically lower. A higher density mesh or one that uses smoothing will work better if the displacement map/texture is highly detailed. It can take linger to render as well.

    The final image uses displacement. I copied the bump shader and pasted it into the displacement. I then had to reduce the intensity to around 5% as Carrara's displacement is pretty strong.

    Picture_5.png
    822 x 645 - 53K
    Picture_4.png
    741 x 675 - 82K
    Picture_2.png
    782 x 729 - 116K
    Picture_3.png
    795 x 673 - 36K
  • evilproducerevilproducer Posts: 9,040
    edited December 1969

    Thanks for the link.

    Now I just have to see a visual of what Rashad was talking about.

  • Rashad CarterRashad Carter Posts: 1,799
    edited December 1969

    Uh-oh, somehow a response I posted last night hasn't made it into the thread. My apology for the late response.

    Chris Palomino
    Thanks for that article. The information is presented in a digestible manner.

    EvilProducer,
    Yes, this is exactly the phenomenon I am talking about, thanks for uploading these examples. Indeed, very low bump settings seem to be okay. In Bryce for instance a bump setting of 10 or less will look okay, but with the maximum allowed bump being 1000, and the average user assigned bump is usually between 50 and 100, a setting of 10 or less is not helpful. It is almost equivalent to no bump at all. However the sharpness of the bump image also affects the result, as sharper images affect smoothing more. With a blurred image I can use settings that are higher before mesh smoothing breaks.

    The same is true for the Carrara examples you've uploaded. If the point behind bump is that it is to add the appearance of contours then one would hope they could see those contours from some distance greater than a foot or so. What I am saying is that it seems there is no possible way to use bump settings as high as those in your second image while retaining the smoothness of the mesh in the first image. Very low bump values might not be sufficient depending on the project.

    I've got to re-upload the content I thought I uploaded last night. It demonstrates how this broken smoothing can wreak havoc on an otherwise convincing human figure render. Clearly, HD models demonstrate the issue less as their finer geometry makes any breaks in the smoothing far less noticeable. More to come.

  • evilproducerevilproducer Posts: 9,040
    edited December 1969

    I can kind of see your point, but I don't think the lack of graduation is a smoothing issue, as the edge of the sphere is clearly smoothed. The underlying mesh is fairly low poly and I was able to eliminate the faceting by applying smoothing. The terminus also doesn't look faceted, just not graduated. Could that lack of graduation have more to do with the 256 levels of gray that the bump is limited to? The higher or stronger the bump, the more it is akin to a high contrast image with whiter whites and blacker blacks, with less subtle in-between shades.

  • evilproducerevilproducer Posts: 9,040
    edited December 2014

    I don't use normal maps, as C7.2 Pro doesn't use them, so that is why I'm concentrating on the bump maps. If anybody can post some normal map tests, that would be great!

    So, going back to the bumps, I have an earth model that I built that uses maps by NASA. This uses the mid-resolution maps. The ocean has no bump, but the continents do. I have the level set at 100%. The same for the cloud layer. I have that set at 100%

    I see graduation of the terminus across the even the continents. I think that as the article that Cris linked to suggests, there are limitations and advantages for each method. An overly exaggerated bump will cause issues with the terminus not having a smoothly graduated surface. The earth image has a high bump value, but the resolution of the map, coupled with a well designed bump map produces a look that suggests mountains and other elevations without being overly strong in areas where there is less elevation.

    Edited to add that the cloud layer does have the sudden terminus, but that is probably because I didn't have a proper bump map and used the color map in the bump channel. I could probably lower it and have a smoother transition and maybe some more subtle cloud bumps.

    Earth_test.jpg
    2000 x 1500 - 620K
    Picture_6.png
    945 x 816 - 813K
    Post edited by evilproducer on
  • Rashad CarterRashad Carter Posts: 1,799
    edited December 1969

    I can kind of see your point, but I don't think the lack of graduation is a smoothing issue, as the edge of the sphere is clearly smoothed. The underlying mesh is fairly low poly and I was able to eliminate the faceting by applying smoothing. The terminus also doesn't look faceted, just not graduated. Could that lack of graduation have more to do with the 256 levels of gray that the bump is limited to? The higher or stronger the bump, the more it is akin to a high contrast image with whiter whites and blacker blacks, with less subtle in-between shades.

    I may not be using the proper terminology. I consider the hard line to be a localized corruption of the smoothing, but if the word graduation is better suited then it is fine to use that term. This doesn't mean to imply that the smoothing/graduation for the entire mesh is broken, it means that to my eye the smoothing/ graduation seems to be corrupted at the point of the shadow terminus.

    Try the same test on a sphere with a higher polygonal resolution and you may find that the exact location of the hard terminus might be different.

    In fact, I have created models with enough polygons that I had no need to apply smoothing at all. Even in these examples, if indeed the diffuse color map was very sharp, it too would still create a harsh graduation line. I will go into more detail with this part later, but for now we can focus just on procedural bump maps.

    Below is the file I thought I uploaded last night. There are five columns. On the far left is the wireframe and on the right are various renders. I should state that in Bryce 7 there is a bug with displacement mapping being off centered, which is why it doesnt get used very often in Bryce, still, it works fine for these examples.

    Column 2
    Show the models with smoothing but no bump or displacement. **Keep in mind as well, that the very bottom sphere of 32,000 polygons does not have smoothing applied at all.

    Column 3
    Shows the way bump mapping actually works right now. Sharp terminus line. The exact location of the line seems to depend somewhat on the resolution of the underlying mesh.

    Column 4
    This is what bump should look like to my view. While there are some issues such as with the bottom two spheres allowing light from the illuminated side to penetrate all the way to the dark side of the sphere, still it avoids the harsh terminus line. In order to pull this off in Bryce, I had to enable Displacement, but to prevent it from showing I kept the power setting at 0. I have tricked Bryce into calculating the bump more accurately simply by introducing displacement to the material. In this case the micropolygons were created but they were given no height, so in theory , they should be as dark as the bump only renders on the unlit side of the spheres. But indeed, that is not the case and somehow the mere introduction of displacement has fixed the bump

    Column 5
    This is what displacement alone looks like. Notice that in this case smoothing actually has been corrupted along the entire surface of the model (this is true in column 4 as well) but still there is no harsh terminus. I never expected there to be a harsh terminus with displacement, but it is interesting to note that the displacement did corrupt smoothing in order for it to function at all. But with a decent resolution source mesh of 720 polygons, the displacement alone looks quite good aside from the mapping issues.

    Anyhow, this is an exhaustive study. Conducting these experiments in each of the various applications of Daz forums such as Bryce, Carrara, DS, Octane, LuxRender will provide different results, but all the results will be similar. This is an industry wide problem.

    I conclude from this test that in those renders (regardless of software) where we see bump looking the way it should it is probably only looking correct because displacement is also enabled...even if only to the slightest degree. If the same surface was rendered with displacement fully disabled it would likely show the harsh terminus caused by the bump.

    Being the nitpicker that I am, these tiny details tend to be the things I notice and that give away cg art compared to real photos. Even the big boys haven't quite figured this one out. I feel good at least knowing that displacement can help to solve it.

    Bump_Smoothing_Graduation_Problem.jpg
    2000 x 1238 - 607K
Sign In or Register to comment.