javaantialiasingjmonkeyengine

How to enable antialiasing in JMonkeyEngine?


I'm trying to enable antialiasing of objects, at least to some degree. It doesn't matter if it's MSAA or orthe technique. I just want to get some sort of antialiasing, since something is better than nothing.


Solution

  • Afaik you have a couple of options;

    1. Set Samples to > 0 in AppSettings.

       public static void main(String[] args) {
         AppSettings settings = new AppSettings(true);
         settings.setSamples(4);
         MyGame app = new MyGame();
         app.setSettings(settings);
         app.start();
       }
      

    Wiki: https://wiki.jmonkeyengine.org/docs/3.3/core/system/appsettings.html#properties

    1. Add an FXAA post filter:

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

    Wiki: https://wiki.jmonkeyengine.org/docs/3.3/sdk/filters.html

    1. Enable anti-aliasing in the NVidia's application profiles. (Dependent on platform) https://www.nvidia.com/content/Control-Panel-Help/vLatest/en-us/mergedProjects/nv3d/Tips_for_Setting_Antialiasing.htm

    The FXAA filter is probably most expensive way to achieve it. If you can, go for option 1 and 3.