0
$\begingroup$

Recently I've been doing a experiment on implementing raymarching in Blender's shader editor. The result is way out of my expectation. A strange moiré-pattern-like noise artifact is being generated. I just can't figure out what is happening. Such artifact is seen when using both EEVEE and Cycles.

Modifying time parameter through driver makes the shader recompile every frame when I play animation, so I write a simple geometry nodes patch to store the Scene Time as an vertex attribute.

The following images are my shader codes. I pack all the iterations in a 1-4-16-64 way.

I can't keep the hit result except using a bunch of mix nodes since there is no bool or loop termination in shader nodes, sorry. Bad Result Shader Raymarching Group

$\endgroup$

1 Answer 1

1
$\begingroup$

I think I've found the reason of this noise artifact. The key problem is believed to be the float comparison. When the threshold is set to 0, the epsilon became to big, leading the output to become incorrect. (Be like, -0.001 treated as equal to 0, therefore output of 'Less Than' became 0) So the radius should be directly compared with the distance, rather than distance subtracting radius then comparing with zero. Example Correct Result I post my solution here to provide a reference.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .