Below are some screenshots from very early development versions, showing a bit of the techniques behind High Dynamic Range lighting and associated fog/haze rendering. In this early version, before we developed our own texture assets and terrain-generator, we had borrowed some assets from freely available texture-packs on the internet designed for Another Well-known Voxel Game, and had imported and translated a freely available map as well.
HDR + haze + ambient occlusion lighting only
These shows how the High Dynamic Range system works by the “bloom” effect you can see on the dark side of the voxels when the bright sky and sun is seen adjacently. This emulates the way bright light scatters in the lens and eye, creating a similar effect. The end result is that the brain is tricked into believing the sky is actually brighter than full white, even on the computer monitor.
It also shows the ambient occlusion shading, which is the technique to add shadows to corners, edges and crevices in the scene. Fully exposed areas are exposed to scattered light from most directions, so they get bright, but in corners, less scattering occurs and so they look darker. This improves the realism greatly.
Actually, if I had to chose between ambient occlusion shading and texturing, for realism, I would chose AO. Lighting and shading is the basis of realistic rendering.
HDR + AO + haze + texturing
What is interesting to see here is in particular the High Dynamic Range system. The player’s simulated eye adapts to the lighting level just like a human eye, so inside a dark corridor only lit by torches, any outside light that creeps in (in the end of the corridor) is seen as really bright and it takes a few seconds to adapt if you go outside from a dark corridor.
Likewise, in outside daylight, a torch or weak light will hardly be seen at all.
Distance buffer calculation only
This is the “mask” generated for the fog/haze rendering. Just using the z-buffer is not enough, as it is not perspective corrected. Actually, just playing the game like this feels a bit like you’re in a sand-storm or something 🙂
Fog/haze, spherical harmonics and HDR
This shows the fog/haze and HDR rendering together with a spherical harmonics lighting system. The daylight model is physically simulated depending on the position of the sun and turbidity of the atmosphere, to create the same kind of light colors as you’d expect in a real atmosphere and sun. This will be documented in a separate blog post!