POV-Ray : Newsgroups : povray.bugreports : wierd refraction with multiple layer glass Server Time
31 Oct 2024 10:22:03 EDT (-0400)
  wierd refraction with multiple layer glass (Message 1 to 4 of 4)  
From: CAD-Andi
Subject: wierd refraction with multiple layer glass
Date: 10 Nov 2010 13:00:00
Message: <web.4cdadc9e3526c868bf952ed30@news.povray.org>
I probably wouldn't call this a bug, but this behaviour is kinda wierd. Just
wanted to throw this one out to the community to prevent other people from
running into the same issue.

I was trying to simulate multi layer glass like used for large aquariums or for
bullet proof glass.

Problem:
When Creating two transparent boxes that are 100% adjacent to each other the
refraction gets calculated wrong. I don't know exactly what is going on, the
light gets somehow refracted permanently into a really wierd direction.

Solution:
A small gap between the two sheets of glass solves the problem.

Does anyone have a explaination or a better solution for this?

Thanks!
Andi


Here a short example script for illustration:

#CODE##########################################################################

global_settings {max_trace_level 256}
camera {right x*image_width/image_height location  <0,1.6,-3> look_at   <0,0,0>}
light_source { <500,500,150> color rgb 1.3 }
plane { y, -1.1 texture { pigment { checker color rgb 1 color rgb <0,0,0> scale
0.5} finish{ diffuse 0.8ambient 0.1 }}}

#declare frame=
difference {
box {
  <-.65, -1.05, 0> < .65,  1.05,  .2>
    material { texture {pigment {rgb 0.2}}}
    }
box {
  <-.6, -1., -.1> < .6,  1.,  .4>
    material { texture {pigment {rgb 0.2}}}
    }
}

#declare sheet=
box {
  <-.6, -1, 0> < .6,  1,  .1>
    material {
       texture {pigment {rgbt 1} finish { ambient 0.0 diffuse 0.05 specular 0.6
roughness 0.005
       reflection { 0.001, .1 fresnel on } conserve_energy}}
       interior { ior 1.5 fade_power 1001 fade_distance 0.9 fade_color
<0.5,0.8,0.6>}
             }
}

// 0 distance between two glass sheets of double layer window
union{
object {frame}
object {sheet}
object {sheet translate <0,0,.1>}
rotate <0,-30,0>
translate <-.8,0,0>
}

// with tiny gap of 0.0001 in between
union{
object {frame}
object {sheet}
object {sheet translate <0,0,.1001>}
rotate <0,30,0>
translate <0.8,0,0>
}


Post a reply to this message

From: Warp
Subject: Re: wierd refraction with multiple layer glass
Date: 10 Nov 2010 13:31:28
Message: <4cdae4ff@news.povray.org>
CAD-Andi <nomail@nomail> wrote:
> When Creating two transparent boxes that are 100% adjacent to each other the
> refraction gets calculated wrong. I don't know exactly what is going on, the
> light gets somehow refracted permanently into a really wierd direction.

> Solution:
> A small gap between the two sheets of glass solves the problem.

  Coincident surfaces tend to cause problems (and not only in povray, nor
even only in raytracing, but rendering in general).

-- 
                                                          - Warp


Post a reply to this message

From: Kenneth
Subject: Re: wierd refraction with multiple layer glass
Date: 12 Nov 2010 16:30:00
Message: <web.4cddb0f59b8869be196b08580@news.povray.org>
"CAD-Andi" <nomail@nomail> wrote:

> Solution:
> A small gap between the two sheets of glass solves the problem.
>
> Does anyone have a explaination or a better solution for this?
>

I wonder what the effect would be is you moved one pane slightly *into* the
other one? Assuming that they are not in a CSG merge, thus keeping the multiple
surfaces intact.

Ken


Post a reply to this message

From: Christian Froeschlin
Subject: Re: wierd refraction with multiple layer glass
Date: 12 Nov 2010 18:51:48
Message: <4cddd314$1@news.povray.org>
CAD-Andi wrote:

> Problem:
> When Creating two transparent boxes that are 100% adjacent to each other the
> refraction gets calculated wrong. I don't know exactly what is going on, the
> light gets somehow refracted permanently into a really wierd direction.

As Warp pointed out it is numerically tricky if two objects
are exactly aligned. For this use case it would be nice if there
was a more generic way of defining "insides" by specifying a
single surface of transition. In some cases you might be able
to do it by embedding one object into another.

> Solution:
> A small gap between the two sheets of glass solves the problem.

This is what the documentation recommends as well,
e.g. for rendering a glass of water. I suspect it may
produce artefacts especially when the surface is viewed
at shallow angles, but otherwise a very thin layer of
"air" shouldn't hurt too much.

You might find the following thread of interest:

http://news.povray.org/povray.binaries.images/thread/%3C45cf36f7%40news.povray.org%3E/?mtop=1


Post a reply to this message

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