POV-Ray : Newsgroups : povray.general : 24 bit heightfields : Re: 24 bit heightfields Server Time
6 Sep 2024 05:19:23 EDT (-0400)
  Re: 24 bit heightfields  
From: Dan Connelly
Date: 11 Dec 2008 18:44:56
Message: <4941a5f8$1@news.povray.org>
SharkD wrote:
> Nicolas Alvarez <nic### [at] gmailcom> wrote:
>> 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.
> 
> OK, but 255 + 255/256 + 255/65536 still don't add up to 16777216!
> 

No -- the values go from 0 to 255, so the sum can go from 0 to (256 - 1 / 256^2)

Dan


Post a reply to this message

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