Hi folks,

actually i am working on object shading with OSG (i.e. Dot3). All works fine
with single views. Now i am using the osgViewer::Composite viewer and getting
some dielemma with the usage of object based shaders in differend views based
on the same scene graph.

I.e.: I've a single scene node with an object X where i bind the shaders (at 
the object StateSet) for execution. In a single view no problem. If i use this 
scene in 
multiple views (i.e. A, B) i've the dilemma, that i've to use diffrend shader 
params
on the same shader instance. In each rendering pass the params of the camera
are differend from the point of view of the views, if the views are rendered. 
But
the shader has no knowledge about this, it uses only a single uniform to hook 
bind
param ...

I've thought about the following sollutions:

1. Using for each view a single shader instance at the same object StateSet.
Is this usefull? If the scene is complex i could get a huge count of shaders
which have to be executed. Additionally i'm not sure, if the binding of the 
"unused"
shaders produces render artifacts or perfomance issues...

2. Using a callback mechanism which switches this values at the shader before 
   rendering

How i could achieve this aim in best way? Has anyone a better solution? 

Best regards,
Christian 



_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to