diff --git a/engine/src/terrain/Common/MatDefs/Terrain/TerrainLighting.frag b/engine/src/terrain/Common/MatDefs/Terrain/TerrainLighting.frag index 4d1d41ac1..fcda3f495 100644 --- a/engine/src/terrain/Common/MatDefs/Terrain/TerrainLighting.frag +++ b/engine/src/terrain/Common/MatDefs/Terrain/TerrainLighting.frag @@ -182,7 +182,10 @@ float lightComputeSpecular(in vec3 norm, in vec3 viewdir, in vec3 lightdir, in f vec2 computeLighting(in vec3 wvPos, in vec3 wvNorm, in vec3 wvViewDir, in vec3 wvLightDir){ float diffuseFactor = lightComputeDiffuse(wvNorm, wvLightDir, wvViewDir); float specularFactor = lightComputeSpecular(wvNorm, wvViewDir, wvLightDir, m_Shininess); - specularFactor *= step(1.0, m_Shininess); + + if (m_Shininess <= 1.0) { + specularFactor = 0.0; // should be one instruction on most cards .. + } float att = vLightDir.w; diff --git a/engine/src/terrain/Common/MatDefs/Terrain/TerrainLighting.j3md b/engine/src/terrain/Common/MatDefs/Terrain/TerrainLighting.j3md index ecc3c0d4c..d72b9d6bf 100644 --- a/engine/src/terrain/Common/MatDefs/Terrain/TerrainLighting.j3md +++ b/engine/src/terrain/Common/MatDefs/Terrain/TerrainLighting.j3md @@ -22,7 +22,7 @@ MaterialDef Terrain Lighting { Color Specular // Specular power/shininess - Float Shininess : 1 + Float Shininess : 0 // Texture map #0 Texture2D DiffuseMap