- const float ZERO( 0.0f );
- const float HALF( 0.5f );
- const float ONE( 1.0f );
- const float TWO( 2.0f );
- const uint32_t DEFAULT_ATLAS_WIDTH = 512u;
- const uint32_t DEFAULT_ATLAS_HEIGHT = 512u;
-
- #define MAKE_SHADER(A)#A
-
- const char* VERTEX_SHADER = MAKE_SHADER(
- attribute mediump vec2 aPosition;
- attribute mediump vec2 aTexCoord;
- uniform mediump mat4 uMvpMatrix;
- uniform mediump vec3 uSize;
- varying mediump vec2 vTexCoord;
-
- void main()
- {
- mediump vec4 position = vec4( aPosition, 0.0, 1.0 );
- position.xyz *= uSize;
- gl_Position = uMvpMatrix * position;
- vTexCoord = aTexCoord;
- }
- );
-
- const char* FRAGMENT_SHADER = MAKE_SHADER(
- uniform sampler2D sTexture;
- varying mediump vec2 vTexCoord;
-
- void main()
- {
- //gl_FragColor = vec4( 1.0 );
- gl_FragColor = texture2D( sTexture, vTexCoord );
- }
- );
-
- const char* VERTEX_SHADER_SHADOW = MAKE_SHADER(
- attribute mediump vec2 aPosition;
- attribute mediump vec2 aTexCoord;
- uniform mediump vec3 uSize;
- varying mediump vec2 vTexCoord;
-
- void main()
- {
- mediump vec4 position = vec4( aPosition, 0.0, 1.0 );
- position.xyz *= uSize;
- gl_Position = position;
- vTexCoord = aTexCoord;
- }
- );
-
- const char* FRAGMENT_SHADER_SHADOW = MAKE_SHADER(
- uniform sampler2D sTexture;
- uniform lowp vec4 uColor;
- varying mediump vec2 vTexCoord;
-
- void main()
- {
- mediump vec4 color = texture2D( sTexture, vTexCoord );
- gl_FragColor = vec4(uColor.rgb, uColor.a*color.r);
- }
- );
+const float ZERO( 0.0f );
+const float HALF( 0.5f );
+const float ONE( 1.0f );
+const float TWO( 2.0f );
+const uint32_t DEFAULT_ATLAS_WIDTH = 512u;
+const uint32_t DEFAULT_ATLAS_HEIGHT = 512u;