Water ripples

2012-05-14
2013-06-05
  • henriquebarone
    henriquebarone
    2012-05-14

    I want to simulate simple ripples for rain drops. I don't need a surface displacement, just an effect in bump option.
    I want to get something like these, but a bit more simple:
    Fresnel shader w/wave equation
    2d wave equation
    And I have found this equation:
    z=(cos( 0.5sqrt(x^2+y^2)-6n)/(0.5(x^2+y^2)+1+2n), n={0…10}
    but i need some heelp to adapt to AOI

     
  • Luke S
    Luke S
    2012-05-16

    That first example (fresnel +wave equation) Is really cool. I think the lion's share of it could be done as a one off coded procedural texture. (Or someone could code a ripple pattern module for the editor)
    That might take a while.
    In the meantime, I've set up something using this formula in the Procedural editor. Its kind of a hack, but it should work. Since we can't embed images here, I've posted it on your thread on FriendlySkies, along with some notes on how to use it.

    ljsails (ljs)

     
  • Kevin D.
    Kevin D.
    2012-05-16

    I'm sure that it is possible.  I'm a firm believer that anything is possible with the procedural texture editor.  What kind of rain are you making?  A dripping faucet and a rainstorm both require ripples.  However, the implementation would be entirely different for each case.  In the case if the dripping faucet, I would manually animate the water mesh through poses.  With the rainstorm we need to approximate the effect with a clever animated texture.  It wont look as nice, but if you need thousands of ripples, it's the only way to go.  Here is a texture I made:

    http://www.youtube.com/watch?v=8BKBrk8O3nk

    These ripples don't behave quite like real ripples, but they might work for you.

     
  • Peter Eastman
    Peter Eastman
    2012-05-18

    If you just want to model a single drop, that's pretty easy with the procedure editor.  Create an Expression module and enter your expression for z into it.  In place of n use t (or 10*t, or input1 if you want to make it a parameter you can keyframe).  Then route that expression into the bump height channel.  You may also want to scale it up.

    Doing lots of drops is harder, though zorksox's texture suggests it could probably be done.  (How exactly does that texture work?)  To really make it realistic you need to actually simulate the water, but an approximation might be good enough for your purposes.

    Peter

     
  • Kevin D.
    Kevin D.
    2012-05-18

    Here is the scene file: http://www.proceduraltextures.com/AOIfiles/ripples.zip

    I basically used two cell modules to create two groups of different sized circles.  I then subtracted one from the other.  The animation is driven with time.  The only problem with this it the ripples grow and the shrink again.  It's not accurate to real ripples, but the render time is almost nonexistent.

     
  • Luke S
    Luke S
    2012-05-19

    Glad to see that the creative juices are flowing.

    @Zorksox: You are right, It can be done in the procedural editor. I have not gotten to take a look at your file yet (AOI seems to be having a hard time tonight… or maybe it is having an argument with the browser) but your texture seems to be a nice simple one.

    @peastman: What you suggested was the core of the texture that I have cooked up… But you are right, getting multiple drops is the hard part.

    Current version:http://www.friendlyskies.net/aoiforum/misc.php?action=pun_attachment&item=348&download=1
    (sorry - just a screenshot - I don't have anyplace to upload a generic file)

    This one actually has five drop-centers, but that is all that I had room for in the work area. This is one of the reasons that I have thought of writing a stand-alone procedural texture for this purpose.

    Another is that even this texture is slowing down the renders. (Those expressions are being evaluated for the whole surface of the object, even though most of that data is being damped out.)

    Any thoughts on improving this texture would be appreciated, (especially improving speed, and is there a way to get more work area in the procedural editor?)

    ljsails

     
  • Luke S
    Luke S
    2012-05-19

    Oh, should mention that this new version is much better than the last one - many of the faults I mentioned in my first post are gone.

    ljsails

     
  • Kevin D.
    Kevin D.
    2012-05-19

    I have struggled with the procedural editor for a while now.  I made the complicated planet texture that's in the texture library.  When you are dealing with 100+ modules, there is simply no room left.  Even if the window is maximized, only half the window is usable (Win7 64bit).  There are scroll bars, but they don't like scrolling past the maximum size of the window.

     
  • Peter Eastman
    Peter Eastman
    2012-05-19

    If it were just a matter of a static image, that could be done pretty easily and efficiently.  Just use a single expression module, but use the distance1 output of a cells module in place of sqrt(x^2+y^2).  But I can't think of any way to animate that realistically.  You could slide it through z with time, but then you would see the ripples flow in, reach a peak, and then flow back out again.

    Peter

     
  • henriquebarone
    henriquebarone
    2012-05-24

    Zorks, thanks for helping
    But, I try for hours reduce the ripple sizes but I can't. sometimes the rings dont apper, sometimes it becomes polygon

     
  • Kevin D.
    Kevin D.
    2012-05-24

    To reduce the ripple size you should alter the mapping on your object.  Changing the size of the ripples in the texture can have some unwanted effects.  Is it possible to post your scene file?

     
  • Kevin D.
    Kevin D.
    2012-05-25

    I see what's going on.  My texture is supposed to send those shapes through the surface.  Yours are traveling across the surface.  There are two things I needed to do to fix this.  First, the scene had to be rendered with a Surface Accuracy of 0.002 rather than the default 0.02.  You may not have to go as low as 0.002, but that is what I tried, and it worked great.  This is necessary because the texture is using displacement.  This creates real geometry.  It will also slow your render down a bit.  Secondly, had to edit the mapping of the ripple texture on your two water objects.  I rotated them 90 degrees in the X direction.  This made the ripples travel through the surface instead of across it.  I also decreased the Z scale to 0.05 so the ripples would be circular.  I hope all that made sense.

    update scene file