Use the same depth format in all places in FPP

opengles2-fixes
Kirill Vainer 7 years ago
parent b0316e419c
commit 88aaa079e3
  1. 11
      jme3-core/src/main/java/com/jme3/post/FilterPostProcessor.java

@ -66,7 +66,7 @@ public class FilterPostProcessor implements SceneProcessor, Savable {
private FrameBuffer renderFrameBuffer; private FrameBuffer renderFrameBuffer;
private Texture2D filterTexture; private Texture2D filterTexture;
private Texture2D depthTexture; private Texture2D depthTexture;
private SafeArrayList<Filter> filters = new SafeArrayList<Filter>(Filter.class); private SafeArrayList<Filter> filters = new SafeArrayList<>(Filter.class);
private AssetManager assetManager; private AssetManager assetManager;
private Picture fsQuad; private Picture fsQuad;
private boolean computeDepth = false; private boolean computeDepth = false;
@ -85,6 +85,7 @@ public class FilterPostProcessor implements SceneProcessor, Savable {
private AppProfiler prof; private AppProfiler prof;
private Format fbFormat = Format.RGB111110F; private Format fbFormat = Format.RGB111110F;
private Format depthFormat = Format.Depth;
/** /**
* Create a FilterProcessor * Create a FilterProcessor
@ -178,7 +179,7 @@ public class FilterPostProcessor implements SceneProcessor, Savable {
filter.setProcessor(this); filter.setProcessor(this);
if (filter.isRequiresDepthTexture()) { if (filter.isRequiresDepthTexture()) {
if (!computeDepth && renderFrameBuffer != null) { if (!computeDepth && renderFrameBuffer != null) {
depthTexture = new Texture2D(width, height, Format.Depth24); depthTexture = new Texture2D(width, height, depthFormat);
renderFrameBuffer.setDepthTexture(depthTexture); renderFrameBuffer.setDepthTexture(depthTexture);
} }
computeDepth = true; computeDepth = true;
@ -477,20 +478,20 @@ public class FilterPostProcessor implements SceneProcessor, Savable {
renderFrameBufferMS = new FrameBuffer(width, height, numSamples); renderFrameBufferMS = new FrameBuffer(width, height, numSamples);
if (caps.contains(Caps.OpenGL32)) { if (caps.contains(Caps.OpenGL32)) {
Texture2D msColor = new Texture2D(width, height, numSamples, fbFormat); Texture2D msColor = new Texture2D(width, height, numSamples, fbFormat);
Texture2D msDepth = new Texture2D(width, height, numSamples, Format.Depth); Texture2D msDepth = new Texture2D(width, height, numSamples, depthFormat);
renderFrameBufferMS.setDepthTexture(msDepth); renderFrameBufferMS.setDepthTexture(msDepth);
renderFrameBufferMS.setColorTexture(msColor); renderFrameBufferMS.setColorTexture(msColor);
filterTexture = msColor; filterTexture = msColor;
depthTexture = msDepth; depthTexture = msDepth;
} else { } else {
renderFrameBufferMS.setDepthBuffer(Format.Depth); renderFrameBufferMS.setDepthBuffer(depthFormat);
renderFrameBufferMS.setColorBuffer(fbFormat); renderFrameBufferMS.setColorBuffer(fbFormat);
} }
} }
if (numSamples <= 1 || !caps.contains(Caps.OpenGL32)) { if (numSamples <= 1 || !caps.contains(Caps.OpenGL32)) {
renderFrameBuffer = new FrameBuffer(width, height, 1); renderFrameBuffer = new FrameBuffer(width, height, 1);
renderFrameBuffer.setDepthBuffer(Format.Depth); renderFrameBuffer.setDepthBuffer(depthFormat);
filterTexture = new Texture2D(width, height, fbFormat); filterTexture = new Texture2D(width, height, fbFormat);
renderFrameBuffer.setColorTexture(filterTexture); renderFrameBuffer.setColorTexture(filterTexture);
} }

Loading…
Cancel
Save