Mini Minecraft

Specular & Normal Maps

I implemented support for Specular and Normal maps for our Textures. The textures were obtained from BDCraft.

For Normal Maps, All the light calculations are done in Tangent Space so by the time the Pixel Shader Stage is executed, we have everything (like light position, eye position) in tangential space.

The Specular Map was also obtained from the same source. The data is stored in green channel and I used it to modify the cosine power, which is used in the Blinn Phong specular calculation.

Shadow Mapping

I also did a basic version of shadow mapping. The images show the depth texture stored as well as the exact world image at the same time.

Procedural Night Sky

I made a procedural night sky which has square-like stars similar to Minecraft’s style. I achieved it using VoroNoise & 3D FBM.

I also added meteor showers/shooting stars, for that I just made up a quadratic curve that has the similar trajectory and used the frame timer that is sent to the shader to animate it.

For the night sky gradient, I used a Simplex noise to offset the gradients slightly so it doesn’t look uniform.

Procedural Terrain Color

Implemented a way through which we can send colors for blocks like grass or leaves. We had planned to use this with biomes and change or jitter the grass color as we “lerp” between biomes. But, we just ran out of time so this is the code-wise override if I pass different colors.