From 3dfe3d70f52a8bc595be6f6ffe86a387aa22af2b Mon Sep 17 00:00:00 2001 From: "Sha..rd" Date: Sat, 25 Feb 2012 19:51:35 +0000 Subject: [PATCH] * Re-added conditional in Lighting.frag to avoid NVIDIA bug. It uses control flow but most GLSL compilers should optimize it to compare and set. git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9204 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- engine/src/core-data/Common/MatDefs/Light/Lighting.frag | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/engine/src/core-data/Common/MatDefs/Light/Lighting.frag b/engine/src/core-data/Common/MatDefs/Light/Lighting.frag index 76f0e1512..eb1c3fdb2 100644 --- a/engine/src/core-data/Common/MatDefs/Light/Lighting.frag +++ b/engine/src/core-data/Common/MatDefs/Light/Lighting.frag @@ -126,6 +126,10 @@ vec2 computeLighting(in vec3 wvNorm, in vec3 wvViewDir, in vec3 wvLightDir){ float att = vLightDir.w; #endif + if (m_Shininess <= 1.0) { + specularFactor = 0.0; // should be one instruction on most cards .. + } + specularFactor *= diffuseFactor; return vec2(diffuseFactor, specularFactor) * vec2(att);