POV-Ray : Newsgroups : povray.general : Scanline rendering in POV-Ray : Re: Scanline rendering in POV-Ray Server Time
4 Aug 2024 18:15:40 EDT (-0400)
  Re: Scanline rendering in POV-Ray  
From: Warp
Date: 2 Jun 2003 16:46:26
Message: <3edbb7a2@news.povray.org>
Ray Gardener <ray### [at] daylongraphicscom> wrote:
> In a raytracer, all of the scene's geometry must
> be retained in memory because secondary rays due
> to reflection, refraction, shadows, etc. could
> be aimed anywhere, thus random access to the geometry
> database must be possible.

  There are several things here which are not completely accurate.

  The reason given above about why all geometry needs to be retained
on memory is related exactly to what raytracing can do *more* than
scanline-rendering (ie. reflections, refractions and shadow-testing).
  There's nothing in raytracing that *forces* you to use these extra
features. If it's enough to get the same result as you would get with
scanline-rendering, you can use simple raycasting (ie. don't calculate
any reflected nor refracted rays) without shadows. This way the necessity
of having all the objects in memory at once is removed in the exact same
way as in scanline-rendering.
  (If you want to use scanline-type reflections and shadows, there's nothing
in raytracing which would not allow using the same techniques.)

  Of course one would ask: If the result is the same as with
scanline-rendering, then why don't do it with scanline-rendering?
  There are two reasons:
  1. It's a lot simpler. Rendering and texturing a mesh is a lot simpler
with a raytracing algorithm than with a scanline-rendering algorithm.
  2. With very complex meshes raytracing can be even faster (because
triangles which are not visible are automatically skipped due to
octree optimizations).

  Also, even if full raytracing done, keeping the whole scene geometry
in memory at once is not strictly necessary.
  If the bounding box of a mesh object is never hit, there's no reason
to even load that mesh into memory. It should be possible to develop
a load-at-demand scheme, where meshes are loaded only when needed. It
could also be a cache scheme, where meshes which have not been hit in
longest time can be freed from memory.

> In a scanline renderer, each object is considered
> only once, so an object only exists in memory
> while being drawn.

  This has the drawback that if a hundred triangles cover a certain
pixel, that pixel is recalculated a hundred times (including texturing
and lighting).
  In raytracing the closest intersection point for the pixel is
calculated and then texturing and lighting is calculated for that
triangle only.

-- 
plane{-x+y,-1pigment{bozo color_map{[0rgb x][1rgb x+y]}turbulence 1}}
sphere{0,2pigment{rgbt 1}interior{media{emission 1density{spherical
density_map{[0rgb 0][.5rgb<1,.5>][1rgb 1]}turbulence.9}}}scale
<1,1,3>hollow}text{ttf"timrom""Warp".1,0translate<-1,-.1,2>}//  - Warp -


Post a reply to this message

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