I'm trying to use deferred shading on OpenGL3+ renderer, using GLSL only, on Ogre 1.10, and the image seems upside down and rendered in the top-right quarter of the screen? Can anyone help?
https://www.dropbox.com/s/n8tth64f0klj63e/crap_dff.jpg
GLSL compositor render on top right
- tod
- Troll
- Posts: 1394
- Joined: Wed Aug 02, 2006 9:41 am
- Location: Bucharest
- x 94
- Contact:
- tod
- Troll
- Posts: 1394
- Joined: Wed Aug 02, 2006 9:41 am
- Location: Bucharest
- x 94
- Contact:
Re: GLSL compositor render on top right
Apparently the GLSL shader is broken for Deferred Shading.
Can some expert tell me what I need to change?
Can some expert tell me what I need to change?
Code: Select all
#version 150
in vec4 vertex;
out vec2 oUv0;
out vec3 oRay;
uniform vec3 farCorner;
uniform float flip;
void main()
{
// Clean up inaccuracies
vec2 Pos = sign(vertex.xy);
// Image-space
oUv0 = (vec2(Pos.x, -Pos.y) + 1.0) * 0.5;
// This ray will be interpolated and will be the ray from the camera
// to the far clip plane, per pixel
oRay = farCorner * vec3(Pos, 1);
gl_Position = vec4(Pos, 0, 1);
gl_Position.y *= flip;
}