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

jluis jluis at ualg.pt
Tue Dec 13 16:54:32 EST 2005


Thanks Lennox,
Looks very promising

Joaquim Luis

Lennox Antoine wrote:
> How about the regular gaming approach of generating shadows by shooting 
> light rays.
> 
> http://www.vterrain.org/Performance/lighting.html
> http://www.gamedev.net/reference/articles/article1817.asp
> 
> Of course you would have to modify it not to store the entire thing in 
> memory, but what I would suggest is downsampling your dem to about 
> 2Kx2K, doing the line of sight generation in memory and then 
> interpolating the shadow value when applying to the raster. I did this 
> once using quadtrees to speed up the calculation. I had it working 
> almost realtime (for realtime shadows), but never followed it up. 
> Unfortunately it was almost 4 years ago so the code is lost by now. 
> Theory is still the same though. Calculate a one time quadtree for your 
> heightfield which you can do in almost linear time, then use that to 
> speed up the ray bounding box attemts.



More information about the Gdal-dev mailing list