POV-Ray : Newsgroups : povray.text.tutorials : How to make rippling water? Server Time
4 May 2024 23:40:43 EDT (-0400)
  How to make rippling water? (Message 1 to 10 of 10)  
From: Tim Soderstrom
Subject: How to make rippling water?
Date: 31 Jan 1999 14:53:26
Message: <36B4B43C.DDAA6648@sitc.net>
I've read the docs over and over again about the concept of phasing, and
I have never figured it out.
The problem is that I want a water pigment to ripple and I can't figure
out how to do it properly.
I've tried using a normal map, but the reflection is not right. I would
also like to know if there is anyway to fade an entire color to another
(IE without using a pigment modified like gradient, so the color is
solid and changes to another solid color). Any help with either would be
apreciated! :)

Thanks,
Tim Soderstrm


Post a reply to this message

From: Spider
Subject: Re: How to make rippling water?
Date: 31 Jan 1999 17:18:08
Message: <36B4D585.4EBB9E96@bahnhof.se>
Tim Soderstrom wrote:
> 
> I've read the docs over and over again about the concept of phasing, and
> I have never figured it out.
> The problem is that I want a water pigment to ripple and I can't figure
> out how to do it properly.
check out the pigment modifiers ripples and waves.. You can also take a
look at warps.

> I've tried using a normal map, but the reflection is not right. I would
> also like to know if there is anyway to fade an entire color to another
> (IE without using a pigment modified like gradient, so the color is
> solid and changes to another solid color). Any help with either would be
> apreciated! :)
Solid colour, please explain.

To fade, I'd use a texture_map/pigment_map/colour_map depending on how I
wanted the fade..

//Spider


Post a reply to this message

From: Josh English
Subject: Re: How to make rippling water?
Date: 1 Feb 1999 17:35:17
Message: <36B62D04.9C5296EB@spiritone.com>
Tim Soderstrom wrote:

> I've read the docs over and over again about the concept of phasing, and
> I have never figured it out.
> The problem is that I want a water pigment to ripple and I can't figure
> out how to do it properly.
> I've tried using a normal map, but the reflection is not right. I would
> also like to know if there is anyway to fade an entire color to another
> (IE without using a pigment modified like gradient, so the color is
> solid and changes to another solid color). Any help with either would be
> apreciated! :)
>
> Thanks,
> Tim Soderstrm

Here is basic water: it's not very fancy:

// ground under water... gotta have somthing down there
plane { y,-5 pigment { granite } }

// the water itself
plane { y,0
              pigment { rgbf 1 } // this makes the water perfectly clear
              normal { waves phase clock }
              finish { reflection 0.75
                            specular 1 }
              interior { ior 1.333 }
           }

this creates water ripples emating from the center when you animate it with
the clock value going from 0 to 1.

As for the second question about color, try this:

plane { y,0
             pigment { gradient x
                               color_map { [0.0 rgb <1,0,0> ]
                                                     [ 1.0 rgb <0,0,1> ] } }
}

this creates a blend from red to blue, the abruptly changes back to red 1
unit over, blends to blue, and back to red... ad nauseum.
The important thing is that when x=0,1,2,3... (basically, when it reaches an
integer value) it is red. As it approaches the next integer it shifts to
blue.

If you want to have one color change immediately to another look at this
example:

plane { y,0
             pigment { gradient x
                               color_map { [0.0 rgb <1,0,0> ]
                                                      [ 0.5 rgb <1,0,0> ]
                                                      [0.5 rgb<0,0,1> ]
                                                     [ 1.0 rgb <0,0,1> ] } }
}

This creates a band of red then a band of blue, then a band of red, then a
band of blue.... as nauseum

Now, if we make a slight alteration:

plane { y,0
             pigment { gradient x
                               color_map { [0.0 rgb <1,0,0> ]
                                                      [ 0.3 rgb <1,0,0> ]
                                                      [0.6 rgb<0,0,1> ]
                                                     [ 1.0 rgb <0,0,1> ] } }
}

