POV-Ray : Newsgroups : povray.newusers : Extinction value of scattering and mirrors Server Time
28 Mar 2024 08:01:28 EDT (-0400)
  Extinction value of scattering and mirrors (Message 1 to 10 of 12)  
Goto Latest 10 Messages Next 2 Messages >>>
From: fsv2712
Subject: Extinction value of scattering and mirrors
Date: 14 Jul 2016 10:50:00
Message: <web.5787a5c0585bcde0991518c30@news.povray.org>
Hello,
I don't know why my reflector doesn't reflect photons. With scattering and an
extinction value I should be able to see the area inside the cilindrical
reflector slightly brighter than the area outside. Furthermore, the image is the
same despite the value of "reflection" I use.

Another question. Please, could someone explain me what the extinction value
means?. Is it related to the Beer-lambert law, as I have read at the newsgroups
or only a percentage of the scattered light?

The code:
#version 3.7;

global_settings { ambient_light 0
    photons {spacing 0.1 max_trace_level 5 media 100,1 radius 0.5 autostop 0}
    assumed_gamma 1.0
}

//Container box
box {<-11,-11,-31><11,11,31> hollow
   texture {pigment {color rgb 1}}
   interior { media { scattering {1, color rgb <0.5,0.5,0.5> extinction 0.1}
method 3 intervals 1 samples 100 collect on} }
   photons {pass_through}
}

//camera
camera {orthographic location <0,0,30.5> up <0,0,1> look_at <0,0,0> angle 50}


//Source
light_source { <0,0,0> rgb <1,1,1> fade_distance 1 fade_power 2
    photons{reflection on refraction on}
}

//Reflector
cylinder {<0,0,-30> <0,0,30> 10 open clipped_by {box {<-30,-30,-40> <0,30,40>
inverse} }
    texture {pigment {color rgb<1,1,1>} finish {emission 0 ambient 0 reflection
1 diffuse 0 } }
    photons {target reflection on refraction off collect on}
}

Thanks


Post a reply to this message

From: clipka
Subject: Re: Extinction value of scattering and mirrors
Date: 14 Jul 2016 11:31:36
Message: <5787b058$1@news.povray.org>
Am 14.07.2016 um 16:46 schrieb fsv2712:

> Another question. Please, could someone explain me what the extinction value
> means?. Is it related to the Beer-lambert law, as I have read at the newsgroups
> or only a percentage of the scattered light?

The rationale behind the extinction value is that a physically realistic
scattering medium not only has a brightening component to it (the light
normally not travelling in the direction of the camera, but scattered
towards it as it passes the medium), but also a darkening component (the
light normally travelling in the direction of the camera, but scattered
away from it).

I can't say off the top of my head to what detail this effect is modeled
in POV-Ray. It definitely includes (A) attenuation of the scenery behind
the medium, and IIRC it also includes (B) attenuation of scattered light
by the medium between the point of scattering and the camera, but I
think it does not include (C) attenuation of scattered light by the
medium between the light source and the point of scattering. The reason
is that while (B) can be computed pretty much along with (A) without
much additional effort, (C) would increase the effort significantly, and
should have a comparatively low impact for the use cases the media
mechanism was designed for.

If you need realistic modeling of high-density media, SSLT is probably
the better alternative.

The default for the extinction parameter, 1, results in a realistic
balance between the brightening component and the darkening component
for purely scattering media; lower values are physically unrealistic,
while higher values can be used for media with both a scattering and
absorbing component to avoid having to explicitly specify an additional
absorbing media.


Post a reply to this message

From: Alain
Subject: Re: Extinction value of scattering and mirrors
Date: 14 Jul 2016 11:47:39
Message: <5787b41b$1@news.povray.org>

> Hello,
> I don't know why my reflector doesn't reflect photons. With scattering and an
> extinction value I should be able to see the area inside the cilindrical
> reflector slightly brighter than the area outside. Furthermore, the image is the
> same despite the value of "reflection" I use.
>
> Another question. Please, could someone explain me what the extinction value
> means?. Is it related to the Beer-lambert law, as I have read at the newsgroups
> or only a percentage of the scattered light?
>
> The code:
> #version 3.7;
>
> global_settings { ambient_light 0
>     photons {spacing 0.1 max_trace_level 5 media 100,1 radius 0.5 autostop 0}
>     assumed_gamma 1.0
> }
This looks OK
I'd remove radius 0.5. In my experience, it tend to cause some problems 
if not set exactly right.
You don't need max_trace_level 5: It's the default value.

>
> //Container box
> box {<-11,-11,-31><11,11,31> hollow
>    texture {pigment {color rgb 1}}
>    interior { media { scattering {1, color rgb <0.5,0.5,0.5> extinction 0.1}
> method 3 intervals 1 samples 100 collect on} }
>    photons {pass_through}
> }
You may want to make the box thinner, or reduce the density of your 
media. If you get pure white with only the light, the reflected photons 
can't show.
method 3 is the default and don't need to be specified.
With method 3, intervals default to 1 and must be left unchanged. Beter 
to leave that one out.

>
> //camera
> camera {orthographic location <0,0,30.5> up <0,0,1> look_at <0,0,0> angle 50}
>
>
> //Source
> light_source { <0,0,0> rgb <1,1,1> fade_distance 1 fade_power 2
>     photons{reflection on refraction on}
> }
This photons block is useless. By default, all light_source, except 
shadowless, DO emit photons.
You need the photons block to turn on the area_light option or 
specificaly turn OFF some option for that light_source.
In this case, you don't need to use light fading. A plain non-fading 
light is OK.

>
> //Reflector
> cylinder {<0,0,-30> <0,0,30> 10 open clipped_by {box {<-30,-30,-40> <0,30,40>
> inverse} }
>     texture {pigment {color rgb<1,1,1>} finish {emission 0 ambient 0 reflection
> 1 diffuse 0 } }
>     photons {target reflection on refraction off collect on}
> }
>
> Thanks
>
>

