Atmospheric Scattering for top down 2D space shooters

I’ve been playing around with a twinstick shooter idea where you can fly around planets in a solar system and I wanted the atmosphere on those planets to properly fade to night without simply using gradient color or a texture. So I made a material that uses an atmospheric scattering algorithm to calculate the sky gradient properly.

I think I will polish it up further, make a sample map and put material up on the marketplace. Maybe make a planet and star blueprint example too.

oh my gosh, looks amazing. Is there anyway I could convince you to do a tutorial on ? I’ve been messing around with space scenes for an intro video but the atmospheres are just beyond me. Anyway, looks really good. I love the scale and how it adjusts on the fly.

The video shows all the math in the material. If you mean a tutorial on the planet it’s really just hooking up variables to the material parameters.

10/10 will buy if put up on the marketplace.

Also just curious how did you make the planet surface loop?

Great work :slight_smile:

That figures. I just watched the first half over and over with no sound.

The planets is a circle. I am currently using a spline mesh curved around the radius. The camera is aligned to have it’s down vector always aligned with the gravity vector so moving the ship left and right will move you along the surface.

Gravity is done with a custom physics volume.

I wanted the illusion of moving on a flat plane but in reality you are going around the planet. When you leave the planet’s gravity the camera flips back to the solar system’s up direction.

I can see some awesome games being made with .

Would it be possible to make a “game template” and sell it on the Marketplace?

Either way I would love to see how you did the 2D planet mesh. :slight_smile:

  • HeadClot

I had a hunch was the GPU Gems one before you mentioned it in the video :wink:

I don’t have a game template for myself right now. The mesh is made the same way you make a road. It’s just a box mesh put on a spline that goes around the planet.

Really nice work as always Handkor! I read that article a few months back as well. It’s something I have thought about for a more realistic sky but most likely won’t get around to creating it any time soon (if at all), too busy atm. :wink:

Good to see you getting back into it again! look forward to seeing on the marketplace.

Just curious - Would it be possible to put a Panner node at a really low pan rate in the material setup to make it look like the planet has a day / Night cycle?

I really think that would make the planet a bit more interesting over the course of long play sessions.

Look forward to purchasing if you put on the market place.

No that would not be possible, not with a Panner. Instead you can do day/night by either moving the sun around the planet or by rotating the planet.

Ah ok, I think I understand - So a star would provide light based on where it is hitting the planets atmosphere / Surface. That is pretty awesome.

So here goes another question would it be possible to do planetary orbits or would be too much?

Orbits are not a problem.