* GLSL spec allows having unset uniforms/attributes/varyings as long as they are not used in the shader, thus they are now always in scope

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9622 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
Sha..rd 12 years ago
parent dba5ba5851
commit 0a38ca0cf4
  1. 24
      engine/src/core-data/Common/MatDefs/Misc/Unshaded.frag
  2. 18
      engine/src/core-data/Common/MatDefs/Misc/Unshaded.vert

@ -1,27 +1,15 @@
uniform vec4 m_Color;
#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
#endif #endif
#ifdef HAS_COLORMAP uniform vec4 m_Color;
uniform sampler2D m_ColorMap; uniform sampler2D m_ColorMap;
#endif uniform sampler2D m_LightMap;
#ifdef NEED_TEXCOORD1
varying vec2 texCoord1;
#endif
#ifdef HAS_LIGHTMAP varying vec2 texCoord1;
uniform sampler2D m_LightMap; varying vec2 texCoord2;
#ifdef SEPARATE_TEXCOORD
varying vec2 texCoord2;
#endif
#endif
#ifdef HAS_VERTEXCOLOR varying vec4 vertColor;
varying vec4 vertColor;
#endif
void main(){ void main(){
vec4 color = vec4(1.0); vec4 color = vec4(1.0);

@ -5,20 +5,14 @@ attribute vec3 inPosition;
#define NEED_TEXCOORD1 #define NEED_TEXCOORD1
#endif #endif
#ifdef NEED_TEXCOORD1 attribute vec2 inTexCoord;
attribute vec2 inTexCoord; attribute vec2 inTexCoord2;
varying vec2 texCoord1; attribute vec4 inColor;
#endif
#ifdef SEPARATE_TEXCOORD varying vec2 texCoord1;
attribute vec2 inTexCoord2; varying vec2 texCoord2;
varying vec2 texCoord2;
#endif
#ifdef HAS_VERTEXCOLOR varying vec4 vertColor;
attribute vec4 inColor;
varying vec4 vertColor;
#endif
void main(){ void main(){
#ifdef NEED_TEXCOORD1 #ifdef NEED_TEXCOORD1

Loading…
Cancel
Save