POV-Ray : Newsgroups : povray.newusers : photons and refraction : photons and refraction Server Time
28 Jul 2024 20:21:42 EDT (-0400)
  photons and refraction  
From: Oliver
Date: 17 Aug 2007 12:25:01
Message: <web.46c5caeeadcd499789891a3f0@news.povray.org>
Hi everyone,
I'm new to povray and have recently been playing around with media and
photons.  Below is a little test scene I put together to help me understand
how these things work, but I haven't been able to get it to work as I would
expect.

What is supposed to happen, is a narrow beam of light from a spotlight
enters some scattering media so it shows up, enters a glass block at an
angle, where it is refracted, and then exits at the other side, where it
shows up in the media again.

What actually happens is it shows up before it strikes the block, but then
does not show up again at the other side.  I have been looking at the
source code of other scenes that do something similar (particularly the
advanced/optics.pov scene that comes with povray) but I can't really tell
what I am doing wrong.

Here is what I have so far:
#include "colors.inc"

global_settings {
    assumed_gamma 1
    photons {
 count 10000
 jitter 0.2
 media 100, 2
    }
}

// Fog
box { <-2,-2,-2>, <2,2,2>
    hollow
    texture {
 pigment { colour rgbf 1 }
    }
    interior {
 media {
     scattering { 1, colour Gray50 extinction 1 }
     method 2
     intervals 10 samples 20
 }
    }
}

// Glass block
box {<-0.5,-0.5,-2>, <0.5,0.5,2>
    material {
 texture {
     pigment { colour rgbf 1 }
     finish { ambient 0 diffuse 0 reflection 0 }
 }
 interior {
     ior 1.5
 }
    }
    rotate -30*z
    photons {
 target
 refraction on
 reflection off
    }

}


// Spotlight
light_source { <152, 0, 0>, colour 20*White
    spotlight
    radius 0.01
    falloff 0.02
    point_at <0,0,0>
    photons {
 refraction on
 reflection off
    }
}

camera {
    location <0,0,-8>
    look_at <0,0,0>
    angle 50
}

// End


Post a reply to this message

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