From 0604418b3cfb8f5e236a4daa5dc7d25e6f5233e4 Mon Sep 17 00:00:00 2001 From: "ant..om" Date: Mon, 27 Jun 2011 19:11:50 +0000 Subject: [PATCH] Fix: calculating localTranslation after gridChange git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7756 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- .../Common/MatDefs/Terrain/HeightBasedTerrain.frag | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/engine/src/terrain/Common/MatDefs/Terrain/HeightBasedTerrain.frag b/engine/src/terrain/Common/MatDefs/Terrain/HeightBasedTerrain.frag index 91dacd2d4..b0b594c62 100644 --- a/engine/src/terrain/Common/MatDefs/Terrain/HeightBasedTerrain.frag +++ b/engine/src/terrain/Common/MatDefs/Terrain/HeightBasedTerrain.frag @@ -18,20 +18,20 @@ varying vec4 position; vec4 GenerateTerrainColor() { float height = position.y; vec4 p = position / m_terrainSize; - + vec3 blend = abs( normal ); blend = (blend -0.2) * 0.7; blend = normalize(max(blend, 0.00001)); // Force weights to sum to 1.0 (very important!) float b = (blend.x + blend.y + blend.z); blend /= vec3(b, b, b); - vec4 terrainColor = vec4(0, 0, 0, 1.0); + vec4 terrainColor = vec4(0.0, 0.0, 0.0, 1.0); float m_regionMin = 0.0; float m_regionMax = 0.0; float m_regionRange = 0.0; float m_regionWeight = 0.0; - + vec4 slopeCol1 = texture2D(m_slopeColorMap, p.yz * m_slopeTileFactor); vec4 slopeCol2 = texture2D(m_slopeColorMap, p.xy * m_slopeTileFactor); @@ -70,7 +70,7 @@ vec4 GenerateTerrainColor() { return (blend.y * terrainColor + blend.x * slopeCol1 + blend.z * slopeCol2); } -void main() { +void main() { vec4 color = GenerateTerrainColor(); gl_FragColor = color; }