Skip to main content

Blog Archive

Character Shadows Get the Dynamic Lighting Treatment

May 29, 2014

by ConvexRumbler


Ever since we introduced dynamic lighting last May, we’ve been listening to your feedback and prioritizing improvements based on your requests. One of the most common developer requests was for objects blocking light to cast shadows — an update we implemented in late 2013. Another top request was a revamp of character shadows, which, as of today, has come to fruition. Character shadows are now integrated in the voxel-based dynamic lighting engine, making them an aesthetic match to ROBLOX worlds and preventing them from rendering when they should be blocked by walls and structures.

Our approach to this update was simple: make virtual characters’ shadows act the way they would in the real world. This meant throwing out our previous method, known to us as “stencil” shadows, and replacing it with a “blob” system that is much more flexible. The new player shadows are softer and better reflect the position of the light source (the sun or moon), which fits the aesthetic of dynamic lighting much better. And though the newly optimized player shadows are more complex and dynamic, they still carry a light foot print — each is rendered with only nine instructions to your GPU.

We’ve developed an algorithm that determines where you are in any given world, and which player shadows are most important for you to see. You’ll notice not only is your own shadow present and reacting to the position of the sun, but other nearby players’ shadows are as well. With new character shadows in place, we’re now thinking about ways to make shadows reactive to individual sources of light (i.e., SpotLights and PointLights) in addition to the sun and moon. This is obviously a much larger feature to scale, though the new character shadows act as a baseplate for many more ideas to be implemented in the future.

For more information about working with dynamic lighting, see this tutorial by Stickmasterluke or read up on the Lighting service in the ROBLOX Wiki.

If you’re already a lighting expert, what additional lighting and/or shadow changes would you like to see next?