Planetary atmosphere shader

@riuthamus That’d be great. I’m just having difficulty getting it to react to anything when placed in the World. It looks great, just doesnt change based on anything it seems.

Any examples would be great to help me click how to get this going.

Please do.

So I’ve been playing with this shader for a few weeks now and am totally lost at where/how to hook it up to receive whatever information it requires.

I’ve tried setting it as a DynamicMaterialInstance and getting world info (such as world position) to set in Eclipse_Position_A etc.

Any insight would be fantastic and much appreciated (I’d even love to spitball some ideas for alternate methods to achieve this if anyone has ideas)

Left: my material preview window, Right: the object in the world
3fe62705457903955cf3cc943513a44b98feb891.jpeg

Have you tried using the camera’s position?

I am too having difficulties with this aswell.

In what sense? The Material utilizes the Camera Vector (I assume to draw the eclipse correctly which is where I am having the problem) - I have looked in Blueprints for a way to get camera location in another way but so far nothing has worked.

Did you have a specific place in mind to send the cameras position to?

Just bumping this for fresh eyes.

I’ve still been playing around with trying to get this to work, more so now because its frustrating hitting a wall.

I believe the issue is in the either the Camera Vector or Object/Absolute World Space nodes as everything appears to work correctly in preview but not in-world.

I’ve been using this for some reference to help troubleshoot but no luck thus far:

Hey all, sorry for the late reply.
This solution was a quick one (and not the most user friendly) so I do apologize. It is built upon an idea that is meant (in it’s final setup) to take 3 things into account.

  1. An observers fixed position
  2. A world position sphere mask (used for eclipse) and blending.
  3. Pre-animated light source

This week is very busy, but I promise to re-visit this topic soon and take some time to flush out a more user friendly approach that will work in real time with more automated parameters.

Edit :: I began to work out a solution that uses custom lighting only to find out there is no such thing within the shader with the new system (But rather has to be integrated into the blueprints?) not only that but since distortion has been removed and refraction is full of artifacts, we are going to have to do some work arounds. Not cool :frowning:

I never thought it was possible, but the unreal engine 4 feels like it is being based on reality so much that it actually hinders and hurts the creative process. I really hope we get back things such as distortion and custom lighting…

So depressing…

-Jeremy-

@JBaldwin Thank you so much, that’d be fantastic.

It’s such an awesome Shader I’d love to dissect and learn from, just the setup is doing my head in. Whenever you can, some additional info would be greatly appreciated :slight_smile:

Man, awesome shader! Thanks JBaldwin!

This is an awesome shader, but I cant make it work like it should :frowning:
I understand that the shader needs some information from the light and that we should feed him with this information through blueprint, but I have no idea on how to do that.
Here’s what my planet looks like so far:

https://dl.dropboxusercontent.com/u/2739873/atmosphere_Shader.png

I would love if someone could point me in the right direction.

Bit of a thread hi-jack but, I initially felt the same way. I did some digging into the reasoning why.

Custom Lighting isn’t available simply because we have a deferred lighting system, so that path just isn’t possible anymore. That said, I did have some luck going directly into the engine source code and adding shader/BRDF models of my own with the help of Ehamloptiran, but it’s quite clunky and with the recent engine updates everything has changed once again.

You can however use the Emissive channel and effectively plug a ‘custom lighting’ setup into that, but you’ll have to drive a ‘Light Vector’ parameter from Blueprint as those are also no longer available to the material editor due to the deferred lighting path.

As for Refraction, I too preferred distortion, especially for Particle Systems. I did try to get around it by creating a translucent material and offseting ‘Scene Colour’ by a certain amount, the results worked at some angles but they too were somewhat glitchy. They did say that they planned to add Distortion back in, but apparently it’s not a high priority :frowning:

Its like xmass, this is exactly what i need for my spess scene!

I dont want to lower the work you people do in any ways, but Earth has a thick atmosphere, and looks just so:

For reference purposes. The dust around the planet is reallllly incredible thin (in relation), not like this shader.

But most of us do (or try to do) game of some sort, we do not make yet another “space engine” or simulation. So how thick earth dust really is does not matter, our spaceships will never be to scale compared to earth, and Mount Everest will be always 10 times higher than real one. (even if its flat with normalmap only).

For eg. I made night side of Earth (and moon) reflect sky and stars, all because on night side everything was black, i do not care that ocean reflecting stars is totally unrealistic, it looks better than half of earth black. Same goes for distance to moon, altitude of satelites, distance to sun and its size, I made it all look good, not realistic. I also put damping on my spaceship where I should keep orbital movment frictionless, but that was annoying not fun.

Regardless of how realistic it is, OP was asking how to replicate a specific shader from shadertoy, it may not be realistic but he nailed the reference.

@JBaldwin any chance of another look at this? :slight_smile: I’m sure I’m not the only one eagerly awaiting your reply

@Mikand79:

You are correct. However, this was a simple template shader. I based it off of the provided example (which showed an exaggerated atmosphere density). However the atmosphere size can be changed at any time using falloff and power parameters. This was a fast “possible” shader solution, so there are several things that could be greatly expanded upon or fixed.

@TheFear:

I have been away for 2 weeks, but will be flying home shortly. At that point in time I am going to be finishing up the Star Kit I am developing and will then take another look at this.

-Jeremy-

Hey Jeremy! Is there any update on this yet? This is too good stuff to just forget about it! :slight_smile:

Is anyone going to revisit this shader? I built the shader, but not exactly sure how to implement it in blueprints. Any help on this would be appreciated.

Absolutely great, re-visitation would be cool to take this even further. Could some one help me with a small problem I have with the shader. I am trying to place a texture “inside” the effect sphere yet the outer rim of the texture is always outside the sphere effect. Here is an image to express my problem:

I am trying to achieve what brunogruber has where the planet texture is neatly within the sphere.