small opti

This commit is contained in:
Crizomb 2025-09-28 02:45:46 +02:00
parent 0cf71d7abb
commit a6a3785a9f
5 changed files with 23 additions and 15 deletions

View file

@ -39,7 +39,7 @@ func shadow(point Vector3) float64 {
}
res = min(res, SOFT_SHADOW_COEFF*dist/dist_total)
dist_total += dist
p = p.Add(direction.Scale(dist))
p.Radd(direction.Scale(dist))
}
return res
}
@ -55,7 +55,7 @@ func rayMarch(origin Vector3, direction Vector3) (bool, Vector3) {
if dist > MAX_DIST {
break
}
p = p.Add(direction.Scale(dist))
p.Radd(direction.Scale(dist))
}
return false, GREY
}