Add the ability to ignore fog in ViewportFrames

As a Roblox developer, it is currently annoying to work with projections using ViewportFrames because very often fog glitches them.

In my case, I am trying to create a boreal aurora effect using a ViewportFrame projection. However, my game is heavily dependant on fog, and this is ruinning the effect.

Despite the fog having no way to reach the effect due to how high in the sky it is, it still somehow does. I cannot alter the color or material texture at all because of the fog.

I have fog set at 1000, and my projection is set at 5000 studs away from the world center. However, it is in the sky and, therefore, shouldn’t be affected by the fog:

The color of the part is set by the color of the fog.
image
image

This can be seen in this place, using as the example the 3D Skybox script made by @ITBV: Fog ViewportFrame Repro.rbxl (41.2 KB)

In this place, there are two city unions being projected towards a far distance. One being on top of the user, in the sky, flipped upside-down.
You can see that both cities have a concrete material and persimmon color.
However, when lowering the fog distance, both cities lose their material and color, including the one that shouldn’t be affected by fog (the one in the sky).

This is a big upside-down of ViewportFrames and their use for games with fog enabled.

Something as simple as the ability to toggle whether or not the ViewportFrame is affected by fog would fix my issue.

Would love to have this implemented at some point. It’d be a really good addition, and would allow me to create the boreal effect and much more even with fog.

10 Likes

The fog is from BillboardGui, not related to ViewportFrame. It has fog because the Billboard is far from camera.

2 Likes

Would it be possible to implement this into BillboardGuis instead then?

Would be such a big help for this project.

Currently fog is not height-based. It’s just as thick in any direction you look.

Can you describe more the effect you’re trying to achieve in your game?

I’m trying to replicate (even if not perfectly) the austral aurora:
image

To do this, I currently rely on the hacky method of projecting a normal inverted sphere (meaning you can only see its surface from inside) very far outwards based on the camera position. For this, I use a BillboardGui, and a ViewportFrame that renders the sphere.

This sphere’s material is then set to ForceField, which creates this awesome effect.

However, my game also relies heavily on fog (as it’s meant to be taking place in an arctic location), where the fog is set at a distance of 1000.

This messes with the aurora effect because it loses its material and color to the fog.