POV-Ray : Newsgroups : povray.advanced-users : creating faked water depth via gradient pigment : creating faked water depth via gradient pigment Server Time
2 Nov 2024 11:26:22 EDT (-0400)
  creating faked water depth via gradient pigment  
From: omniVERSE
Date: 8 Nov 1999 00:59:10
Message: <382666ae@news.povray.org>
For TonyB.
As the lengthy Subject of this message post suggests this is one way to
create the illusion of depth in water when a object is partially or fully
submerged.
Let's say you already have both a water object (plane, etc.) and other
typical object (cylinder maybe).  By differencing the cylinder, slightly
scaled larger than the final one to be used, from the plane and applying a
texture having a gradient y color map there can be a surface showing the
variation of filtered pigment against that cylinder when reinserted into the
plane.  Example:

#declare WaterPlane=plane {y,0} // water texture to be added later
#declare UprightPipe=cylinder {-y,y,1} // original object to test with, no
texture

difference { // this will be the water
 object {WaterPlane}
 object {UprightPipe scale 1.001} // scaled slightly larger to create a
hollow for the later original addition
  texture {pigment {gradient y color_map { // a basic water texture
                [0,1 color rgbf <.5,.6,.7,.8> color rgbf <.8,.9,1,1>]}
ramp_wave } // darker to light coloring, less to more filtering
                 normal {ripples 1 turbulence .4}
                  finish {specular .9 roughness .01 reflection .3}
    scale 1 // scaled to appropriate dimension for actual water depth
  }
   interior {ior 1.33 caustics 1}
}

// the pipe added in
object {UprightPipe // non-scaled original
 texture {pigment {rgb <1,1,1>}}
}

A camera and light should be placed to see this at a good angle of course.
Now I realize this isn't anything to compare to fog, media, or maybe not
even fade_distance; yet it's a simple "pigment only" method which could do
okay for certain situations.  With the new fade-color patch in UVPov this is
even less useful. TonyB needed my explanation though.  You catching on Tony?
Hope I'm telling it right. The water texture could of course be anything so
long as the transparency allows for seeing through it enough. And a
height_field used in the same way can do good for the lake bottom, etc.

Bob
--
// omniVERSE
// http://users.aol.com/inversez/


Post a reply to this message

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