POV-Ray : Newsgroups : povray.binaries.images : Upgrading POV-Ray's include files - a few remarks : Re: Upgrading POV-Ray's include files - a few remarks Server Time
28 Apr 2024 15:29:38 EDT (-0400)
  Re: Upgrading POV-Ray's include files - a few remarks  
From: Cousin Ricky
Date: 8 Mar 2021 13:56:55
Message: <60467377$1@news.povray.org>
On 2021-03-08 2:23 PM (-4), Bald Eagle wrote:
> Cousin Ricky <ric### [at] yahoocom> wrote:
> 
>> POV-Ray 3.6.2 and earlier read image files incorrectly, although this
>> can be fixed with a pigment function, which is what I did before 3.7 was
>> developed.  (Thanks Jaime or Ive, whoever posted the function.)  The
>> article might also explain why anti-aliased text in POV-Ray 3.5 looks
>> heavier than in 3.6 and later.
> 
> Friedrich Lohmueller?
> 
> http://www.f-lohmueller.de/pov_tut/backgrnd/p_sky8.htm

No, the function I have uses sRGB non-linearity instead of a power 

original post, but this code is adapted from one of my old scene files.

-----------[BEGIN CODE EXCERPT]-----------
#declare p_Map = pigment
{ image_map { jpeg "myimage.jpg" interpolate 2 }
}

#declare fn_Map = function { pigment { p_Map } }

#declare fn_Adjust = function (x) //from IEC 61966-2-1:1999
{ select (x - 0.04045, x / 12.92, pow ((x + 0.055) / 1.055, 2.4))
}

#declare p_Adjusted = pigment
{ average pigment_map
   { [ function { fn_Adjust (fn_Map (x, y, z).red) }
       color_map { [0 rgb 0] [1 red 3] }
     ]
     [ function { fn_Adjust (fn_Map (x, y, z).green) }
       color_map { [0 rgb 0] [1 green 3] }
     ]
     [ function { fn_Adjust (fn_Map (x, y, z).blue) }
       color_map { [0 rgb 0] [1 blue 3] }
     ]
   }
}
-----------[BEGIN CODE EXCERPT]-----------


Post a reply to this message

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