Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: data/branches/Shader_HS18/programs/Example/GLSLES/hdr_downscale3x3.glsles @ 12092

Last change on this file since 12092 was 12091, checked in by wiesep, 6 years ago

Updated programs and adjusted Material to work with GLSL>150

File size: 908 bytes
Line 
1#version 100
2precision mediump int;
3precision mediump float;
4
5uniform sampler2D inRTT;
6uniform vec2 texelSize;
7
8varying vec2 uv;
9
10void main(void)
11{
12    vec4 accum = vec4(0.0, 0.0, 0.0, 0.0);
13
14    // Get colour from source
15    accum += texture2D(inRTT, uv + texelSize * vec2(-1.0, -1.0));
16    accum += texture2D(inRTT, uv + texelSize * vec2( 0.0, -1.0));
17    accum += texture2D(inRTT, uv + texelSize * vec2( 1.0, -1.0));
18    accum += texture2D(inRTT, uv + texelSize * vec2(-1.0,  0.0));
19    accum += texture2D(inRTT, uv + texelSize * vec2( 0.0,  0.0));
20    accum += texture2D(inRTT, uv + texelSize * vec2( 1.0,  0.0));
21    accum += texture2D(inRTT, uv + texelSize * vec2(-1.0,  1.0));
22    accum += texture2D(inRTT, uv + texelSize * vec2( 0.0,  1.0));
23    accum += texture2D(inRTT, uv + texelSize * vec2( 1.0,  1.0));
24   
25        // take average of 9 samples
26        accum *= 0.1111111111111111;
27
28        gl_FragColor = accum;
29
30}
Note: See TracBrowser for help on using the repository browser.