Before diving into the code I wonder if somebody (Ken if he has time) can explain in a few words how MD2 support is implemented in the recent Build versions. Is it done with some kind of Z-Buffer? Rendered and then draw as sprite?
Any explanation would be very well received. Thanks in advance!
JonoF at
MD2s are drawn by doing nothing more than excecuting the GL commands list that are present in the MD2 file format. The Z-buffer takes care of overdraw and the polygon winding order takes care of the back-facing polygon culling.
Jonathon
Saucjedi at
Thanks for the reply! ANyway, one more question: does the engine draw the world and then the models using z-buffer? or it is all part of the same process?
JonoF at
The solid walls, ie. white lines and the walls formed by the height difference of a lower sector and higher sector, are drawn first. Then, the masked walls and sprites (models) are drawn in back-to-front order, with the Z-buffer of course. This is why in Polymost you get the occasion where a masked wall and a sprite are drawn in the wrong order and the sprite is invisible because the wall that is closer is drawn before the sprite.