Revision 1cbf4103
Added by Leszek Koltunski about 7 years ago
src/main/res/raw/main_fragment_shader.glsl | ||
---|---|---|
20 | 20 |
precision lowp float; |
21 | 21 |
|
22 | 22 |
#if __VERSION__ != 100 |
23 |
#define TEXTURE texture |
|
24 | 23 |
in vec3 v_Position; // Interpolated position for this fragment. |
25 | 24 |
in vec3 v_Normal; // Interpolated normal for this fragment. |
26 | 25 |
in vec2 v_TexCoordinate; // Interpolated texture coordinate per fragment. |
27 | 26 |
out vec4 fragColor; // The output color |
27 |
#define TEXTURE texture |
|
28 |
#define FRAG_COLOR fragColor |
|
28 | 29 |
#else |
29 |
#define TEXTURE texture2D |
|
30 | 30 |
varying vec3 v_Position; // Interpolated position for this fragment. |
31 | 31 |
varying vec3 v_Normal; // Interpolated normal for this fragment. |
32 | 32 |
varying vec2 v_TexCoordinate; // Interpolated texture coordinate per fragment. |
33 |
#define TEXTURE texture2D |
|
34 |
#define FRAG_COLOR gl_FragColor |
|
33 | 35 |
#endif |
34 | 36 |
|
35 | 37 |
uniform sampler2D u_Texture; // The input texture. |
... | ... | |
149 | 151 |
} |
150 | 152 |
#endif |
151 | 153 |
|
152 |
#if __VERSION__ != 100 |
|
153 |
fragColor = |
|
154 |
#else |
|
155 |
gl_FragColor = |
|
156 |
#endif |
|
157 |
|
|
158 |
vec4(pixel.rgb * (1.0 + 7.0*v_Normal.z) * 0.125, pixel.a); |
|
154 |
FRAG_COLOR = vec4(pixel.rgb * (1.0 + 7.0*v_Normal.z) * 0.125, pixel.a); |
|
159 | 155 |
} |
Also available in: Unified diff
Simplify shaders.