diff --git a/data/shaders/fog.frag b/data/shaders/fog.frag index 3fb5f39bb..961400c7e 100644 --- a/data/shaders/fog.frag +++ b/data/shaders/fog.frag @@ -15,9 +15,9 @@ out vec4 FragColor; void main() { - float z = texture(tex, uv).a; + float z = texture(tex, uv).x; - vec3 tmp = vec3(gl_TexCoord[0].xy, z); + vec3 tmp = vec3(uv, z); tmp = tmp * 2.0 - 1.0; vec4 xpos = vec4(tmp, 1.0); diff --git a/src/graphics/post_processing.cpp b/src/graphics/post_processing.cpp index 845d6928e..186930c39 100644 --- a/src/graphics/post_processing.cpp +++ b/src/graphics/post_processing.cpp @@ -567,7 +567,7 @@ void PostProcessing::renderFog(const core::vector3df &campos, const core::matrix glUseProgram(FullScreenShader::FogShader::Program); glBindVertexArray(FullScreenShader::FogShader::vao); - setTexture(0, static_cast(irr_driver->getRTT(RTT_NORMAL_AND_DEPTH))->getOpenGLTextureName(), GL_NEAREST, GL_NEAREST); + setTexture(0, static_cast(irr_driver->getRTT(RTT_NORMAL_AND_DEPTH))->DepthBufferTexture, GL_NEAREST, GL_NEAREST); FullScreenShader::FogShader::setUniforms(ipvmat, fogmax, startH, endH, start, end, col, campos, 0); glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);