See the glsl_quickref.pdf there are several OSG-specific "built-in
uniforms" such as osg_ViewMatrix.  Also see glsl_simple.osg for example
of a single shader parameterized with different uniforms.

-- mew





> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:osg-users-
> [EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED]
> revolution.org
> Sent: Tuesday, April 08, 2008 3:55 AM
> To: [email protected]
> Subject: [osg-users] Dilemma with the usage of object Shaders in
> differendviews ...
> 
> 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
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to