Search in

Sort by:

Everything Rendering

Current Space

Question Status:

All Questions With Answer With Accepted Answer

Quick results

Search help

Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both.
Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.

You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with
each other. Examples

Why does this RayMarcher doesn't work with 3D Textures?

I use the basic code from the first sample (opacity only).
The only difference is, that I don't use a 2D Flipbook, but a real Volume Texture which is available sind 4.20 (You can create it from a flipbook, but I also implemented a Factory which imports my raw 3D data, both methods show this bug). When using his flipbook approach, everything is fine. But when I use the Volume Texture I get weird artifacts.

Here is the custom Material Node Code which I use to compute the Emissive Color:

Most likely you are hitting volume limits and as your texture coordinates are saturated, when you are hitting a plane of the bounding box, your raymarch continues with 2 coordinates out of 3 incrementing, resulting in said artifacts.
Either pre-calculate exit point and adjust step number accordingly or check if you are still inside the volume at every step.

Thanks, your answer brought me on the right track. I thought this can't be the problem because I also used his code where he precalculates the Step count. But the article didn't show that the StepSize has to be precalculated too, otherwise a modified step count doesn't do anything, because the ray marcher code will always fit the step size to a ray length of 1. The flipbook approach also showed artifacts with other volumes that are more box-like. Those start to repeat when the ray goes beneath the volume.