POV-Ray : Newsgroups : povray.newusers : Reflection, Refraction & Scattering : Re: Reflection, Refraction & Scattering Server Time
28 Sep 2024 18:01:39 EDT (-0400)
  Re: Reflection, Refraction & Scattering  
From: Alain
Date: 24 Jan 2012 23:05:17
Message: <4f1f7f7d@news.povray.org>

> Hi, I'm still pretty new to povray and I need some help please - I am trying to
> model reflection and refraction of a cylinder beam that is incident on a glass
> slab. My goal is to get accurate reflection and transmission based on ior values
> - with the multiple reflections from the front and back surfaces of the glass
> slab being included (exluding inteference effects). Therefore I will eventually
> turn off scattering but at the moment I'd like to use it to check that the
> reflected and refracted beams are going where I think they should be in both the
> air and the glass layer. Then I will look at their brightness once scattering is
> turned off to check that the reflected/transmitted intensities are correct.
>
> I have copied my code below which doesnt quite work correctly. The first problem
> is that I cant see the glass layer (I wasn't sure how best to make this visible
> without affecting the accuracy of the simulation too much). The next issue is
> that I only see the first refracted ray inside the glass. I dont see the first
> reflection from the front surface, or the second reflection and so on. I put the
> rgb level of the light to 100,0,0 because the reflectance will only be a few
> percent - I hoped setting the rgb so high would enable me to see the
> reflectance. I copied the photon settings from another example on this site...
> it may be overkill because it seems to be very slow to render. Also the
> scattering at the exit of the glass slab looks a bit strange.
>
> Some guidance on how to improve things would be really appreciated! Also any
> tips on ensuring accurate results in this kind of simulation would be great too.
> Thanks.
>

To make the glass visible, you need to decrease the transmit value a little.
Try: rgbt<1,1,1,0.9>
This will also slightly dimish the transmited light intensity. You can 
slightly increase the light's intensity to compensate.
You may also add a faint fill light:
light_source{<0,0,-150> rgb<0, 0.01, 0.03> shadowless}
//slightly blueish to have some contrast with your red light. Red is 
your light, blue is fill light.

A shadowless light never cast photons and don't generate any highlight.

Your light_source don't need any photons block. The default is 
{reflection on refraction on}
You only need it if you want to disable reflection or refraction or 
enable an area_light for the photons.
If you want the photons to remain parallel and not spread, add 
"parallel" to your light_source.

In your glass finish, you have this:
finish {reflection {fresnel on} conserve_energy }

You need to add the minimal and maximal reflection values. As it is now, 
it's as if it was this:
finish {reflection 0,0 {fresnel on} conserve_energy }
Meaning NO reflection at all.

It should be
finish {reflection 0,1 fresnel conserve_energy }

fresnel works by it presence alone, you don't need any value after it. 
It don't need to be enclosed in braces.

Your Scatter_M media should be as follow:
#declare Scatter_M =
   material {
     texture {
       pigment { rgbt 1 }
       finish {
         ambient 0
         diffuse 0
       }
     }
     interior {
       media {
         method 3
// NO intervals entry needed, MUST stay at the default value of 1.
         samples 70
// ONLY the first value is ever used.
// The second value, if present, is silently ignored.
// Adjust that value up or down as needed.
         scattering {
           1, rgb 0.1
           extinction 0.00001
// That extinction value is not realistic but correct for this use.
// A beter value in THIS case would be: extinction 0
// Advantage: faster rendering.
         }
       }
     }
   }

If you want the beam to be visible inside the glass, you need to allow 
the media to exist inside the glass object. Add hollow to the glass object.
object{glasslayer hollow}



Anothe raproach is as follow:
Don't use any media.
Shine your light through a slit. Use 2 box placed in front of the light. 
Make the light broader. Be sure to use parallel.
Place a white plane across the view. It will replace the media.
Make the light go slightly toward that plane.
Your light_source can look like this:
#declare Light_Distance = 100;
// Place the light farther away.
light_source{ <Light_Distance,Light_Distance,10> color rgb <100,0,0>*30
               cylinder parallel
               point_at<0, 0, 0>
               radius 10
               falloff 0.5
               tightness 10
             }
The slit can look like this:
union{box{<Light_Distance-0.5,1000,20><Light_Distance-0.6,0.1,-20>}
box{<Light_Distance-0.5,-1000,20><Light_Distance-0.6,-0.1,-20>}}
It don't need any texture as it's not part of the visible scene.

You can make an union of the light_source and the boxes. It makes things 
easier if you want to change the direction of the light with a rotation 
or translation.

This make a light sheet shining on your glass object.
The plane will make the light's path visible.
It's *much* faster than using media.





Alain


Post a reply to this message

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