POV-Ray : Newsgroups : povray.general : Negative diffuse settings? : Re: Negative diffuse settings? (ATTN: POV-Team) Server Time
8 Aug 2024 14:20:22 EDT (-0400)
  Re: Negative diffuse settings? (ATTN: POV-Team)  
From: Mark Wagner
Date: 1 Dec 2000 01:02:54
Message: <3a273f0e@news.povray.org>
Chris Jeppesen wrote in message <3a26c94e$1@news.povray.org>...
>This kinda works, but not as well as I had hoped. It seems as though
diffuse
>is constrained to be >0. Does anyone know if this is true? Does anyone have
>any better ideas?


A quick perusal through the POV-Ray source code reveals that yes, diffuse is
currently constrained to being greater than 0.  For anyone who cares to, the
fix is to replace the line in function Diffuse() in lighting.c that reads :

      if (Finish->Diffuse > 0.0)

with

      if(Finish->Diffuse != 0.0)

This will get rid of the limitation.  Additionally, to get rid of the
related limits on phong, specular, and irid, replace the lines that read:
        if (Finish->Phong > 0.0)
        if (Finish->Specular > 0.0)
      if (Finish->Irid > 0.0)
with
        if (Finish->Phong != 0.0)
        if (Finish->Specular != 0.0)
      if (Finish->Irid != 0.0)
respectively.

There are probably other places where settings are unnecessarily constrained
to be greater than zero.

--
Mark

"The derivative of sin(2x) is cos(2x)"  - Matt Giwer


Post a reply to this message

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