diff --git a/jme3-effects/src/main/resources/Common/MatDefs/Post/Fog.frag b/jme3-effects/src/main/resources/Common/MatDefs/Post/Fog.frag index 7321b1516..9a1dcbcb8 100644 --- a/jme3-effects/src/main/resources/Common/MatDefs/Post/Fog.frag +++ b/jme3-effects/src/main/resources/Common/MatDefs/Post/Fog.frag @@ -6,10 +6,10 @@ uniform vec4 m_FogColor; uniform float m_FogDensity; uniform float m_FogDistance; -vec2 m_FrustumNearFar=vec2(1.0,m_FogDistance); const float LOG2 = 1.442695; void main() { + vec2 m_FrustumNearFar=vec2(1.0,m_FogDistance); vec4 texVal = texture2D(m_Texture, texCoord); float fogVal =texture2D(m_DepthTexture,texCoord).r; float depth= (2.0 * m_FrustumNearFar.x) / (m_FrustumNearFar.y + m_FrustumNearFar.x - fogVal* (m_FrustumNearFar.y-m_FrustumNearFar.x)); diff --git a/jme3-effects/src/main/resources/Common/MatDefs/Post/Fog15.frag b/jme3-effects/src/main/resources/Common/MatDefs/Post/Fog15.frag index 7a1f756be..9db3ec47b 100644 --- a/jme3-effects/src/main/resources/Common/MatDefs/Post/Fog15.frag +++ b/jme3-effects/src/main/resources/Common/MatDefs/Post/Fog15.frag @@ -10,10 +10,10 @@ uniform float m_FogDistance; in vec2 texCoord; out vec4 fragColor; -vec2 m_FrustumNearFar=vec2(1.0,m_FogDistance); const float LOG2 = 1.442695; void main() { + vec2 m_FrustumNearFar=vec2(1.0,m_FogDistance); vec4 texVal = getColor(m_Texture, texCoord); float fogVal = getDepth(m_DepthTexture,texCoord).r; float depth= (2.0 * m_FrustumNearFar.x) / (m_FrustumNearFar.y + m_FrustumNearFar.x - fogVal* (m_FrustumNearFar.y-m_FrustumNearFar.x));