POV-Ray : Newsgroups : povray.newusers : Using rand() : Re: Using rand() Server Time
5 Nov 2024 09:23:34 EST (-0500)
  Re: Using rand()  
From: Kevin Wampler
Date: 7 Jan 2000 02:11:43
Message: <387590B5.DE2E5010@tapestry.tucson.az.us>
The water_level function in Pov, as you have noticed, cuts off the height field
along a plane, so you can't get a jagged look.  There are two ways that I would
suggest to make the snow look good, both involve texturing instead of multiple
height_fields.  The first one is to create a y gradient texture_map
(interpolating between your rock and snow textures) for the snow, and scale it
so that the snow level on the height field is about what you want (it will still
look like a plane at this point)  Then add some turbulence to the texture to
make the snow line jagged.  The other method relies on the slope dependent
textures in Megapov, so it won't work in the official version.  The slope
dependent textures allow you to define how the texture changes depending on both
the slope and the altitude, so it is a very useful tool.  I have forgotten the
syntax, but it is quite easy to understand and get good results from.  Some pov
artists have created some very nice images that may help give you ideas, take a
look in p.b.i. under  SamualT.'s "Snowy Mountain: trace function (512x384)"
(11/13/99) and under Michael Andrews' "Isosurface snowscape ..." (9/01/99).  I'm
not sure if the source for either of these images has been posted, bit it's
probably worth checking.

Matthew Green wrote:

> I've been trying to get something of a snow-topped mountain range, but I'm
> having difficulty getting the snow to look even halfway natural.
>
> I've got the mountains as a height field, and I thought I might be able to
> declare the snow as that same height field, raised just a hair, but with a
> randomized waterlevel (ie. #declare s1=seed(1000); water_level 0.6+rand(s1)).
> However, as most experienced people already know and are laughing at me
> about at the moment is the fact that I do indeed get a random number, but I
> only get ONE random number.  Thus, the bottom of the snow IS random, but
> it's still completely straight regardless.
>
> Is there a way around this?  A snowlevel that's perfectly even just don't
> look right!  I'm looking for something a little more jagged.  Is there a
> way to do this with my scheme, or do I need to bag it and come up with
> something else?  (And if I do, does anybody have any ideas?)
>
> Thanks!
> - Barelytone


Post a reply to this message

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