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
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users