[WIP] Atmospheric Scattering and Motion Blur

@nehon said:
I don't know if you tried it but the lighting material has a steep parallax option. I never get the difference between steep parallax mapping and parallax occlusion mapping, so it might be of interest for you.
check this thread
http://hub.jmonkeyengine.org/groups/development-discussion-jme3/forum/topic/steep-parallax-mapping/

I've read through most of JME's shaders (in particular the interresting ones, such at Lighting).
Yeah, the difference is hard to tell. I think the one implemented in JME is in fact Parallax Occlusion Mapping, it all lies in how the final offset coordinate is calculated. In steep parallax mapping we don't approximate the heightfield as linear curve in the final step :)

@nehon said:
About the motion blur, it seems to be frame rate dependent (at high frame rate it not visible). But it seems you did account for it in the shader when computing the velocity.
`
vec2 velocity = (currentPos - previousPos).xy*-45.0/g_FrameRate * m_Strength;
`
Is it normal or something is messy on my end?


Hmm, your right :) I came to that insight when I was to explain myself here :P Following updates should solve that problem:

Update to MotionBlurFilter.java
[java]
public void setStrength(float strength) {
material.setFloat("Strength", strength * -.75f);
this.strength = strength;
}
[/java]
And the fragment shader :)
Code:
vec2 velocity = (currentPos - previousPos).xy * m_Strength;

looks awesome!

Been quiet for some time.



I’m a bit curious about that “dome rendered before everything else”, and how that could be used to scatter light onto the other objects (like terrain) without actually doing any work in their shaders. The only thing I could think of was to render the sky onto a texture first, then render the scene, then blend it with the sky-texture in some post processing stuff involving the depth buffer values or something.

@nehon , may I ask you about this shader… You said you would put this shader into JME core…

Did you put it?

didn’t have the time, there is still the frame rate dependency issue.

I’m interested in this one also but haven’t had time to investigate.



I’d really like to set this effect up to kick in when players run… I think it would look cool.

Don’t forget to test this version of Motion Blur: http://hub.jmonkeyengine.org/groups/contribution-depot-jme3/forum/topic/simple-motion-blur/

@mifth i tested it http://hub.jmonkeyengine.org/groups/contribution-depot-jme3/forum/topic/simple-motion-blur/#post-153837



This one is a better candidate to get in the core though as it consider velocity, but still it does only consider camera movements.

This one seemed to me like it would show forward velocity better than a more general motion blur shader. I was going to try both but not until this one was ready to go.



I actually may end up writing my own based on these that combines a radial effect.

@androlo said:
Been quiet for some time.

I'm a bit curious about that "dome rendered before everything else", and how that could be used to scatter light onto the other objects (like terrain) without actually doing any work in their shaders. The only thing I could think of was to render the sky onto a texture first, then render the scene, then blend it with the sky-texture in some post processing stuff involving the depth buffer values or something.



I'm thinking one can apply the scattering in i post-filter. But the implementation is going to clumpsy and result in heavy shader code if ones uses my implemenation right off...