Shadow Detection: Why Render Textures Were a Mistake

During a game jam centered around the theme of light, I worked on a project that required a shadow detection system. You can check out the game here. The challenge was to detect when objects were in light or shadow and identify the closest shadow to an object. Initially, I thought render textures would be an elegant solution, but this approach turned out to be a mistake. Here’s why. The Initial Appeal of Render Textures The idea was to use a camera positioned above the scene to capture light and shadow data into a render texture. This texture could then be sampled to determine if an object was in shadow or to find the nearest shadow by analyzing surrounding pixels. It seemed promising because it provided a dynamic map of the environment, avoiding the performance cost of casting multiple rays while also letting us easily find the closest shadow. ...

October 28, 2024

Real Time Rendering Notes

Some notes I’ve made while reading Real-Time Rendering Fourth Edition. Chapter 2 Summary: The Graphics Rendering Pipeline flowchart LR A[Application]:::app --> B[Geometry Processing]:::geo B --> C[Rasterization]:::rast C --> D[Pixel Processing]:::pix classDef app fill:#f9f9a3,stroke:#333,stroke-width:2px; classDef geo fill:#9fe0a6,stroke:#333,stroke-width:2px; classDef rast fill:#b5d3ff,stroke:#333,stroke-width:2px; classDef pix fill:#f9c1a3,stroke:#333,stroke-width:2px; Overview The graphics rendering pipeline is a core concept in real-time graphics. Its purpose is to generate a 2D image from a virtual 3D environment, which includes objects, light sources, and a virtual camera. The pipeline ensures that objects are appropriately rendered by processing their geometry, materials, light interactions, and textures, among other factors. ...

September 5, 2024