Jon S Berndt writes:
> Found this page interesting:
> 
> http://www.gamedev.net/reference/articles/article1817.asp
> 
> but does this do something that FlightGear doesn't already 
> do?

Interesting, but this article deals with terrain heightmaps (regular
grids of elevation points.)  FlightGear uses an irregular triangle
mesh.

What we'd need to do would be (a) Jettison opengl lighting, (b) for
each vertex in our TIN take a vector from there to the light source.
If it intersects any other terrain, that vertex is shaded, otherwise
it's not.

This would be expensive to do, but we wouldn't need to do each vertex
each frame ... you could maybe do a couple each frame in a round robin
fashon.  

It's hard to say in advance if you could do this quick enough to keep
the shadows tracking the sun over time ... also you'd need to consider
what to do when you load a new tile ... do you prime the pump and do
the calculation for all these points at load time (so it looks correct
from the start) or just throw the points on the update queue and get
to them when you get to them (tile will start looking wrong, but
eventually the vertices will pop to the right shading.)

This wouldn't address what happens if a shadow cuts across the middle
of a large triangle, but it's probably beyond our means to handle
shadows with that amount of fidelity.

Curt.
-- 
Curtis Olson   IVLab / HumanFIRST Program       FlightGear Project
Twin Cities    [EMAIL PROTECTED]                  [EMAIL PROTECTED]
Minnesota      http://www.menet.umn.edu/~curt   http://www.flightgear.org

_______________________________________________
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel

Reply via email to