From 29a4e7e01c2cdebc73ffde1bee75e4b4158ff248 Mon Sep 17 00:00:00 2001 From: "rem..om" Date: Tue, 31 May 2011 06:30:14 +0000 Subject: [PATCH] Fixed shader compilation failure when using glow map and unshaded material git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7539 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- .../src/core-data/Common/MatDefs/Light/Glow.frag | 14 ++++++++++++-- .../core-data/Common/MatDefs/Misc/Unshaded.frag | 2 +- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/engine/src/core-data/Common/MatDefs/Light/Glow.frag b/engine/src/core-data/Common/MatDefs/Light/Glow.frag index 8b613f566..b39e6defd 100644 --- a/engine/src/core-data/Common/MatDefs/Light/Glow.frag +++ b/engine/src/core-data/Common/MatDefs/Light/Glow.frag @@ -1,4 +1,10 @@ -varying vec2 texCoord; + +#if defined(NEED_TEXCOORD1) + varying vec2 texCoord1; +#else + varying vec2 texCoord; +#endif + #ifdef HAS_GLOWMAP uniform sampler2D m_GlowMap; @@ -12,7 +18,11 @@ varying vec2 texCoord; void main(){ #ifdef HAS_GLOWMAP - gl_FragColor = texture2D(m_GlowMap, texCoord); + #if defined(NEED_TEXCOORD1) + gl_FragColor = texture2D(m_GlowMap, texCoord1); + #else + gl_FragColor = texture2D(m_GlowMap, texCoord); + #endif #else #ifdef HAS_GLOWCOLOR gl_FragColor = m_GlowColor; diff --git a/engine/src/core-data/Common/MatDefs/Misc/Unshaded.frag b/engine/src/core-data/Common/MatDefs/Misc/Unshaded.frag index 1f3811ad4..bcfa31b69 100644 --- a/engine/src/core-data/Common/MatDefs/Misc/Unshaded.frag +++ b/engine/src/core-data/Common/MatDefs/Misc/Unshaded.frag @@ -1,6 +1,6 @@ uniform vec4 m_Color; -#if defined(HAS_COLORMAP) || (defined(HAS_LIGHTMAP) && !defined(SEPERATE_TEXCOORD)) +#if defined(HAS_GLOWMAP) || defined(HAS_COLORMAP) || (defined(HAS_LIGHTMAP) && !defined(SEPERATE_TEXCOORD)) #define NEED_TEXCOORD1 #endif