How about the regular gaming approach of generating shadows by shooting light rays.<br>
<br>
<a href="http://www.vterrain.org/Performance/lighting.html">http://www.vterrain.org/Performance/lighting.html</a><br>

<a href="http://www.gamedev.net/reference/articles/article1817.asp">http://www.gamedev.net/reference/articles/article1817.asp</a><br>
<br>
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.<br>
<br>
-Lennox<br>
<br><div><span class="gmail_quote">On 12/13/05, <b class="gmail_sendername">jluis</b> &lt;<a href="mailto:jluis@ualg.pt">jluis@ualg.pt</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Charles Wivell wrote:<br>&gt; Hi all;<br>&gt;<br><br>&gt; If you want to include shadow, it becomes a little more complex.<br>&gt;<br><br>Charles,<br>Do you know any reference where I could study the more complex<br>&quot;include shadow&quot; method?
<br><br>I have implemented 4 or 5 different algorithms of shading relief but<br>none of them does shadows.<br>To my knowledge, the best shading with shadows is the one used by a<br>software called flerdermaus.<br><br>J. Luis
<br>_______________________________________________<br>Gdal-dev mailing list<br><a href="mailto:Gdal-dev@lists.maptools.org">Gdal-dev@lists.maptools.org</a><br><a href="http://lists.maptools.org/mailman/listinfo/gdal-dev">
http://lists.maptools.org/mailman/listinfo/gdal-dev</a><br></blockquote></div><br>