POV-Ray : Newsgroups : povray.advanced-users : Odd refraction phenomena. (Water to Air) : Re: Odd refraction phenomena. (Water to Air) Server Time
30 Jul 2024 02:29:31 EDT (-0400)
  Re: Odd refraction phenomena. (Water to Air)  
From: Chris Colefax
Date: 30 Apr 2000 20:30:30
Message: <390cd026@news.povray.org>
Simen Kvaal <sim### [at] studentmatnatuiono> wrote:
> See (small) image in p.b.i. for visual impression.
>
> I am trying to model air-bubbles in water, and ran across this problem:
> Exactly _how_ does one model the camera _in_ water, viewing bubbles of
air?
> At first, I thought maybe place the camera inside an object with ior about
> 1.33 (water), then add objects (bubbles) with ior about 1.01 (air). That
> produced weird results, however exactly the same as the second method.
>
> The second method was using the law pysics: The ior is relative, I
thought,
> therefore, light passing from air into water, where air has (absolute) ior
> 1.01 and water (absolute) ior 1.33, would give a relative ior of 1.33/1.01
> (water/air). When light passes from water to air, OTOH, we will get a
> relative ior of 1.01/1.33, so I simply placed camera in space, and let the
> bubbles have ior 1/1.33. That gave me exactly the same results as before.
It
> seems iors below 1 is not allowed, judging from the image I get.
>
> The scene is really simple. A checkered plane with inverse applied to
place
> camera outside it. (Removing inverse places the camera inside, ie into the
> water.) The sphere is just that; a sphere.
>
> I've tried several combinations; all giving more or less the same results:
> *Difference between (water-)box and sphere.
> *Difference between (water-)plane and sphere.
> *Sphere inside box.
> *Sphere inside plane.
>
> Any suggestions?

My instinct would be to difference the bubbles out of the water, which has
an ior, and also to place the camera *inside* a bubble (or rather, an
air-filled lens), e.g.:

   difference {
      plane {y, 0 texture {WaterSurfaceTexture}}
      object {UnionOfBubbles}
      sphere {0, 0.01 pigment {rgbt 1} translate camera_location}
      interior {ior 1.33}
      }

This way, a ray is bent after it leaves the camera, then bent back when it
enters a bubble (or exits the surface of the water).  I haven't tested it,
but hopefully this will give you the effect you're after...


Post a reply to this message

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