3
\$\begingroup\$

I just fixed a bug where rays starting and ending in an octree node were not detected as octree node hits (because the ray doesn't hit the sides).

I'm changing the code to check if a ray starts in the octree node, then it is an automatic node hit.

Any reason to not do this?

\$\endgroup\$
4
\$\begingroup\$

If your ray starts in an octree node, then it could, of course, hit something in that node. If you ignored the node in which the ray starts, you risk missing the closest hit.

So, no, there is no reason not to do it because you should do it.

| improve this answer | |
\$\endgroup\$
2
\$\begingroup\$

That's exactly the way to do it, provided that's a leaf node. If not, you need to drill down to subsequent levels to raymarch there.

| improve this answer | |
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.