Victor Haefner
2014-11-04 17:17:49 UTC
Hi all,
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...
thanks for reading!
best regards,
Victor
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...
thanks for reading!
best regards,
Victor