Hi,

Here is my problem, I use 2 passes to render a frame.
On the 1st pass, I render the whole scenegraph into a texture with a material A 
on a node N.
On the 2nd pass, I render the whole scene graph again and I use the texture 
from the 1st pass into a shader to render same node N with a material B.
As you can see, the node N must have a material A on the 1st pass and another 
material B on the 2nd pass; and I do not know how to do this.

All the rendering to texture and multiple pass rendering is done, but I do not 
know how to use a material A for my node N for the 1st pass, then to use a 
material B for the same node N on the 2nd pass.

One first and ulgy solution may be to duplicate the scenegraph, and to assign a 
material A on my node N on the 1st copy of the scenegraph and to assign a 
material B on my node N on the 2nd copy of the scenegraph.
But it is really ugly...

Another better solution is - I think - to use a switch node. this switch node 
may be have 2 children, the 1st child may hold the material A and the 2nd child 
may hold the material B. These 2 children may have my node N as a child. But I 
don't know how to activate the 1st swith's child on the 1st pass and the 2nd 
switch's child for the 2nd pass.

Does anyone of you have any ideas ? I think I may have to use render callback 
then to activate the correct switch's child for the correct pass, but I do not 
know OSG well and I don't know which callbacl to use and how to get the render 
pass number.

Thank you

Cheers,
Sebastien

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=17140#17140





_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to