Space Graphics Toolkit & Planets

@Dist0
Windows build, all builds, or some specific platform?

@MAVG
SGT currently doesn’t include any ray-marching features, and is mostly designed to be as simple and modular as possible. If this github effects works well, can’t you use it?

Same thing with the clouds, compared to the cloudsphere this is a very advanced and performance intensive rendering technique. It also requires the new Sky atmosphere rendering component to render. So in other words, I could include all of this in SGT, but since they work so differently I want to keep them separate.

Windows for now.

Also maybe I miss something, but I can’t make reflectionprobe to work with the ocean shader.
Is there a way to fix that ?

Edit: the ocean water shader also don’t reflect the sky, because there are no skybox to reflect.
So the shader doesn’t make any reflection at all.

I’ve spend this afternoon to create a planet skybox generator to create a cubemap with the clouds and the atmosphere. It work great with cloudsphere, but not with the atmosphere because when a Camera used to render the cubemap is perfectly centered, the atmosphere is fully black :confused: (And when moved from a small amount like 0.001f, the light goes on, but on the same intensity everywhere. It’s like some internal calculations based on camera position in the shader could not work when fully centered (maybe a divide by 0 ?) so it’s not a good solution for now)

It could be really great to have a cubemap on each planets for local environment reflections :slight_smile:

Edit2: The issue with the missing reflection in the ocean shader seems to be caused by these two line (when present) in each of the stackables parts of the shader :

BEGIN_OPTIONS

//Alpha "Blend"   => this will break reflection

//Tags { "Queue" = "Transparent-1" } => this will break reflection

END_OPTIONS```

I’m not super sure of what I’m looking at there, but yeah … layers of clouds, which a give a greater sense of atmospheric depth. As for the complete cloud cover idea, I was thinking of putting a space station above a planet that has what amounts to continual storm cloud activity, blanketing the atmosphere. Hoping for a solution from somewhere that would give me an interesting texture and depth to clouds so it would look fluffy, and not like coat of white paint. It might be a tricky thing to get right, IDK.

yeah exaclty what i was thinking, a function that allows to control how “deep” the clouds go on each layer, could make for rocky planets with very dense atmospheres or gas giants when Planet Forger is used with SGT.

no prob mate, and about the thing with the black hole, i actually learnt to use the “Black Hole” and “Ring” component for the effect i was looking for (its amazing what this asset can do when one learns how to use it properly.), now i have both a SGT black hole and a github black hole that look like the one in the movie interstellar (while keping their own unique style) HURRAY!!! (the accretion disk even rotates backwards inside the gravitational lens :raised_hands: :raised_hands: :raised_hands:), you put good work into this, thank you.

I have a massive SgtStarfieldBox. I want the stars to fade out instead of consuming the entire screen when I approach them. How can I do this? Ideally I’d like to fade the star field star out and replace it with a sphere and corona and prominence.

I looked at the SgtStarfieldNearTex component but that only seems to work for infinite star fields and not box ones.

Edit: never mind, NearTex worked. I just needed to make a copy of the original star field material with the shader and then enable near tex on the shader and set the properties on SgtStarfieldNearTex to work with the size of my universe.

Les

1 Like

I’ve now a working faked skybox on each planets.
This is a planet made with SGT terrain and the modified TerrainOceanShader with reflection support, and a fake skybox.
Just an example on how this can increase visual quality with reflections on planets.

5 Likes

this is looking pretty good! How much performance impact by reflection?


The ring looks a bit different, when adding the SGT Ring MainTex Filter. I hope you know what I mean. Is there a way to fix it?

@Dist0
Great work, looks great!

I don’t remember off the top of my head why I used those shader settings, but I imagine it’s to avoid some type of draw order issues with cloudsphere and atmosphere.

@hopeful
The video is showing two cloud layers defined by texture masks, so you could have one layer covering the whole planet. It still needs more detail, but I think it already looks a little fluffy.

@MAVG
Great! Yeah, to get it looking just like in the show I think you need ray marching as the way the light bends is very complex, but combining these two effects indeed gets you most of the way there for a fraction of the performance impact.

@foxyspace
This component is designed to pull/push the colors to make each ring band more prominent, which will change the colors. You can change the code to make it behave differently. The current code is just what I played around with to get the results I found good, but they’re not based on anything specific.

Small update on the clouds:

I got the temporal reprojection working really well. These are rendered at 1/16 resolution, so incredible performance, and they still look ok for mobiles or something. I think I can also add some fast sharpening to make it look better too.

Next up, make sure it works on larger planets, make them look a bit better, and integrate them into Planet Forge!

2 Likes

Looking really nice. Are the planet forge logo and the other clouds on separate layers?

Edit: I see by your earlier comment they are on different layers. Very cool.

1 Like

And you mentioned 4 layers of clouds, so that seems promising for creating a sense of depth and interesting texture in how it would look when seen from orbital cameras … at least as far as cloud formation goes toward solving the problem. Probably I’d have my lowest level of cloud cover be complete, but varying in transparency, and then maybe 3 layers of incomplete clouds on top of that, or something of that nature. I don’t know much about shadow behavior with clouds and what’s needed for that. Clouds do diffuse light, pretty much eliminating shadows on a cloudy day, but they also cast shadows, so understanding how to work with that would probably be a key to getting it to look right.

When I remove the component, my ring will be very translucent. I am using it, because of the power.

Ok, my issues with Unity 6 are now fixed, thanks @Darkcoder1. So first of all - thank you for working on this new asset :slight_smile:. I think it was the best approach. The asset looks promising, but unfortunately I see a major problem: shadows on big planets.

This is 500k radius, so not that big. Earthlike in SGT was 6mln radius. With default setting on URP there are artifacts, no matter how you set shadows. Yes, I use stacked camera to try to fix it and isolated the issue to the terrain. Some of those are because the terrain casts wrong shadows by itself (weird half-oval shape, sometimes oval, sometimes glitching, etc):

But when you disable shadows cast by terrain, the shadows from cubes are still cut at closer distances:

I can send you a project with instructions to easily reproduce this, it really works beside that:

Also, the planet Landscape is causing shadow artifacts even from 1mln km afar:

Proper shadows without SgtSphereLandscape:

Some of these issues are also caused by SGT Terrain:
image

Here with both new and old terrains disabled:

So first thing, please add an option to switch off shadows cast by terrain like you did in SGT. I see Graphics.DrawMeshNow don’t have shadow settings, so I didn’t know how to disable them. But this helped solve some issues in SGT when shadows aren’t even borked - they we were working without artifacts with stacked camera in SGT previously.

Still, even if you fix this, we also have a major issue of the planet being wrongly lit on very big surface. The problem is, the landscape gets enormous lit areas at night. If you enable shadows and have really, really big shadow distance (which is unusable because at close distance they will be borked then), those areas get properly dark. So they should be dark.
But when you try to land on the planet from space, the planet won’t be shadowed where it should as the distance is too big. So you get near surface and suddenly lit area gets completely black - shadows are in. This is especially a problem when you have some mountain or crater - shadows appear out of nowhere.

It basically makes it look really wrong, disorienting. Imagine this:

  1. You plan to land on the surface, but when you get close, shadow distance kicks in and everything is suddenly pitch black. Out of nowhere. Wasn’t from just a few meters back.
  2. You’re on the surface. Everything is dark where you are. So you think you’re hidden. But no, players above don’t see the shadows so for them you’re in a completely lit area.

This means we really can’t make a believable space sim even with this asset yet.

I really think you need to solve this issue somehow. Star Citizen or Elite Dangerous, NMS don’t have this problem - night is night, everything gets dark at exactly right angle of the sun.
Of course, the best solution would be if you could create shadow system with more cascades so we get shadows from crazy distances like in Elite: Dangerous - I read they have 6 cascades and can render simple shadows of craters millions of kms ahead. Or some Virtual Shadow Maps. That way with lighting system it shadows entire planet with proper mountains/crater slope shadowing. We can’t do that without destroying shadow system even from 100kms right now.

But if you wouldn’t be able to tweak a custom shadow system for all uses, which even if you sold on Asset Store would probably be a very good seller, maybe you could just cover the part of planet where it gets dark (by checking when the atmosphere is starting to fade or by angle of the sun to the point on surface?) with big layer of shadow, making everything dark and blending with other shadows?
This won’t help if you get in the shadows of a mountain - you will still see a bright area from space, and then suddenly get into pitch black area when you land. Which is ridiculous. But that would be at least something to get properly dark surface at night when sky is dark.

Best solution for now:
But I think for now best solution would be if you just made the planet black (unlit - able to be lit) through shader based on the angle to directional light - you could maybe sync it with atmosphere. Approximate it and give us maybe some setting to blend the edge of the “night” to fine tune it per planet.
That way if you allowed us to also disable shadows cast by the terrain, we could just use our Unity’s close range shadows for dynamic objects and still have proper night cycles. Then maybe in future some shadow system would provide a real solution with shadowing of the planet even from space.

How night should look:

How night looks without shadows that are causing issues:

It doesn’t get totally dark at night:

Such work around would at least make the asset probably usable for space-sims, as we could just have close distance shadows.
Many of us (if not most) want to create very big planets, like 500000-2mln radius. But even with 500k we basically can’t use shadows with SGT and sadly with Planet Forge too right now.

I really appreciate your incredible work on volumetric clouds, etc. But I think it’s gonna be a much higher priority to make a game with night cycle of big planets, maybe even shadows from mountains / craters. As I think it’s completely impossible to think of a modern project in URP/HDRP for PC without them working and without proper night cycles.

Once again, I can send you this project to fast check if you wish.

And 2 quick requests for now:

  1. A switch to turn off terrain casting shadows.
  2. A switch to choose lighting layer and rendering layer for all chunks of terrain. It can work around the night problem.

So this, and a close-distance (FPS distance) custom material system with detailed textures usual games have and we’re all set. I’ll share some ideas of that texture system later (layer on top of current one), as I’m probably able to implement if myself (still you could do it better I think).

@hopeful
Yeah, tweaking it to look right is always difficult.

Here’s some super early pics of it on Alythar with nearly full coverage of thin clouds, and some lines of thicker clouds. Still needs lighting/shadows/atmosphere of course!




2 Likes