edge
 
latest news
TUTORIAL: Level - All: Using the pWittmer_gCloud shader

Summary:
The shader is a general purpose particle shader made in sl. In this instance it was built and compiled with 3delight in mind but im sure it will be suitable for any renderman compliant renderer. It'd just need to be compiled for each one.

Its a surface shader that you apply to sphere particle type but instead of just having a texture this one employs a 3d noise based on world position. If you supply the particle position then the noise will travel locally with the particles also .

You could use this shader instead of points since it accepts rgbPP and opacityPP already (just make smaller spheres). It will also do a better job then sprites since you can 'light' the spheres according to the scene. And lastly it does an acceptable job of rendering volumous effects like clouds and steam etc.

          

How to use:

1. First download the .sdl from here:

philCloud.sdl

-updated!! now has contrast and a few tweaks internally to help the shadowing problem when density reaches the end of the spheres. plus i changed the name to something a bit easier to remember. There are other steps ofcourse like making shadows calculate the surface shaders aswell in the 3delight globals but they should be covered in the video tutorial (even if the name has changed). See image below

2. Ive actually made a 30 minute video on how to best use the shader here

gcloud video tutorial

3. Here is a demo scene with the attributes needed on the particle shape already created for you and attached via a 3delight attrs node plus a light with deep shadows via a light attr node plus ofcourse the particles and the shader attached. (maya 2008 .ma file.)

test_philCloud.ma

 

The shader above (philCloud.sl) will do self shadowing (using a simple lambert diffuse model) but since its a surface shader it relies solely on the information on the surface of the sphere. The shadowedcloud shader on the other hand raymarches into the sphere to gather actual 3d data. Its alot slower because of that though.

The shader code for this surface shader (philCloud) is available on the forum. Im also going to add some displacement to the shader too and possibly different types of noise calcs, not just perlin.

Below is a render after I made some tweaks to the shader. In the first flash video above you might be able to see some shadow artifacts from the spheres themselves, unfortunately since they are actually spheres you can sometimes get this problem. To counter this Ive added a contrast control to the next version of philCloud so that you can contrast out the detail that softly spreads out to the edges (which becomes a problem with many overlapping particles). This way, the noise doesnt follow the circumference as tightly and is less likely to produce shadow artifacts.

test_philCloud
Now for something else. Below is a shader that actually steps thru the space of the sphere and adds noise in 3d.

Self shadowed clouds now available!
Above is the rendered version of the self shadowed clouds. Its an edit of the shadowedclouds.sl in the renderman book, but ive added :

  • rgbPP
  • opacityPP
  • rotPP (which needs rotateAxisPP to work also)
  • contrast
  • position

More examples below. sorry about rushing these examples but you get the idea. The next image is with 3 octaves of noise, you have to decrease the step size to see it, in this example it went from 0.1 down to 0.05 before more noise was visible.
Then the image after that is with mo blur but back on 2 octaves.

Here is the example scene used.

shadowedClouds_exampleScene.ma

And youll need to put this .sdl in your shaders folder for 3delight.

shadowedclouds_pw.sdl

You have to add the per particle attributes and make them spheres for this to work. Also you need a 3delight attr with those particle attrs added to it. See the example scene for a demo.

3octaves
moblur

 

 
links

 

copy right 2008