POV-Ray : Newsgroups : povray.general : ripples with actual height Server Time
31 Jul 2024 14:21:38 EDT (-0400)
  ripples with actual height (Message 1 to 10 of 10)  
From: Eric
Subject: ripples with actual height
Date: 13 Mar 2007 14:20:01
Message: <web.45f6f88d935f00a3577619e90@news.povray.org>
There are many ways I've seen to simulate water, but all are really
illusions on a uniform surface.  So if you have a vertical surface coming
straight up out of the 'water', you get a perfectly straight line at the
intersection.  What options are there that will form actual height-ripples
in a surface?  I know of bump_map and height_field, all of which require an
image for the height field, but I'd rather not go that way.

Thanks!
-Eric


Post a reply to this message

From: Chambers
Subject: Re: ripples with actual height
Date: 13 Mar 2007 14:30:33
Message: <45f6fbd9$1@news.povray.org>
Eric wrote:
> There are many ways I've seen to simulate water, but all are really
> illusions on a uniform surface.  So if you have a vertical surface coming
> straight up out of the 'water', you get a perfectly straight line at the
> intersection.  What options are there that will form actual height-ripples
> in a surface?  I know of bump_map and height_field, all of which require an
> image for the height field, but I'd rather not go that way.
> 
> Thanks!
> -Eric
> 
> 

Bump mapping isn't really implemented in POV-Ray, at least not the way 
you're probably thinking from the above.

Most people use isosurfaces, which are surfaces defined by equations. 
Here's a simple scene using one:

camera {
  location <0,10,-15>
  look_at 0
}

isosurface {
  function { cos( sqrt(x*x+z*z) ) +y }
  threshold 0
  max_gradient 1.5
  contained_by {box {<-100,-2,-100>,<100,2,100>}}
  pigment {color rgb 1/2+z/2}
  finish {specular 1/2}
}

light_source {<1,1,-1>*100 color rgb 1}

...Chambers


Post a reply to this message

From: Warp
Subject: Re: ripples with actual height
Date: 13 Mar 2007 15:28:54
Message: <45f70986@news.povray.org>
Eric <[firstname]@theothersideofthenet.com> wrote:
> There are many ways I've seen to simulate water, but all are really
> illusions on a uniform surface.  So if you have a vertical surface coming
> straight up out of the 'water', you get a perfectly straight line at the
> intersection.  What options are there that will form actual height-ripples
> in a surface?  I know of bump_map and height_field, all of which require an
> image for the height field, but I'd rather not go that way.

  Heightfields can be generated from user-defined functions.

-- 
                                                          - Warp


Post a reply to this message

