Thursday, 21 July 2011

Day 39 -- 21/7/2011 Thursday

I went to continue working on the toon shader. I managed to decipher the cross-hatch shader with the help of Charles, an intern, shader guy. The only part which I dont understand was the normalise -> dot product -> absolute. Charles explained to me that these nodes creates a similar effect as a Fresnel look.

See Fresnel Effect: http://www.3drender.com/glossary/fresneleffect.htm

In this case, it acted like a rim light. Some shading-like toon effect, enhances the toon shader. Before I asked Charles for some help of understanding, I did a test myself. With partial understanding and followed node by node used in the network, this was the result. It was slightly better than the first time where I totally had no clue on what I'm doing and just blindly followed. Here was the result.



When I showed Charles the test file, he pointed out the T & S frequency was high and lowered down. Also the lighting model was set to Oren-Nayar, instead of constant. I believed that constant made the entire thing in white or flat colors for stuff to be projected on.

Here is the network in parts then the whole network together:

The first part was to clamp the color values to a new range and fit it to the diffuse color of the lighting model. Normalize the normals of it.





It is based on the luminance that the object gets from the lights in the scene. After the Lighting VOP, a Luminance VOP was used to get monochrome values, which range from 0 to 1.



A wireframe node was added with UV coordinates to map the lines properly. A control parameter to control the wire width and another parameter to control the wire color. However I need to add a complement to flip the operation because later on there will be another complement node to reverse the entire operation right after the wireframe node.



 Said earlier on, a complement node to reverse the whole operation.




This was the part I don't understand. With Charles' help, these nodes creates a similar effect as a Fresnel look. You can see the contrast/gradient effect falloff-kind of shade.



 The entire network with the final result.

No comments:

Post a Comment