2 cameras shaders

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Vamp
Posts: 5
Joined: Mon Nov 23, 2009 9:53 am

2 cameras shaders

Post by Vamp »

Hi,
I'd like to make stereo support for irrlicht. I made many tests with different results, but I'd like to try using shaders. But I don't know how to use not simple shaders like:

Code: Select all

uniform sampler2D leftTex;
uniform sampler2D rightTex;
varying vec2 texCoord;

uniform int width;
uniform int height;

void main()
{
	gl_FragColor = mix(
			texture2D(leftTex, vec2(texCoord.x*2,texCoord.y)),
			texture2D(rightTex, vec2(texCoord.x*2-1,texCoord.y)),
			step(.5,texCoord.x));

}
where I have 2 Tex parts (leftTex and rightTex for left and right eye). This is the shader for dual output, another technique I'd like to make this way is quadbuffer. Thank you for help.
Post Reply