From: Warp
Subject: Re: ripples with actual height
Date: 13 Mar 2007 15:29:20
Message: <45f709a0@news.povray.org>
Chambers <ben### [at] pacificwebguycom> wrote:
> isosurface {
>   function { cos( sqrt(x*x+z*z) ) +y }

  A heighfield would be faster to render than an isosurface.

-- 
                                                          - Warp


Post a reply to this message

From: Stephen
Subject: Re: ripples with actual height
Date: 13 Mar 2007 16:02:49
Message: <ib4ev21r8ho07nopdqmfa2or4up8p1bd4f@4ax.com>
On Tue, 13 Mar 2007 14:16:29 EST, "Eric" <[firstname]@theothersideofthenet.com>
wrote:

>There are many ways I've seen to simulate water, but all are really
>illusions on a uniform surface.  So if you have a vertical surface coming
>straight up out of the 'water', you get a perfectly straight line at the
>intersection.  What options are there that will form actual height-ripples
>in a surface?  I know of bump_map and height_field, all of which require an
>image for the height field, but I'd rather not go that way.
>
>Thanks!
>-Eric
>

Tim Nikias wrote a good animation system for water. I just looked at his new
site (http://www.nolights.de/main.html) but I cant see it for download. I'm sure
that if you contact him he will be pleased to give you a copy.
JUS### [at] gmxnetWARE

Regards
	Stephen


Post a reply to this message

From: Eric
Subject: Re: ripples with actual height
Date: 13 Mar 2007 18:25:01
Message: <web.45f7319727ae231e577619e90@news.povray.org>
Thanks for all the good advice.  I've found a very nice looking solution
with isosurface (code example 1 below) but I'm having trouble getting a
function to work right for a height_field alternative (non-working code
example 2 below).  I did find a posting that gives some info on how to use
function for height_field, but still could use further advice to get a
ripple or 'sloshing' appearance.  (f_noise3d gives a nice 'sloshing' with
an underlying rippled appearance when the x and z parameters are scaled
differently)
Thanks!

EXAMPLE 1:
isosurface {
  function { y + f_noise3d(x/10,0,z/2) }  // f_noise3d requires
'functions.inc'
  threshold 0
  max_gradient 0.5
  contained_by {box {<-1000,-1,-1000>,<1000,1,1000>}}
  pigment {color rgbft <0.1,0.4,0.3,0.9,0.1> }
  finish { ambient 0 diffuse 0 specular 0.9 roughness 0.001 reflection 0.2 }
  interior { ior 1.3 caustics 1 fade_distance 2 fade_power 1 }
  translate <0,3,0>
  scale 0.1
  }
// finish and interior need a little work
// shouldn't need to scale... may need to alter function a bit instead

EXAMPLE 2:
height_field {
  function 200, 200 { y + f_noise3d(x/10,0,z/2) }   // f_noise3d requires
'functions.inc'
  smooth
  pigment {color rgbft <0.1,0.4,0.3,0.9,0.1> }
  finish { ambient 0 diffuse 0 specular 0.9 roughness 0.001 reflection 0.2 }
  interior { ior 1.3 caustics 1 fade_distance 2 fade_power 1 }
  translate<-0.5,0,-0.5>
  scale <100,1,100>
  }


Post a reply to this message

From: Chambers
Subject: Re: ripples with actual height
Date: 13 Mar 2007 19:57:22
Message: <45f74872$1@news.povray.org>
Eric wrote:
> Thanks for all the good advice.  I've found a very nice looking solution
> with isosurface (code example 1 below) but I'm having trouble getting a
> function to work right for a height_field alternative (non-working code
> example 2 below).  I did find a posting that gives some info on how to use
> function for height_field, but still could use further advice to get a
> ripple or 'sloshing' appearance.  (f_noise3d gives a nice 'sloshing' with
> an underlying rippled appearance when the x and z parameters are scaled
> differently)
> Thanks!

The problem with height fields is that they are limited to the cube from 
<0,0,0> to <1,1,1>.  The functions for them take, as arguments, X and Y 
rather than X and Z, and the height must never be <0 or >1 (actually it 
can, but it wraps around, which is visually... disturbing).

I find isofurfaces easier because you can define their domain to be 
anything you want; however, it is certainly true that HFs render 
faster*.  If you can scale your function well in a HF, then it would 
probably be a better solution.

...Chambers

*It is conceivable that, in the future, isosurfaces will render faster 
than HFs simply due to the fact that the parse stage remains single 
threaded while the trace stage runs in parallel.  Since isosurfaces 
parse almost instantly, if you have enough cores on hand it the savings 
in parse time could more than pay for the cost of trace time.


Post a reply to this message

From: Trevor G Quayle
Subject: Re: ripples with actual height
Date: 13 Mar 2007 21:35:15
Message: <45f75f63$1@news.povray.org>
"Warp" <war### [at] tagpovrayorg> wrote in message 
news:45f70986@news.povray.org...
> Eric <[firstname]@theothersideofthenet.com> wrote:
>> There are many ways I've seen to simulate water, but all are really
>> illusions on a uniform surface.  So if you have a vertical surface coming
>> straight up out of the 'water', you get a perfectly straight line at the
>> intersection.  What options are there that will form actual 
>> height-ripples
>> in a surface?  I know of bump_map and height_field, all of which require 
>> an
>> image for the height field, but I'd rather not go that way.
>
>  Heightfields can be generated from user-defined functions.
>
> -- 
>                                                          - Warp

http://news.povray.org/povray.binaries.images/thread/%3Cweb.45d9a3a3e460fb2bc150d4c10%40news.povray.org%3E/

The water I use here is made in such a way.  The advantage of this too is 
that I can dynamically change the resolution of the heightfield whe I want, 
so I can give a low resolution to renfder faster while I'm testing other 
stuff in the scene and bump the resolution up high for a quality render.  If 
you'd like, I can post some example code for this tomorrow.

-tgq


Post a reply to this message

From: Rune
Subject: Re: ripples with actual height
Date: 14 Mar 2007 12:20:42
Message: <45f82eea$1@news.povray.org>
Stephen wrote:
> Tim Nikias wrote a good animation system for water. I just looked at
> his new site (http://www.nolights.de/main.html) but I cant see it for
> download. I'm sure that if you contact him he will be pleased to give
> you a copy. JUS### [at] gmxnetWARE

It's available for download on this page:
http://www.nolights.de/rnd/development.html#LSSM

Rune
-- 
http://runevision.com


Post a reply to this message

From: Stephen
Subject: Re: ripples with actual height
Date: 15 Mar 2007 03:15:02
Message: <web.45f9003027ae231ef1cb1e660@news.povray.org>
"Rune" <new### [at] runevisioncom> wrote:

>
> It's available for download on this page:
> http://www.nolights.de/rnd/development.html#LSSM
>
> Rune
> --
> http://runevision.com



Stephen


Post a reply to this message

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