POV-Ray : Newsgroups : povray.general : image based normal maps? : Re: image based normal maps? Server Time
2 May 2024 02:46:41 EDT (-0400)
  Re: image based normal maps?  
From: clipka
Date: 22 Jan 2019 15:22:53
Message: <5c477b9d$1@news.povray.org>
Am 22.01.2019 um 17:47 schrieb Alain:

> ..hf use the red as the upper, or most significative, 8 bits and green 
> as the lower, or least significative, 8 bits of a 16 bits value to be 
> used as a height field. The *0.996093 is there as a fudge value to 
> prevent clipping at the higher end of the range. The blue channel is 
> ignored.

BTW, 0.996093 is 255/256.

The function might also be written as:

     hf value = (Red * 255 + Green) / 256

I think for technical reasons the function _should_ be

     hf value = (Red * 256 + Green) / 257

but alas! it isn't.


Post a reply to this message

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