POV-Ray : Newsgroups : povray.binaries.images : Media photons artifact Server Time
15 Nov 2024 03:21:42 EST (-0500)
  Media photons artifact (Message 1 to 5 of 5)  
From: Bruno Cabasson
Subject: Media photons artifact
Date: 24 Oct 2006 04:50:01
Message: <web.453dd34a9442a68ff5fba6ef0@news.povray.org>
Hello POVers!

Here is an attempt to media photons with refraction and reflection for my
own education. The result is quite satisfactory, but an artifact appears.
If follows the radius of the cylinder light. I tried many settings and
combinations, in vain. The artifact still remains. Any idea?

     Thanks.

The code is small enough I can put it hereafter.

// Persistence of Vision Ray Tracer Scene Description File
// File: ?.pov
// Vers: 3.5
// Desc: Basic Scene Example
// Date: mm/dd/yy
// Auth: ?
//

#version 3.5;

#include "colors.inc"


#declare LIGHT_RADIUS = 1/2;
#declare PHOTON_SPACING = 1/100;
#declare PHOTON_MEDIA = 80;


global_settings {
  assumed_gamma 1.0
  max_trace_level 10
  photons {spacing PHOTON_SPACING media PHOTON_MEDIA jitter 1}
}

// ----------------------------------------

camera {
  location  <0.0, 0.0, 0.0>
  direction 1.5*z
  right     x*image_width/image_height
  look_at   <0.0, 0.0,  1.0>
  translate -12*z
  rotate 85*x
  translate -z

}

light_source {
  -200*z
  color rgb 1*<1, 1, 1>  // light's color
  cylinder radius LIGHT_RADIUS falloff LIGHT_RADIUS point_at 0
  photons {refraction on reflection on}
}
// ----------------------------------------

#declare O_Background = sphere
{
    0, 1
    hollow
    pigment {color 0.05*White}
    scale 100000
}

#declare O_Mirror = union
{
    box {-1, 1 pigment {rgb 1} finish {reflection 1 ambient 0 diffuse 0
specular 0}}
    box {-1.05, 1.05 translate 0.06*z pigment {Yellow}}
    scale 0.1*z
}

#declare O_Lens = union
{
    intersection
    {
      sphere {0.0, 2 translate 1.8*z}
      sphere {0.0, 2 translate -1.8*z}
      //hollow
      pigment {rgbt 1}
      finish {diffuse 0 ambient 0}
      interior {ior 1.5 fade_color Red fade_distance 0.2 fade_power 1001}
    }
}

#declare O_MediaContainer = box
{
    -1, 1 scale LIGHT_RADIUS*y
    pigment {rgbt 1}
    hollow
    scale 5
    interior {media {samples 20*PHOTON_MEDIA*PHOTON_SPACING scattering {1,
0.3*White extinction 0}}}
}

object {O_Background}
object {O_Mirror scale 2 rotate 60 *y}

object {O_MediaContainer photons {target}}
object {O_Lens translate -4*z photons {target collect off refraction on
reflection on}}



// "Artifact" label
#declare O_Arrow = union
{
    cylinder {0, z, 1/20}
    cone {0, 1/6, z/2, 0 translate z}
}

#declare O_Label = text
{
    ttf "arial.ttf" "Artifact"
    0.1, 0
    rotate 90*x
}

union
{
    object {O_Arrow rotate 30*y translate z + 3*x}
    object {O_Label}
    pigment {Yellow}
    finish {diffuse 0 ambient 1}
    scale 1/3
    translate -1.77*x -1.3*z
}


Post a reply to this message


Attachments:
Download 'mediaphotons.jpg' (30 KB)

Preview of image 'mediaphotons.jpg'
mediaphotons.jpg


 

From: dlm
Subject: Re: Media photons artifact
Date: 25 Oct 2006 00:11:11
Message: <453ee3df$1@news.povray.org>
First let me say that I am no expert on this!
May I suggest that this artefact may be the result of your cylinder light 
source.
Try changing its radius. Does that move the shadow edge?
also rotating your view by adding "rotate 85*z" at the end of your camera 
block will reveal that you have two parallel lines - and that looks like a 
cylinder to me.
As a matter of interest why are you using a red lens rather than red light?
Is that just the fun part of this neat optical workbench?
DLM

