POV-Ray : Newsgroups : povray.binaries.images : Refraction is iffy through media : Re: Refraction is iffy through media Server Time
5 Jul 2024 08:59:38 EDT (-0400)
  Re: Refraction is iffy through media  
From: William F Pokorny
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


 

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