Wednesday, March 5, 2014

WIP shader NPR development on Petal and Stem

WIP NPR shader development on Petal and Stem

I have been using RSL(renderman shading language) to develop my NPR shader and render it from Renderman for Maya.
I used one of Chang Dai-chien's Lotus painting as my main reference for composition and surface properties. And I started with developing the shader for the Petals.


1. First Draft Petal Shader:

Here is a screenshot of my first draft Petal shader:
In my first draft version, I tried to get a basic contour rendered and a basic interior shading for the surface to match the ink color. I wrote a function to detect the contour based on the surface normal N, the eye ray I, and a user input threshold th (for controlling the width of the contour).
For the interior shading, the color of the surface is determined by the diffuse factor of particular surface point (the angle between the surface normal and the incoming light ray hitting that surface point). And according to the diffuse factor (an float number from 0.0 to 1.0), an 1D color ramp is applied to the surface to determined the color. These colors are picked based on the different tones of the ink and also the changes of color when ink spreading on paper.

The render result with this draft petal shader is shown below:


2. Adding Painterly Details and Irregularity:

Apparently, this looks way too perfectly smooth and really CG. 
In next step, I'm trying to adding more 'painterly details' to mimic the effect of ink spreading on paper.
Here is a screenshot of the revised shader:


Here I  added a simply noise function to the diffuse factor to break the transition between different ink tones. The noise (from 0 to 1), is applied with a scale factor: (noise-0.5)/scaleFactor for controlling how much the ink spread. And I assemble different shading components back to a MaterialEnsemble node builded in Renderman Silm. The benefit of doing this is to take advantage of the build-in function renderman already has and get a better implement with maya (for instance, using light link with maya lights) 

Also, I used the similar method to create the stem shader (with irregular edges and same interior shading)

 


A render test in maya with the revised shaders:

A close-up compare of the improvements:

before

after


3. Thoughts on the Artistic Controls of Shading:

When using physical brush and ink, traditional painters control where and in what direction to have the brush interact with paper. Similar to this, CG artists also need to have artistic control on where to put the color and even how it spread over the surface.
Since the interior shading is control by diffuse factor, artist can control the look of the surface by using lights with different intensities in different directions.
Here are some screenshots with maya file and the render image side by side.



As shown above, the color of the petal is changed by manipulating the directional lights in maya. In this way, artist can control the shading by moving lights.

No comments:

Post a Comment