POV-Ray : Newsgroups : povray.newusers : Problem with Photon's : Re: Problem with Photon's Server Time
29 Jul 2024 18:29:44 EDT (-0400)
  Re: Problem with Photon's  
From: Alain
Date: 25 Apr 2005 19:36:01
Message: <426d7ee1$1@news.povray.org>
Bryan Heit nous apporta ses lumieres en ce 2005-04-25 09:37:
> I've designed an old oil lamp, but am hjaving problems assigning photons 
> to the globe.  Basically, if photon's are off the base of the lamp 
> causes a shadow to form beneath the lamp (as it should), but if rendered 
> with photons on this shadow is lost, as is the projection of 
> yellow-orange light onto the ground.  I suspect that photons are getting 
> assiged to both the metal and glass parts of the lamp.  Is this what 
> happened, and if so how do I fix it?
> 
> I've attached the code below.  If you render it as-is you should get an 
> image with 2 lamps - the one on the left has photon's on, the one on the 
> right has photon's off.  If you only render the one with photons on 
> you'll see that id doesn't cast any shadows, or illuminate the ground, 
> whereas both of these happen with photons off.
> 
> Thanx
> 
> Bryan
> 
> /*===============================================================
> 
> Oil Lamp
> 
> Makes an oil lamp, with glass globe and copper base
> 
> 
> Flame is made up of emiting media plus a point light
> 
> 
> Using this object:
>   Photon's must be on to get refractive characteristics of glass
> 
> Calling the lamp (macro):
>   Oil_Lamp (Photons_On)
>     Photons_On = on/off statement allowing an #if statmement to be
>                  used to turn photons on or off.
> 
> 
> ===============================================================*/
> 
> //--------------------------Include Files------------------------------
> 
> #include "colors.inc"
> #include "metals.inc"
> #include "glass.inc"
> 
> #macro Oil_Lamp (Photons_On)
> 
> #declare Globe = lathe {
>     cubic_spline
>     8,
>     <0.5,-1>, <0.45,0>, <0.45,0.5>, <1.25,1>, <1.25,1.5>, <0.75,3>, 
> <0.45,5>, <0.45, 5.5>
>     hollow on
>     texture {
>       pigment { Col_Glass_Old }
>       finish { F_Glass3 }
>             }// end texture
>     #if (Photons_On = on)
>     photons{
>       target
>       reflection off
>       refraction on
>             }//end photons
>     #end
>           }//end lathe
> 
I think that the problem in in the lathe you used. Even if you used the hollow option,
it's 
effectively "solid", in that it don't have any open space inside of it.
Try using a difference of your lathe with itself scaled <0.9,1.01,0.9>(smaller
diameter, very 
slightly taller to remove coincident surfaces). You can also make the lathe come back
to make the 
inside empty.
Another thing, if all elements of a CSG object share the same texture and finish, it's
preferable to 
assing your texture once to the whole object, not to each of it's elements. It makes
smaller, easier 
to read and maintain code, it also save memory when rendering, possibly gaining some
little speed. 
You can always use some textures for individual elements if you want to have some that
have a 
different texture.

Alain


Post a reply to this message

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