"Bruno Cabasson" <bru### [at] alcatelaleniaspacefr> wrote in message 
news:web.453dd34a9442a68ff5fba6ef0@news.povray.org...
> Hello POVers!
>
> Here is an attempt to media photons with refraction and reflection for my
> own education. The result is quite satisfactory, but an artifact appears.
> If follows the radius of the cylinder light. I tried many settings and
> combinations, in vain. The artifact still remains. Any idea?
>
>     Thanks.
>
> The code is small enough I can put it hereafter.
>
> // Persistence of Vision Ray Tracer Scene Description File
> // File: ?.pov
> // Vers: 3.5
> // Desc: Basic Scene Example
> // Date: mm/dd/yy
> // Auth: ?
> //
>
> #version 3.5;
>
> #include "colors.inc"
>
>
> #declare LIGHT_RADIUS = 1/2;
> #declare PHOTON_SPACING = 1/100;
> #declare PHOTON_MEDIA = 80;
>
>
> global_settings {
>  assumed_gamma 1.0
>  max_trace_level 10
>  photons {spacing PHOTON_SPACING media PHOTON_MEDIA jitter 1}
> }
>
> // ----------------------------------------
>
> camera {
>  location  <0.0, 0.0, 0.0>
>  direction 1.5*z
>  right     x*image_width/image_height
>  look_at   <0.0, 0.0,  1.0>
>  translate -12*z
>  rotate 85*x
>  translate -z
>
> }
>
> light_source {
>  -200*z
>  color rgb 1*<1, 1, 1>  // light's color
>  cylinder radius LIGHT_RADIUS falloff LIGHT_RADIUS point_at 0
>  photons {refraction on reflection on}
> }
> // ----------------------------------------
>
> #declare O_Background = sphere
> {
>    0, 1
>    hollow
>    pigment {color 0.05*White}
>    scale 100000
> }
>
> #declare O_Mirror = union
> {
>    box {-1, 1 pigment {rgb 1} finish {reflection 1 ambient 0 diffuse 0
> specular 0}}
>    box {-1.05, 1.05 translate 0.06*z pigment {Yellow}}
>    scale 0.1*z
> }
>
> #declare O_Lens = union
> {
>    intersection
>    {
>      sphere {0.0, 2 translate 1.8*z}
>      sphere {0.0, 2 translate -1.8*z}
>      //hollow
>      pigment {rgbt 1}
>      finish {diffuse 0 ambient 0}
>      interior {ior 1.5 fade_color Red fade_distance 0.2 fade_power 1001}
>    }
> }
>
> #declare O_MediaContainer = box
> {
>    -1, 1 scale LIGHT_RADIUS*y
>    pigment {rgbt 1}
>    hollow
>    scale 5
>    interior {media {samples 20*PHOTON_MEDIA*PHOTON_SPACING scattering {1,
> 0.3*White extinction 0}}}
> }
>
> object {O_Background}
> object {O_Mirror scale 2 rotate 60 *y}
>
> object {O_MediaContainer photons {target}}
> object {O_Lens translate -4*z photons {target collect off refraction on
> reflection on}}
>
>
>
> // "Artifact" label
> #declare O_Arrow = union
> {
>    cylinder {0, z, 1/20}
>    cone {0, 1/6, z/2, 0 translate z}
> }
>
> #declare O_Label = text
> {
>    ttf "arial.ttf" "Artifact"
>    0.1, 0
>    rotate 90*x
> }
>
> union
> {
>    object {O_Arrow rotate 30*y translate z + 3*x}
>    object {O_Label}
>    pigment {Yellow}
>    finish {diffuse 0 ambient 1}
>    scale 1/3
>    translate -1.77*x -1.3*z
> }
>


Post a reply to this message

From: Bruno Cabasson
Subject: Re: Media photons artifact
Date: 25 Oct 2006 06:05:01
Message: <web.453f361b351eacd7f5fba6ef0@news.povray.org>
It was just experimenting.

I fixed the problem: I have to specify 'media_interaction off' for my
light_source. By doing this the white part of the beam before the lens (not
refracted yet) disappears. Apparently, no photons are deposited in this area
if the light has not been refracted (or reflected, I guess), I can't see
exactly why. Thus, I had to put a thin cylinder of glass with 'target' and
'refraction on' for photons in front of the light_source.

