POV-Ray : Newsgroups : povray.general : Fuctions, My two cents : Re: Fuctions, My two cents Server Time
3 May 2024 10:58:18 EDT (-0400)
  Re: Fuctions, My two cents  
From: Kenneth
Date: 26 Feb 2023 21:35:00
Message: <web.63fc154ff28769a39b4924336e066e29@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
> "Kenneth" <kdw### [at] gmailcom> wrote:
> >
> > But *most* interestingly, the two HF-creation methods show some different
> > results for the height values. The 'direct' approach uses only the RED color
> > channel, AND shows the linear white-to-black 'ramp' correctly; the function
> > approach uses only the BLUE channel...but shows an unexpected gamma-value(?)
> > bending of the 'ramp' (and some other shapes there too.) I wasn't expecting
> > that!
>
> I'd like to see if the function approach using the red channel gives the same
> result as either of these experiments.

Using Leroy's function and changing his .blue to .red, I still see the
'gamma-curving' ramp in the HF. Same with .green.
>
> Also, you should look into all of the input_gamma for gamma pre-corrected file
> formats stuff, to see if that's what's going on...

An interesting point-- and a good suggestion. By using the newer(?) 'gamma'
value keyword with my .png test image, it eliminates the gamma-curve effect seen
with the function method; the HF ramp is nice and linear now:

#declare PigM =
function{pigment{image_map{png "MY_IMAGE.png" gamma 1.0 }}}

Yet when the image_map is used 'directly' to create the HF (no pre-function
stuff), it works linearly as expected, without any gamma fiddling.

I don't know if this unexpected difference is mentioned in the docs; I haven't
seen anything that expressly mentions it.

-------
By the way, I was a *little* bit mistaken about the 'direct' image-to-HF method
using only the RED channel. With a different color_map and lighting, I see a
*tiny* amount of the GREEN channel used as well, but it looks almost
non-existent. See the attached render.


Post a reply to this message


Attachments:
Download 'test_hf_red_and_green_channels.jpg' (70 KB)

Preview of image 'test_hf_red_and_green_channels.jpg'
test_hf_red_and_green_channels.jpg


 

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