[Help!] Fog in the Distance

Ive been digging the forums over pretty heavily and i cant seem to find what im looking for, nor are my tinkerings coming up with any good results.

Could someone please show me how to properly add fog at the far frustum?

This is what i tried so far, but i get some very weird behavior. It cuts off almost half my view and fogs the rest.
[java]
fogPPS=new FilterPostProcessor(assetManager);
fog = new FogFilter(ColorRGBA.Gray, 0.1f, 800f);
fogPPS.addFilter(fog);
viewPort.addProcessor(fogPPS);[/java]

could you define “weird behavior”?
A screenshot would help too

Also, what are your frustum parameters?

Not trying to detract from the current fog filter… but this an awesome opportunity to learn a bunch about:

JME Filters
Shaders

If you do a search for GLSL fog implementation, you see that they provide 3 different methods of rendering fog:

Camera to Distance
Distance to Infinity (this would be far frustum)
And Linear

I learned a ton implementing a Fog Filter that allows for all of these and it didn’t take long to do.

Anyways… I’m sure either nehon or pspeed can answer your question as is… but it’s worth considering the option I gave even if there is another solution.

Cheers

@nehon said: could you define "weird behavior"? A screenshot would help too

essentially it doesnt render the heightmap past a certain level.
screeny

i should also point out that this only seems to happen when i apply the fogFilter post processor after the waterFilter pps. discovered this after posting last night.

@pspeed said: Also, what are your frustum parameters?

i left them at the default for simpleApplication, with the exception of setting the frustumFar to 800f

@t0neg0d said: Not trying to detract from the current fog filter... but this an awesome opportunity to learn a bunch about:

JME Filters
Shaders

If you do a search for GLSL fog implementation, you see that they provide 3 different methods of rendering fog:

Camera to Distance
Distance to Infinity (this would be far frustum)
And Linear

I learned a ton implementing a Fog Filter that allows for all of these and it didn’t take long to do.

Anyways… I’m sure either nehon or pspeed can answer your question as is… but it’s worth considering the option I gave even if there is another solution.

Cheers

I saw some of these posts, but i wasn’t sure if this was an actual module that is stable and available. I did like what i read about what its capable of, but i wasn’t clear on how to implement it. I’ll have to dig more on those subjects it seems.