Tuesday, November 10, 2009

An update on RibTools

Here is a quick update on the recent work on RibTools... which is not much, considering how busy I've been with maintaining web sites and building new ones (more on that in another update !).

With the goal of getting the light shaders working, a lot of refactoring had to happen. Both in the the shader compiler and in the state machine, where all the symbols are kept. Those symbols are often exposed to the shaders, so it was important to clean things up.

With light shaders also functions such as diffuse() are written in RenderMan SL themselves. See here the commented code vs the new code, that relies on the illuminance() construct.

illuminance() is some sort of foreach() kind of construct. It loops over all the lights, running each light-shader corresponding to that light (in RenderMan, apparently a light is a shader).
The parameters give an optional cone of influence, so if a certain light direction doesn't intersect the cone of incluence specified by illuminance() then the statements below the illuminance() constructs aren't called (the light is ignored).

The light shader basically is responsible to set the eventual light direction L and the color Cl ('C' stands for color and 'l' stands for light). The statements below will most likely at least use the Cl value to give color to the surface.

This is more or less what I understood of this process.. but for me, the next step will really be just to run the light shader of an ambient light and get a surface to be lit just but that basic light 8)

I haven't been working in a branch, so the current build is basically broken (builds, but renders black or crashes).. but I don't suspect that many people are currently lining up to the get code to compile and run 8P

..time for some more debugging and then zzzzz !

No comments:

Post a Comment