Consider that the values are approximated . Anyway I played with the setting and I can obtain preatty awesome atmospheres , great great job!
Thanks, you get the windows intel achievement unlocked then.
I think it’s interesting that the atmospheric shader seems consistently a little faster than Unshaded.j3md. Puzzling and encouraging at the same time. I have some theories and I may have to experiment sometime to see.
I tested it. I get 680-690 fps with it off, looking at the horizon and 660-680fps with it on looking at the horizon.
Windows 8.1, AMD r9 270x, AMD FX 8320, 1080p, 16x AA
Note: this shader and associated parameters code has been added (sometime back) to a new SimFX library that I just haven’t released yet. But the source code is all up in SVN. If there is interest, I can quickly push a library.
It’s pretty easy to use, I think. Add the LightingState (which can be used to take over management of your main directional light) and the SkyState. Voila: sky
Can even be done right in your simple app constructor:
[java]
public class MyGame extends SimpleApplication {
…
…
public MyGame() {
super( new LightingState(), new SkyState() );
}
}
[/java]
There is also a built in SkySettingsState if you want to be able to easily pop open a window to edit sky settings.
I’m writing this from my Mac Mini. Yeah, I never get to use it.
It is an intel and NVidia based machine from the 2012 or 2011, I don’t remember specifically when I bought it. But it is as powerful as my windows machine I described earlier in this thread.
It says the quit unexpectedly. Then I get this error. So the program doesn’t run.
I’m not familiar enough with Macs to know how to interpret that… but if it crashes the JVM without an error than it’s likely a driver bug, I guess. Either that or the hardware just doesn’t support the features selected or something. I assume it crashed after you got past the app settings screen at least?
@Pixelapp said:
Congratulations @pspeed. It works on my mac mini. No problems at all.
Will you integrate your Atmospheric scattering into SkyControl. It is just a suggestion. I would be awesome though.
That would be up to the author of SkyControl, I guess. If I push up a library it should be pretty easy for him to support if he is interested… though it does pull in a few extra dependencies.
I have a question to atmospheric scattering.
These shaders are always applied to a 180° syk dome. Is there a way to render a 360° sphere? Because my scene is not large enough to cover the black lower half of the sky dome
Ok thank you. I have copied your code to test your atmospheric scattering shader with the ground disc. But there is not a smooth transition between sky dome and ground disc. Is there a way to fix this? I noticed that your shader code is slightly different to the shader code from Sean O’Neil, but at the end it seems that it doesn’t make a difference how it looks.
“fix” is an interesting word since if I go somewhere like the ocean where I can see all the way to the horizon I see an exact horizon line just like this. So perhaps “unfix” is a better word?
Or if you want fog then you may want to implement fog.
Note: if you use reflective water (like the water post processor filter) then I think you will get a reflection at the horizon which might be closer to what you want. Either way, your “best” picture is entirely inaccurate with real life.
Hm I don’t think the ground shader is correct
In this thesis (page 69) you can read, that the color of the ground and the sky should be identical.
He also describes the edge as a artifact on page 100.
How high up are you trying to simulate? Because at anywhere near ground level, the notion is patently false as it’s easy to find real world images that clearly show a horizon line. Pages and pages and pages of them.
And if you are traveling up in the sky then you will have to make sure to set the Y offset or the ground won’t look right… but if you’ve got that rigged properly then the ground will fade away to pure haze as you move up.