Author Archives: Ignacio Castaño


We just finished porting The Witness to D3D11. It took a little longer than I was hoping and one of the unexpected difficulties was getting our D3D9 HLSL shaders to work in D3D11. The D3D shader compiler provides a backward compatibility flag (D3DCOMPILE_ENABLE_BACKWARDS_COMPATIBILITY) that I was hoping would allow us to use our shaders ‘as […]

Posted in Engine Tech | 14 Responses

Shadow Mapping Summary – Part 1

During the last several weeks I’ve been polishing and optimizing the shadowing system and I think that at this point it won’t undergo any more significant changes. In the process I’ve been reading a bit and looking up references and I’m appalled by how inaccessible is all the shadow mapping knowledge. For the most part […]

Posted in Engine Tech | 12 Responses

scope(exit) in C++11

I really like the scope(exit) statements in D. They allow you to keep the cleanup code next to the initialization code making it much easier to maintain and understand. I wish we had them in C++. Turns out this can be implemented easily using some of the new C++ features. I’m not a big fan […]

Posted in Engine Tech | 56 Responses

Seamless Cube Map Filtering


Modern GPUs filter seamlessly across cube map faces. This feature is enabled automatically when using Direct3D 10 and 11 and in OpenGL when using the ARB_seamless_cube_map extension. However, it’s not exposed through Direct3D 9 and it’s just not available in any of the current generation consoles.

Posted in Engine Tech | 23 Responses

Irradiance Caching – Part 1

This is the first article I wanted to publish when I started writing about the technology behind The Witness. I had just spent a week or so implementing irradiance caching with rotation and translation gradients. Extending the equations of the gradient estimation to the hemicube sample distribution had proven to be tricky and had taken […]

Posted in Engine Tech | 15 Responses

Hemicube Rendering and Integration

One of our aims with our global illumination implementation was to keep it as simple as possible, while still obtaining good performance, and we hoped to achieve that by using the GPU. While the are several approaches to compute global illumination in the GPU, the most simple one that we could come up with was […]

Posted in Engine Tech | 15 Responses

Computing Alpha Mipmaps

A little problem that we had when we started to create trees and vegetation is that the standard mipmap generation algorithms produced surprisingly bad results on alpha tested textures. As the trees moved farther away from the camera, the leafs faded out becoming almost transparent. Here’s an example. The following tree looked OK close to […]

Posted in Engine Tech | 31 Responses

Lightmap Parameterization

As explained by Jon in his previous post, we are using precomputed global illumination in The Witness, and one of my first tasks was to work on that system. I have developed some interesting technology to compute automatic paramaterizations, to formulate the lighting computations in a way that can be easily mapped to the GPU, […]

Posted in Engine Tech | 12 Responses