2x Perf, because wtf *Material is useless, Material is an interface so it's already a ref
This commit is contained in:
parent
a6a3785a9f
commit
0ded879dce
4 changed files with 26 additions and 25 deletions
|
|
@ -50,7 +50,8 @@ func rayMarch(origin Vector3, direction Vector3) (bool, Vector3) {
|
|||
dist, mat := scene.Distance(p)
|
||||
if dist < EPS {
|
||||
normal := Gradient(scene, p, EPS).Normalized()
|
||||
return true, phongShading(p, normal, *mat).Scale(max(shadow(p), 0.3))
|
||||
return true, phongShading(p, normal, mat).Scale(max(shadow(p), 0.3))
|
||||
// return true, phongShading(p, normal, *mat)
|
||||
}
|
||||
if dist > MAX_DIST {
|
||||
break
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue