How to turn on anti aliasing in Android Development

How to turn on anti aliasing in Android Development

You can use FXAAFilter.

1 Like

I use it like this:

FilterPostProcessor fpp = new FilterPostProcessor(assetManager);
fpp.addFilter(new FXAAFilter());

But the effect is not obvious

Try :

fxxa.setSubPixelShift(0f);
fxxa.setReduceMul(0f);

Before adding the filter.

1 Like

Is it correct to use this in Android?

@Override
public void simpleInitApp() {
FilterPostProcessor fpp = new FilterPostProcessor(assetManager);
FXAAFilter fxxa = new FXAAFilter();
fxxa.setSubPixelShift(0f);
fxxa.setReduceMul(0f);
fpp.addFilter(fxxa);
}

I have not used antialiasing before, but looking at the docs, its correct.

In this way, the effect is not obvious, and there are still sawteeth

I will need to check the associated shader to be sure of the real effect on gl es.

Have you tried the effect on desktop ? So, to be sure that the code is working and no other antagonistic effects on your code ?

Do you ever actually add your FilterPostProcessor anywhere or just create it in thin air and let it hang in the ether?