small opti
This commit is contained in:
parent
0cf71d7abb
commit
a6a3785a9f
5 changed files with 23 additions and 15 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue