ecere/gfx/drivers/GL3: Fixed missing precision for WebGL
authorJerome St-Louis <jerome@ecere.com>
Thu, 25 Aug 2016 21:00:55 +0000 (17:00 -0400)
committerJerome St-Louis <jerome@ecere.com>
Thu, 25 Aug 2016 21:00:55 +0000 (17:00 -0400)
ecere/src/gfx/drivers/gl3/default.frag
ecere/src/gfx/drivers/gl3/defaultShader.ec

index 5a9f5b8..7d34066 100644 (file)
@@ -1,4 +1,6 @@
-// precision highp float;
+#if GLSL_FLOAT_PRECISION
+precision highp float;
+#endif
 
 #if LIGHTING_ON
    #if PER_VERTEX_COLOR
index 1f52d97..b1dc4bb 100644 (file)
@@ -240,8 +240,10 @@ public:
 
 #if defined(__EMSCRIPTEN__)
       defs.concatf("#version 100\n");
+      defs.concatf("#define GLSL_FLOAT_PRECISION   1\n");
 #else
       defs.concatf("#version 110\n");
+      defs.concatf("#define GLSL_FLOAT_PRECISION   0\n");
 #endif
       defs.concatf("\n#define NUM_LIGHTS %d",               8);
       defs.concatf("\n#define MODELVIEW %d",                state.modelView          ? 1 : 0);