The approach used here is to do a reverse ray tracing from each vertex to the light source, determining if the the light ray is obscured by something on the height map. The approach is described well here...
Ah yes, that's essentially a subset of line-of-sight checking on a terrain-tile basis. However, my intention was to be able to produce the shadows of individual unit sprites on the ground or other objects, not simply restricted to the terrain.
What I'd really like to know is whether you can set up a View from the same perspective as a directional lght source:
* That pays no attention to texture colouring, diffusion, ambience, specularity or emission, but does notice transparency.
* That will produce a pixel-by-pixel depth map of the surfaces (as in, distance from the light source according to some standardised coordinate system,)
And if I can:
* Modulate diffuse lighting application on a pixel-by-pixel basis, with reference to the 3d coordinates of the surfaces concerned.
...I suspect you might want to do something similar and apply a wave filter (maybe something as simple as multiple sine waves) to the texture to give the impression of waves.
I was thinking that. The problem is, rendering the entire scene from an alternate viewpoint for the sake of a surface that will most likely only occupy a small portion of the screen seems wasteful. I'd like to be able to mask out irrelevant areas to create a 'rendering window' in the same shape as the reflective surfaces, but I can't think of a method using the api.
It's nothing urgent, but I wanted to bring up the idea now to have plenty of time to flesh out possible techniques.