Disabling post process filters in initializing thread?

I’m having an issue disabling my filters. Here is an example below.

fogFilter = new FogFilter(control.getFogColor(),control.getFogDensity(), control.getFogDistance());

There is an odd issue here. This line causes a crash when used in the application initialization for simpleApp or AbstractAppState.


What is odd is after the file is loaded if I call I call this line from the main loop such as update , onAction , etc it works.

If I try to disable the filter during initialization the the application freezes forcing me manually shut it down.

My loading process is.

.j3o file
input set up
physics set up
camera set up
effects set up

I’m not sure if it my order or if this is a known issue. I even tried calling this as the last line in my set up but it still fails. It only seems to work after the app is loaded and the first frame is processed. The filter works but it won’t let me disable it in the initialization process in my simpleApp or any AbstractAppStates.

What about if you swap those two lines?

Okay , that works. So what is the reasoning behind this ?

Probably a bug with disabling a filter that’s only partially setup. Easy work around is to disable it before you add it.

I only mentioned it because I disable filters all the time in init. But I habitually add the filter last for no real reason (until now).


That’s what I get for typing responses when I can barely hold my eyes open after 4 hours of No Man’s Sky.