Commit 60f42461 authored by Jan Möbius's avatar Jan Möbius

Added shader for 20 philips display

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@7501 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 4d565e0c
uniform sampler2D ColorTexture;
uniform sampler2D DepthStencil;
void main(void)
{
// Left side is the color image seen by the user
// Right side is the the depth map of the current view
// Texture coordinates have to be scaled
// and for the left image they also have to be shifted
if ( gl_TexCoord[0].s < 0.5 ) {
gl_TexCoord[0].s = gl_TexCoord[0].s * 2.0;
gl_FragColor = texture2D( ColorTexture, gl_TexCoord[0].st );
} else {
gl_TexCoord[0].s = (gl_TexCoord[0].s - 0.5) * 2.0;
vec4 convert = texture2D( DepthStencil, gl_TexCoord[0].st );
// This conversion is specified in the docs for a 20'' Display
convert.rgba = (-1586.34 *( 1.0 - (6.180772 / ( convert.r - 0.459813 + 6.180772)) ) + 127.5) / 255.0;
gl_FragColor = convert;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment