Using an inverted sphere to hide skybox behind Fog

Problem

So I’ve been struggling with fogs for a while now. I’ve always had this problem where whenever you look at the skybox, the fog seems clear and whenever you look downwards where parts and terrain are placed, the fog seems to be visible. Right after then you’re left with this line separating the sky and the ground like they’re not in the same world. Like there aren’t any transition at all. One example being:

Solution

The best solution I figure is adding an inverted spheroid mesh that surrounds the sky. This way, the fog will recognize it as a part, therefor fog will be applied leaving me with the transition I’m looking for. This is what I’m left with:

Other Uses

You may also use this method to have a clear colored sky. You just need to set the fog end to around 9000 studs. You’ll be left out with this results: https://gyazo.com/d8cdfda639a9ba86de59aa60c1a711a5

Disadvantages

The skybox will not be visible at all, no skybox cloud and skybox decorations will be visible for players to see. The sun will be visible as long as you applied sunrays into your game and adding transparency in the mesh for right around 0.011. The moon will not be visible, there’s no solution to fix this, your game will suffer a loss of stars and moon during night times.

Model

The link to the model is: FogMesh/Handler - Roblox

Have a good day! Enjoy :happy2:

24 Likes

This is a cool and creative way to get around this issue. Alternatively, you could also program (or weld, but that could get weird) the sphere to follow player location that way, in the case of extremely large maps or maps with teleports, you don’t end up having to reuse spheres or accidentally forget to add one.

2 Likes

I made an engine feature request 8 months ago requesting for fog implementation for the skybox and I haven’t received a response.

https://devforum.roblox.com/t/lighting-realistic-fog-visibility/295818/5

This is definitely a good workaround solution in the meantime.

1 Like

I could be wrong, but can’t you just change the skybox to the same colour decal as your fog? I suppose it isn’t configurable on the fly, but if you’re just looking for a single solid colour for a foggy background, I’ve done it before and that works well.

4 Likes

For a static environment, I guess that would work but it really limits the potential possibilities out there.

If you want dynamic sunlight that changes over time, or dynamic weather effects such as rain or fog, then the skybox would have to change in some way.

1 Like

Just attach the inverted sphere as an accessory to the character model! :smiley:

I’ve been doing this as well. Why can’t Roblox implement this natively though?

2 Likes

I’ve been asking myself that for the last 8+ months lol… Hopefully someday it will be part of the platform game engine :sunny:

I’ve used this method before, and unfortunately, I can’t say it’s the best!

I made a thread requesting help on this quite some time ago and I found that using a giant sphere actually causes extreme lag if the player moves their camera too quickly.

I did come up with an alternate solution using a BillboardGui that is lagless, however, and you may consider mentioning this.

3 Likes

Fog feels half complete right now - I’m honestly a little shocked that it hasn’t been addressed yet.

1 Like

Please remember that if you don’t give Roblox your use cases, they will never know / never address it. Make sure to file a feature request with whatever you need!