Browse Source

refactor: увеличение точности дополнительной итерацией

master
exepirit 10 months ago
parent
commit
aa2cc813ba
Signed by: exepirit GPG Key ID: 7F96A965465257B9
  1. 3
      go.mod
  2. 2
      pkg/sdf/sdf.go

3
go.mod

@ -0,0 +1,3 @@
module git.0x73.ru/exepirit/sdf
go 1.15

2
pkg/sdf/sdf.go

@ -26,5 +26,5 @@ func GetIntersection(ray Ray, sdf SDF) (Vector3, bool) {
ray.origin = ray.origin.Add(ray.dir.Multiply(dist * shiftCoefficient))
dist = sdf(ray.origin)
}
return ray.origin, dist < maxDistance
return ray.origin.Add(ray.dir.Multiply(dist * shiftCoefficient)), dist < maxDistance
}
Loading…
Cancel
Save