POV-Ray : Newsgroups : povray.binaries.images : Grassy Julia, Final : Re: Grassy Julia, Final Server Time
12 Aug 2024 23:24:56 EDT (-0400)
  Re: Grassy Julia, Final  
From: Tek
Date: 25 Jul 2003 18:34:07
Message: <3f21b05f$1@news.povray.org>
"Tony LaVigne" <ton### [at] xenomechanicscom> wrote in message
news:web.3f2165ea2acdf50fd97cd3e00@news.povray.org...
> Very nice rendering.
> How did you model the water surface?
> If the code for it is available it would be appeciated.
> Thanks
> Tony
>

Sure thing. Basically the sea is a flat plane with a granite texture used as a
normal map, and some realistic reflection settings. I've also added concentric
ripples to the surface around the base of my object, and flattened the surface
in the distance to prevent unpleasant noisiness near the horizon.

Here's the full source for the ocean effect:

//ocean
#declare f_Ripple =
 function ( d ) {
  sin(d*80)/(d*d)
 }

plane {
 y, -.8

 material {
  texture {
   pigment { rgb <.3,.5,.5> filter 1 }
   finish { diffuse 0 reflection { 0.05, 1 falloff 5 } conserve_energy }
   normal {
    function {
     .5+
     (1/((x*x+z*z)/pow(30,2) + 1))* //exp(-(x*x+z*z)/pow(50,2))* //
     (
      -.1 * f_granite(x,y,z)
      + .002*f_Ripple( sqrt(x*x+z*z)-.3 ) //rippples from base of object
     )
    } 1
    translate <.15,0,-.4>
   }
  } //texture
  interior {
   ior Water_Ior
  } //interior
 } //material
}

-- 
Tek
http://www.evilsuperbrain.com


Post a reply to this message

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