angered-ghandi / OpenAOE

An open source reimplementation of Age of Empires (1997)
Other
66 stars 6 forks source link

Missing shadows #52

Open angered-ghandi opened 8 years ago

angered-ghandi commented 8 years ago

Now that the game is rendering delta graphics (see #37), there are a hundreds of TODO comments being printed out when the game starts up:

...
TODO: skipped 15 instead of drawing the shadow
TODO: skipped 20 instead of drawing the shadow
TODO: skipped 13 instead of drawing the shadow
TODO: skipped 13 instead of drawing the shadow
TODO: skipped 7 instead of drawing the shadow
...

I made it draw yellow instead of skipping, and it looks like several of the delta graphics are nothing but shadows: missing_shadows

Unfortunately, with the way the SLP crate is currently laid out, it's not going to be easy to correctly implement the actual shadows. In the original game, it'd use the index of the color in the destination pixel buffer to determine the shadow color to draw. We'll need to do something clever here since that's not feasible with OpenGL (at least not with good performance). Might be able to make it look as close to the original as possible using a pixel shader, but being able to use a shader will require a rewrite of the whole render system.