Rev | Line | |
---|
[821] | 1 | uniform sampler2D indirectTexture;
|
---|
| 2 | uniform sampler2D sourceTexture;
|
---|
| 3 | uniform float epsilonX;
|
---|
| 4 | uniform float epsilonY;
|
---|
| 5 | uniform float sourceTextureSize;
|
---|
[861] | 6 | uniform float numSamples;
|
---|
| 7 | uniform float sqrtNumSamples;
|
---|
[821] | 8 |
|
---|
| 9 | void main(void)
|
---|
| 10 | {
|
---|
| 11 | vec4 ocolor = vec4(0.0, 0.0, 0.0, 0.0);
|
---|
| 12 | vec2 epsilon = vec2(epsilonX, epsilonY);
|
---|
| 13 | vec2 texCoord = gl_TexCoord[0].xy;
|
---|
| 14 | vec2 subTexCoord = gl_TexCoord[1].xy;
|
---|
[861] | 15 | vec4 value = texture2D(indirectTexture, subTexCoord).xyzw;
|
---|
| 16 | vec2 coords = vec2(0.0, 1.0) - abs(texCoord - ( value.xy - epsilon ) );
|
---|
[821] | 17 |
|
---|
[861] | 18 | if (value.z != 0.0)
|
---|
[821] | 19 | {
|
---|
[864] | 20 | vec2 newcoord = (vec2(1.0, 1.0) - value.zw) + ((coords * sourceTextureSize) / sqrtNumSamples);
|
---|
[861] | 21 | ocolor = vec4(texture2D(sourceTexture, newcoord).xyzw);
|
---|
[821] | 22 | }
|
---|
| 23 | gl_FragColor = ocolor;
|
---|
| 24 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.