POV-Ray : Newsgroups : povray.general : image based normal maps? : Re: image based normal maps? Server Time
1 May 2024 20:13:29 EDT (-0400)
  Re: image based normal maps?  
From: Kenneth
Date: 22 Jan 2019 05:25:00
Message: <web.5c46ee32e20dd126cd98345b0@news.povray.org>
ingo <ing### [at] tagpovrayorg> wrote:
>
> ...it appears that .hf = (Red + Green/255)*0.996093 not the same as .gray
> as I thought.
>
> http://wiki.povray.org/content/Documentation:Tutorial_Section_3.2
> #Noise_and_pigment_functions
> The only appearence of .hf I could find,

Thomas wrote:

>  .hf is typically used in height_field functions like, e.g.:
>  height_field {function HF_res, HF_res {F_HF_01(x,y,z).hf}}

I knew I had seen  .hf  *somewhere* but didn't know where to look. Thanks, Ingo.

But it comes as a fascinating surprise (to me) that .gray and .hf use different
color-to-grayscale formulas...

   .gray to get the gray value of the color vector:
    gray value = Red*29.7% + Green*58.9% + Blue*11.4%

   .hf to get the height_field value of the color vector:
    hf value = (Red + Green/255)*0.996093

I don't think I've ever actually used  .hf (in either a height_field OR a
function)-- but I'm mostly curious as to why they are different. And/or the
historical significance of the .hf formula. AFAIU, the .gray formula is the de
facto standard in POV-Ray for internal color conversions; but is there something
'special' about height_field/FUNCTION use that requires a different formula?


Post a reply to this message

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