POV-Ray : Newsgroups : povray.advanced-users : Lightning : Re: Lightning Server Time
12 Jun 2024 17:07:28 EDT (-0400)
  Re: Lightning  
From: Alain
Date: 19 Oct 2013 19:45:59
Message: <526319b7@news.povray.org>


There is a possible problem if the variable Thickness is set to zero.
Here a slightly revised code to take care of that possiblility:

> Maybe /I/ adapted the code some time ago, I don't remember. Here is the
> electric macro working under version 3.7:
>


           media {
             samples M_samples
             emission color rgb 1
             density {
               spherical
               poly_wave 1.5
               color_map{
                 [0.00 color rgb 0 ]

        #ifdef(Thickness)
            #if(Thickness = 0) // To be used with Thickness = 0
                 [0.80 color rgb ElectricColor(ValueM)*Brightness*2 ]
                 [0.90 color rgb <1,1,1>*Brightness*75  ]
                 [1.00 color rgb <1,1,1>*Brightness*200 ]
                 //or this? (Alain)
            #else // To be used whenever Thickness have been set to a 
non-zero value
                 [0.80 color rgb 
ElectricColor(ValueM)*Brightness/Thickness ]
                 [0.90 color rgb <1,1,1>*Brightness/Thickness  ]
                 [1.00 color rgb <1,1,1>*Brightness/Thickness ]
            #end
        #else // Fallback if Thickness was not defined
                 [0.80 color rgb ElectricColor(ValueM)*Brightness*2 ]
                 [0.90 color rgb <1,1,1>*Brightness*75  ]
                 [1.00 color rgb <1,1,1>*Brightness*200 ]
        #end
               }
             }
           }
         }



Alain


Post a reply to this message

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