Welcome to Episode 5 of the Tower Blocks series!
In the last episode we made the game feel alive with smooth camera movement and falling chopped blocks. Now it's time to give the game a major visual upgrade.
In this video we:
✨ Write custom GLSL vertex and fragment shaders
💡 Implement real lighting using ambient, diffuse and specular components
🎨 Add per block color support via shader uniforms
👁️ Pass the camera position for specular reflection calculations
🔧 Hook the lighting shader into both placed and falling blocks
This step takes our game from flat to fully 3D lit, giving depth, contrast and a big jump in visual quality.
📺 Full Tower Blocks series playlist: • Tower Blocks in C and Raylib
📖 Companion Blog Post: https://letsreinventthewheel.github.i...
🧠 Source code: https://github.com/letsreinventthewhe...
💬 Got questions? Drop a comment.
👍 Like what you see? Hit the like button.
📌 Want more projects like this? Subscribe and stay tuned...
00:00 Episode's goals
01:32 Loading shaders
02:40 Basic vertex and fragment shaders
05:00 Using our shaders in Raylib code
06:25 Ambient light
10:47 Diffuse light
18:25 Vertex normals "fix"
20:02 Specular light
26:01 Switch falling blocks to use custom shader
28:22 Next step / episode
#gamedev #coding #programming #raylib #cprogramming