POV-Ray : Newsgroups : povray.general : 24 bit heightfields Server Time
27 Nov 2024 10:45:54 EST (-0500)
  24 bit heightfields (Message 1 to 10 of 35)  
Goto Latest 10 Messages Next 10 Messages >>>
From: SharkD
Subject: 24 bit heightfields
Date: 10 Dec 2008 18:05:01
Message: <web.494049f1c9a7e0d12c4b57320@news.povray.org>
I generated the following heightfield in some program or other. It uses all 24
bits for elevation information. My question is, how are the colors/height data
organized? I would like to create a pigment that produces similar maps.

http://i421.photobucket.com/albums/pp292/SharkD2161/Support/Untitled1_hf.png

-Mike


Post a reply to this message

From: Nicolas Alvarez
Subject: Re: 24 bit heightfields
Date: 10 Dec 2008 18:22:28
Message: <49404f34@news.povray.org>
SharkD wrote:
> I generated the following heightfield in some program or other. It uses
> all 24 bits for elevation information. My question is, how are the
> colors/height data organized? I would like to create a pigment that
> produces similar maps.

Seems similar to the POV-Ray TGA heightfields, except using all three
channels instead of two.

Basically, red*256*256 + green*256 + blue = 24-bit grayscale value.


Post a reply to this message

From: SharkD
Subject: Re: 24 bit heightfields
Date: 10 Dec 2008 20:50:01
Message: <web.494070ee869f689f2c4b57320@news.povray.org>
Nicolas Alvarez <nic### [at] gmailcom> wrote:
> SharkD wrote:
> > I generated the following heightfield in some program or other. It uses
> > all 24 bits for elevation information. My question is, how are the
> > colors/height data organized? I would like to create a pigment that
> > produces similar maps.
>
> Seems similar to the POV-Ray TGA heightfields, except using all three
> channels instead of two.
>
> Basically, red*256*256 + green*256 + blue = 24-bit grayscale value.

How would I create this type of pigment? Thanks.

-Mike


Post a reply to this message

From: Nicolas Alvarez
Subject: Re: 24 bit heightfields
Date: 10 Dec 2008 21:27:54
Message: <49407aa9@news.povray.org>
SharkD wrote:
> How would I create this type of pigment? Thanks.

You want POV-Ray to output an image like this, for another application to
use?

I don't think it would be easy at all. You definitely can't use
antialiasing :) (try slightly blurring the image you have and loading it
into your app, see what you get!)


Post a reply to this message

From: clipka
Subject: Re: 24 bit heightfields
Date: 10 Dec 2008 21:40:00
Message: <web.49407d17869f689febb7cc8a0@news.povray.org>
"SharkD" <nomail@nomail> wrote:
> I generated the following heightfield in some program or other. It uses all 24
> bits for elevation information. My question is, how are the colors/height data
> organized? I would like to create a pigment that produces similar maps.
>
> http://i421.photobucket.com/albums/pp292/SharkD2161/Support/Untitled1_hf.png

it's not very easy to tell, given the low resolution - but it is quite obvious
that the red channel is most significant. So I'd guess that the height is coded
as:

    height = red + (green/256.0) + (blue/65536.0)

with red, green, blue and height all ranging from 0.0 to 1.0.


Post a reply to this message

From: SharkD
Subject: Re: 24 bit heightfields
Date: 11 Dec 2008 16:45:01
Message: <web.494188b3869f689feb2e5c3e0@news.povray.org>
Nicolas Alvarez <nic### [at] gmailcom> wrote:
> You want POV-Ray to output an image like this, for another application to
> use?

No, I want to reuse the images in POV.

-Mike


Post a reply to this message

From: SharkD
Subject: Re: 24 bit heightfields
Date: 11 Dec 2008 16:45:01
Message: <web.4941894e869f689feb2e5c3e0@news.povray.org>
"clipka" <nomail@nomail> wrote:
> it's not very easy to tell, given the low resolution - but it is quite obvious
> that the red channel is most significant. So I'd guess that the height is coded
> as:
>
>     height = red + (green/256.0) + (blue/65536.0)
>
> with red, green, blue and height all ranging from 0.0 to 1.0.

I don't quite understand your math. If red, green and blue all range from 0 to
1, then the maximum possible height is 3. The maximum height of heightfields is
1.

-Mike


Post a reply to this message

From: Reactor
Subject: Re: 24 bit heightfields
Date: 11 Dec 2008 16:55:00
Message: <web.49418be0869f689f353f48a70@news.povray.org>
"SharkD" <nomail@nomail> wrote:
> I generated the following heightfield in some program or other. It uses all 24
> bits for elevation information. My question is, how are the colors/height data
> organized? I would like to create a pigment that produces similar maps.
>
> http://i421.photobucket.com/albums/pp292/SharkD2161/Support/Untitled1_hf.png
>
> -Mike

I am intrigued by this idea.  I have been using hf_gray_16 in the past, and it
usually creates enough levels, but an hf_gray_24 might be pretty cool too.

From the documentation:
"When  hf_gray_16 is on, the output file will be in the form of a heightfield,
with the height at any point being dependent on the brightness of the pixel.
The brightness of a pixel is calculated in the same way that color images are
converted to grayscale images: height = 0.3 * red + 0.59 * green + 0.11 *
blue."

It'll take a bit of testing, but if it is that easy...

-Reactor


Post a reply to this message

From: SharkD
Subject: Re: 24 bit heightfields
Date: 11 Dec 2008 16:55:01
Message: <web.49418c0e869f689f1c3f45200@news.povray.org>
"SharkD" <nomail@nomail> wrote:
> "clipka" <nomail@nomail> wrote:
> > it's not very easy to tell, given the low resolution - but it is quite obvious
> > that the red channel is most significant. So I'd guess that the height is coded
> > as:
> >
> >     height = red + (green/256.0) + (blue/65536.0)
> >
> > with red, green, blue and height all ranging from 0.0 to 1.0.
>
> I don't quite understand your math. If red, green and blue all range from 0 to
> 1, then the maximum possible height is 3. The maximum height of heightfields is
> 1.
>
> -Mike

Errr... I meant, "the maximum possible height is greater than 1", not 3.

-Mike


Post a reply to this message

From: Nicolas Alvarez
Subject: Re: 24 bit heightfields
Date: 11 Dec 2008 17:23:27
Message: <494192df@news.povray.org>
SharkD wrote:
> "clipka" <nomail@nomail> wrote:
>> it's not very easy to tell, given the low resolution - but it is quite
>> obvious that the red channel is most significant. So I'd guess that the
>> height is coded as:
>>
>>     height = red + (green/256.0) + (blue/65536.0)
>>
>> with red, green, blue and height all ranging from 0.0 to 1.0.
> 
> I don't quite understand your math. If red, green and blue all range from
> 0 to 1, then the maximum possible height is 3. The maximum height of
> heightfields is 1.

Those maths assume red, green and blue go from 0 to 255, and height would be
from 0 to 16777216.


Post a reply to this message

Goto Latest 10 Messages Next 10 Messages >>>

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