|
|
=?ISO-8859-1?Q?J=F6rg_=27Yadgar=27_Bleimann?= <yaz### [at] gmxde> wrote:
> High!
>
> While my machine closes in on the last few hundred frames of a
> 3600-frame animation of an isosurface desert world, I started to ask
> myself how to achieve a more realistic surface relief. From high
> altitudes, my simple granite pattern mountains look fairly believable,
> but when rendering a scene from "pedestrian perspective" (as attached
> below), they look like soft undulating sand dunes rather than rugged
> mountains - and the outlines of land forms are very crude!
>
> I would like to add some "ruggedness" while also keeping the lower
> altitudes smooth - how can it be done? Is it possible to use a
> texture_map also with isosurfaces?
>
> See you in Khyberspace!
>
> Yadgar
Right now it looks like your isosurface is suffering from accuracy and
max_gradient problems. The granite pattern with the default color_map is much
more complex than that with many small details. Controlling the shape is
possible by using other functions to add details, and functions to control them.
For instance, if we have a landscape being produced by a pigment function
fn_land and details by fn_detail, and we only want these details to appear below
a certain altitude:
fn_land(x,y,z).red
- 0.10 * (fn_land(x,y,z).red < 0.25) *fn_detail(x,y,z).red
This means that fn_details will only be applied if the values for fn_land are
below 0.25. Of course, this gives a sharp cut-off point, but that can be
controlled by a more complex function:
#local CutOffAlt = 0.20;
#local FallOffDist = 0.10;
select( fn_land(x,y,z).red - CutOffAlt, 1,
select( fn_land(x,y,z).red - CutOffAlt - FallOffDist,
(fn_land(x,y,z).red - CutOffAlt) / FallOffDist , 0 ) )
The above looks a little funky, but is very similar to things I've used in the
past. The first select statement subtracts the cut-off altitude. If the result
is less than zero, then 1 is returned, since the effect is to be fully applied
below the cut-off alt. If the result is greater than zero (indicating an
altitude above cut off), then the second select statement comes into play. This
time, both the cut off altitude and the blend space is subtracted. If the
result is below zero, the equation is applied to smoothly map the value to the
range 1..0. If the result is above zero, then zero is returned, preventing the
effect from being applied above that altitude.
Variations on this are easy - you could make the falloff quadratic, have both a
min and max altitude for various functions, etc. This could also be adapting
into a macro to make things look cleaner.
HTH
-Reactor
Post a reply to this message
|
|