bug solving phong specular
This commit is contained in:
parent
a7b5306fa9
commit
60730edb7b
3 changed files with 13 additions and 13 deletions
2
vec3.go
2
vec3.go
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue