POV-Ray : Newsgroups : povray.general : Scattered light Server Time
23 Apr 2024 03:22:22 EDT (-0400)
  Scattered light (Message 1 to 4 of 4)  
From: radmac
Subject: Scattered light
Date: 26 Apr 2023 10:05:00
Message: <web.64492ed0a6a4f3edfdaa0703735dc13b@news.povray.org>
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


Post a reply to this message


Attachments:
Download 'testing_scene.png' (157 KB)

Preview of image 'testing_scene.png'
testing_scene.png


 

From: Alain Martel
Subject: Re: Scattered light
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

From: Kenneth
Subject: Re: Scattered light
Date: 26 Apr 2023 19:15:00
Message: <web.6449af4f9e514ea29b4924336e066e29@news.povray.org>
As Alain mentioned, adding 'hollow' to the right-side plane will cause the
reflected spotlight to show up nicely in the media.

From playing with your code, the photon block in your 'target light source' is
apparently not needed; the result looks the same with or without it.

> 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:
> 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...

These two effects seem to be interrelated... AND related to the photons 'count'
in your global_settings block. Given a mirror size of 1, the reflected
light-spot appearing on the left plane gets sharper with a higher count--
10000000, for example. Strangely, the count also affects the result when the
mirror diameter is increased; in other words, the relative blurriness of the
light spot is an interplay between photon count and mirror size. Which is rather
odd!

It's *as if* the given count of photons is being applied to (or spread out over)
the full area of the mirror surface (not just in the area where the spotlight
cone hits the mirror.) By increasing the mirror size, there are apparently less
photons 'for use' in the unchanged spotlight cone-size...requiring a higher
'count'.

This is my guess, anyway!

Here is a simplified version of your code, to test this. Vary the photon count
vs. mirror size.

----------
#version 3.8; // or 3.7
#declare MirrorSiz = 1;   // [1 | 5 | 6]

global_settings {
   assumed_gamma 1
   ambient_light rgb 1
   max_trace_level 10
   photons {
      count 10000000 // 100000  original
      media 100, 2
   }
}

background{rgb .1*<1,.5,.5>}

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 } // [apparently not needed]
}

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   }
      }
   }
}

   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 // [apparently not needed]
         }
      }
      photons {
         target
         reflection on
      }
      rotate 90*y
      translate <2, 0, +0.0>
   }


Post a reply to this message

From: Alain Martel
Subject: Re: Scattered light
Date: 27 Apr 2023 10:12:48
Message: <644a82e0$1@news.povray.org>
Le 2023-04-26 à 19:10, Kenneth a écrit :
> As Alain mentioned, adding 'hollow' to the right-side plane will cause the
> reflected spotlight to show up nicely in the media.
> 
>  From playing with your code, the photon block in your 'target light source' is
> apparently not needed; the result looks the same with or without it.
> 

Effectively. The default for all lights, except shadowless ones that 
never emit photons, is refraction on reflection on.
The photon block of light is only needed to disable reflection or 
refraction for a given light, just as done with the ambient light.
Missed that detail.

In version prior to V3.5, it was required to add a photon block to 
light_source to enable photons shooting. That's no longer needed since 
version 3.5.

Shadowless light are a special case. Those can't ever shoot photons just 
as they never cause any phong or specular highlight.


Post a reply to this message

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