Your clipping box is exactly the same hight as your cylinder. This leads 
to coincident surfaces, in some cases, even when using "open". Make your 
box a little smaller, or the cylinder a little taller.
  cylinder {<0,0,-30.001> <0,0,30.001> 10 open...

Make absolutely sure that there are no transparent object in front of 
the light. If there is any, it need photons{pass_through} to be added.

The extinction is specific to the scattering media. It controls the 
amount of incoming light that is absorbed by the media. It's default 
value is 1 and any other value is not physically correct. In case such 
as this one, it can be set lower, even down to zero, to ignore the 
absorption and to be able to show the full path of the light and 
photons. This affect ONLY light and photons, the background remains 
unaffected by this setting.

Just as a test, try this for your reflection:
reflection{rgb<1,0,0>}
This will make a reflector that reflect only the red, that should make 
it more visible. You may also unrealistically increase the reflection 
like this:
reflection{rgb<4,0,0>}


Alain


Post a reply to this message

From: fsv2712
Subject: Re: Extinction value of scattering and mirrors
Date: 14 Jul 2016 14:35:00
Message: <web.5787dad6f6f56c36bec14beb0@news.povray.org>
Alain: I have done those changes, but it still doesn't work, and it's a simple
scene (how frustrating):

#version 3.7;

global_settings { ambient_light 0
    photons {count 1000000 media 1000,1 autostop 0}
    //subsurface {samples 10,100}
    //mm_per_unit 1
    assumed_gamma 1.0
}

//Container box
//box {<-11,-11,-31><11,11,31> hollow
box {<-70,-11,-31><11,11,31> hollow
   texture {pigment {color rgb 1}}
   interior { media { scattering {1, color rgb <0.5,0.5,0.5> extinction 0}
samples 100 collect on} }
   photons {pass_through}
   //finish {subsurface { translucency rgb <0.5,0.5,0.5> } }
   //interior {ior 1}
}

//camera
camera {orthographic location <0,0,30.5> up <0,0,1> look_at <0,0,0> angle 50}

//Source
light_source { <0,0,0> rgb <0.5,0.5,0.5> fade_distance 1 fade_power 2}

//Reflector
cylinder {<0,0,-30> <0,0,30> 10 open clipped_by {box {<-31,-31,-40> <0,31,40>
inverse} }
    texture {pigment {color rgb<5,0,0>} finish {emission 0 ambient 0
reflection{rgb<5,0,0>} diffuse 0 } }
    photons {target reflection on refraction off collect on}
}

clipka:

Thanks for the suggestion. I have tested SSLT, but, does it works with photons?
do I need them?. This scene is part of a bigger one with the light (well, more
of them), the reflector, a plano-convex cylindrical lens and a disc target,
where I'd like to measure the brightness. Perhaps I don't need to "see" the
light to obtain the measure I seek, but then, how can I be sure the behavior is
the expected and the measure is correct?.
Regarding attenuation, if, as you say, component (C) is not calculated,


Post a reply to this message

From: fsv2712
Subject: Re: Extinction value of scattering and mirrors
Date: 18 Jul 2016 07:00:00
Message: <web.578cb612f6f56c36991518c30@news.povray.org>
I have discovered the problem with the reflector, at least if it's made with an
open or hollow cylinder and a "clipped_by" instance. It's that the interior
surface of the cylinder doesn't reflect light despite the exterior surface works
OK and even if I use "interior_texture".
Does anyone knows how to solve this? Is this to be expected?


Post a reply to this message

From: fsv2712
Subject: Re: Extinction value of scattering and mirrors
Date: 18 Jul 2016 10:20:01
Message: <web.578ce527f6f56c36bec14beb0@news.povray.org>
More information about the reflector:
If I make the reflector as the difference of two cylinders plus a box, it works,
but only if the light source is displaced 2 unit out of the axis of the
reflector. I think perhaps this is a bug. See the code:

#version 3.7;

global_settings { ambient_light 0
    photons {spacing 1 max_trace_level 30 radius 5 autostop 0 media 50,1}
    assumed_gamma 1.0
}

//Container box
box {<-30,-30,-32><30,30,32> hollow
   texture {pigment {color rgb 1}}
   interior { media { scattering {1, color rgb <1,1,1> extinction 0}  method 3
intervals 1 samples 10 collect on} }
   photons {pass_through}
}

camera {orthographic location <0,0,29> sky <0,0,1> up <0,0,1> look_at <0,0,0>
angle 80}

//Light source
#declare position=2; //2--> works 1--> fail

light_source { <0,0,0> color rgb <0.4,0.4,0.4> fade_distance 1 fade_power 2
    translate <position,0,0>
}

//Reflector
difference { cylinder {<0,0,-30> <0,0,30> 12}
    cylinder {<0,0,-30.1> <0,0,30.1> 11}
    box {<-13,-13,-31><0,13,31>}
    texture {pigment {color rgb<1,0,0>} finish {emission 0 ambient 0 reflection
rgb <0.8,0,0.8> diffuse 0 } }
    interior_texture {pigment {color rgb<1,1,1>} finish {emission 0 ambient 0
reflection rgb <0.8,0,0.8> diffuse 0 } }
    photons {target reflection on refraction off}
}


Post a reply to this message

From: clipka
Subject: Re: Extinction value of scattering and mirrors
Date: 18 Jul 2016 12:33:52
Message: <578d04f0$1@news.povray.org>
Am 18.07.2016 um 16:18 schrieb fsv2712:
> More information about the reflector:
> If I make the reflector as the difference of two cylinders plus a box, it works,
> but only if the light source is displaced 2 unit out of the axis of the
> reflector. I think perhaps this is a bug. See the code:
> 
> #version 3.7;
> 
> global_settings { ambient_light 0
>     photons {spacing 1 max_trace_level 30 radius 5 autostop 0 media 50,1}
>     assumed_gamma 1.0
> }

I'm not an expert on the practical application of photons, and haven't
done much work on the photons code either, so can't give a precise
explanation of the magic behind it and why it makes your scene fail, but
your problem seems to be in the `spacing` parameter.

Note how the render statistics report the total number of stored photons
as 10 on surfaces and 28 in media. It seems plausible that they may all
happen to end up in places where they don't make much of a difference,
whether by chance or by some systematic effect emerging from the scene's
geometry.

To increase the total number of photons, and hence reduce the risk of
getting no photons at all where they're needed, reduce the `spacing`
parameter. For instance, a value of 0.1 seems small enough to make the
scene look roughly the way you seem to expect it to look like,
regardless of the `position` variable.

Alternatively, you can drop the `spacing` parameter entirely and specify
a `count` instead. To my knowledge, that's also what the people with a
knack for photons prefer.


Post a reply to this message

From: Alain
Subject: Re: Extinction value of scattering and mirrors
Date: 18 Jul 2016 14:01:00
Message: <578d195c$1@news.povray.org>

> Hello,
> I don't know why my reflector doesn't reflect photons. With scattering and an
> extinction value I should be able to see the area inside the cilindrical
> reflector slightly brighter than the area outside. Furthermore, the image is the
> same despite the value of "reflection" I use.
>
> Another question. Please, could someone explain me what the extinction value
> means?. Is it related to the Beer-lambert law, as I have read at the newsgroups
> or only a percentage of the scattered light?
>

>
> Thanks
>
>

Thinking again about this case, I usualy prefer to get away with media 
and use a plane instead as follow:
#version 3.7;

global_settings { ambient_light 0
     photons {spacing 0.1 autostop 0}
     assumed_gamma 1.0
}

//camera
camera {orthographic location <0,0,30.5> up <0,0,1> look_at <0,0,0> 
angle 50}

//Source
light_source { <0,0,0> rgb <1,1,1>
  looks_like{sphere{ 0, 0.1 pigment{<rgb<0,1,0>}
  finish{emission 1}photons{pass_through}}}
//make the light's position visible
// Purely optionnal, good for debugging
}

//Reflector
cylinder {<0,0,-30> <0,0,30> 10 open clipped_by {box {<-30,-30,-40> 
<0,30,40>
inverse} }
     texture {pigment {color rgb<1,1,1>} finish {emission 0 ambient 0 
reflection
1 diffuse 0 } }
     photons {target reflection on refraction off collect on}
}

plane{z, -10
  pigment{rgb 0.5}
  finish{ambient 0 diffuse 0.5
    brilliance 0 // The "magic trick" is here
  }
}

With brilliance set to zero, the illumination becomes independent on the 
incident angle of the incoming light. If the light can reatch a point, 
that point get full illumination.
I've set the pigment to 0.5 so that you don't get pure white everywhere. 
You can also reduce the diffuse value if you get an image that is to bright.

This is also much faster to render than using media.
If you still want to use media, you may try to add hollow to your 
reflector. Maybe it's considered as a non-hollow object, even if it's 
open, killing media inside and interfering with the photons.
It's just a guess as I only very rarely use clipped_by for anything.

Another thing that I tend to use in a similar case is to use a 
difference of 2 cylinders to get a shell:
difference{
  cylinder {<0,0,-30> <0,0,30> 10.15}// Slightly larger outer part
  cylinder {<0,0,-30.01> <0,0,30.01> 10}// Inner surface
  box{<-10.15, 0, -30.01><10.15, 10.15, 30.01>}// Keep upper half
  texture {pigment {color rgb<1,1,1>}
  finish {emission 0 ambient 0 reflection 1 diffuse 0 } }
  photons {target reflection on refraction off collect on}
}



Alain


Post a reply to this message

From: Jaime Vives Piqueres
Subject: Re: Extinction value of scattering and mirrors
Date: 18 Jul 2016 14:07:18
Message: <578d1ad6$1@news.povray.org>

> I'm not an expert on the practical application of photons, and
> haven't done much work on the photons code either, so can't give a
> precise explanation of the magic behind it and why it makes your
> scene fail, but your problem seems to be in the `spacing` parameter.

   Yes, it seems to be a case of "not enough photons". Just using spacing
.1 gives a "better result":

Number of photons shot:            1265
Surface photons stored:             630
Media photons stored:             20351


   With spacing 1 it was only getting a few photons:

Number of photons shot:              21
Surface photons stored:              10
Media photons stored:                28


--
jaime


Post a reply to this message

From: fsv2712
Subject: Re: Extinction value of scattering and mirrors
Date: 19 Jul 2016 11:35:00
Message: <web.578e47e9f6f56c36bec14beb0@news.povray.org>
I can decrease spacing to 0.000000001 or increase the count value. But no matter
how I construct the reflector, it doesn't reflect light if the light source is
placed at his axis or very near it.

Furthermore, if I use a plane instead of media the problem remains.

What draws my attention is that with this geometry for the scene, the number of
photons shot is always 5 despite the value of spacing or count.


Post a reply to this message

Goto Latest 10 Messages Next 2 Messages >>>

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