[Gdal-dev] RE: shaded relief utility (DIY)

Ben Discoe ben at vterrain.org
Thu Dec 15 21:37:09 EST 2005


Joaquim,

As Lennox pointed out, http://vterrain.org/Performance/lighting.html is a
good starting point for learning about shadow methods.

However, you already have the VTP software, which can do this all for you
now, either with VTBuilder for off-line 2D processing, or Enviro for shading
on the fly at 3D runtime.

If it's the code you're interested in, you'll find it in
TerrainSDK/vtdata/HeightField.cpp, methods ColorDibFromElevation(),
ShadeDibFromElevation(), ShadeQuick(), ShadowCastDib().  The shadow casting
is an optimized implementation of Mircea Marghidanu's article on the page
above.  If you know some ways it could be improved, please let me know.

-Ben

> -----Original Message-----
> From: jluis
> Sent: Tuesday, December 13, 2005 7:07 AM
> 
> Charles Wivell wrote:
> > If you want to include shadow, it becomes a little more complex.
> 
> Charles,
> Do you know any reference where I could study the more 
> complex "include shadow" method?
> 
> I have implemented 4 or 5 different algorithms of shading 
> relief but none of them does shadows.
> To my knowledge, the best shading with shadows is the one 
> used by a software called flerdermaus.
> 
> J. Luis




More information about the Gdal-dev mailing list