POV-Ray : Newsgroups : povray.binaries.images : Isosurface rocks and slope texture : Re: Isosurface rocks and slope texture Server Time
29 Jul 2024 22:20:15 EDT (-0400)
  Re: Isosurface rocks and slope texture  
From: Thomas de Groot
Date: 3 Jul 2013 10:19:30
Message: <51d432f2$1@news.povray.org>
Thanks. Some comments before experimenting with what you suggest.

On 3-7-2013 15:47, Le_Forgeron wrote:
> Reading:
>
> http://www.povray.org/documentation/view/3.6.1/393/
>
> <0,0.3,0> is the direction of reference, so rather something like +y

Yes, and you can weight slope against altitude by fractionating the 
direction of slope and altitude. Hence <0,0.3,0> and <0,0.7,0> 
respectively in my code.
>
> Beware, going to -y evaluates to Low (here 0), and
> going +y evaluates to High (here 0.5) (and horizontal x or z evaluates
> to middle value (here 0.25) (but it's not linear, arcsinus is used, or
> rather it's linear for the angle but not the projection)

Yes. Note that the documentation says the use 0.0, 0.5 for Lo_slope and 
Hi_slope permits the texture_map to be used from 0 to 1.

>
> Altitude add a gradient. here parallel to +y too.
>
> At LowerBound, the value is 0, and 1 at UpperBound.

LowerBound and UpperBound in my code are the vertical limits of the 
bounding box of the isosurface.

>
> The value of slope and the value of altitude get merged using the
> relative length of each vector (otherwise irrelevant). And it is *not* a
> linear interpolation (but the final value is wrapped to be modulo 1.0),
> it's just a basic weighted addition. (the slope value is [0,1), but the
> altitude value can be out of range if LowerBound & UpperBound are too small)
>
> So, let's assume +y is the normal where you want some grass to show.
> slope { abs(L1)*y, 1, 0 // keep full range, inverted
> // (y->0, vertical->0.5, overhang (surplomb)->1.0)
>         altitude abs(L2)*y, LowerBound, UpperBound (
>        }
>   texture_map{
>    [0.25 Grass] // flat & small slope are full of grass
>    [0.45 Soil] // a slope without any grass
>    [0.5 Rocks] // a vertical surface is rock, and so is overhanging
>    }
>
I have to test this. Are you sure that this is correct for Lo_slope=0 
and Hi_slope is 0.5? I shall test it also for values 0 and 1.

> you can then adjust the weight of L1 & L2. (nevertheless, L2 will
> generate grass everywhere at LowerBound despite the normal, so better
> have LowerBound far out of scope (or you might want to compress the
> texture_map to 0.125/0.225/0.25 or further, to reduce the influence of
> altitude LowerBound.
>
> Assuming a ground at 0 and Upperbound at 100m, LowerBound might be
> interesting at -100 or -200... (in function of the texture_map's
> compression), with L2 about 0.01 or less; L1 can probably be 0.99 or a
> bit less
>
> (if Lowerbound & Upperbound are from the iso, maybe the Lowerbound value
> in altitude should be replaced with Lowerbound - (Upperbound -
> Lowerbound)*Factor )

This is an interesting idea. I have to test that too...

Thomas


Post a reply to this message

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