|
|
In article <3f24e28c$1@news.povray.org>,
"Tom Melly" <tom### [at] tomandlucouk> wrote:
> This was one of the possibilities I considered, but I couldn't work out why
> this was efficient.
For POV-Ray's algorithm, having the depth of the bounding shape is of no
benefit and finding it can take additional computations over a simple
hit/no hit test.
> Doesn't it imply that more tests will have to be done than if the ray
> was only checked for intersections with the object when the ray was
> inside the container?
If you did that, the vast majority of objects will be invisible. The
camera is rarely inside the bounds of an object. It is very uncommon for
a ray to hit an object which has a bounds that contains the origin of
the ray.
If the ray originates inside the bounding shape, you may as well assume
the bounding shape has been hit, no matter what the direction...there is
no need to actually intersect with the bounds. Is this what you were
thinking?
> Hmm, looking at that last sentence, I'm beginning to suspect that the notion
> of "more tests" if fundementally flawed.
I'm not sure what you're thinking of or how you're trying to apply that
idea. I have built a raytracer that does use the depths of the bounds
intersections: if the bounds intersection of a shape is further than the
current best intersection, it doesn't bother to do a full intersection
test. I haven't tested it to see how much of an improvement there is, if
there is any at all, because it does require additional work to manage
the extra information.
--
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/
Post a reply to this message
|
|