Tuesday, June 12, 2012

Day 12

In the first part of the day I started off with renderMan. By now I have come to terms with the fact that I wont be able to cover 25 pages of the book everyday. Its painfully slow going, but I am getting it and its really great. The amount of control you get on the appearance is really amazing and I haven't even started writing my own shaders yet.

Today I was trying inbuilt surface shaders that come with renderMan. This is the base setup I used for all my scenes.

Basic setup used for all the scenes
The camera has been translated 5 units back in z-axis and we have zoomed in using a fov of 30 degrees. There are two lights in the scene, a key-light which is a spotlight positioned at (-2, 2, -2) and aiming at (0, 0, 0), having an intensity of 7 and a fill-light which is an ambient light with an intensity of 0.3. As always I will be testing out everything on a sphere.

Constant Surface 

This is, I guess, the simplest surface shader.  It just takes the colour that we define in the RIB and uses it as the output colour, completely ignoring the lighting setup in the scene.

The constant surface
Matte Surface

This is more like the lambert shader in Maya. It gives a diffuse and an ambient reflection. The amount of the diffuse and the ambient light scattered by the surface can be specified by Ka(coefficient of ambient reflection) and Kd(coefficient of diffuse reflection). I experimented with both the parameters to see how it effects the output.

Testing the effect of increasing Kd from 0 to 1

Testing the effect of increasing Ka from 0 to 1

Metal Surface

The position of the specular highlight on the metal surface shader is highly dependent on the position of the observer. We can control the overall look of the object by adjusting the Ks(the coefficient of specular reflection) and the roughness parameters. Surface with high roughness produces a less sharply defined highlight and a smooth surface produces a small and sharp bright point.

Testing the effect of Ks for 0.5, 1.0, 2.0 and 4.0
Testing the effect for different values of Roughness
Ks = 1.0 for all the images
Plastic Surface

Plastic surface is one of the more versatile surfaces. It has the Kd and Ks parameters using which it can be made to appear like metal, plastic or matte surface.
Plastic surface shader adjusted to look like different surfaces
Also, we have the option to control the specular colour. In the images below I have set the specular colour to red, yellow and white.
Plastic surface shader with different coloured highlights
Painted Plastic Surface

Painted plastic is one of the more complex surface shaders. Along with the regular Ks, Ka, Kd, roughness, specularcolor attributes it comes with a 'texturename' attribute with which we can attach textures to the shader. Here I have attached a marble like texture to the shader.
Painted Plastic suface with a marble-like texture

Well thats all for shaders now. These are just regular inbuilt surface shaders which ship with all the renderMan compliant renderers. I will be getting extensively into shaders once I am done with the general stuff. Tomorrow I will get into more complex surfaces(a refreshing break from spheres) like patches, polygons etc. Thats it for today.



No comments:

Post a Comment