POV-Ray : Newsgroups : povray.binaries.animations : Terraforming: a approach with contour lines converted to a height_field Server Time
22 Dec 2024 00:07:32 EST (-0500)
  Terraforming: a approach with contour lines converted to a height_field (Message 1 to 5 of 5)  
From: MichaelJF
Subject: Terraforming: a approach with contour lines converted to a height_field
Date: 3 Nov 2012 13:50:02
Message: <web.50955906b25343e5b2c55e290@news.povray.org>
Hi folks,
here an approach to convert contour lines to hight_fields. I wanted to have a
certain landscape und found no answer to this topic in the newsgroups. Only an
older Windows-Tool by Leroy whetstone. So I thought the one or other may be
interested in such an technique with POV (and the GIMP) alone.

First I tried to create mesh2-objects, what worked but at very high time costs,
since the whole iteration took place during the parse phase. And I wondered if
it could be possible to do it during the rendering. The idea was simply to have
the countour lines with constant height and to calculate the other heights by
averaging the heights of the surrounding until no visible change was apparent.
Then I remembered one of our discussions here about baking occlusion maps some
weeks ago. I proposed a texture to avoid the Gimp-Step Jaime proposed. And this
texture was the solution to the actual issue. Of course I had to enlarged it a
bit.

So if you have a map with contour lines (grey values of the lines must fit the
heights) make the background transparent, create a box with the transparent
texture and a second one behind the first without using the transparency. Blur
it with an averaged map of the same texture and use the resulting picture as the
texture of the second box in the next frame in an animation, but leave the first
one with the contour lines and transparent background untouched. Only with the
last frames leave it out to get rid of the little peaks.

Here is a first impression. It took less than 1 hour 20 minutes at 800x800 at a
core i7 (mpeg1-file from ffmpeg). I'll put the source into the p.b.s-f within
the next minutes.

Best regards,
Michael


Post a reply to this message


Attachments:
Download 'cl2hf.mpg' (1730 KB)

From: MichaelJF
Subject: Re: Terraforming: a approach with contour lines converted to a height_field
Date: 3 Nov 2012 14:00:01
Message: <web.50955aa8383e880ab2c55e290@news.povray.org>
I was not able to view the whole movie by clicking at it, but downloading and
than viewing worked.

Best regards,
Michael


Post a reply to this message

From: Christian Froeschlin
Subject: Re: Terraforming: a approach with contour lines converted to a height_field
Date: 3 Nov 2012 15:14:36
Message: <50956d1c$1@news.povray.org>
MichaelJF wrote:

> here an approach to convert contour lines to hight_fields. 

neat! Two ideas:

Starting with a 0-level background will take a long time for
the high values to seep in, you can probably accelerate this by
using a mid-gray background in the first frame, or even better
use a "max" filter for the first few frames (you probably need
to use a pattern function for that).

The filter size (currently constant 15x15) could be frame
dependent so you start out smoothing over a wide area and end
up refining only the details.


Post a reply to this message

From: MichaelJF
Subject: Re: Terraforming: a approach with contour lines converted to a height_field
Date: 5 Nov 2012 02:10:01
Message: <web.509765b9383e880a9097fcaf0@news.povray.org>
Christian Froeschlin <chr### [at] chrfrde> wrote:
> MichaelJF wrote:
>
> > here an approach to convert contour lines to hight_fields.
>
> neat! Two ideas:
>
> Starting with a 0-level background will take a long time for
> the high values to seep in, you can probably accelerate this by
> using a mid-gray background in the first frame, or even better
> use a "max" filter for the first few frames (you probably need
> to use a pattern function for that).
>
> The filter size (currently constant 15x15) could be frame
> dependent so you start out smoothing over a wide area and end
> up refining only the details.

Thank you, I'm still thinking about the pattern function, but cannot see a gain
with them. First because my experience with them is very limited and second
because my contour lines range from black to white, so using the maximum would
only reverse the problem.

The second idea, starting with a larger area and decreasing it during the
animation, sounds promising. I will give it a try tonight. I used the 15x15
because it the largest grid which is quadratic and centered and fits into 256
map entries.

Best regards,
Michael


Post a reply to this message

From: MichaelJF
Subject: Re: Terraforming: a approach with contour lines converted to a height_field
Date: 5 Nov 2012 14:25:01
Message: <web.509811ad383e880af6fcbc350@news.povray.org>
"MichaelJF" <mi-### [at] t-onlinede> wrote:
Since I like quick hacks: a simple way to speed up the rendering time and to get
a better start distribution is to leave the code untouched and iterate it 500
times with a very low resolution (in my example 30 minutes at 512^2) and then
switch to the desired resolution and run it over night.

Best regards,
Michael


Post a reply to this message

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