Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 4 down vote accepted

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.

share|improve this answer

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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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