Revision f2367b75
Added by Leszek Koltunski about 7 years ago
src/main/res/raw/main_fragment_shader.glsl | ||
---|---|---|
21 | 21 |
|
22 | 22 |
uniform sampler2D u_Texture; // The input texture. |
23 | 23 |
|
24 |
varying vec3 v_Position; // Interpolated position for this fragment. |
|
25 |
varying vec3 v_Normal; // Interpolated normal for this fragment. |
|
26 |
varying vec2 v_TexCoordinate; // Interpolated texture coordinate per fragment. |
|
24 |
in vec3 v_Position; // Interpolated position for this fragment. |
|
25 |
in vec3 v_Normal; // Interpolated normal for this fragment. |
|
26 |
in vec2 v_TexCoordinate; // Interpolated texture coordinate per fragment. |
|
27 |
out vec4 fragColor; // The output color |
|
27 | 28 |
|
28 | 29 |
#if NUM_FRAGMENT>0 |
29 | 30 |
uniform int fNumEffects; // total number of fragment effects |
... | ... | |
92 | 93 |
|
93 | 94 |
void main() |
94 | 95 |
{ |
95 |
vec4 pixel = texture2D(u_Texture,v_TexCoordinate);
|
|
96 |
vec4 pixel = texture(u_Texture,v_TexCoordinate); |
|
96 | 97 |
|
97 | 98 |
#if NUM_FRAGMENT>0 |
98 | 99 |
vec2 diff; |
... | ... | |
140 | 141 |
} |
141 | 142 |
#endif |
142 | 143 |
|
143 |
gl_FragColor = vec4(pixel.rgb * (1.0 + 7.0*v_Normal.z) * 0.125, pixel.a);
|
|
144 |
fragColor = vec4(pixel.rgb * (1.0 + 7.0*v_Normal.z) * 0.125, pixel.a);
|
|
144 | 145 |
} |
Also available in: Unified diff
Upgrade from GLSL 1.00 to GLSL 3.00 ES
Introduce separate BLUR1 and BLUR2 shaders, the second one marging (writing to gl_FragDepth still does not work)