Hello Carsten, Thanks a lot! this is exactly what I needed!! :)
best regards, Victor On Tue, Nov 4, 2014 at 6:30 PM, Carsten Neumann <carsten.p.neum...@gmail.com > wrote: > Hello Victor, > > On 11/04/2014 06:17 PM, Victor Haefner wrote: > > the gl_ProjectionMatrix allows me to compute the up and right vector in > > view coordinates. > > vec4 right = gl_ProjectionMatrix*vec4(1,0,0); > > vec4 up = gl_ProjectionMatrix*vec4(0,1,0); > > I can use those vectors to create a nice quad in the geometry shader. > > The problem is when using head tracking (OSGProjectionCameraDecorator). > > The orientation of the head messes with the gl_ProjectionMatrix, and > > thus with the shape of my quad. > > I essentially just need the aspect ratio of the viewport in my shader. > > Passing it as a variable is not possible (I think?) because I have a > > cluster environment, multiple viewports, with different aspect ratios... > > you can use one of the 'magic' OpenSG variables: > uniform vec2 OSGViewportSize; > > see Source/State/Shader/Variables/OSGShaderVariableOSG.{h,cpp} and > ShaderProgram::addOSGVariable() > > Cheers, > Carsten > > > ------------------------------------------------------------------------------ > _______________________________________________ > Opensg-users mailing list > Opensg-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/opensg-users >
------------------------------------------------------------------------------
_______________________________________________ Opensg-users mailing list Opensg-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensg-users