POV-Ray : Newsgroups : povray.advanced-users : Problem getting media to show photons reflected from a mirror Server Time
29 Jul 2024 02:21:04 EDT (-0400)
  Problem getting media to show photons reflected from a mirror (Message 1 to 3 of 3)  
From: Raymond
Subject: Problem getting media to show photons reflected from a mirror
Date: 26 Jan 2003 02:40:03
Message: <web.3e3390b894ba8eb2802871ed0@news.povray.org>
Below is a scene that attempts to do a much simpler version of the
optics.pov scene. Essentially it it a spotlight shining along the Z axis
onto a mirror sitting at the origin and inclined 45 degrees. The light
source and mirror sit within a box containing media that is intended to
react to photons to produce a light scattering showing the path of the
lightbeam before and after it is reflected by the mirror.

Unfortunately, while the light beam is visible as it approaches the mirror,
it is not visible after it has been reflected by the mirror.

I have attempted to model this scene as closely as possible to the technique
that is used in optics.pov. However, I have obviously missed some detail
that eludes me :-(

Could someone point out the (hopefully obvious and glaring) problem for
me???

Cheers,

Raymond.

Scene follows:

#include "colors.inc"

#version 3.5;

#default {finish {ambient 0}}

global_settings {
    assumed_gamma 1
    max_trace_level 5
    photons {
        count 150000
        max_trace_level 9
        media 100, 2
    }
}

// Setup the camera
#declare CamPos = <0, -5, 15>;

camera {
    location CamPos
    look_at < 0, 0, 0>
    angle 35
}


// Define the light sources for the scene
// LIght coming from the camera position
light_source {CamPos, color Gray25
    photons {refraction off reflection off}
    media_interaction off
}

// Light from above the center mirror shining onto it
light_source {<0, 0, 50>, rgb < 1.2, 1, 1.5>
    spotlight radius 0.3 falloff 0.35 point_at < 0, 0, 0>
    photons {refraction off reflection on}
}

// Construct a box to contain the media which will show the path of
// the light beam as it reflects from the mirror

box {<-110,-110, -20>, <110, 110, 50> hollow
    texture {pigment {color rgbf 1}}
    interior {
        media {
            scattering {1, color White extinction 0}
            method 3
            intervals 1 samples 4
        }
    }
    photons {target}
}

// Define a mirror
// X, Y, Z: Position in space of center of mirror
// W, H, D: Width, height depth of mirror
// XR, ZR: Rotation about the X and Z axes
#macro Mirror(X, Y, Z, W, H, D, XR, ZR)
  box {<-(W/2), -(D/2), -(H/2)> <(W/2), (D/2), (H/2)>
  rotate XR*x
  rotate ZR*z
  translate <X, Y, Z>
  texture {
    pigment {color White}
    finish {ambient 0 diffuse 1 reflection 1}
}
}
#end

// Place the mirror
Mirror(0, 0, 0,
       5, 5, .1,
       -45, -45)


Post a reply to this message

From: hughes, b 
Subject: Re: Problem getting media to show photons reflected from a mirror
Date: 26 Jan 2003 05:41:56
Message: <3e33bb74@news.povray.org>
"Raymond" <ray### [at] trimbleconz> wrote in message
news:web.3e3390b894ba8eb2802871ed0@news.povray.org...
> Below is a scene that attempts to do a much simpler version of the
> optics.pov scene. Essentially it it a spotlight shining along the Z axis
> onto a mirror sitting at the origin and inclined 45 degrees. The light
> source and mirror sit within a box containing media that is intended to
> react to photons to produce a light scattering showing the path of the
> lightbeam before and after it is reflected by the mirror.
>
> Unfortunately, while the light beam is visible as it approaches the
mirror,
> it is not visible after it has been reflected by the mirror.
>
> I have attempted to model this scene as closely as possible to the
technique
> that is used in optics.pov. However, I have obviously missed some detail
> that eludes me :-(

It can be frustrating, even if you set it up as right as seems necessary,
when you see one scene file do what you can't get POV to do yourself.

Main things you have wrong is the lack of a photons block in the mirror
object and too low samples in the media. I removed the photons block from
the media container since that isn't needed (apparently). So basically what
I did is add:

  photons {
   target
   reflection on
   collect off
   }

and used intervals 4 samples 40,80. Which still wasn't enough really, and it
is already very slow. I realize intervals is supposed to be on auotpilot
whhen method 3 is used but it seems to help setting it and keeping samples
lower. Otherwise I was having to go real high on the samples (100 or more).
Oh, and I also went with a spacing 0.02; since I never use count in the
global photons block I don't know it as well.


Post a reply to this message

From: Raymond
Subject: Re: Problem getting media to show photons reflected from a mirror
Date: 27 Jan 2003 01:55:03
Message: <web.3e34d7166f090325802871ed0@news.povray.org>
hughes, b. wrote:
>It can be frustrating, even if you set it up as right as seems necessary,
>when you see one scene file do what you can't get POV to do yourself.
>
>Main things you have wrong is the lack of a photons block in the mirror
>object and too low samples in the media. I removed the photons block from
>the media container since that isn't needed (apparently). So basically what
>I did is add:
>
>  photons {
>   target
>   reflection on
>   collect off
>   }
>
>and used intervals 4 samples 40,80. Which still wasn't enough really, and it
>is already very slow. I realize intervals is supposed to be on auotpilot
>whhen method 3 is used but it seems to help setting it and keeping samples
>lower. Otherwise I was having to go real high on the samples (100 or more).
>Oh, and I also went with a spacing 0.02; since I never use count in the
>global photons block I don't know it as well.

Thanks for looking at it. I don't understand why these sorts of changes are
needed when the optics.pov doesn't have them!

After reading through the help pages on photons a few (more) times, I
figured out the optics.pov scene uses the block object as the initial
target to shoot the photons at (since POV needs at least one target for the
photons...) and since it has a pair of holes the photons can move through
the holes and form the caustics in the media.

I made the changes you mentioned, but left the photon count as it was. This
gave an interesting string of pearls media effect along the reflected
photon vector which I am guessing is due to the low sample intervals (so
how does optics do it with an interval of 1??? - maybe its due to the
adaptive sampling type).

I then found that by making the media box more tightly fit the region around
the mirror, the scene traced _much_ faster (>10x the speed) and no longer
gave the string of pearls effect, instead I got a continuous reflected
beam! Oddly though, it seems that the effect just wont work if the light
source emitting the photons is not positioned within the media box (the one
in optics.pov is not!) I can't work this one out, it's as if the sides of
the media box are somehow opaque to the photons...

Even more strange (!), is I can use no_image and no_reflection to make the
mirror almost completely disappear, except for its casting a shadow, but
adding no_shadow stops the photons from working!

<Hopefully I haven't just run into some POVRay bugs...>

Thanks again,

Raymond.


Post a reply to this message

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