Now we start at red, 0.3 units over we're still at red, then begin to blend
towards blue. We get there at 0.6 units, and stay blue until 1 unit over,
then start back at red and go through the whole exercise again. Now lets
look at how phasing would affect this ( I'll bet you thought I forgot)

plane { y,0
             pigment { gradient x
                               color_map { [0.0 rgb <1,0,0> ]
                                                      [ 0.3 rgb <1,0,0> ]
                                                      [0.6 rgb<0,0,1> ]
                                                     [ 1.0 rgb <0,0,1> ] }
                              phase 0.1 } }

Now the color map starts 0.1 units over, so when x=0, instead of using the
color at 0 in the color map, we start at 0.1 in the color map.
If we set the phase value to 0.3, then when x=0 it will be red, but at
x=0.3, it will be blue.

Now, back to the water. The ripples statement creates a sine wave like bump
pattern, if you have a graphing calculator, you can graph y=sin(x)
phase is altering the formula to y=sin(x + phase). If this doesn't make
sense, try it on a calculator, or just ignore it. But the bump pattern in
the normal statement works similalry to the color_map we used earlier. It
slides the bump pattern from the origin the same way it slides it in the
color_map

Hope this helps
--
Josh English
eng### [at] spiritonecom
www.spiritone.com/~english


Post a reply to this message

From: Spider
Subject: Re: How to make rippling water?
Date: 1 Feb 1999 19:59:47
Message: <36B64CE2.90301185@bahnhof.se>
Now this was impressive. Thankyou!

//Spider


Post a reply to this message

From: Mr  B  Elliott
Subject: Re: How to make rippling water?
Date: 2 Feb 1999 10:39:35
Message: <MPG.1121b8f921b1806e989682@news.povray.org>
In article <36B4B43C.DDAA6648@sitc.net>, Tig### [at] sitcnet says...
> I've read the docs over and over again about the concept of phasing, and
> I have never figured it out.
> The problem is that I want a water pigment to ripple and I can't figure
> out how to do it properly.
> I've tried using a normal map, but the reflection is not right. I would
> also like to know if there is anyway to fade an entire color to another
> (IE without using a pigment modified like gradient, so the color is
> solid and changes to another solid color). Any help with either would be
> apreciated! :)
> 
> Thanks,
> Tim Soderstrm
> 
> 
> 
Hi Tim,

Here's a water animation (3.0 syntax source code - not a binary) I once 
did as an experiment.  This may not be really what you're after, since 
this doesn't use phasing, but it's a surface I like on water.  Anyway, 
Josh has already answered your phase question.

I was looking for a surface that would move in riplets in a passably 
realistic fashion like calm open water.  It's a standard surface normal 
method, but I discounted using waves or ripples as the normal pattern 
because they produce a geometrically perfect series of concentric circles, 
and I've never seen a lake look like that yet!

I used the "bumps" surface normal instead, and with the changing clock 
value, it translates at a sloping angle up through the surface of the 
water.  This produced the effect of general ripple drift in one direction 
with blowing wind, but the surface pattern is always changing.

I've thrown all of the scene in, not just the water definition.  The 
moonrise idea came from artwork that really struck me on the Chris Rea 
album "The Road to Hell", released sometime back in the '80s.  And yes, 
the moon does rotate a bit eccentrically - never fixed that either :~)  
Still, I loved its reflection: it really surprised me.

Be warned, the scene is VERY DARK.  It is a night scene after all.  To see 
everything better, you'll probably want to change it to a sunrise (just 
shift the clock on your PC forward 12 hours :-)  :-)

Before I put in the scene file, and since this scene is geared for 
animation, may I offer an INI file I use for anims?  It makes my life 
easier anyway.  As well as rendering anims of various lengths, you can 
render a single frame at various points on the way, ie. start, 25%, mid, 
75%, or end frame.

It's name is "anim512.ini": for 512x384 resolution.  If you want it, place 
it in your "renderer" directory, and load it into POV-Ray with the Render 
Settings dialog (<Alt-C> keystroke or Render/Edit Settings from the menu).  
From there you can choose your render options from the drop list in the 
toolbar.  The scene file comes second and is called "moonrise.pov".

Oh christ! Bedtime!  Another day tired at work coming...will I ever learn?


Ciao,
       Brian.
-- 
"Strictly UNIX"    To dance is to live.
bel### [at] gilcomau


==========anim512.ini  :  249 lines==========
; Animate file for Persistence Of Vision raytracer version 3.X.
; Brian Elliott - Oct 1998.


[Start Frame @512, no AA ]
Width=512
Height=384

Antialias=Off
Antialias_Threshold=0.3
Antialias_Depth=3
Test_Abort_Count=384


[25% Frame @512, no AA ]
Width=512
Height=384
Clock=0.25

Antialias=Off
Antialias_Threshold=0.3
Antialias_Depth=3
Test_Abort_Count=384


