2x Perf, because wtf *Material is useless, Material is an interface so it's already a ref

This commit is contained in:
Crizomb 2025-09-28 03:08:27 +02:00
parent a6a3785a9f
commit 0ded879dce
4 changed files with 26 additions and 25 deletions

View file

@ -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