POV-Ray : Newsgroups : povray.general : Lightsys IV may not work correctly in POV 3.8 : Lightsys IV may not work correctly in POV 3.8 Server Time
25 Apr 2024 16:24:09 EDT (-0400)
  Lightsys IV may not work correctly in POV 3.8  
From: Cousin Ricky
Date: 30 Jan 2021 15:02:37
Message: <6015bb5d@news.povray.org>
See thread "FYI. Watch out for bad color to grey value conversions." in 
povray.unix.

Macro Light_Color_Filtered() in Lightsys IV uses .gray, so scenes using 
this macro are unlikely to have proper lighting under the latest 3.8 
build.  This situation is temporary, until 3.8 is debugged; but in the 
meantime, this workaround should work:

First, add this macro to lightsys.inc:

   #macro Light_DotGray (C)
     (0.297 * C.red + 0.589 * C.green + 0.114 * C.blue)
   #end

Then change the Light_Color() call in macro Light_Color_Filtered() to:

   Light_Color(Lct*Flt,Lm*Light_DotGray(filtered)/Light_DotGray(Lct))

I haven't tested this yet, because I wanted to get the info out quickly, 
but it looks straightforward.  Also, this workaround uses the internal 
POV-Ray grayscale formula, which will keep the old behavior, but was 
coded before gamma handling was seriously examined.  A more accurate 
formula can be found in the p.unix thread, although that formula is 
accurate only for the sRGB/BT.709 color systems (which yours probably is 
anyway).


Post a reply to this message

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