POV-Ray : Newsgroups : povray.binaries.images : Sparkling water : Re: Sparkling water Server Time
3 Aug 2024 04:16:39 EDT (-0400)
  Re: Sparkling water  
From: Mark Wagner
Date: 15 Feb 2007 00:25:23
Message: <45d3eec2@news.povray.org>
Christian Froeschlin wrote:

> Hello,
> 
> I just experimented a bit with glass, water and photons. For making
> a glass filled with water, the documentation recommends to make a
> hollow container using CSG, and filling it with a liquid object
> scaled down a bit to avoid coincident surfaces. I'm a bit unsure
> about this, as the extra transitions through a thin air slice would
> seem to cause unnecessary calculations, and yield incorrect results
> as well (e.g., I think it is possible that the expected refraction
> at a water/glass transition turns into a total internal reflection
> at a water/air transition). A problem like this was discussed some
> time ago in povray.newusers regarding "Refraction in the eye":

> So, I made three images:
> 
> 1. Uses the recommended technique
> 2. Embeds the liquid in a solid glass block (in the hope that
>     the IOR specified in the second object takes precedence)
> 3. Is a variation of 1., with the liquid scaled *up* a tiny
>     bit and the "merge"-d with the glass container to remove
>     the inner surface (but no idea how POV-Ray handles the
>     differing IORs in a merge).

If my reading of the source is correct, #2 will do *almost* the right thing. 
What should produce correct results is scaling the water slightly larger
than the hollow of the glass:

   1     2           3     4           5     6
air|glass|water+glass|water|water+glass|glass|air

What should happen is:
1: The ray exits the air, enters the glass
2: The ray exits the glass, enters the water
3: The ray has already left the glass, so this is ignored for refraction
4: The ray exits the water, enters the glass
5: The ray has already left the water, so this is ignored for refraction
6: The ray exits the glass, enters the air

The first glass-water transition will be slightly nearer the camera than it
should be, but otherwise this is correct.  The proper number of refractions
will take place, and they will all have correct IORs.


-- 
Mark Wagner


Post a reply to this message

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