POV-Ray : Newsgroups : povray.newusers : Trying to figure out media... : Re: Trying to figure out media... Server Time
30 Jul 2024 02:28:52 EDT (-0400)
  Re: Trying to figure out media...  
From: Bob Hughes
Date: 4 Dec 2004 18:57:28
Message: <41b24ee8@news.povray.org>
"Soace Munky" <alu### [at] gmailcom> wrote in message 
news:41872737@news.povray.org...
> I've tried changing ior to an inverse vaule, that resulted in a wierd, 
> inverted reflection in, i guess, the bubble of air.
> im still looking for places to upload...any tips?

I managed to render your script, minus the bubble.inc, plus seed() for the 
random numbers. Obviously you're trying to get air bubbles to render 
technically accurate or realistic. Fresnel reflection is most likely needed 
in the water 'finish'. By having a different refraction (ior of air) for the 
bubble (isosurface) it might be correct. As it stands now you only have 
water refraction throughout. And you put media inside the air bubbles 
instead of into the water, and it's the water you need to make murkier with 
clear air in the bubbles.

You can post the files to povray.binaries.scene-files, after joining or 
subscribing to that group like you did for this one. Just "attach" them to 
the message (never attach files to non-"binaries" groups). There's also the 
povray.text.scene-files group for text-only scene files put into the message 
body.

Sorry for replying a month later, I haven't been here much these past few 
months. Surprised to see no one else replied. Hope you had some success 
yourself in the meantime.

Check the changes to your script below. BTW, you had used only rgbf for 
rgbft color vectors.

Bob H.

/* water air bubbles */

global_settings {  assumed_gamma 1.0
                    noise_generator 2
                    max_trace_level 5
}

#include "colors.inc"
#include "functions.inc"

#declare Bubble=sphere {0,1}

camera {
   location <0,2.5,7>
   look_at   <1,0,0>
   rotate 35*y
}
// sun ---------------------------------------------------------------------
light_source{< -3000, 3000, -3000> color White}
// sky ---------------------------------------------------------------------
sky_sphere { pigment { gradient <0,1,0>
                        color_map { [0.00 rgb <0.6,0.7,1.0>]
                                    [0.35 rgb <0.0,0.1,0.8>]
                                    [0.65 rgb <0.0,0.1,0.8>]
                                    [1.00 rgb <0.6,0.7,1.0>]
                                  }
                        scale 2
                      }
            }

// ground ------------------------------------------------------------------
plane {
         y,-1
         material {texture {pigment {checker rgb 0 rgb 1}}}
}

#local R1=seed(123);
#local R2=seed(321);
#local R3=seed(231);

#declare X=rand(R1)/3;
#declare Y=rand(R1)/3;
#declare Z=rand(R1)/5;
#declare X1=rand(R2)/3;
#declare Y1=rand(R2)/3;
#declare Z1=rand(R2)/5;
#declare X2=rand(R3)/3;
#declare Y2=rand(R3)/3;
#declare Z2=rand(R3)/5;

#declare water =
material
    {texture{pigment{color rgbf <0.9, 0.9, 1.0, 0.9>}
          finish
                 {
                 ambient 0 diffuse 0
                 phong 1.0
                 phong_size 100.0
                 reflection {0,0.9 fresnel on}
                 conserve_energy
                 }
         }
       interior
                 {
                 ior 1.33
                 media
                         {
                         absorption rgb<0.9,0.6,0.3>/3
                         //emission rgb <1,0,0>
                         scattering {3,0.01}
                         }
                 }
    }

difference {
box {<-2,-1,-1><2,1,1>
      material {water}
      }

isosurface
         {                    //Experiment
         function {f_sphere(x, y, z, .9)+f_noise3d(x+X, y+Y, z+Z)}
         contained_by {sphere {< 0, 0, 0>, 1}}
         max_trace 4
         max_gradient 1.6
         material
                 {
                 texture
                         {
                         pigment {color rgbft <0,0,0,0,1>}
                         //finish { diffuse 0.2 specular 0.6 }
                         }
                 }
         interior
                 {
                    ior 1.002
                 }
         hollow
         translate 1*x

         }

isosurface
         {                    //control
         function {f_sphere(x, y, z, .9)+f_noise3d(x+X, y+Y, z+Z)}
         contained_by {sphere {< 0, 0, 0>, 1}}
         material
                 {
                 texture
                         {
                         pigment {color rgbft <0,0,0,0,1>}
                         //finish { diffuse 0.2 specular 0.6 }
                         }
                 }
         interior
                 {
                 media
                         {
                         scattering {2}
                         density
                                 {
                                 turbulence
                                 10
                                 }
                         }
                 ior 1
                 caustics 1
                 }
         hollow
         translate -1*x
         }

hollow
scale 2
}


Post a reply to this message

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