GLSLCompat: support GLES compatibility

experimental
Kirill Vainer 9 years ago
parent 139ba573bc
commit cb7d139488
  1. 2
      jme3-core/src/main/resources/Common/MatDefs/Misc/Unshaded.frag
  2. 2
      jme3-core/src/main/resources/Common/MatDefs/Misc/Unshaded.vert
  3. 14
      jme3-core/src/main/resources/Common/ShaderLib/GLSL150Compat.glsllib
  4. 34
      jme3-core/src/main/resources/Common/ShaderLib/GLSLCompat.glsllib

@ -1,4 +1,4 @@
#import "Common/ShaderLib/GLSL150Compat.glsllib" #import "Common/ShaderLib/GLSLCompat.glsllib"
#if defined(HAS_GLOWMAP) || defined(HAS_COLORMAP) || (defined(HAS_LIGHTMAP) && !defined(SEPARATE_TEXCOORD)) #if defined(HAS_GLOWMAP) || defined(HAS_COLORMAP) || (defined(HAS_LIGHTMAP) && !defined(SEPARATE_TEXCOORD))
#define NEED_TEXCOORD1 #define NEED_TEXCOORD1

@ -1,4 +1,4 @@
#import "Common/ShaderLib/GLSL150Compat.glsllib" #import "Common/ShaderLib/GLSLCompat.glsllib"
#import "Common/ShaderLib/Skinning.glsllib" #import "Common/ShaderLib/Skinning.glsllib"
#import "Common/ShaderLib/Instancing.glsllib" #import "Common/ShaderLib/Instancing.glsllib"

@ -1,14 +0,0 @@
#if __VERSION__ >= 130
out vec4 outFragColor;
# define texture1D texture
# define texture2D texture
# define texture3D texture
# define texture2DLod texture
# if defined VERTEX_SHADER
# define varying out
# define attribute in
# elif defined FRAGMENT_SHADER
# define varying in
# define gl_FragColor outFragColor
# endif
#endif

@ -0,0 +1,34 @@
#if defined _GL_ES_
# define hfloat highp float
# define hvec2 highp vec2
# define hvec3 highp vec3
# define hvec4 highp vec4
# define lfloat lowp float
# define lvec2 lowp vec2
# define lvec3 lowp vec3
# define lvec4 lowp vec4
#else
# define hfloat float
# define hvec2 vec2
# define hvec3 vec3
# define hvec4 vec4
# define lfloat float
# define lvec2 vec2
# define lvec3 vec3
# define lvec4 vec4
#endif
#if __VERSION__ >= 130
out vec4 outFragColor;
# define texture1D texture
# define texture2D texture
# define texture3D texture
# define texture2DLod texture
# if defined VERTEX_SHADER
# define varying out
# define attribute in
# elif defined FRAGMENT_SHADER
# define varying in
# define gl_FragColor outFragColor
# endif
#endif
Loading…
Cancel
Save