[Mid Frame @512, no AA ]
Width=512
Height=384
Clock=0.5

Antialias=Off
Antialias_Threshold=0.3
Antialias_Depth=3
Test_Abort_Count=384


[75% Frame @512, no AA ]
Width=512
Height=384
Clock=0.75

Antialias=Off
Antialias_Threshold=0.3
Antialias_Depth=3
Test_Abort_Count=384


[End Frame @512, no AA ]
Width=512
Height=384
Clock=1

Antialias=Off
Antialias_Threshold=0.3
Antialias_Depth=3
Test_Abort_Count=384


[10 frames @512, no AA]
Width=512
Height=384

Antialias=Off
Antialias_Threshold=0.3
Antialias_Depth=3
Test_Abort_Count=384

Initial_Frame=1
Final_Frame=10

Cyclic_Animation=off
Pause_when_Done=off


[10 frames @512, AA 0.3]
Width=512
Height=384

Antialias=On
Antialias_Threshold=0.3
Antialias_Depth=3
Test_Abort_Count=384

Initial_Frame=1
Final_Frame=10

Cyclic_Animation=off
Pause_when_Done=off


[20 frames @512, no AA]
Width=512
Height=384

Antialias=Off
Antialias_Threshold=0.3
Antialias_Depth=3
Test_Abort_Count=384

Initial_Frame=1
Final_Frame=20

Cyclic_Animation=off
Pause_when_Done=off


[20 frames @512, AA 0.3]
Width=512
Height=384

Antialias=On
Antialias_Threshold=0.3
Antialias_Depth=3
Test_Abort_Count=384

Initial_Frame=1
Final_Frame=20

Cyclic_Animation=off
Pause_when_Done=off


[50 frames @512, no AA]
Width=512
Height=384

Antialias=Off
Antialias_Threshold=0.3
Antialias_Depth=3
Test_Abort_Count=384

Initial_Frame=1
Final_Frame=50

Cyclic_Animation=off
Pause_when_Done=off


[50 frames @512, AA 0.3]
Width=512
Height=384

Antialias=On
Antialias_Threshold=0.3
Antialias_Depth=3
Test_Abort_Count=384

Initial_Frame=1
Final_Frame=50

Cyclic_Animation=off
Pause_when_Done=off


[100 frames @512, no AA]
Width=512
Height=384

Antialias=Off
Antialias_Threshold=0.3
Antialias_Depth=3
Test_Abort_Count=384

Initial_Frame=1
Final_Frame=100

Cyclic_Animation=off
Pause_when_Done=off


[100 frames @512, AA 0.3]
Width=512
Height=384

Antialias=On
Antialias_Threshold=0.3
Antialias_Depth=3
Test_Abort_Count=384

Initial_Frame=1
Final_Frame=100

Cyclic_Animation=off
Pause_when_Done=off


[200 frames @512, no AA]
Width=512
Height=384

Antialias=Off
Antialias_Threshold=0.3
Antialias_Depth=3
Test_Abort_Count=384

Initial_Frame=1
Final_Frame=200

Cyclic_Animation=off
Pause_when_Done=off


[200 frames @512, AA 0.3]
Width=512
Height=384

Antialias=On
Antialias_Threshold=0.3
Antialias_Depth=3
Test_Abort_Count=384

Initial_Frame=1
Final_Frame=200

Cyclic_Animation=off
Pause_when_Done=off


[500 frames @512, no AA]
Width=512
Height=384

Antialias=Off
Antialias_Threshold=0.3
Antialias_Depth=3
Test_Abort_Count=384

Initial_Frame=1
Final_Frame=500

Cyclic_Animation=off
Pause_when_Done=off


[500 frames @512, AA 0.3]
Width=512
Height=384

Antialias=On
Antialias_Threshold=0.3
Antialias_Depth=3
Test_Abort_Count=384

Initial_Frame=1
Final_Frame=500

Cyclic_Animation=off
Pause_when_Done=off
==========END anim512.ini==========


==========moonrise.pov  :  93 lines==========
//  Moonrise.pov  --  Moonrise over water
//  Brian Elliott - Oct 1997
#version  3.0

#declare AnimSpeed = 2.5   // Set the rate of the animation sequence.
#declare RealClock = AnimSpeed * clock
// declare RealClock = 1    // If you're too lazy to use animation INI 
file.

