RenderMan & RISpec >> "Surface" calls in light shaders

by STefano » Wed, 04 Oct 2006 00:26:03 GMT

Hi all , does something like this have any sense ?

code:
light
surfLight(
float intensity = 1;
color lightcolor = 1;
point from = point "shader" (0,0,0);
)
{
illuminate(from) {
color surfaceCol ;
float getme = surface( "_diffuse" , surfaceCol );
printf ( "%f %c \n", getme , surfaceCol ) ;
Cl += surfaceCol; // it should look twice as bright
}
}



It seems like i get nothing returning from the

code:
surface( "_diffuse" , surfaceCol )

call (the _diffuse component is an output color of a surface shader)?
Thanks ,
STe


RenderMan & RISpec >> "Surface" calls in light shaders

by georgeharker@googlemail.com » Wed, 04 Oct 2006 16:48:22 GMT


The question is, when does _diffuse get output from the surface shader.
It will have some default value as specified in the parameter list of
the surface shader, but to be useful the surface shader has to assign
something to it.

My guess given that it is called _diffuse would be that it is the
result of running the lighting and combining with the local shading
model - and is therefore computed after the call which invokes lighting
(illuminance, diffuse() etc). In which case, when the lighting is
invoked, that variable most probably hasn't been set yet, and you won't
get anything useful from it.

Cheers

George

Similar Threads

1. Lighting a shaders

Correct me if I am wrong here, but if I want to use shaders to perform
lighting calculations, I need to use shader constants for the light
info and not the IDirect3DDevice9::SetLight() series of functions?

Murrgon

2. Implementing a 3D lighting manager with shaders

3. GLSL-calling fuction from other shader

Hello.
Is it possible from the (fragment)shader call function which is compiled
in other shader which are linked together to one program?

My problem is that I make one group of shaders(functions) to convert
various colorspace to RGB and independetly I need apply effect shaders
from other group to this RGB colorspace output. So I need  arbitrarily
combine (shaders)functions from these groups.





4. vertex shader + lighting

5. Help needed using a light shader


6. 3Delight lighting problem with envlight shader - RenderMan & RISpec

7. AOVs in light shaders?

Hi,

I'd like to output data from a light shader. I've already used AOVs in
surface shaders to generate special passes but is it possible to do
this from other shader types like light shaders?

P.S.: In the last resort, I can "send" this data from the light shader
to the surface shader with message passing and use the AOVs there but
that would be a less flexible and quite clumsy option in my case.

Thanks in advance,
Robert Kovacs

8. Distant light shader with raytraced soft shadow - RenderMan & RISpec