bug solving phong specular

This commit is contained in:
Crizomb 2025-09-26 22:57:06 +02:00
parent a7b5306fa9
commit 60730edb7b
3 changed files with 13 additions and 13 deletions

View file

@ -69,7 +69,7 @@ func (u Vector3) Min(x float64) Vector3 {
// i incident, n normal. Both vector should be normalized
func Reflect(i Vector3, n Vector3) Vector3 {
y := i.Dot(n)
return i.Add(n.Scale(2 * y))
return (i.Add(n.Scale(2 * y))).Normalized()
}
// Todo : Refract