Hi Karl
1. Recreate diffuse shading with VSL, adding only curve control. I guess
everyone has done this.
2. Create an analytical sphere, which is cut in half by a cube, making it
a hemisphere.
3. Set the analytical sphere to hollow and put a lightsource inside it,
just to make sure lighting is done correctly, to illustrate this point.
When rendered without the material, only the inside is lit as expected.
Applying the material will render it all black?
I could not duplicate the problem. Here's my minimally simple test material:
COLOR mydiffuse=r,g,b
surface properties
color=0,0,0 /* Default diffuse off */
surface illumination
FLOAT k
k=multiply(light:ray*normal, surface:ray*normal)
if(k>0) /* if light and camera see the same side of surface */
COLOR tmp
k=fabs(light:ray*normal) /* Eliminate sign issue*/
k=curve(k) /* weight by angle */
tmp=multiply(mydiffuse, light:illumination)
surface:illumination += multiply(tmp, k)
The structure is pretty much the same as in the simple example materials
such as the silk. Instead of using fabs of the ray*normal, one can naturally
use a curve that defines a zero centered symmetric weight for the parameter
range from -1 to +1 . This simplifies the shader but keeping the curve
symmetric is a little bit extra work for the user.
I suspect that this is nothing new for you, so please send me a test file if
the problem remains a mystery.
Best regards,
Vesa