POV-Ray : Newsgroups : povray.general : Scattering media and photons : Re: Scattering media and photons Server Time
3 Aug 2024 16:22:00 EDT (-0400)
  Re: Scattering media and photons  
From: Lonnie
Date: 2 Jun 2005 18:45:01
Message: <web.429f899689a510e13cb015b90@news.povray.org>
IMBJR <no### [at] spamhere> wrote:
> On Tue, 16 Mar 2004 10:03:13 -0000, Phil Cook
> <phi### [at] nospamdeckingdealscouk> wrote:
>
> >On Mon, 15 Mar 2004 21:19:25 +0000, IMBJR <no### [at] spamhere> wrote:
> >
> >> On Mon, 15 Mar 2004 09:31:18 -0000, Phil Cook
> >> <phi### [at] nospamdeckingdealscouk> wrote:
> >>
> >>> On Sat, 13 Mar 2004 15:58:50 +0000, IMBJR <no### [at] spamhere> wrote:
> >>>
> >>>> On Fri, 12 Mar 2004 23:18:50 -0500, "Slime" <slm### [at] slimelandcom> wrote:
> >>>>
> >>>>>> Currently, I've a cylinder of light
> >>>>>
> >>>>> Hmm, I vaguely remember other people having troubles with cylinder
> >>>>> lights
> >>>>> and photons... but I don't remember what the solutions were.
> >>>>
> >>>> LOL
> >>>>
> >>>> Cheers, that fills me with hope!
> >>>>
> >>>>>
> >>>>> - Slime
> >>>>> [ http://www.slimeland.com/ ]
> >>>>>
> >>>
> >>> Hopefully you won't object to comments from a newbie, but as I've been
> >>> messing with this sort of thing I may know what's happening.
> >>> The parallel light source beam diameter seems to be controlled by the
> >>> tightness keyword, as for reflecting the light beam off a reflected
> >>> surface; it doesn't.
> >>> As they say a picture is worth a thousand words;
> >>>
> ><snip code>
> >>>
> >>> As you can see from the top view the light beam isn't reflected, but if
> >>> you switch to the other camera view the white sphere is reflected in the
> >>> prism. The only way round this I think is to point a cylinder light
> >>> where
> >>> the beam should reflect.
> >>>
> >>> Hope this helps
> >>
> >> Interesting. I've had a play with your scene and still can't see why
> >> this does not work. After all I'm sure the documentation does talk
> >> about photons being trapped/held/sampled in media.
> >
> >Yeah I've fiddled with it at lot too, add a new camera at:
> >
> >location <10,7,3>
> >look_at <-10,3,3>
> >
> >add a box at:
> >
> >box{0,<-10,10,-100> rotate y*22.5 translate <-10,0,10> pigment {rgb 0.8}
> >finish{reflection {1.0} ambient 0.5 diffuse 1}}
> >
> >then switch the LightReflector to ambient 0.5 diffuse 1
> >
> >you can see that the light beam is being calculated as there is a patch on
> >the box however note the lack of a shadow from the first sphere which
> >should appear in the middle of it, also note the lack of the reflected
> >shadow in the box part which is showing the reflection of the
> >LightReflector.
> >
> >So unless there's something I'm missing it appears POV-Ray can't do this
> >sort of thing with media.
>
> How odd. Unless I'm misreading the documentation, we should be able to
> do this. I'm sure I've see a classic Dark Side Of The Moon prism with
> refracted beam done in POV. I can't see why reflections should be any
> different.
>
> >
> >--
> >Phil
>
> --------------------------------
> My First Subgenius Picture Book:
> http://www.imbjr.com

I am about to tear out my hair over the same problem only with refracted
light.  It seems that photons and media exclude each other.  My scene is a
glass model of a Greek temple, totally transparent material, with ior and
dispersion, photons enabled (target) and illiminated by a spotlight.  It is
surrounded by a hollow, transparent cylinder filled with scattering media.
Interior dispersion works fine, BUT:

1.  When both media and photons are enabled where the media is shadowed by
the (transparent) material the media vanishes.  Caustics completely
diappear leaving black shadows.

2.  When media is diabled and photons are enabled the caustics work fine and
the shadows are correctly rendered in shades of grey.

3.  When photons are diabled and media is enabled the media works fine,
showing up even in the shadows.

I have spent many hours going over the documentation and I can find nothing
about the cause of this.  Here is the code:

#version 3.5;

#include "colors.inc"

global_settings {
  assumed_gamma 1.0
  max_trace_level 15

   photons {
     count 20000
     jitter .4
     media 300
     max_trace_level 35
   }
}

// ----------------------------------------

camera {
  location  <-2.0, 19.0, -32>
  direction 1.5*z
  right     x*image_width/image_height
  look_at   <0.0, 4.0,  0.0>
}




sky_sphere {
  pigment {
    gradient y
    color_map {
      [0.0 rgb <0.6,0.7,1.0>]
      [0.7 rgb <0.0,0.1,0.8>]
    }
  }
}

light_source {
  <60, 58,21>
  color rgb <1, 1, 1>
  spotlight
  radius 6
  falloff 6.1
  tightness 22
  point_at <0,0,0>
}



// ----------------------------------------

#declare M_Mymat1=material{
  texture{
    pigment{
      color rgbt <.9,.9,.9,.9>
    }
    finish{
      ambient .1
      diffuse .7
      specular .3
      reflection 0
    }
    normal{
      crackle .4
      warp{turbulence .3}
      scale .7
    }
  }
  interior{
    ior 2.2
    dispersion 1.9
    dispersion_samples 120
  }
}

plane {
  y, 0
  pigment { color rgb <0.1,0.1,0.1> }
}

union{
  cylinder{<0,-.001,0>,<0,.502,0>,7}
  cylinder{<0,.5,0>,<0,1.002,0>,6.5}
  cylinder{<0,1,0>,<0,1.502,0>,6}
  #declare ix=0;
  #while (ix<360)
    torus{.5,.3 translate <4.9,1.5> rotate <0,ix,0>}
    torus{.5,.3 translate <4.9,8,0> rotate <0,ix,0>}
    cylinder{<4.9,1.5,0>,<4.9,8,0>,.5 rotate <0,ix,0>}
    #declare ix=ix+45;
  #end
  difference{
    cylinder{<0,8,0>,<0,8.501,0>,6}
    cylinder{<0,7.9,0>,<0,8.6,0>,4}
  }
  torus {6,.1 translate <0,8.25>}
  difference{
    sphere{<0,0,0>,5}
    sphere{<0,0,0>,4.8}
    box{<-5.1,0,-5.1>,<5.1,-5.1,5.1>}
    translate <0,8.5,0>
  }
  material{M_Mymat1}
  photons{
    target
    reflection on
    refraction on
  }
}

cylinder{
  <0,-.01,0>,<0,14,0>,8
  texture{
    pigment{ color rgbt <1,1,1,1>}
  }
  interior{
    media{
      scattering { 1, rgb 0.03}
      intervals 1
      samples 5
      method 3
    }
  }
  hollow
}


Post a reply to this message

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