diff --git a/jme3-examples/src/main/java/jme3test/light/TestSpotLightTerrain.java b/jme3-examples/src/main/java/jme3test/light/TestSpotLightTerrain.java index f656b1fd6..02bd48abb 100644 --- a/jme3-examples/src/main/java/jme3test/light/TestSpotLightTerrain.java +++ b/jme3-examples/src/main/java/jme3test/light/TestSpotLightTerrain.java @@ -98,7 +98,7 @@ public class TestSpotLightTerrain extends SimpleApplication { ambLight.setColor(ColorRGBA.Black); rootNode.addLight(ambLight); - cam.setLocation(new Vector3f(-41.219646f, -84.8363f, -171.67267f)); + cam.setLocation(new Vector3f(-41.219646f, 0.8363f, -171.67267f)); cam.setRotation(new Quaternion(-0.04562731f, 0.89917684f, -0.09668826f, -0.4243236f)); sl.setDirection(cam.getDirection()); sl.setPosition(cam.getLocation()); diff --git a/jme3-terrain/src/main/resources/Common/MatDefs/Terrain/SPTerrainLighting.frag b/jme3-terrain/src/main/resources/Common/MatDefs/Terrain/SPTerrainLighting.frag index b62915145..9b90c73e1 100644 --- a/jme3-terrain/src/main/resources/Common/MatDefs/Terrain/SPTerrainLighting.frag +++ b/jme3-terrain/src/main/resources/Common/MatDefs/Terrain/SPTerrainLighting.frag @@ -150,6 +150,7 @@ varying vec2 texCoord; vec4 calculateDiffuseBlend(in vec2 texCoord) { vec4 alphaBlend = texture2D( m_AlphaMap, texCoord.xy ); + vec4 diffuseColor = vec4(1.0); #ifdef ALPHAMAP_1 vec4 alphaBlend1 = texture2D( m_AlphaMap_1, texCoord.xy ); @@ -157,9 +158,10 @@ varying vec2 texCoord; #ifdef ALPHAMAP_2 vec4 alphaBlend2 = texture2D( m_AlphaMap_2, texCoord.xy ); #endif - - vec4 diffuseColor = texture2D(m_DiffuseMap, texCoord * m_DiffuseMap_0_scale); - diffuseColor *= alphaBlend.r; + #ifdef DIFFUSEMAP + diffuseColor = texture2D(m_DiffuseMap, texCoord * m_DiffuseMap_0_scale); + diffuseColor *= alphaBlend.r; + #endif #ifdef DIFFUSEMAP_1 vec4 diffuseColor1 = texture2D(m_DiffuseMap_1, texCoord * m_DiffuseMap_1_scale); diffuseColor = mix( diffuseColor, diffuseColor1, alphaBlend.g ); diff --git a/jme3-terrain/src/main/resources/Common/MatDefs/Terrain/TerrainLighting.frag b/jme3-terrain/src/main/resources/Common/MatDefs/Terrain/TerrainLighting.frag index 344fd9a15..249969bfa 100644 --- a/jme3-terrain/src/main/resources/Common/MatDefs/Terrain/TerrainLighting.frag +++ b/jme3-terrain/src/main/resources/Common/MatDefs/Terrain/TerrainLighting.frag @@ -151,6 +151,7 @@ varying vec3 lightVec; vec4 calculateDiffuseBlend(in vec2 texCoord) { vec4 alphaBlend = texture2D( m_AlphaMap, texCoord.xy ); + vec4 diffuseColor = vec4(1.0); #ifdef ALPHAMAP_1 vec4 alphaBlend1 = texture2D( m_AlphaMap_1, texCoord.xy ); @@ -158,9 +159,10 @@ varying vec3 lightVec; #ifdef ALPHAMAP_2 vec4 alphaBlend2 = texture2D( m_AlphaMap_2, texCoord.xy ); #endif - - vec4 diffuseColor = texture2D(m_DiffuseMap, texCoord * m_DiffuseMap_0_scale); - diffuseColor *= alphaBlend.r; + #ifdef DIFFUSEMAP + diffuseColor = texture2D(m_DiffuseMap, texCoord * m_DiffuseMap_0_scale); + diffuseColor *= alphaBlend.r; + #endif #ifdef DIFFUSEMAP_1 vec4 diffuseColor1 = texture2D(m_DiffuseMap_1, texCoord * m_DiffuseMap_1_scale); diffuseColor = mix( diffuseColor, diffuseColor1, alphaBlend.g ); diff --git a/jme3-terrain/src/main/resources/Common/MatDefs/Terrain/TerrainLighting.j3md b/jme3-terrain/src/main/resources/Common/MatDefs/Terrain/TerrainLighting.j3md index 8084f8104..66107a632 100644 --- a/jme3-terrain/src/main/resources/Common/MatDefs/Terrain/TerrainLighting.j3md +++ b/jme3-terrain/src/main/resources/Common/MatDefs/Terrain/TerrainLighting.j3md @@ -272,29 +272,7 @@ MaterialDef Terrain Lighting { } - Technique GBuf { - VertexShader GLSL100: Common/MatDefs/Light/GBuf.vert - FragmentShader GLSL100: Common/MatDefs/Light/GBuf.frag - - WorldParameters { - WorldViewProjectionMatrix - WorldMatrix - } - - Defines { - VERTEX_COLOR : UseVertexColor - MATERIAL_COLORS : UseMaterialColors - V_TANGENT : VTangent - MINNAERT : Minnaert - WARDISO : WardIso - - DIFFUSEMAP : DiffuseMap - NORMALMAP : NormalMap - SPECULARMAP : SpecularMap - PARALLAXMAP : ParallaxMap - } - } Technique Glow {