POV-Ray : Newsgroups : povray.general : Scattered light : Re: Scattered light Server Time
5 Oct 2024 15:34:28 EDT (-0400)
  Re: Scattered light  
From: Alain Martel
Date: 26 Apr 2023 15:15:40
Message: <6449785c$1@news.povray.org>
Le 2023-04-26 à 10:01, radmac a écrit :
> I have a scene (see at the bottom) where light travels through scattering media
> until it hits the wall, or it is reflected by mirror to the opposite wall.
> 
> If no mirror and no right wall is present (see image a) in attached
> test_scene.png), the scene looks as expected.
> 
> If, however, the right wall is added, the scattering disappears (see image b).
> 
> Next, I can add mirror to reflect the light to opposite wall. Again, since there
> is the wall on the right the scattering is not visible, but on the top of that,
> the spot on left wall is not as sharp as non-reflected one (see image c) and
> compare it with image b).
> 
> I can now remove the right wall to visualize the scattering again to make sure
> the light is not diffracted on the edge of the mirror (see image d).
> 
> Finally, I can enlarge the mirror (in transverse direction only; right wall is
> added again to suppress the scattering to see the spot on the left wall) to see
> that it affects the spot shape in way I have difficulty to understand (see image
> f) and compare it with image c).
> 
> The very final step was to enlarge the mirror even further, when the reflected
> spot disappears completely (see image f).
> 
> So to summarize I would like to understand:
> 1) Why is scattering affected by other objects presented in the scene.
> 2) Why is the transverse profile of reflected spot different from the direct
> one, and how to recover the initial profile (this is the main issue I have).
> 3) Why the size of the mirror matters and why the light disappears for large
> enough mirror (this is not really an issue, that affects me, just curiosity).
> 
> 
> Scene in question:
> 
> #declare AddMirror = off; // [on | off]
> #declare AddPlane  = off; // [on | off]
> #declare MirrorSiz = 1;   // [1 | 5 | 6]
> 
> global_settings {
>     ambient_light rgb 1
>     max_trace_level 10
>     photons {
>        count 100000
>        media 100, 2
>     }
> }
> 
> camera {
>     location <0, 0, -10>
>     look_at  <0, 0,   0>
> }
> 
> light_source { // ambient light
>     <0, 10, 0>
>     color rgb 1
>     photons {
>        reflection off
>        reflection off
>     }
>     media_interaction off
> }
> 
> plane { // left side plane
>     x, -5
>     pigment { color rgb 0.7 }
>     photons { collect on    }
> }
> 
> #if (AddPlane)
>     plane { // right side plane
>        x, +5
>        pigment { color rgb 0.7 }
>        photons { collect on    }
>     }
> #end
> 
> cylinder { // scattering media
>     <-5.1, 0, 0>,
>     <+5.1, 0, 0>,
>     3
>     pigment {rgbf 1}
>     hollow
>     interior {
>        ior           1
>        fade_distance 0
>        fade_power    0
>        media {
>           absorption 0
>           emission   0
>           scattering {
>              1, 1
>              extinction 0
>           }
>           samples 100
>        }
>     }
>     photons {pass_through}
> }
> 
> light_source { // target light source
>     <0, 0, 0>
>     color rgb <0, 1, 0>
>     spotlight
>     radius  10
>     falloff 10
>     point_at <1, 0, 0>
>     looks_like {
>        sphere {
>           <0, 0, 0>,
>           0.1
>           pigment { color rgb 1 }
>           finish  { ambient 1   }
>        }
>     }
>     photons {
>        reflection on
>        refraction on
>     }
> }
> 
> #if (AddMirror)
>     cylinder { // mirror
>        0, 0.5*z, MirrorSiz
>        texture {
>           pigment {color rgb 1}
>           finish {
>              reflection 1.0
>              ambient    0.0
>              diffuse    0.0
>              specular   1.0
>           }
>        }
>        photons {
>           target
>           reflection on
>        }
>        rotate 90*y
>        translate <2, 0, +0.0>
>     }
> #end

ALL planes have an interior and an exterior. Media can not exist inside 
a non hollow object.
The interior of the plane to the right is everything to it's left, or, 
the entirety of your scene.
Change that plane as follow :
#if (AddPlane)
    plane { // right side plane
       x, +5
       pigment { color rgb 0.7 }
       //photons { collect on    } not needed as it is the default.
     hollow
     // using inverse is also a viable option in this case
    }
#end
Another option :
#if (AddPlane)
    plane { // right side plane
       -x, -5
       pigment { color rgb 0.7 }
       photons { collect on    }
    }
#end

Not sure about what happen with the huge mirror. Scaling it up should 
not have any effect.

It must be noted that the reflected photons always tend to be fuzzier 
than the direct illumination.
Increasing the count, or reducing the spacing, usually help.
Personally, I prefer using spacing over count.



Some nit picking regarding your media...
  interior {
       ior           1 // default value, should be removed
       fade_distance 0 // also default
       fade_power    0 // also default
       media {
          absorption 0 // another default default value
          emission   0 // Same.
          scattering {
             1, 1
             extinction 0
          }
          samples 100
       }

Becomes :
  interior {
       media {
          scattering {
             1, 1
             extinction 0
          }
          samples 100
       }
    }

Much easier to read and maintain.


Post a reply to this message

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