|
Revision 8081
(checked in by robert, 9 months ago)
|
From Jose Delport, shaders for osgsterematch example
|
| Line | |
|---|
| 1 |
/* -*- Mode: C -*- */ |
|---|
| 2 |
uniform sampler2DRect textureIn; |
|---|
| 3 |
uniform int min_disparity; |
|---|
| 4 |
uniform int max_disparity; |
|---|
| 5 |
|
|---|
| 6 |
void main(void) |
|---|
| 7 |
{ |
|---|
| 8 |
float disp = texture2DRect( textureIn, gl_TexCoord[0].st ).g; |
|---|
| 9 |
float sad = texture2DRect( textureIn, gl_TexCoord[0].st ).r; |
|---|
| 10 |
if (sad > 0.7+100) { |
|---|
| 11 |
gl_FragColor = vec4(1,0,0,1); |
|---|
| 12 |
} else { |
|---|
| 13 |
disp = (disp-min_disparity)/(float)(max_disparity-min_disparity); |
|---|
| 14 |
gl_FragColor = vec4(disp,disp,disp,1); |
|---|
| 15 |
} |
|---|
| 16 |
} |
|---|