v0.9.1a: adjusted fragment shader to always use mediump

This commit is contained in:
Evan Debenham 2020-12-14 21:56:42 -05:00
parent d78a9b567c
commit 84d3029b04
2 changed files with 8 additions and 16 deletions

View File

@ -207,16 +207,12 @@ public class NoosaScript extends Script {
//fragment shader //fragment shader
//preprocessor directives let us define precision on GLES platforms, and ignore it elsewhere //preprocessor directives let us define precision on GLES platforms, and ignore it elsewhere
"#ifdef GL_ES\n" + "#ifdef GL_ES\n" +
" #define LOW lowp\n" + " precision mediump float;\n" +
" #define MED mediump\n" +
"#else\n" +
" #define LOW\n" +
" #define MED\n" +
"#endif\n" + "#endif\n" +
"varying MED vec2 vUV;\n" + "varying vec2 vUV;\n" +
"uniform LOW sampler2D uTex;\n" + "uniform sampler2D uTex;\n" +
"uniform LOW vec4 uColorM;\n" + "uniform vec4 uColorM;\n" +
"uniform LOW vec4 uColorA;\n" + "uniform vec4 uColorA;\n" +
"void main() {\n" + "void main() {\n" +
" gl_FragColor = texture2D( uTex, vUV ) * uColorM + uColorA;\n" + " gl_FragColor = texture2D( uTex, vUV ) * uColorM + uColorA;\n" +
"}\n"; "}\n";

View File

@ -63,14 +63,10 @@ public class NoosaScriptNoLighting extends NoosaScript {
//fragment shader //fragment shader
//preprocessor directives let us define precision on GLES platforms, and ignore it elsewhere //preprocessor directives let us define precision on GLES platforms, and ignore it elsewhere
"#ifdef GL_ES\n" + "#ifdef GL_ES\n" +
" #define LOW lowp\n" + " precision mediump float;\n" +
" #define MED mediump\n" +
"#else\n" +
" #define LOW\n" +
" #define MED\n" +
"#endif\n" + "#endif\n" +
"varying MED vec2 vUV;\n" + "varying vec2 vUV;\n" +
"uniform LOW sampler2D uTex;\n" + "uniform sampler2D uTex;\n" +
"void main() {\n" + "void main() {\n" +
" gl_FragColor = texture2D( uTex, vUV );\n" + " gl_FragColor = texture2D( uTex, vUV );\n" +
"}\n"; "}\n";