Lighting and Shading demo

This demo implements Lighting and Shading.

You can enable Diffuse Reflection, Specular Reflection, or both. Independently of this, you can choose between the Flat, Gouraud and Phong shading models. Finally, you can choose whether to use vertex normals from the model, or the normals of each triangle.

Lighting model

Shading model

Computer Graphics From Scratch · Dedication | Acknowledgements | Table of Contents | Introduction | Introductory Concepts
Part I: Raytracing · Basic Raytracing | Light | Shadows and Reflections | Extending the Raytracer
Part II: Rasterization · Lines | Filled Triangles | Shaded Triangles | Perspective Projection | Describing and Rendering a Scene | Clipping | Hidden Surface Removal | Shading | Textures | Extending the Rasterizer
Appendixes · Linear Algebra | Afterword