camera
{ location <0, 10, -10>
  direction z
  angle 60
  rotate x*5
  //look_at <0, 0, 0>
}

sky_sphere  // Night colours
{ pigment
  { gradient y
    color_map
    { [0      color rgb <0.15, 0.15, 0.3> ]
      [0.15   color rgb <0.05, 0.07, 0.15> ]
      [1.0001 color rgb <0, 0.03, 0.07> ]
    }
  scale 1.05
  translate -0.04
  }
}


// MorphStartPoint:
//   Value of RealClock when the Moon begins morphing to a cube.
#declare MorphStartPoint = 1.5

//
// The Moon
//
light_source
{ <RealClock*-400, RealClock*3800-800, 20000>
  color rgb<1, 1, 1>
  area_light <282.84, 282.84, 0>, <-282.84, 282.84, 0>, 2, 2
  adaptive 1
  looks_like
#if ( RealClock <= MorphStartPoint)
  { sphere
    { 0, 800
#else
  // MorphValue = Range of values (1 -> 0) where RealClock in range (1.5 
to 2)
  // Make sure the value of MorphValue drops no lower than 0.001
  #declare MorphValue =  max(0.001,  1 - 2*(RealClock - MorphStartPoint))
  { superellipsoid
    { <MorphValue, MorphValue>
      scale 800
#end  // [if (RealClock ...]
      texture
      { pigment
        { wrinkles
          colour_map
          { [ 0.05   colour rgb <0.5,0.5,0.5> ]
            [ 0.15   colour rgb <0.706, 0.706, 0.706> ]
            [ 0.5    colour rgb <1.0, 1.0, 1.0> ]
          [ 1      colour rgb <1.0, 1.0, 1.0> ]
          }
          turbulence 0.2
        }
        finish { diffuse 0.8}
        normal { wrinkles turbulence 0.2}
        scale 100
      }
      rotate <RealClock*360*0.3162, RealClock*360*0.9487, 0>
    }
  }
}

//
// Water surface
//
intersection
{ plane { y, 0 }      // Surface
  sphere { 0, 19300 } // Limit it to a finite horizon
  texture
  {	pigment { color rgb<.5, .5, 1> }
	normal
    { bumps 0.2
      scale 2
      translate <RealClock*-14,RealClock*20, RealClock*-17>
    }
	finish
    { //refraction 1
	  //ior 1.333
      reflection 0.6
	  //phong 0.6
	  //phong_size 60
	}
  }
}
==========END moonrise.pov==========


Post a reply to this message

From: Josh English
Subject: Re: How to make rippling water?
Date: 2 Feb 1999 17:03:09
Message: <36B776FF.BC7F69B3@spiritone.com>
Your welcome. I figured all this knowledge wouild do me some good.
Hopefully it helps others as well : )

Spider wrote:

> Now this was impressive. Thankyou!
>
> //Spider

--
Josh English
eng### [at] spiritonecom
www.spiritone.com/~english


Post a reply to this message

From: Tim Soderstrom
Subject: Re: How to make rippling water?
Date: 21 Mar 1999 12:10:24
Message: <36F47F56.4F982784@sitc.net>
Can you explain that further? What I meant to say was that I wanted, for
example, to place a gradient map on a skysphere and then, as the animation
moves, have it cycle the colors so that it will go from night to day, but I
tried using phase and it didn't work :( I found a tutorial on the water
efect, though, so that part is squared aaway.

Also, for everyone who replied to me, I apologize for not being able to reply
but my computer has been broken (which is kinda good - I had a P100 now
I have an AMD K6-II 300! :) And a new motherboard with that....heh :P

Thanks for the help!


Spider wrote:

> Tim Soderstrom wrote:
> >
> > I've read the docs over and over again about the concept of phasing, and
> > I have never figured it out.
> > The problem is that I want a water pigment to ripple and I can't figure
> > out how to do it properly.
> check out the pigment modifiers ripples and waves.. You can also take a
> look at warps.
>
> > I've tried using a normal map, but the reflection is not right. I would
> > also like to know if there is anyway to fade an entire color to another
> > (IE without using a pigment modified like gradient, so the color is
> > solid and changes to another solid color). Any help with either would be
> > apreciated! :)
> Solid colour, please explain.
>
> To fade, I'd use a texture_map/pigment_map/colour_map depending on how I
> wanted the fade..
>
> //Spider


Post a reply to this message

