Ambient Occlusion

Shadows on ROBLOX: Past, Present, and Future

We got the chance to sit down and chat with Simon Kozlov, Client Engine Lead for ROBLOX, about the implementation of shadows, how they came to be, and where he hopes they go in the future. What do you have for us, Simon?

People take shadows for granted. The placement of shadows on 3D models is integral for your brain and eyes to understand how large something is, how heavy it is, and how close or far away it is from you, just to name a few things. So creating realistic shadows in ROBLOX is very important to us.

This article was designed to explain our methods, both past and present, for rendering shadows and detail what we hope to achieve with them in the future. Shadows take a great deal of computing power — we’ve discovered that only 10-15% of our users actually have the hardware needed to utilize all of the features we have bundled into our shadow system. We’re actively working on making detailed, scalable shadows available for people who have slower systems and GPUs.

The Past

Stencil Shadow

A very basic stencil shadow

Shadows have existed on ROBLOX for four years. When we introduced them, they existed as an algorithm known as “Stencil Shadows.” A stencil shadow is a fundamental point to start at — it’s a darkened shadow with pixel-perfect edges that moves with you. Creating a shadow involves several tricks — it’s essentially an extruded version of an object that darkens everything within it. This makes shadows difficult to scale. Unlike most facets on ROBLOX, a shadow changes, in real time, dependent on any given players’ geometry. It also reacts to different sources of light, and the angle at which the sun is shining.

Essentially, the form of a stencil shadow changes based on the object creating it. It’s this weird, geometric, stretchable object. This makes them difficult to define, and also takes a great deal of computing power. Want proof? By default, most ROBLOX players have an individual shadow for their character model, but their computers aren’t suited for anything more than that. You can enable a mode where everything has shadows, but we’re warning you now, chances are this will slow your machine to a crawl.

To do it, enter ROBLOX Studio, go to “Settings,” click “Rendering,” then “Shadows,” then hit “All.” Warning: Your jaw may drop.

The Present

In 2010, advances in real-time graphics technology allowed us to begin entertaining the idea of ambient shadows. This would not replace stencil shadows overall, but it would significantly add to their depth and range of movement.

Here are the basics: Stencil shadows depend entirely on light. If you move the light, the shadows move. Ambient occlusion doesn’t operate under such specific rules. To keep things simple, imagine a cube on a floor. The sun is shining above. The amount of light on the top of the cube is radically different than, say, the bottom corner of the cube, right? Ambient occlusion is able to gauge distances between the walls of a cube, which leads to more realistic shading.

In other words, ambient occlusion allows us to add depth to 3D objects. So when we create an image for a scene in a game, we also create a depth image; it’s a special image where things that are close to your point of view appear darker, and things that are further away are lighter. It’s not so much about looking at the lighting of a particular pixel, as it is looking at the lighting surrounding that pixel. When objects move closer to each other, they start occluding light from one another, darkening as they converge.

The human eye relies heavily on this type of information, though we never think twice about it. If you saw a chair on a floor with no shadows, you’d think it was floating. Shadows tell you how close an object is to you, how far away, how heavy, how light. It pains us to report that most of our users don’t have the hardware to see our ambient shadows, though we’re actively working on scaling down the hardware needed to utilize these features.

The Future

Few people in our industry have explored the avenue of “Voxel Lighting,” but we’ve been tinkering with it.

Voxel lighting involves inserting a three dimensional grid that would break down any given  scene into a bunch of cubes. Notice we’re using the term “cubes” and not “squares,” because a cube is a three dimensional object. Let’s call them “Lighting Cubes.” By adding this grid, we are now lighting objects in fully three-dimensional space. Each object, like a car, or a person, or a house, has its own lighting cube, and each of these cubes can share lighting data with one another, in real time.

[do action=”youtube-iframe” videoid=”eDrajhqC4tQ”/]

Even if you have a huge object, like a mountain, that exceeds the confines of one lighting cube, the surrounding lighting cubes will share lighting data to create a realistic 3D shadow.

Voxel lighting would also allow us to create smaller, local lights like lamps or torches, as well as global shadows that cascade from every part of any given scene. We’re working on lighting a wide range of environments using this system, and will keep you posted on what we find and some of the hurdles we come across.

This was the white board after our chat with Simon

About Simon "Gemlocker" Kozlov

Client Engine Lead at ROBLOX.

