Re: [osg-users] Getting the model matrix in the vertex shader.

2008-04-17 Thread Wojciech Lewandowski
@lists.openscenegraph.org Sent: Wednesday, April 16, 2008 10:18 PM Subject: Re: [osg-users] Getting the model matrix in the vertex shader. Hi Robert, The main cameras view matrix could be added as an extra uniform, the main cameras projection matrix too? That's what I'm doing, with the code I posted

[osg-users] Getting the model matrix in the vertex shader.

2008-04-16 Thread Jean-Sébastien Guay
Hello, In my current project, I have 3 slave cameras rendering to texture with offsets in their view matrices, and then another camera reassembling the images with a deformation to map it onto a half-sphere dome (similar to osgdistortion --dome). I'm trying to fix the problem where

Re: [osg-users] Getting the model matrix in the vertex shader.

2008-04-16 Thread Mike Weiblen
just a quick thought, but have a look at the code that sets up the osg_ predefined GLSL uniforms. that feature was added pre-OSG 1.0, and may have drifted during the viewer rework moving into OSG 2.x. dont know how many folks actually use those uniforms, and thus how much exercise they get. --

Re: [osg-users] Getting the model matrix in the vertex shader.

2008-04-16 Thread Robert Osfield
Hi J-S, When you start using slave cameras with view offsets/rotation you'll need to take care over the lighting models used - using a light source such as a directional head light that is set in eye coordinates and along eye's z axis you'll find that the effective light direction is different

Re: [osg-users] Getting the model matrix in the vertex shader.

2008-04-16 Thread Jean-Sébastien Guay
Hi Robert, Using a light source that is fixed in the world coordinates, or one that is not directional i.e. a positional light source that is placed at the eye point resolves the shading problem. Well, yes, that resolves that specific problem. But what if I was using view-dependent shadow

Re: [osg-users] Getting the model matrix in the vertex shader.

2008-04-16 Thread Jean-Sébastien Guay
Hi Mike, Just a side question, is it still the case on modern video cards (like nVidia 8800 and up) that the GPU will execute both sides of an if-then-else statement and choose the right value when both are available? I just want to know if I'm better off making a really general shader that

Re: [osg-users] Getting the model matrix in the vertex shader.

2008-04-16 Thread Robert Osfield
Hi J-S, On Wed, Apr 16, 2008 at 6:25 PM, Jean-Sébastien Guay [EMAIL PROTECTED] wrote: Well, yes, that resolves that specific problem. But what if I was using view-dependent shadow mapping, or reflection mapping (as I said with the cow example), or other similar view-dependent effects...

Re: [osg-users] Getting the model matrix in the vertex shader.

2008-04-16 Thread Jean-Sébastien Guay
Hi Robert, The main cameras view matrix could be added as an extra uniform, the main cameras projection matrix too? That's what I'm doing, with the code I posted at the beginning of the thread, but it doesn't work, and I was wondering if I could get some help from someone who would have done