3 ms·
Related question: I'm coding a demo (as in "demoscene") and want to displace a plane SDF (think e.g. a heightmap) for raymarching. This produces some visible d
by kaoD 1y ago
Related question: I'm coding a demo (as in "demoscene") and want to displace a plane SDF (think e.g. a heightmap) for raymarching.
This produces some visible discontinuities in the plane at larger slopes. My surface is still at f(x,y,z) = 0 but the rest of the field is completely messed up. From the little maths I know, that is no longer an SDF because among other issues, it no longer satisfies the Eikonal equation mentioned in the article.
Is there any way to fix this or am I SOL?
- bhouston 1y agoYou need to take the minimum of the two SDF fields in the surrounding region (up to the global context if you need to) if you want it to maintain an SDF. The minimum of two SDFs is always a new SDF. My suspicion is that the new plane isn't an SDF anymore, that is why you are getting artifacts or your ray marcher has problems with large scope angles, or something.
- akomtu 1y agosdf(p + sin(p)*0.01)
- GistNoesis 1y agoSee "Deformations and distortions" paragraph in https://iquilezles.org/articles/distfunctions/ https://iquilezles.org/articles/distfunctions/ where it suggests playing with the ray-marching step size.