POV-Ray : Newsgroups : povray.binaries.images : Drifting over the traps : Re: Drifting over the traps Server Time
2 Nov 2024 16:09:17 EDT (-0400)
  Re: Drifting over the traps  
From: Thomas de Groot
Date: 16 Jul 2010 10:36:30
Message: <4c406e6e$1@news.povray.org>
"John VanSickle" <evi### [at] hotmailcom> schreef in bericht 
news:4c405902$1@news.povray.org...
> Bill Pragnell wrote:
>> Love it. I get a real sense of scale and space, although the realism 
>> lapses a
>> little in the foreground. Of course, this is just a wip. :)
>>
>> (I think this is a universal problem with landscapes - you need enough 
>> detail
>> for a convincing foreground, but not so much that speed/memory is wasted 
>> in the
>> distance. Either meshes and clever texturing, or some sort of 
>> level-of-detail
>> system).
>
> If I recall correctly, I did that with my patchwork height field macro, 
> although the version I posted wherever I posted it might have had that 
> part removed.  The macro set the precision of each height field so that it 
> was about as great as the span of pixels occupied by it.
>

If I read this correctly, it does indeed. See your comments with the macro 
(povray.general, May 13, 2008):

[start  John's comments]
There are several macros here that do the work.  The upshot to all this
is that I divide the x-z plane into a set of squares of unit size, and
create a separate heightfield for each box.  Some of these squares are
subdivided into smaller squares when they are near the camera.  Squares
whose height_fields fall outside of the camera view are culled so that
they don't take up memory space; this will be an issue if you have
reflective surfaces that clearly show the off-camera portions of your
scene.  The macro HF_Chunk() creates a height field for one square in
the x-z plane, starting at a particular x-z location and going the
specified size in the positive x and z directions.  I use one as the
square size.  The precision of the height field is calculated based on
the number of pixels the height field will span in the image.  This
causes issues if the height field is near the viewpoint, so such height
fields are subdivided until every child is either off-camera (and
culled) or no longer causing the problems from being too close.
[end John's comments]

In the present image, the subdivision level is pretty low (CLevel=3). In a 
final version this can go up, although not too much as parsing time 
increases proportionally of course.

Thomas


Post a reply to this message

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