Filters : fixed depth buffer rendering for additionnal passes

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8176 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
rem..om 14 years ago
parent 90a7917e1a
commit 29dbdc08a4
  1. 4
      engine/src/core/com/jme3/post/Filter.java

@ -102,6 +102,7 @@ public abstract class Filter implements Savable {
if (numSamples > 1 && caps.contains(Caps.FrameBufferMultisample) && caps.contains(Caps.OpenGL31)) { if (numSamples > 1 && caps.contains(Caps.FrameBufferMultisample) && caps.contains(Caps.OpenGL31)) {
renderFrameBuffer = new FrameBuffer(width, height, numSamples); renderFrameBuffer = new FrameBuffer(width, height, numSamples);
renderedTexture = new Texture2D(width, height, numSamples, textureFormat); renderedTexture = new Texture2D(width, height, numSamples, textureFormat);
renderFrameBuffer.setDepthBuffer(depthBufferFormat);
if (renderDepth) { if (renderDepth) {
depthTexture = new Texture2D(width, height, numSamples, depthBufferFormat); depthTexture = new Texture2D(width, height, numSamples, depthBufferFormat);
renderFrameBuffer.setDepthTexture(depthTexture); renderFrameBuffer.setDepthTexture(depthTexture);
@ -109,6 +110,7 @@ public abstract class Filter implements Savable {
} else { } else {
renderFrameBuffer = new FrameBuffer(width, height, 1); renderFrameBuffer = new FrameBuffer(width, height, 1);
renderedTexture = new Texture2D(width, height, textureFormat); renderedTexture = new Texture2D(width, height, textureFormat);
renderFrameBuffer.setDepthBuffer(depthBufferFormat);
if (renderDepth) { if (renderDepth) {
depthTexture = new Texture2D(width, height, depthBufferFormat); depthTexture = new Texture2D(width, height, depthBufferFormat);
renderFrameBuffer.setDepthTexture(depthTexture); renderFrameBuffer.setDepthTexture(depthTexture);
@ -116,7 +118,7 @@ public abstract class Filter implements Savable {
} }
renderFrameBuffer.setColorTexture(renderedTexture); renderFrameBuffer.setColorTexture(renderedTexture);
renderFrameBuffer.setDepthBuffer(depthBufferFormat);
} }

Loading…
Cancel
Save