WateFilter depth write fix (yeah 'fix' Kirill). Issue was glClear(GL_DEPTH_BUFFER_BIT) seems to not work when glDepthMask is false

see http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=257223
Also there might be the same issue when copying frame buffers 

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7628 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
rem..om 14 years ago
parent be8929da87
commit 978ee32a96
  1. 3
      engine/src/core/com/jme3/post/FilterPostProcessor.java
  2. 9
      engine/src/lwjgl-ogl/com/jme3/renderer/lwjgl/LwjglRenderer.java

@ -199,9 +199,6 @@ public class FilterPostProcessor implements SceneProcessor, Savable {
r.clearBuffers(false, true, true);
renderManager.renderGeometry(fsQuad);
//re applying default render state at the end of the render
// to avoid depth write issues, MUST BE A BETTER WAY
r.applyRenderState(RenderState.DEFAULT);
}
public boolean isInitialized() {

@ -456,6 +456,15 @@ public class LwjglRenderer implements Renderer {
bits = GL_COLOR_BUFFER_BIT;
}
if (depth) {
//glClear(GL_DEPTH_BUFFER_BIT) seems to not work when glDepthMask is false
//here s some link on openl board
//http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=257223
//if depth clear is requested, we enable the depthMask
if (context.depthWriteEnabled == false) {
glDepthMask(true);
context.depthWriteEnabled = true;
}
bits |= GL_DEPTH_BUFFER_BIT;
}
if (stencil) {

Loading…
Cancel
Save