[Gdal-dev] RE: shaded relief utility (DIY)
Lennox Antoine
lxnyce at gmail.com
Tue Dec 13 16:26:36 EST 2005
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.
-Lennox
On 12/13/05, jluis <jluis at ualg.pt> wrote:
>
> Charles Wivell wrote:
> > Hi all;
> >
>
> > 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
> _______________________________________________
> Gdal-dev mailing list
> Gdal-dev at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/gdal-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20051213/6b9dfdd9/attachment.html
More information about the Gdal-dev
mailing list