Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: data/branches/Shader_HS18/programs/Example/GLSLES/SharpenEdgesFP.glsles @ 12091

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

Updated programs and adjusted Material to work with GLSL>150

File size: 637 bytes
Line 
1#version 100
2
3precision mediump int;
4precision mediump float;
5
6uniform sampler2D RT;
7
8uniform vec2 vTexelSize;
9varying vec2 oUv0;
10//varying vec2 uv1;
11
12void main()
13{
14        vec2 usedTexelED[8];
15        usedTexelED[0] = vec2(-1, -1);
16        usedTexelED[1] = vec2(0, -1);
17        usedTexelED[2] = vec2(1, -1);
18        usedTexelED[3] = vec2(-1,  0);
19        usedTexelED[4] = vec2(1,  0);
20        usedTexelED[5] = vec2(-1,  1);
21        usedTexelED[6] = vec2(0,  1);
22        usedTexelED[7] = vec2(1,  1);
23
24    mediump vec4 tc = texture2D(RT, oUv0);
25        vec4 cAvgColor = vec4(9.0 * tc);
26
27        for(int t=0; t<8; t++)
28                cAvgColor -= texture2D(RT, oUv0 + vTexelSize * usedTexelED[t]);
29
30        gl_FragColor = cAvgColor;
31}
Note: See TracBrowser for help on using the repository browser.