nothing important

This commit is contained in:
Crizomb 2025-09-27 20:25:52 +02:00
parent 2e6f0a0730
commit 264a759ac5
3 changed files with 26 additions and 13 deletions

View file

@ -91,7 +91,7 @@ func (s SubstractionSDF) Distance(p Vector3) (float64, Material) {
d1, color1 := s.primitive1.Distance(p)
d2, _ := s.primitive2.Distance(p)
d := math.Max(-d1, d2)
d := math.Max(d1, -d2)
return d, color1
}
@ -138,8 +138,8 @@ func (s SmoothSubstractionSDF) Distance(p Vector3) (float64, Material) {
d1, mat1 := s.primitive1.Distance(p)
d2, mat2 := s.primitive2.Distance(p)
h := math.Max(k-math.Abs(-d1-d2), 0.0)
d := math.Max(-d1, d2) + h*h*0.25/k
t := SmoothStep(d2-d1, -k, k)
d := math.Max(d1, -d2) + h*h*0.25/k
t := SmoothStep(d1-d2, -k, k)
mat := MixMat(mat2, mat1, t, p)
return d, mat
}