Shader: Refine preprocessing on GLES platform
Don't globally set float precision to mediump, only fragment shaders need that and defining it for vertex shaders causes tilemap cracks. Also manually define low precision for variables that hold color / alpha values.
This commit is contained in:
parent
a501e4f22f
commit
a53163660f
14 changed files with 67 additions and 42 deletions
15
shader/common.h
Normal file
15
shader/common.h
Normal file
|
@ -0,0 +1,15 @@
|
|||
#ifdef GLSLES
|
||||
|
||||
#ifdef FRAGMENT_SHADER
|
||||
/* Only the fragment shader has no default float precision */
|
||||
precision mediump float;
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
/* Desktop GLSL doesn't know about these */
|
||||
#define highp
|
||||
#define mediump
|
||||
#define lowp
|
||||
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue