diff --git a/jme3-effects/src/main/resources/Common/MatDefs/Post/LightScattering.frag b/jme3-effects/src/main/resources/Common/MatDefs/Post/LightScattering.frag index 7e1c542f0..8f5957ca6 100644 --- a/jme3-effects/src/main/resources/Common/MatDefs/Post/LightScattering.frag +++ b/jme3-effects/src/main/resources/Common/MatDefs/Post/LightScattering.frag @@ -29,7 +29,8 @@ void main(void) res /= m_NbSamples; //Blend the original color with the averaged pixels - gl_FragColor =mix( colorRes, res, m_LightDensity); + float mean = (res.r + res.g + res.b)/3; + fragColor =mix(colorRes ,mix( colorRes, res, m_LightDensity),mean); }else{ gl_FragColor= texture2D(m_Texture,texCoord); } diff --git a/jme3-effects/src/main/resources/Common/MatDefs/Post/LightScattering15.frag b/jme3-effects/src/main/resources/Common/MatDefs/Post/LightScattering15.frag index bf72fd9d5..8db6d9b04 100644 --- a/jme3-effects/src/main/resources/Common/MatDefs/Post/LightScattering15.frag +++ b/jme3-effects/src/main/resources/Common/MatDefs/Post/LightScattering15.frag @@ -33,7 +33,8 @@ void main(void) res /= m_NbSamples; //Blend the original color with the averaged pixels - fragColor = mix( colorRes, res, m_LightDensity); + float mean = (res.r + res.g + res.b)/3; + fragColor =mix(colorRes ,mix( colorRes, res, m_LightDensity),mean); }else{ fragColor = getColor(m_Texture,texCoord); }