From: Bob Hughes
Subject: Re: How to make rippling water?
Date: 21 Mar 1999 14:10:38
Message: <36F54428.D56DE7FE@aol.com>
Only 'ripples' and 'waves' will 'phase'.
With 'gradient' you will need to translate instead, OR you could set
'number_of_waves' to 1 in 'global_settings' and still use that maybe.
Haven't tried so you might not be able to due to the way the pattern
ripples and waves lays out. Cylindrically if I'm thinking about it
right, so there's a chance.


Tim Soderstrom wrote:
> 
> Can you explain that further? What I meant to say was that I wanted, for
> example, to place a gradient map on a skysphere and then, as the animation
> moves, have it cycle the colors so that it will go from night to day, but I
> tried using phase and it didn't work :( I found a tutorial on the water
> efect, though, so that part is squared aaway.
> 

-- 
 omniVERSE: beyond the universe
  http://members.aol.com/inversez/homepage.htm
 mailto:inv### [at] aolcom?Subject=PoV-News


Post a reply to this message

From: Chris Huff
Subject: Re: How to make rippling water?
Date: 9 Apr 1999 20:27:15
Message: <370E8D52.38983AB8@compuserve.com>
Actually, other patterns like bozo will phase(I have tested it). I think phase
applies to all pattern types. I am not sure about solid colors, though. (Have an
object with no pattern, but a color_map, and the color would cycle through the
color_map as phase varies from 0 to 1)

Bob Hughes wrote:

> Only 'ripples' and 'waves' will 'phase'.
> With 'gradient' you will need to translate instead, OR you could set
> 'number_of_waves' to 1 in 'global_settings' and still use that maybe.
> Haven't tried so you might not be able to due to the way the pattern
> ripples and waves lays out. Cylindrically if I'm thinking about it
> right, so there's a chance.
>
>
>
> --
>  omniVERSE: beyond the universe
>   http://members.aol.com/inversez/homepage.htm
>  mailto:inv### [at] aolcom?Subject=PoV-News


Post a reply to this message

From: Bob Hughes
Subject: Re: How to make rippling water?
Date: 10 Apr 1999 20:56:13
Message: <370FE4F9.6417DF46@aol.com>
Thanks so much for pointing my ignorance out :)
I get stuck on these things from time to time, when in doubt use the
DOC.
What I was going on was the fact that ripples and phase are usually
thought of as the primary use for phase (and I think these used to be
the only patterns capable of it, but of that I'm making no guarantee
either).

This snippet is from the 3.1 DOC:
-----
This is only one, simple example of how a clock dependant phase shift
can create interesting animation effects. Trying phase will all sorts of
texture patterns, and it is amazing the range of animation effects we
can create simply by phase alone, without ever actually moving the
object.
-----
And in another place:
-----
The frequency and phase modifiers have no effect on block patterns
checker, brick, and hexagon nor do they effect image_map, bump_map or
material_map. They also have no effect in normal statements when used
with bumps, dents, quilted or wrinkles because these normal patterns
cannot use normal_map or slope_map.

They can be used with normal patterns ripples and waves even though
these two patterns cannot use normal_map or slope_map either. When used
with ripples or waves, frequency adjusts the space between features and
phase can be adjusted from 0.0 to 1.0 to cause the ripples or waves to
move relative to their center for animating the features.
-----

Fact is there's just a lot more to it than a quick and dumb reply,
forgive me please.


Chris Huff wrote:
> 
> Actually, other patterns like bozo will phase(I have tested it). I think phase
> applies to all pattern types. I am not sure about solid colors, though. (Have an
> object with no pattern, but a color_map, and the color would cycle through the
> color_map as phase varies from 0 to 1)
> 
> Bob Hughes wrote:
> 
> > Only 'ripples' and 'waves' will 'phase'.
> > With 'gradient' you will need to translate instead, OR you could set
> > 'number_of_waves' to 1 in 'global_settings' and still use that maybe.
> > Haven't tried so you might not be able to due to the way the pattern
> > ripples and waves lays out. Cylindrically if I'm thinking about it
> > right, so there's a chance.
> >
> >
> >
> > --
> >  omniVERSE: beyond the universe
> >   http://members.aol.com/inversez/homepage.htm
> >  mailto:inv### [at] aolcom?Subject=PoV-News

-- 
 omniVERSE: beyond the universe
  http://members.aol.com/inversez/homepage.htm
 mailto:inv### [at] aolcom?Subject=PoV-News


Post a reply to this message

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