POV-Ray : Newsgroups : povray.binaries.images : city buildings as height_fields-- WIP 1 : Re: city buildings as height_fields-- WIP 1 Server Time
2 May 2024 04:02:56 EDT (-0400)
  Re: city buildings as height_fields-- WIP 1  
From: Alain
Date: 28 Feb 2018 19:33:31
Message: <5a974a5b$1@news.povray.org>

> Alain <kua### [at] videotronca> wrote:
> 
>>>
>> This may help:
>> Start with a reflective box for the buildings.
> 
> That is a brilliant and simple solution to my problem, for this height_field
> version of the scene; as Bill says, it eliminates the need to use an
> image_pattern/holdout matte altogether, with LOTS of image_map memory saved.
> THANKS. I probably wouldn't have thought of it.
> 
> Strangely, it gave me another different (or maybe additional!) kind of idea: For
> each of the 50 types of building faces, make ONE very large tiled height_field
> slightly larger than any conceivable building I might make (made from the single
> much-smaller original HF tile, that one being pre-#declared as usual.)
> PRE-#declare this larger one too, *with* all of the images/reflections already
> on it (or no reflections at all, like your idea.) That should require only a
> relatively smallamount of memory, I think. Then use clipping planes in the later
> #while loop to simply slice away parts of the 'iterated' HF, to get the building
> dimensions I want for each different-height/different width building face. And
> then add your reflective box underneath.
> 
> Of course, I'll end up using thousands and thousands of clipping planes for the
> entire 'city'. I don't really know how that by itself might affect the
> scene's memory use. Those planes are just simple(?) mathematical entities, so
> maybe not much at all.
> 
> I have one small but important question about clipped_by planes: Regarding later
> MEDIA use (if I decide to add it to the scene), do those planes have an
> inside/outside nature like a regular 'plane' object? In other words, do they
> affect the appearance/non appearance of media? I've never had to think about
> this before!
Test it. Make a test scene where you have a sphere clipped by a plane 
and a background plane. Fill that with some media.

sphere{0,2 clipped_by{plane{x,0.1}}}
plane{-z, -10}
media{Some_Media}
camera{location -5*z}

> 
> 
> 

A plane is almost as simple as a sphere, but is unbounded : A normal 
vector and an offset float, totalling 4 floats just the same as a 
sphere. That effectively take only a small amount of memory.
If you use it to clip an other object, then, you are left with the part 
of that object that is inside the plane, or whatever primitive you used.
The draw back is that having 1000, of infinite primitives will 
significantly increase the rendering time. You'll also need to manually 
bound those cut hight_field using bounded_by{box{...}}. It would 
probably be more efficient to use a box to cut the opposing walls than 
using planes. A box is defined by 6 floats if there is no texturing and 
no transform.
So, for the two opposing walls, you need two planes per faces, total 4 
planes or 16 floats, or a single box or 6 floats.

BUT, the very large tiled hight_field will take a large amount of 
memory, and part of it will get cut out and never be used in any way. 
That mean some amount of wasted memory. It will effectively take as much 
memory as the total of every tiles used to make it.
A middle ground solution would be to make some medium tiled hight_field.


Post a reply to this message

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