From f669290a3aff2afd5878940af8802a3c13dad7a3 Mon Sep 17 00:00:00 2001 From: "bre..ns" Date: Wed, 25 Apr 2012 21:02:56 +0000 Subject: [PATCH] updated terrainLighting.frag's shininess to match more of Lighting.frag git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9328 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- .../src/terrain/Common/MatDefs/Terrain/TerrainLighting.frag | 5 ++++- .../src/terrain/Common/MatDefs/Terrain/TerrainLighting.j3md | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) 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