Hi Vadiraj,

Simply attach the Uniform to an osg::StateSet to the View's Camera so
that view's subgraph inherits  Camera's stateset.

Robert.

On 5 February 2013 09:17, vadiraj kaamsha <[email protected]> wrote:
> Hi,
>
> I have a problem similar to the one being discussed in this thread.
> I have 2 views, V1 and V2, each with its own master camera.
> Both these views render a common set of nodes, say N1 and N2.
> The node needs an uniform U1 in the shader. The value of the uniform is 
> specific to the node and the view in which it is drawn.
>
> In other words,
> V1 =>N1, U1 = X1
> V1 =>N2, U1 = X2
>
> V2 =>N1, U1 = Y1
> V2 =>N2, U1 = Y2
>
> So, when view V1 renders the node N1, the uniform U1 should value X1 and when 
> the same node N1 is rendered in view V2, the uniform should have value Y1.
> Now, I cannot associate this uniform to the state-set of the node as this 
> will result in both the views getting the same value, which is not intended.
> I also cannot associate this uniform to the state-set of the camera as this 
> will result in all the nodes in that view getting the same value, which is 
> also wrong.
>
> The application runs in a multi-view scenario with shared GL context using 
> threading model "CullDrawThreadPerContext"
>
> What is basically need is a state-set associate to a node which is view 
> specific.
> I would like to know if there is any way OSG handles this use case?
>
> Thank you!
>
> Cheers,
> vadiraj
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=52380#52380
>
>
>
>
>
> _______________________________________________
> 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