Issues with changing anti-aliasing samples after application start

I’m experiencing a problem where changing the number of anti-aliasing samples is causing geometry attached to the gui node to behave oddly and render incorrectly. Essentially any time I do this:

settings.setSamples(x)
this.restart()

Where ‘x’ is any valid number of samples different from that currently set. If the value is set at application start it works as expected.

This code for example reproduces the issue:

public class ChangeSamplingTest extends SimpleApplication implements ActionListener
{
    private static final String CHANGE_SAMPLES_MAPPING_NAME = "ChangeSettings";
    
    public ChangeSamplingTest()
    {
        super();
        
        AppSettings appSettings = new AppSettings(true);        
        appSettings.setSamples(2);        
        this.setSettings(appSettings);
        
        this.start();
    }
    
    public static void main(String[] args)
    {
        new ChangeSamplingTest();
    }

    @Override
    public final void simpleInitApp()
    {        
        this.getInputManager().addMapping(CHANGE_SAMPLES_MAPPING_NAME, new KeyTrigger(KeyInput.KEY_Q));
        this.getInputManager().addListener(this, CHANGE_SAMPLES_MAPPING_NAME);
    }

    @Override
    public final void onAction(String name, boolean isPressed, float tpf)
    {
        if ((name == CHANGE_SAMPLES_MAPPING_NAME) && isPressed)
        {
            settings.setSamples(4);
            this.restart();
        }
    }
}

If you press q it will restart the application and the fps/stats info will disappear.

This is using the latest master checked out from github as well as a version that was a couple of months older. I’m unfamiliar with the parts of the jme code to do with restarting the application context and so my own investigations haven’t yet yielded anything. Can anybody else reproduce this?

1 Like

I’ve also had problems with changing samples while the program is running. I’m still on jme 3.0, what version are you on out of interest?

I’d leave it at that but the forum makes me put content. :slight_smile:

2 Likes

Fuck…

Ahem. I’m using a really old version and when I change AA settings I also get problems, was hoping it would be different in the newer versions since mine is ancient