Devblog 4: Global Illumination, TAA, and CSM.

Finally, Blacksmith has finished its diffuse lighting system. It’s made of several components that contribute to direct and indirect lighting, such as:

Blacksmith's direct lighting pass via deferred shading

Direct lighting via deferred shading.

Screenshot 2026 10 14 113538

Indirect lighting via DDGI and IBL.

Blacksmith composite image (direct & indirect)

Composite image (direct & indirect). This ran after the tonemapper pass, so the image has been tonemapped. In the real pipeline, this usually outputs to an HDR color target.

But… how?

After I had successfully implemented IBL in the engine, I thought it was the perfect time to do real-time global illumination. I had several options:

  • Baked GI via lightmaps
  • Pre-computed radiance transfer via probes
  • DDGI (Dynamic diffuse GI) with software ray tracing
  • RTXGI (a variation of DDGI) with hardware ray tracing
  • VXGI (voxel cone tracing)

One of the main issues of pre-computed indirect lighting in open worlds is that not only the baking time is slow, but also, with a time of day cycle, you have to re-bake dozens of times, which eats up storage.

RTXGI requires hardware ray tracing, and both of my laptops dont have RT acceleration cores. I also didnt choose voxel cone tracing because scene voxelization can be expensive and you lose some detail.

Then… DDGI. The first thing I wrote in my raytracing branch was a small code for BVH traversal. I used the open-source TinyBVH library for the BVH code, as it’s small, header-only and optimized for GPU use cases.

Then, I started working on the actual DDGI code, the first thing I made was a code that wrote irradiance to SH coefficients, and depth to octahedrally encoded maps. It was very hard to implement and I had lots of issues on day one, but after several days I had finally made the GI pass work very well. The image above uses mostly DDGI for it.

Cascade Shadow Maps

Originally, Blacksmith used a single 2048×2048 shadow map for the whole scene, and I had found out that in my highway test scene, not all the bridge railing was shadowed and it was cut on a specific edge, so I decided to implement cascade shadow mapping.

Blacksmith uses five cascades instead of four and you can change their resolution via console commands. By default, these cascades are 2048×2048. We use a 9-tap (3×3) PCF instead of the single shadow map’s default 5×5 due to performance concerns.

Temporal Anti-Aliasing

After implementing all of this, I had remembered that the velocity target of my GBuffer (RT4) was not used, so I decided to implement TAA. My TAA implementation is based on Intel’s XeTAA. It was very optimized for integrated graphics, so it should run well on most GPUs. Here is a comparison:

No TAA.

The scene with TAA got darker. I am trying to mitigate the issue

With TAA. Notice how the scene got darker, I’m trying to fix this issue.

But, I should also show you one of the most important change over all.

Command Prompt!

Yes, now the engine supports a command console. This is one of the biggest changes I have made aside from graphics, because it will pave the way to graphics settings, and many more.

The console supports multiple CVars and commands which I can use for debugging and for enabling and disabling features.

Discord Server

I’ve made a discord server for the game. Check it out, don’t miss new updates, and have the chance of talking with me! The link is here.