I was looking through the code trying to figure out why my OSRViewport works but Filters do not… and it seems to boil down to something that could be easily fixed.
In Filter’s init method:
[java]
public void init(Renderer renderer, int width, int height, Format textureFormat, Format depthBufferFormat, int numSamples, boolean renderDepth) {
Collection<Caps> caps = renderer.getCaps();
if (numSamples > 1 && caps.contains(Caps.FrameBufferMultisample) && caps.contains(Caps.OpenGL31)) {
renderFrameBuffer = new FrameBuffer(width, height, numSamples);
renderedTexture = new Texture2D(width, height, numSamples, textureFormat);
renderFrameBuffer.setDepthBuffer(depthBufferFormat); // <<<<<< THIS LINE
if (renderDepth) {
depthTexture = new Texture2D(width, height, numSamples, depthBufferFormat);
renderFrameBuffer.setDepthTexture(depthTexture);
}
} else {
renderFrameBuffer = new FrameBuffer(width, height, 1);
renderedTexture = new Texture2D(width, height, textureFormat);
renderFrameBuffer.setDepthBuffer(depthBufferFormat); // <<<<<< THIS LINE
if (renderDepth) {
depthTexture = new Texture2D(width, height, depthBufferFormat);
renderFrameBuffer.setDepthTexture(depthTexture);
}
}
renderFrameBuffer.setColorTexture(renderedTexture);
}
[/java]
These two lines should be inside of the if(renderDepth) check.
Now… I haven’t looked at all of the filters… actually very few of them… BUT! BloomFilter… does not require Depth… so… each of the Filter.Pass.init() methods need to be changed to look like this:
extractPass.init(renderManager.getRenderer(), screenWidth, screenHeight, Format.RGBA8, Format.Depth, 1, false);
extractPass.setPassMaterial(extractMat);
And they should work fine on Android. FXAA should as well.
Anyways… hope this helps… /wave