GLSL compositor render on top right

Anything and everything that's related to OGRE or the wider graphics field that doesn't fit into the other forums.
User avatar
tod
Troll
Posts: 1394
Joined: Wed Aug 02, 2006 9:41 am
Location: Bucharest
x 94

GLSL compositor render on top right

Post by tod »

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
Image
User avatar
tod
Troll
Posts: 1394
Joined: Wed Aug 02, 2006 9:41 am
Location: Bucharest
x 94

Re: GLSL compositor render on top right

Post by tod »

Apparently the GLSL shader is broken for Deferred Shading.
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;
}