So, did anyone succeed running this? I still cannot push to the Ufoai Git
also I've found more bugs in my code, need time to fix them though.
rasterising a map, and allow to play it is imo a very big computation problem. No idea if it is possible.
That seem not that complicated if we'll just use OpenGL - from the map editor render each map tile to an off-screen surface or even to the screen (I mean big tile, like dropship or UFO), then get the resulting image and Z-buffer values using glReadPixels(). Then for each individual small tile, where soldiers will stand, check Z-buffer value and determine if there are any pixels that will cover the soldier, and also save that "visibility" images.
Then repeat for each floor level.
Those big tiles can be combined on-the-fly into an isometric game level just like you're doing that in 3D (but you'll have to combine "visibility" images on the tile borders, not that complicated too).
When rendering the soldiers there are two ways:
1. Draw the background to the near Z-Buffer plane. Then for each soldier, sorted from top to bottom:
Disable Z-Buffer check.
Render soldier 3-D model onto the background, so it will make a depth "hole" in Z-Buffer.
Enable Z-buffer check
Draw the "visibility" image with some alpha-blend value to the near Z-Buffer plane, that will make soldier model half-transparent but other background pixels will not change, because it will be applied only to a "hole" in Z-Buffer.
This will also fill the "hole" in the Z-buffer, so when you'll render next soldier which will be close to the previous one the "visibility" image will not be applied twice on the first soldier.
2. Draw the background to the far Z-Buffer plane. Then for each soldier, sorted from top to bottom:
Render soldier 3-D model normally.
Call glAlphaFunc() so only non-transparent pixels will modify Z-Buffer.
Draw the "visibility" image right before soldier with some alpha-blend value, that will make soldier model half-transparent, but will not change background pixels 'cause they have the same value.
If two soldiers will stand near each other the "visibility" image from the second one may be applied to the first one, and this will create drawing artifacts.
That sounds easy, but require lot of developer time and small details sorted out.
Edit: I've made another build
, with slightly less memory usage - it uses just 170 Mb with loaded main menu.