cylinder
{
  0, 0.01*z, 1.2*LIGHT_RADIUS
  hollow
  pigment {rgbt 1}
  interior {ior 1.0}
  translate -5*z
  photons {target collect off refraction on reflection on}
}

What this experiment tends to show is that photons are deposited in media
only if the light has been already refracted or reflected at least once
before reaching the current location. Am I right?

But this does not explain the artifact in the first case (with
'media_interaction on'). Could it be an 'extinction' side-effect of the
media though I specified zero?

I also noticed that, when using media photons and in the sorting phase of
the parse, the status bar displays a wrong number of sorted photons.


I join here another experiment. I am quite happy with the path of the red
beam in the first lens. However, I wonder why there is a gap between the
incident rays and relected rays on the mirrors. Suggestions welcome. And
there is something strange at the end where the remaning beams converge.


Post a reply to this message


Attachments:
Download 'experiment.png' (139 KB)

Preview of image 'experiment.png'
experiment.png


 

From: Alain
Subject: Re: Media photons artifact
Date: 25 Oct 2006 19:44:29
Message: <453ff6dd$1@news.povray.org>
Bruno Cabasson nous apporta ses lumieres en ce 25/10/2006 06:02:
> It was just experimenting.
> 
> I fixed the problem: I have to specify 'media_interaction off' for my
> light_source. By doing this the white part of the beam before the lens (not
> refracted yet) disappears. Apparently, no photons are deposited in this area
> if the light has not been refracted (or reflected, I guess), I can't see
> exactly why. Thus, I had to put a thin cylinder of glass with 'target' and
> 'refraction on' for photons in front of the light_source.
Photons are not computed before the first reflection or passage thrue the first 
transparent object with a target photon item. This save rendering time.
> 
> cylinder
> {
>   0, 0.01*z, 1.2*LIGHT_RADIUS
>   hollow
Not needed, don't have any effect.
>   pigment {rgbt 1}
>   interior {ior 1.0}
Here, you don't need interior. ior 1 is the default value.
>   translate -5*z
>   photons {target collect off refraction on reflection on}
> }
> 
> What this experiment tends to show is that photons are deposited in media
> only if the light has been already refracted or reflected at least once
> before reaching the current location. Am I right?
You are.
> 
> But this does not explain the artifact in the first case (with
> 'media_interaction on'). Could it be an 'extinction' side-effect of the
> media though I specified zero?
It's the edges of the light's cylinder.
> 
> I also noticed that, when using media photons and in the sorting phase of
> the parse, the status bar displays a wrong number of sorted photons.
> 
> 
> I join here another experiment. I am quite happy with the path of the red
> beam in the first lens. However, I wonder why there is a gap between the
> incident rays and relected rays on the mirrors. Suggestions welcome. And
> there is something strange at the end where the remaning beams converge.
> 
> 
> ------------------------------------------------------------------------
> 
By default, there are 7 dispersion samples and you have 7 beams. Try increasing 
dispersion_samples.
You mean the black strip cuting the light after the second lens? Don't know.

-- 
Alain
-------------------------------------------------
Don't let your mind wander -- it's too little to be let out alone.


Post a reply to this message

From: Kenneth
Subject: Re: Media photons artifact
Date: 26 Oct 2006 02:10:00
Message: <web.454050bd351eacd7870dc4da0@news.povray.org>
"Bruno Cabasson" <bru### [at] alcatelaleniaspacefr> wrote:
> Hello POVers!
>
> Here is an attempt to media photons with refraction and reflection for my
> own education. The result is quite satisfactory, but an artifact appears.
> If follows the radius of the cylinder light...

I recently came across a problem --it's a bug of some sort--that might be
related to yours, having to do with spotlights and cylinder lights causing
strange problems with media in an object.  I posted a discussion here...

http://news.povray.org/povray.general/thread/%3Cweb.45125ba9d84b4b77cc29cf380%40news.povray.org%3E/

Like you, I found that the only soution was to turn off media_interaction in
the lights.

Ken W.


Post a reply to this message

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