- var fragShader =
- " uniform lowp vec4 uColorShift; \
- uniform lowp vec2 uScale; \
- \
- void main() \
- { \
- gl_FragColor = texture2D( sTexture, vTexCoord * uScale ) * uColor + uColorShift; \
- }"
-
- // Shader API
- // geometryType = "image", "text", "mesh", "texturedMesh"
- // fragmentPrefex ="" // prefix ( optional)
- // fragmentShader = "" // fragment shader ( optional)
- // geometryHints = [ "gridX", "gridY", "grid","depthBuffer","blending" ] ( optional)
- //
- var shaderOptions = {
- geometryType: "image",
- fragmentShader: fragShader,
- geometryHints: ["blending"]
+ var fragShader =
+ "varying vec2 vTexCoord;\
+ uniform sampler2D sTexture;\
+ uniform vec4 uColor;\
+ uniform lowp vec4 uColorShift;\
+ uniform lowp vec2 uScale;\
+ void main() \
+ { \
+ gl_FragColor = texture2D( sTexture, vTexCoord * uScale ) * uColor + uColorShift; \
+ }";
+
+ // vertexShader = ""; // vertex shader ( optional)
+ // fragmentShader = ""; // fragment shader ( optional)
+ // hints = // shader hints ( optional)
+ // [ "requiresSelfDepthTest", // Expects depth testing enabled
+ // "outputIsTransparent", // Might generate transparent alpha from opaque inputs
+ // "outputIsOpaque", // Outputs opaque colors even if the inputs are transparent
+ // "modifiesGeometry" ]; // Might change position of vertices, this option disables any culling optimizations
+
+ var shader = {
+ "fragmentShader": fragShader,
+ "hints" : "outputIsTransparent"