Wednesday, May 2, 2012

Bent normal to simulate indirect illumination(plus diffuse convolution).


Using the final gathering for animated objects demands very high settings and could take a very long rendering time. This high settings are usually for preventing flickering or swimming pixels in the image.
If there's a flicker free solution, one can feel free to use the final gathering for animation.
Bent normal can produce a one-bounce final gathering like result easily, even though it takes some preparation.





Fist, I used the final gathering using the following 2k environment map to get this result.



This is a 3-bounce FG result. 
I assigned a white mia_material on the left one. I will use bent normal env as an indirect illumination input for the right one.

Here's the bent normal env connection which will be used as an indirect illumination input.



The bent normal env node's attributes.


The amb occlusion node feeds the Bent Normals attribute of the bent normal env node.




 For the environment texture for the lookup_spherical node, you need a convolution-applied version of the environment texture that was used for the final gathering.


This small thumbnail-like image is what I used as an input environment for the bent normal env node.
It can be really small like this since it doesn't require any detail. It's just to simulate a fully diffusive illumination.

Here's the other mia_material for the object on the right.
I connect the output of the bent normal env node to the Ambient Light Color attribute.



 Now, this mia material shader has an incoming illumination which is attenuated by the build-in AO.



This is the render result. The left one is illuminated by FG and the right one is the simulated indirect illumination that comes from the bent normal environment.( I turned off the Final Gather Cast and Receive render flag for the object on the right to prevent it from getting the double indirect illumination.)


They look almost the same. This method can be a good alternative to the FG. It's flicker-free.
With a textured shading, it's almost impossible to tell which is which.



1 comment:

  1. Hi mate, I just discovered your amazing blog! You give great tips, thanks a lot for sharing!

    ReplyDelete