I’m using a FilterPostProcessor like so (in an AppState) (lifted straight from TestCartoonEdge.java):
@Override
public void create() {
super.create();
if (app.getRenderer().getCaps().contains(Caps.GLSL100)) {
FilterPostProcessor fpp = new FilterPostProcessor(app.getAssetManager());
int numSamples = app.getContext().getSettings().getSamples();
if (numSamples > 0) {
fpp.setNumSamples(numSamples);
}
CartoonEdgeFilter toon = new CartoonEdgeFilter();
toon.setEdgeColor(ColorRGBA.Blue);
toon.setEdgeIntensity(1.0f);
toon.setEdgeWidth(1.0f);
fpp.addFilter(toon);
app.getViewPort().addProcessor(fpp);
}
// update camera to make sure it is set up properly
updateCamera();
}
When the window loses focus the screen stops updating (this is normal). when I re focus the screen the renderer has stopped working for my scene, it just stays the same, or black if I try to resize. I can see the stats view updating but that is it.
If I remove the fpp then it works as I expect (but without the fpp obviously).
Am I missing something simple?
version 3.1.0-beta1
UPDATE
In fact I incorrectly stated that the issue persists when the window loses focus but actually it seems to only break when you resize the window. Or at least that is what I now observe from the above TestApplication code.
So i found this topic and in it it mentions that fpp.setNumSamples(numSamples); causes issues.
Sure enough if I remove that code it works, but is obviously aliased.
However what is not so obvious is this (bear with me): When the scene first loads (with my original code) it works up until the window loses focus. This code contains the call to fpp.setNumSamples(numSamples) even if I force it to set num samples to 4 then the FilterPostProcessor is still aliased, the scene is anti-aliased in the manner I expected, but still broken when the window loses focus.
UPDATE
I get the same problem exactly repeated if I use a different filter instead; I used RadialBlurFilter.
In fact I incorrectly stated that the issue persists when the window loses focus but actually it seems to only break when you resize the window. Or at least that is what I now observe from the above TestApplication code.