a 4k PC intro released at Under Construction 2018

image

[pouët]

In this intro, I wanted to play around with real-time graphics using baked, path-traced lighting. I am aware that baked lighting is quite popular in oldschool demos, but as far as I know, this is the first 4k PC intro to implement it.

The Lightmap

The lighting information for all four rooms is stored in one flat texture, that is rendered at the start of the intro. Originally, I wanted to use a separate cubemap for each room, but it ended up being a lot easier (and smaller) to use one texture.

This is what the lightmap looks like once it's fully converged.

image

The translation from world-space to texture coordinates is done using spherical coordinates. The 'poles' of this projection are on the left and right walls of each room, though I made sure to design the rooms such that they are almost always hidden inside light sources or behind geometry.

The rendering itself is done using a fairly standard path tracer with BRDF sampling, only that the 'camera' is placed at the corresponding point in the wall for a given pixel, and the camera ray is shot in a random direction into the box.

The path tracer renders 40 spp each frame for the first 12.5 seconds of the intro. After that, it drops down to just 1 spp and continues to run like that for the rest of the intro. The loading animation only ends after 13 seconds to give the framerate half a second to stabilize before the actual intro starts.

The Rooms

image

Each of the rooms is exactly 2x2x2 units. Since the lightmap only covers the walls of the box, all of the diffuse/emissive surfaces are on the walls of the rooms. The objects inside the rooms have to be perfectly reflective and mostly static for this effect to work.

To ensure we always see the back wall of each room, the room itself is rendered backward, so the ray starts far away and marches towards the camera. I had to be very careful to make sure the rooms never overlap at the end of the intro because the renderer simply cannot handle it.

image image

The reflective objects inside the rooms are rendered in a separate pass.

Conclusion

This entry won 1st place in the compo. I have a couple of regrets about this entry, the biggest one being that I made the intro this short, but overall it was one of my better entries.