Re: [osg-users] Dilemma with the usage of object Shaders in differend views ...

2008-04-09 Thread hellhound
Hello Guy, If you set different shader for each object, I would like some clarification about your original question. Yes this is that what i would have, sorry for my confused description. Do you want different shader per object but with some common features that are different for each view??

Re: [osg-users] Dilemma with the usage of object Shaders in differend views ...

2008-04-09 Thread Guy
Ok, lets have some theoretical example, shall we... Suppose the scene is composed of: - 3 views. - 2 parameters which are view dependent, named Param1 and Param2. - 3 objects with different shader for each. Now, we must have some assumption: - You have access to the shaders code, and you are

[osg-users] Dilemma with the usage of object Shaders in differend views ...

2008-04-08 Thread hellhound
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

Re: [osg-users] Dilemma with the usage of object Shaders in differend views ...

2008-04-08 Thread Guy
Hello, I think attaching a shader to each view instead of to object X would be fine. If you want to use the callback I think you should create a pre-draw callback to the object, which I'm not sure possible. The update callbacks won't help you since it run on all the scene before the rendering

Re: [osg-users] Dilemma with the usage of object Shaders in differend views ...

2008-04-08 Thread Christian Heine
Hello Guy, I think attaching a shader to each view instead of to object X would be fine. I'm not sure if this may be the right thing. Correct me if I'm wrong but this causes in some other issues: 1. I lost the reference to the specifiv object states like Textures, Geometries etc. How does the

Re: [osg-users] Dilemma with the usage of object Shaders in differend views ...

2008-04-08 Thread Guy
Well, the shader doesn't know of the stateset of the object (textures attached) if you don't set it explicitly. Otherwise, the shader can be inherited and at ObjectX you can add a uniform for the sampler. You are right that all the objects will be rendered with the same shader. If you set