FPP and Anti-Alias


I’m trying to put some AA in my project, which is using a FilterPostProcessor.

I’ve already set FPP numSample accordingly to the Application, but ran into an exception :

SEVERE: Uncaught exception thrown in Thread[LWJGL Renderer Thread,5,main] java.lang.IllegalArgumentException: Material parameter is not defined: NumSamplesDepth at com.jme3.material.Material.checkSetParam(Material.java:442) at com.jme3.material.Material.setParam(Material.java:458) at com.jme3.material.Material.setInt(Material.java:605) at com.jme3.post.FilterPostProcessor.renderFilterChain(FilterPostProcessor.java:262) at com.jme3.post.FilterPostProcessor.postFrame(FilterPostProcessor.java:293) at com.jme3.renderer.RenderManager.renderViewPort(RenderManager.java:989) at com.jme3.renderer.RenderManager.render(RenderManager.java:1031) at com.jme3.app.SimpleApplication.update(SimpleApplication.java:251) at com.jme3.system.lwjgl.LwjglAbstractDisplay.runLoop(LwjglAbstractDisplay.java:151) at com.jme3.system.lwjgl.LwjglDisplay.runLoop(LwjglDisplay.java:185) at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:228) at java.lang.Thread.run(Thread.java:722)

It seems to deal with material but i don’t found any infos about material NumSamplesDepth param.
Any hint ?

What Filters do you use?

Here is the list of filters :

dofFilter = new DepthOfFieldFilter();
fogFilter = new FogFilter();
ssaoFilter = new SSAOFilter();
lightSFilter = new LightScatteringFilter();
tbFilter = new TranslucentBucketFilter(true);

I active some of them depending of the displayed scene. Btw, I’m using the pssmRenderer processor too… :slight_smile:

Do you know wich filters are active when this happens? Can you pinpoint the one responsible (or the combination) by commenting them out one by one?

// filters setup
fpp = new FilterPostProcessor(assetManager);
if (settings.getSamples() > 0) {
//setUpShadowPSSM(512, 1, new Vector3f(-0.24F, -0.7F, -0.9F), 0.0F, 0.35f, 200.0f);
//setUpFog(ambient.getFogColor(), ambient.getFogDist(), ambient.getFogInt());
//setUpShadowSSAO(ssao_r, ssao_i, ssao_s, ssao_b);

Here is part of the code, this code makes my app crash (AA sets to 2 samples), so I guess the TranslucentBucketFilter is the one ! (it is create with SoftParticles enabled)

So if you uncomment all the others and comment out that one then it works fine?

if I active all filters but TranslucentBucketFilter, it works just fine :-?

Maybe TBF had to be set up in an other way to work with AA on ?

@kriss4realms said: if I active all filters but TranslucentBucketFilter, it works just fine :-?

Maybe TBF had to be set up in an other way to work with AA on ?

It’s a recent filter… maybe there’s just a glitch.

I agree, if it’s intended the jme api at least gives you a proper exception (Or should).

I’m gonna look into it

ok so you are using soft particles, is it intended?
If yes then consider to use FXAA instead of MS AA, For now soft particles don’t work with multi sampled depth and the shader needs some adaptations.
Else, just initialize your TranslucentBucketFilter with false instead of true.

I committed a fix so you should be able to use it with standard MS in next stable release.

Ty for your reply. I’ll give it a try asap :slight_smile: