From 0a38ca0cf4b63dd033ab624cbaa321377381d44c Mon Sep 17 00:00:00 2001 From: "Sha..rd" Date: Sun, 5 Aug 2012 21:59:58 +0000 Subject: [PATCH] * 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 --- .../Common/MatDefs/Misc/Unshaded.frag | 24 +++++-------------- .../Common/MatDefs/Misc/Unshaded.vert | 18 +++++--------- 2 files changed, 12 insertions(+), 30 deletions(-) diff --git a/engine/src/core-data/Common/MatDefs/Misc/Unshaded.frag b/engine/src/core-data/Common/MatDefs/Misc/Unshaded.frag index ab28778e6..2ebae6a04 100644 --- a/engine/src/core-data/Common/MatDefs/Misc/Unshaded.frag +++ b/engine/src/core-data/Common/MatDefs/Misc/Unshaded.frag @@ -1,27 +1,15 @@ -uniform vec4 m_Color; - #if defined(HAS_GLOWMAP) || defined(HAS_COLORMAP) || (defined(HAS_LIGHTMAP) && !defined(SEPARATE_TEXCOORD)) #define NEED_TEXCOORD1 #endif -#ifdef HAS_COLORMAP - uniform sampler2D m_ColorMap; -#endif - -#ifdef NEED_TEXCOORD1 - varying vec2 texCoord1; -#endif +uniform vec4 m_Color; +uniform sampler2D m_ColorMap; +uniform sampler2D m_LightMap; -#ifdef HAS_LIGHTMAP - uniform sampler2D m_LightMap; - #ifdef SEPARATE_TEXCOORD - varying vec2 texCoord2; - #endif -#endif +varying vec2 texCoord1; +varying vec2 texCoord2; -#ifdef HAS_VERTEXCOLOR - varying vec4 vertColor; -#endif +varying vec4 vertColor; void main(){ vec4 color = vec4(1.0); diff --git a/engine/src/core-data/Common/MatDefs/Misc/Unshaded.vert b/engine/src/core-data/Common/MatDefs/Misc/Unshaded.vert index 7bf9f7e64..bfc347d63 100644 --- a/engine/src/core-data/Common/MatDefs/Misc/Unshaded.vert +++ b/engine/src/core-data/Common/MatDefs/Misc/Unshaded.vert @@ -5,20 +5,14 @@ attribute vec3 inPosition; #define NEED_TEXCOORD1 #endif -#ifdef NEED_TEXCOORD1 - attribute vec2 inTexCoord; - varying vec2 texCoord1; -#endif +attribute vec2 inTexCoord; +attribute vec2 inTexCoord2; +attribute vec4 inColor; -#ifdef SEPARATE_TEXCOORD - attribute vec2 inTexCoord2; - varying vec2 texCoord2; -#endif +varying vec2 texCoord1; +varying vec2 texCoord2; -#ifdef HAS_VERTEXCOLOR - attribute vec4 inColor; - varying vec4 vertColor; -#endif +varying vec4 vertColor; void main(){ #ifdef NEED_TEXCOORD1