Though shader authoring isn't my forte I was willing to have a go, plus had a free weekend, so armed with Google and the RISpec (3.2) I proceeded to create a simple 'light' (not 'surface') shader which uses a texture within its lighting calculations...
/* Simple image-based lighting shader */
light
imagelight(float intensity = 1.0;
color lightcolor = 1;
string texturename = "";
float blur = 0.5,
__nondiffuse = 0,
__nonspecular = 0;)
{
solar()
if (texturename != "")
Cl = intensity * (lightcolor * color environment(texturename, -L, "blur", blur));
else
Cl = 0;
}

Though not perfect, even after much trial-and-error (always a good way to learn), I now have a better understanding of some aspects of the RenderMan shading language and a base shader which offers me a good starting point to continue my work.
Interestingly, and something that's important to note, this shader actually highlighted an issue within Aqsis 1.2.0 (alpha 1) which was fixed the following day by one of the developers... further demonstrating the importance of submitting bug reports, irrespective of your experience/knowledge - http://sf.net/projects/aqsis
0 comments:
Post a Comment