FOCUS Magazine October 2023 issue - Lighting by Dee Lisdun

October 2023 Technology

Light in reality is a natural phenomenon that allows us to see the world around us. Light travels in straight lines and reflects, refracts, or scatters when it encounters different objects or materials. The way light interacts with surfaces determines their color, brightness, texture, and appearance. To simulate realistic lighting in computer graphics, we need to model how light behaves and how it affects the visual perception of a scene. This is called “ray tracing.” The results can be photorealistic as seen in the movies, it however requires tremendous amounts of computing power: rooms full of computers taking hours to render a single frame. Any proper simulation of light is too slow for real-time graphics.
Rasterization is a traditional technique for rendering 3D scenes in games. It involves projecting 3D objects onto a 2D plane (the screen) and filling in the pixels with colors, textures, and shading effects. Rasterization is fast and efficient, but it has some limitations. For example, rasterization cannot handle complex reflections, refractions, or shadows without using special techniques or approximations.

Raycasting is an alternative to, or a special technique on top of, rasterization. Raycasting works in the opposite direction of real light: it starts from a pixel on the screen traveling along the projection until it hits a surface or it reaches the view distance and gets dropped. If a surface was encountered, continuing the ray in its reflected direction will enable things like real-time reflections. It still is an approximation, not a simulation.

Rasterization requires a lot of manual work from developers to create realistic-looking scene, a big part of which is building the scene in a way that hides all the problematic situations. As Second Life gives everyone the freedom to build whatever, wherever, however, and so residents will have to find their own ways to avoid, ignore, or mask the graphical anomalies to suit their sensibilities.

Figure 1 has regular prims at their default material settings, no textures with light and spotlight turned on. The scene looks as expected.
Figure 2 is otherwise the same except the torus has 1% transparency. The expected effect would be almost unnoticeable, yet the shading now looks somehow inverted.
Figure 3 Otherwise same but this time the floor prim is 1% transparent. The difference is notable.

– Dee Lisdun