POV-Ray : Newsgroups : povray.binaries.images : Refraction is iffy through media Server Time
31 Oct 2024 22:24:19 EDT (-0400)
  Refraction is iffy through media (Message 1 to 4 of 4)  
From: Cousin Ricky
Subject: Refraction is iffy through media
Date: 24 Oct 2014 15:14:09
Message: <544aa501$1@news.povray.org>
In POV-Ray 3.7, when a cylindrical beam of light is passed through a 
refracting object in a media environment with photons enabled, sometimes 
the beam is split into two parts, one of which is refracted and the 
other not.  This did not happen in POV-Ray 3.6.

(If photons are not enabled, the beam does not show any refraction at 
all in the media, whether in 3.7 or 3.6.)

The following code illustrates the problem:
____________________________________________________________________

#version 3.6; //[sic]

global_settings
{ assumed_gamma 1
   max_trace_level 15
   photons { spacing 0.005 autostop 0 media 200 }
}

camera
{ orthographic
   location -28 * z
   right 28 * x
   up 21 * y
}

// Medium to reveal the path of the light beam:
box
{ -0.5, 0.5 hollow
   scale <28, 21, 0.1005>
   pigment { rgbt 1 }
   finish { specular 0 reflection 0 }
   interior
   { media
     { scattering { 1, 1 extinction 0 }
       samples 3, 3
       aa_level 2
     }
   }
   photons { pass_through collect off }
}

// The light beam:
light_source
{ <-10, -10, 0>, rgb 10
   cylinder radius 0.025 falloff 0.05 point_at 0
   parallel point_at 0
}

// Refracting block:
box
{ -1, 1 scale <5, 10, 0.05>
   hollow
   pigment { rgbf 1 }
   finish { reflection { 0 1 fresnel } conserve_energy specular 0.2 }
   interior { ior 1.5 }
   photons { target refraction on reflection on collect off }
}

// Environmental light to make the refracting block visible:
light_source
{ <-1, 1, -1> * 28000, rgb 1
   parallel point_at 0
   media_interaction off
   photons { reflection off refraction off  }
}
____________________________________________________________________

The images split_beam_37bug-36run.png and split_beam_37bug-37run.png 
show this file rendered in POV-Ray 3.6.1 and 3.7, respectively.

Oddly enough, the test scene for BeamTest (in the Object Collection) 
renders perfectly, but anything else I try--even slight modifications to 
the BeamTest test scene--reveals the problem.

POV-Ray version: POV-Ray 3.7.0
Operating system: openSUSE 13.1 GNU/Linux
Hardware: Dell Inspiron 17R, Intel Core i7


Post a reply to this message


Attachments:
Download 'split_beam_37bug-36run.png' (5 KB) Download 'split_beam_37bug-37run.png' (5 KB)

Preview of image 'split_beam_37bug-36run.png'
split_beam_37bug-36run.png

Preview of image 'split_beam_37bug-37run.png'
split_beam_37bug-37run.png


 

From: William F Pokorny
Subject: Re: Refraction is iffy through media
Date: 24 Oct 2014 21:08:06
Message: <544af7f6$1@news.povray.org>
On 10/24/2014 03:14 PM, Cousin Ricky wrote:
> In POV-Ray 3.7, when a cylindrical beam of light is passed through a
> refracting object in a media environment with photons enabled, sometimes
> the beam is split into two parts, one of which is refracted and the
> other not.  This did not happen in POV-Ray 3.6.
>
> (If photons are not enabled, the beam does not show any refraction at
> all in the media, whether in 3.7 or 3.6.)
>
> The following code illustrates the problem:
...
>
> The images split_beam_37bug-36run.png and split_beam_37bug-37run.png
> show this file rendered in POV-Ray 3.6.1 and 3.7, respectively.
>
> Oddly enough, the test scene for BeamTest (in the Object Collection)
> renders perfectly, but anything else I try--even slight modifications to
> the BeamTest test scene--reveals the problem.
>
> POV-Ray version: POV-Ray 3.7.0
> Operating system: openSUSE 13.1 GNU/Linux
> Hardware: Dell Inspiron 17R, Intel Core i7
I was able to render the attached image by making the changes outlined 
in the in-lined patch file. Indeed it looks like we need collect to be 
on in the refraction block and this doesn't match the recommendation in 
the documentation for glass-like objects as I understand it.