166 thoughts on “Shadows on ROBLOX: Past, Present, and Future

  1. TheSuper

    I don’t think I’d use the “voxel-lighting” thing when it’s out because if I enabled it my computer could overheat and might burn since my computer is not a recent and slow computer.

  2. Jjakethesnake89

    This is really cool. I guess I always did take shadows for granted. I never really realized how much you guys work on those little details

  3. Icedragon01234

    Um, I like the shadows and all, but when i look at my shadow, my shadow doesn’t look at all like me. Why don’t the hats have shadows?

    1. ZizZazZuz

      I think I can answer that. Hats are pretty restricted due to a hack a few years ago that allowed in-game hat cloning; e. g., I give you a copy of my hat for free, and I still have mine. So there’s that, and there’s also the fact that hats are two parts; the hat object and the actual brick. IDK how it works for them, but in-game Lua stuff makes it hard to access hats (or at least annoying.)

    2. Superusasoccer

      Ok so, shadows, wow I didn’t know you could enable them, I thought they were just there but on specific things

  4. SwagInABAG

    People here dont have any sort of a clue what computer hardware is. No, your processor wont give you better graphics. If your processor sucks, it would be lagging already. No, more RAM doesn’t solve everything. You cannot download RAM. RAM is a physical module slotted into your motherboard. Your lag is from your graphics card. Research things before you guys say ignorant things…

  5. DaggerJax

    It problably is awesome but is likely going to eat up memory like all the epic stuff/places on ROBLOX. So sad. :(

  6. Daredevilz

    Don’t add this, this will eat RAM like crazy and no one will want to play with slow computers.

  7. TSI4ever

    I’m thinking this will have a lot of effect on graphic quality, this would be extremely slow on some windows products but faster on OSX devices since they have a faster processor chip. ;)

  8. jamestoosh

    ADMINISTRATORS/MODERATORS@ I think you should make hats have shadows to. I mean, body shadows are cool, but with hat shadows, AWESOME! Copy this message if you agree!

  9. VistaWiz

    I actually would like this to happen, but due to some people’s graphics cards, they might overheat and well… catch on fire. If you have a EVGA card, get X precision, it keeps track of tempeture and CPU usage. Other then that, make sure you have good fans, and a GOOD graphics card “450 GTS”

  10. SuperSamioWorld

    If you turn on “All” shadows, there is a huge glitch I noticed. The camera inverts any shadows that its own shadow hangs over.

  11. Lackingstriker1000

    Ok I seriously like it (In a not laggy game) I tried it out on my testing place its pretty good. Then I tried it in catalog heaven Catalog heaven isn’t usually laggy for me but when I put this on it seriously lagged. FIX THAT!

  12. yugiohfandude

    I don’t really want that…considering my ROBLOX is slow enough, this will make my computer flip out

  13. Sonicdeath232

    I dont have shadows. I have the same space as a Mac In my computer. I really want shadows on all games/users!

  14. zombie848

    The new lighting BETTER be optional, I couldn’t stand to play this game anymore if it isn’t.

  15. VanceTod

    I don’t even like the new building system so “improving” on this is useless to me. Slowly taking away our bricks is annoying You can’t make small parts with these “MC-like” Blocks. ROBLOX staff this is a step in the right direction but also in the wrong. In short you are not going anywhere with this.

  16. Zucom

    Well its a very good idea and for the ones that want the option to change your game to look like the old roblox its impossible because the people whereing the new roblox hats or the new blocks will crash the game…

  17. DaggerJax

    I hope it doesn’t lag soooo much that the computer freezes and/or crashes!!
    I had a Windows XP until it broke. (I’m typing this on a Vista btw.) I wonder what it’ll do to a old XP.

  18. Droppop(gamecreator)

    I want shadows so badly, without having to update my hardrive. Are you gonna make it that we don’t have to add anything to have the future shadows?

  19. Tj3

    The “all” shadow mode looks pretty nice, except there’s a weird anomaly with it. It appears that the entire level is casting a “shadow” on the bottom of the world (not a part, just down into the bottom of the skybox) and this “shadow” is rendering on top of everything else…

  20. ImaFirinMahLazer95

    Does enabling shadows slow the gameplay of Roblox? Because if it does my computer will explode XD

    1. Jackstrap

      Yea they are. When the shadows activated on it’s first update, it froze my computer numbers of times :/ So far I cannot use any shadow effect, flame effect or even sparkles effect.

  21. mic144

    Well, ROBLOX is already a 3D game, and to me its 3D enough. Adding shadows will just make the game more laggy and will seriously punch some peoples graphics cards. :/
    I know they will turn on or stay off will be depending on you’re computer’s RAM, proccesors… ect.

  22. Kayli

    I personally think you guys keep changing everything so much. I mean i think we should all be able to download the type of roblox studio or whatever we want.. and we should have all the templates from before. This stuff is bogus… some people like how roblox is right now.
    No disrespect to you guys, i just have my own opinion.

  23. Alexblack222

    I for one,Think This will make our Cpus and games laggy.Although,Good job on the graphics and everything.I have to admit,I cant wait until this comes out,But im afraid for it will make our Cpus and games laggy or not. But,I am suprised on how good the 3D Plan is.

  24. fantaskrobloxion

    I don’t know why, but I went in studio and couldn’t find the “settings” button. Please help.

  25. robox44

    lighting does make a great game that much better.
    also, turning shadows on doesn’t do any difference for me

  26. agr0n

    After all this work why do shadows go through walls? For example if someone is on the floor above you why can you see their shadow?

    1. JMan42064

      I know right? I was playing Epic Mining 2 Beta one time… And let’s just say, don’t get me started :O

  27. firedragon2989

    I have an extension to roblox cards. Can you make it so when you get BC, you can refer someone like buying from normal site?

  28. EpicFluttershy

    Shadows might be useful. Maybe sumthing will fall on you and you see the shadow you just run away. TOTALY USEFUL.

  29. PremiumMaster12345

    Well, a while later, I found out how to put in the shadows myself But I cant find for ambient :/

  30. kaykay2090

    I really want ROBLOX to stay the same. I don’t think ROBLOX should do this “3D world.” Just in my opinion,I don’t really like it, and it will just make our computers, and ROBLOX itself more laggy.

    1. Maximumpainboy

      You don’t know yet, it might even make the game faster! You’lll find out hwne it comes out!

    2. Jimmysnow02

      I think it will be optional like if u go to game settings and change ur slider to 1 it won’t have shadows

  31. Maxomega

    I love the idea of voxel shadowing. I think it does matter because they might not seem like a big deal now, they would if they weren’t there.

    1. Jameson5011

      I totally agree, whenever I show a friend Roblox, their only arguement is that the graphics suck and they wont be caught playing it :l

Comments are closed.