POV-Ray : Newsgroups : povray.binaries.images : Tracing the path of streams : Re: Tracing the path of streams Server Time
15 May 2024 14:27:40 EDT (-0400)
  Re: Tracing the path of streams  
From: Samuel B 
Date: 17 Feb 2017 18:35:00
Message: <web.58a7881bbd8ebaff102e48c00@news.povray.org>
"Kirk Andrews" <kir### [at] tektonartcom> wrote:
> "Samuel B." <stb### [at] hotmailcom> wrote:
> > "Kirk Andrews" <kir### [at] tektonartcom> wrote:
> > > To do this *right*, I'm thinking you'd have to do a full-blown physics
> > > simulation.
> >
> > Hey Kirk,
> >
> > I'm not sure if this is helpful or not, but if your computer has a GPU
> > supporting pixel shaders, check out this one I posted a while back:
> > https://www.shadertoy.com/view/XsKGWG
> >
> > It approximates hydraulic erosion on a height map, using a sort of basin-filling
> > method as a key part of the process. It won't form rivers on flat plains, since
> > momentum isn't taken into account (would need to probably implement
> > Navier-Stokes equations for that, which would be difficult using Shadertoy since
> > a fluid sim needs to iterate over a certain operation some 30-50 times per
> > frame, to the same texture). Also, the lakes seem to be slightly sloped.
> >
> > Sam
>
> Wow! I'd never heard of Shadertoy. Is it possible to download the resulting
> height map?

It's possible, but will require editing the source code of the Image shader to
have it display only the height map (or water map, or both [hint: the landMap()
and waterMap() functions give this data]). You can then (in Firefox) right click
on the display window and choose Save Image As... Unfortunately this will only
get you an 8 bit image. For 16 bit data, you'll need to convert it over to the
red/green format (which POV-Ray supports) and then save. (For all I know saving
16 bit data from Shadertoy might be possible if you know Java.)

Better yet is to get your own shader program up-and-running using SFML or the
like. (Although the last I heard SFML would only support 8 bit textures, the
devs assuming anything else was unnecessary :P I was able to add 16 bit texture
support myself, but who knows how many versions ago that has been...)

Sam


Post a reply to this message

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