POV-Ray : Newsgroups : povray.general : Trace Function internals : Re: Trace Function internals Server Time
31 Jul 2024 12:21:06 EDT (-0400)
  Re: Trace Function internals  
From: Warp
Date: 12 Feb 2007 05:13:15
Message: <45d03dba@news.povray.org>
FrogRay <nomail@nomail> wrote:
> When tracing from a starting point A to an object B, does the distance
> between A and B have any effect on rendering time.

  1) Why would you even think that it could have some effect?

  2) If you are having such doubts, why don't you just test it?

> One does not (and could not) compare every possible value of y1
> and y2, given x, to find the point of intersection.

  Ever heard of so-called root-finding algorithms?
http://en.wikipedia.org/wiki/Root-finding_algorithm

  Not that POV-Ray uses that, but equations can be approximated
iteratively too. Of course POV-Ray doesn't do that because it doesn't
need to (except for isosurfaces, which is a different story and not
really related to the question of whether a longer ray takes more to
calculate). Even if POV-Ray used such an algorithm, a clever algorithm
wouldn't be very much dependent on the ray length.

> If trace works in the same way as as the raytracing algorithm

  Why would you think that trace() uses anything else than what the
raytracing process itself uses?
  trace() was originally added (initially to megapov iirc) exactly
because it was so simple to add. There was already an internal trace
function in the source code to trace objects (used to raytrace the
objects in the scene), and the SDL trace() simply calls that for the
given object. I bet the implementation of trace() is a one-liner.

> BTW: Is trace generally considered an "advanced" povray function.

  "Advanced" is completely a question of opinion. To some people
trace() is one of the simplest functions in the whole SDL, while
to others it's really advanced stuff.

  I suppose than in general it's considered quite advanced since it
requires some spatial understanding and visualization skills in order
to be used properly (moreso than eg. just placing objects in a scene).
Of course being able to use the normal vector usefully requires some
knowledge too.

-- 
                                                          - Warp


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.