This wasn't the only cause for the extra beam as part of it seemed to be 
coming from the refracting box being scaled inside the media box ever so 
slightly. I set the scale so it was well outside the media box.

The thin, full white rays I think were due the falloff value <1.0 for 
the light. Further, I got some very strange thicker all white 
light-traces after some surface transitions different & wider than your 
image. Anything >1.0 for the falloff seems to work - not sure why this 
is. Oh, and you left in a point_at and so had one before and after your 
parallel statement. The parallel keyword is supposed to come before any 
point_at.

Bill P.

--------------- Start cut for patch here --------------------------
25c25
<      { scattering { 1, 1 extinction 0 }
---
 >      { scattering { 1, 1 extinction 0.05 }
35,36c35,36
< { <-10, -10, 0>, rgb 10
<    cylinder radius 0.025 falloff 0.05 point_at 0
---
 > { <-10, -10, 0>, rgb 1
 >    cylinder radius 0.025 falloff 1.25
42c42
< { -1, 1 scale <5, 10, 0.05>
---
 > { -1, 1 scale <5, 10, 5.05>
45c45
<    finish { reflection { 0 1 fresnel } conserve_energy specular 0.2 }
---
 >    finish { reflection { 0.1 0.9 fresnel } conserve_energy }
47c47
<    photons { target refraction on reflection on collect off }
---
 >    photons { target refraction on reflection on collect on }
50,56c50,56
< // Environmental light to make the refracting block visible:
< light_source
< { <-1, 1, -1> * 28000, rgb 1
<    parallel point_at 0
<    media_interaction off
<    photons { reflection off refraction off  }
< }
---
 > // // Environmental light to make the refracting block visible:
 > // light_source
 > // { <-1, 1, -1> * 28000, rgb 1
 > //    parallel point_at 0
 > //    media_interaction off
 > //    photons { reflection off refraction off  }
 > // }
----------------- End cut for patch here --------------------------


Post a reply to this message


Attachments:
Download 'better.jpg' (7 KB)

Preview of image 'better.jpg'
better.jpg


 

From: William F Pokorny
Subject: Re: Refraction is iffy through media
Date: 29 Oct 2014 18:16:04
Message: <54516724$1@news.povray.org>
On 10/24/2014 09:08 PM, William F Pokorny wrote:
> Problems with photons and cylinder lights...
>

I was searching this evening for something unrelated and stumbled across 
a bug report from Gilles Tran in 2003 and pretty quickly found another 
report with a search. Again for me keeping the falloff >=1.0 seemed to 
help quite a bit but it perhaps doesn't fix everything. Both reports had 
the falloff <1.0 as did the original code in this thread.

Documenting these older reports for the record I guess... The 2003 
report especially lines up with what I was seeing with the falloff <1.0. 
Perhaps something long not quite right/solid with cylinder lights and 
photons.

2003...
http://news.povray.org/povray.binaries.images/thread/%3C3ec0b590%40news.povray.org%3E/?ttop=396979&toff=6450


2005...
http://news.povray.org/povray.newusers/thread/%3Cweb.41eb3fbd2fb492d13fd15e00@news.povray.org%3E/

Bill P.


Post a reply to this message

From: Cousin Ricky
Subject: Re: Refraction is iffy through media
Date: 30 Oct 2014 17:55:01
Message: <web.5452b347fd6ad054192ae5f10@news.povray.org>
William F Pokorny <ano### [at] anonymousorg> wrote:
> I was able to render the attached image by making the changes outlined
> in the in-lined patch file. Indeed it looks like we need collect to be
> on in the refraction block and this doesn't match the recommendation in
> the documentation for glass-like objects as I understand it.

Collect on does the trick.  Mysterious.  Perhaps the dev team can shed light on
this, but they haven't weighed in yet.  (My days of heavy-duty coding seem to be
over; I cannot take the stress.)

None of your other changes were necessary, nor were they sufficient in my tests.

You shall get a shout out in the next update of BeamTest.


Post a reply to this message

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