http://sidneys77crlfslcr7zmj3msmxchgnxhrxlp3p3kbaswo7twchjnicid.onion/programming/2022/03/23/raytracing.html
Coming soon: a screenshot. By adding our global light value to the dot product we’ll ensure that our diffuse lighting never completely
darkens our scene. // ---✂--- Add a new constant: +// Lighting
+constexpr float AMBIENT_LIGHT = 0.5f; // ---✂--- Update our diffuse lighting: // Next we'll compute the dot product between our surface normal and the light ray.
// We need to clamp this between 0 and 1, because negative...