Realistic atmosphere

Great job Robert on implementing that from the link you posted above! I’m currently working on implementing the same technique but from O’Neil example from NVidia’s GPU Gems 2. Nearly there getting all the math correct but still not 100%.

That’s a bummer Eric Bruneton’s multi-scattering technique looks challenging due to the 3D Texture support in UE4. Considering you’ve already looked at trying to implement it, what was lacking w/ 3D Textures UE4 to allow you to do this? You mentioned it’s not that easy but I was curious if its a limitation or just a massive workaround to get that to work? I looked at his article a week back when I started working on this but wanted to start w/ O’Neil’s example first before moving forward.

But keep up the great work buddy! :smiley:

Saw a couple of the vids of your progress and it’s looking great!

Hey Aurel,

I’ve done this pretty easy. In UDK, you could simply get the “Light Vector” but since UE4 is working w/ a Deferred Renderer, this node isn’t accessible. You can pass through a Vector parameter that you get from your Directional Light in the scene. Maybe in your BP, on the Event ‘Begin Play’, use a ‘Get All Actors Of Class’ and pull down the Directional Light and store the reference from that. Note: There is no need to store the reference if the light does not ever move and in that case you can store the Forward Vector from the first light you find.

In order to do the math, I don’t have my shader in my primary project handy as I’m posting this but here is a link to an old UDK example that will help you create a mask that you can lerp against your ‘Night Lights’ texture to make that happen.

UDK Planet Shader: https://www.youtube.com/watch?v=xS8vDVCHF9c

Best of luck!