POV-Ray : Newsgroups : povray.advanced-users : Question3. Simple Raytracer : Re: Question3. Simple Raytracer Server Time
28 Jul 2024 18:16:02 EDT (-0400)
  Re: Question3. Simple Raytracer  
From: Warp
Date: 20 Apr 2004 04:36:28
Message: <4084e10c@news.povray.org>
Gena <gen### [at] yahoocom> wrote:
> Is it possible to do the same for raytracing? Is it possible
> to avoid generation of all triangles and keeping them in memory?

  Yes, and it has been implemented in many "pro" renderers.

  In scanline rendering it's definitely easier to be selective on what
you are rendering and what not, and to take turns between objects to
render them (that is, you can render first one object and then another
and then compose the two results using their depth maps).
  In raytracing it's equally easy if you are not using reflection nor
refraction and you are using the same lighting tricks as the scanline
renderer (ie. eg. shadow maps instead of raytraced shadows). However,
since in raytracing you usually want raytraced shadows and reflecting
and translucent objects, it becomes a bit trickier.
  You can, for example, use a caching scheme where you load only those
objects which bounding box are hit during the raytracing process. When
more and more objects are loaded and the memory is being filled, you
can drop the oldest hit objects from memory.
  If an object is extremely complex (such as a tree with hundreds of
thousands of triangles) you can even divide these objects into
subobjects and perform the caching on them. That is, instead of loading
the whole tree, just load a properly sized section of it which bounding
box is being hit right now.
  Octree spatial subdivision of meshes (which is AFAIK what POV-Ray uses
for speedup of raytracing meshes) can be a very big help in this. That is,
just load those octree nodes which need to be loaded and forget about
those which don't. (Of course you shouldn't have nodes with one triangle
in them because that would cause too much overhead; the size of the
subobjects should be something optimal.)

-- 
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.