Skip to main content

Blog Archive

ROBLOX Secrets Revealed: Fog Blog

December 09, 2011

by John Shedletsky


Archive

RobloxApp 2011-12-09 14-03-21-24

A new ROBLOX release went out late last night. It contained a lot of important performance improvements, but it also included a secret feature that some ROBLOXians have already discovered… atmospheric fog!

How to Add Fog to Your Place

Currently our default is that fog is turned off in your place until you turn it on. Luckily, enabling fog in your place is super easy.

  1. Open you place in ROBLOX Studio (ROBLOX Studio Help)
  2. Select the Lighting service in the Explorer Pane
  3. Adjust the fog properties (there are 3 – to see something all you need to do is set FogEnd to 100. Now you have a ton of fog.)

FogSettings

What the properties do:

FogColor – This is the color of the fog. For best results, use light grey or the background color of your skybox.

FogEnd – This is the distance at which the scene is 100% fogged.

FogStart – This is the distance at which the fog begins. Inside this distance you will not see fog.

Fog Settings: Getting Technical

A lot of ROBLOXians out there are programmers, so for those of you who are curious, let’s get technical for a second. To remain compatible with older graphics cards that use a fixed-function rendering pipeline, ROBLOX’s fog uses linear interpolation between FogStart and FogEnd. Other fog falloff functions are possible if you are using shaders; some of these are show in the graph below. ROBLOX is using GL_LINEAR – the red line. FogStart on this graph is 10 and FogEnd is 20. At a distance of 15, fog is at 50%. This means that a pixel in your scene that is 15 distance from the camera will be 50% it’s normal color blended with 50% of the fog color.

graph

 

Fog Settings: Getting Artistic

Builderman, the ROBLOX client team, and I decided to expose the lowest level fog properties to users, allowing them maximum customizability in their places. We hope place builders will get really creative. Here’s one effect you can achieve if you make it night time in your place and set the fog color to black..

RobloxApp 2011-12-09 14-05-28-08

Dark levels can be really fun. I whipped up a quick demo based on the original Sword Fight on the Heights – check it out!

– Telamon