POV-Ray : Newsgroups : povray.binaries.images : Problem with a nested texture_map Server Time
30 Jul 2024 20:18:52 EDT (-0400)
  Problem with a nested texture_map (Message 1 to 6 of 6)  
From: Jörg 'Yadgar' Bleimann
Subject: Problem with a nested texture_map
Date: 10 Dec 2010 16:09:22
Message: <4d029702@news.povray.org>
High!

While playing around with SRTM elevation tiles, I just tried to program 
a slope-dependent texture_map which also takes elevation above sea level 
into account.

As real world altitudes stretch from -422 (Dead Sea) to 8848 metres (Mt. 
Everest) and I applied the composite texture_map (see code below) 
*after* scaling the heightfields, I used height values in metres rather 
than the common relative values from 0 to 1.

But regardless of this, PoV-Ray seems to interpret them as relative 
values, so the bright yellow T_Beach texture, which was meant to be 
constrained to the lowermost three metres above sea level, shows up 
throughout all of the terrain (with the highest mountain visible in the 
scene being about 700 metres high). Why?

Code, scene image and hightfield are attached here!

See you in Khyberspace!

Yadgar


Post a reply to this message


Attachments:
Download 'terrain.pov.txt' (4 KB) Download '2010-12-10 southwestern tasmania, take 10.jpg' (35 KB) Download 's44e146_patched.png' (968 KB)

Preview of image '2010-12-10 southwestern tasmania, take 10.jpg'
2010-12-10 southwestern tasmania, take 10.jpg

Preview of image 's44e146_patched.png'
s44e146_patched.png


 

From: Christian Froeschlin
Subject: Re: Problem with a nested texture_map
Date: 10 Dec 2010 19:30:36
Message: <4d02c62c$1@news.povray.org>


> As real world altitudes stretch from -422 (Dead Sea) to 8848 metres (Mt. 
> Everest) and I applied the composite texture_map (see code below) 
> *after* scaling the heightfields, I used height values in metres rather 
> than the common relative values from 0 to 1.

I don't think any pattern can yield values > 1.0.
Try dividing all values in the map by 1200 and
using "gradient 1200*y" instead.


Post a reply to this message

From: Jörg 'Yadgar' Bleimann
Subject: Re: Problem with a nested texture_map
Date: 10 Dec 2010 21:25:14
Message: <4d02e10a@news.povray.org>
High!

On 11.12.2010 01:30, Christian Froeschlin wrote:

> I don't think any pattern can yield values > 1.0.
> Try dividing all values in the map by 1200 and
> using "gradient 1200*y" instead.

You probably mean 9270 rather than 1200, as 9270 is the heightfield's 
size in the y direction (422+8848)... so I divided all texture_map 
values by 9270, but regardless whether I used gradient y or gradient 
y*9270, attached below is what I got...

Strange!

See you in Khyberspace!

Yadgar


Post a reply to this message


Attachments:
Download '2010-12-11 southwestern tasmania, take 11.jpg' (117 KB)

Preview of image '2010-12-11 southwestern tasmania, take 11.jpg'
2010-12-11 southwestern tasmania, take 11.jpg


 

From: Thomas de Groot
Subject: Re: Problem with a nested texture_map
Date: 11 Dec 2010 03:01:21
Message: <4d032fd1$1@news.povray.org>
What I generally do is determine the minimum and maximum extent of the 
height_field using:

#declare Min = min_extent(Landscape).y;
#declare Max = max_extent(Landscape).y;

and use those values in the altitude parameter:

altitude <0.0,  0.2, 0.0> , Min , Max

You may then have to experiment further with your pigment_map{} 
texture_map{} values of course to get what you want.

Hope this helps

Thomas


Post a reply to this message

From: Christian Froeschlin
Subject: Re: Problem with a nested texture_map
Date: 11 Dec 2010 17:31:23
Message: <4d03fbbb@news.povray.org>


> You probably mean 9270 rather than 1200

I mentioned 1200 because of the values used in your original map

texture_map
   {
     [0	TM_Shore]
     ...
     [1200 TM_Alpine]
   }

> but regardless whether I used gradient y or gradient y*9270

oops, sorry, I misremembered how gradient treats the
length of the direction vector. Instead, try

   gradient y scale <1,9270,1>


Post a reply to this message

From: Jörg 'Yadgar' Bleimann
Subject: Re: Problem with a nested texture_map
Date: 12 Dec 2010 03:26:36
Message: <4d04873c@news.povray.org>
High!

On 11.12.2010 23:31, Christian Froeschlin wrote:
> oops, sorry, I misremembered how gradient treats the
> length of the direction vector. Instead, try
>
> gradient y scale <1,9270,1>

Or, instead, scale the whole texture afterwards to 9270 before applying 
them to the heightfield! Worked quite well... as you can see in the 
attachment below!

Nevertheless, thanks for your suggestion!

See you in Khyberspace!

Yadgar


Post a reply to this message


Attachments:
Download '2010-12-11 southwestern tasmania, take 12.jpg' (33 KB)

Preview of image '2010-12-11 southwestern tasmania, take 12.jpg'
2010-12-11 southwestern tasmania, take 12.jpg


 

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