PDA

View Full Version : Renderman Env light and custom shaders


vsPiotr
03-09-2010, 12:11 AM
Hi All,

I'm trying to learn some basic Renderman shader writing.

The biggest problem I have at the moment is creating shaders that take advantage of data generated by the EnvLight.

I'm using RMfM, had a look at the shaders that come with it and they're a bit too much for me.
Is there a simple way of getting the result?

Cheers,
Peter.

ndeboar
03-09-2010, 10:44 AM
Maybe start with the basics, eg writting a shader/light that generates occlusion/color bleeding. Might give you a better understanding of how the env light works. Fundza has some good resources on this.

I'm not familar at all with the rman env light (we just wrote our own), but there are genearlly two ways of passing information from a light to a surface

1.The Cl variable, which gives you the lights intensity and color (i'll take a punt and say it's proably in the ambient light catagory)
or
2. Outputing a varriable from the light shader, and then reading it in the surface shader using lightsource() (think there are fancier ways of doing this in rsl 2.0, but im still stuck in rsl 1).

vsPiotr
03-09-2010, 09:58 PM
Thanks!

I did some experiments with my own env light in 3delight and I've been through using gather() for a variety of purposes.

I really like the way rman envlight integrates.
I suspect it's not going to be as easy as it should be :) esp. when envlight can do all sorts of fancy baking and such.
Do you think there's a chance baked data becomes available in Cl? (or similar).

ndeboar
03-10-2010, 11:29 AM
your best bet is to look at how the shaders access it. I had a quick look at the lambert.h, and it seems to just use the rfmIndirectDiffuse() function. Looks pretty straightforward.

2stepdmb
03-11-2010, 12:06 AM
You can take a look at the $RFM/lib/rfm/rsl/mayaNodes/_rfmShadingUtils.h header file. The functions (like rfmIndirectDiffuse), should show you how you can call the environment light in your own shader.

Good luck!

Ian

mr Bob
03-11-2010, 01:07 AM
You should get hold of the renderman shading language guide book. It covers the env light.

b

CGTalk Moderation
03-11-2010, 01:07 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.