what am i doing
Arcane
- Joined
- Dec 24, 2018
- Messages
- 1,898
Right, forgot about that aspect of partial transparencySo you're saying I should go back to sprites with 1-bit transparency? The Z buffer can't be used otherwise.For your purposes, I would consider making use of a very tiny Z axis offset on objects, applied to their model matrix, and enabling depth testing.
In that case, your best bet is likely to decouple render objects from gameplay entities and get yourself as lightweight a render object struct as possible so that sorting your vector of render objects based on their desired draw order is as fast as possible. If they already are decoupled then you probably won't run into any issues (provided the sort is run only once per frame) but I would go with sorting over reinserting.
The other alternative is to do some sorting of your objects so that translucent materials are done in a later draw call or series of draw calls. This, I think, is how most engines would handle it, but it does add some complexity in that you then have two or more conceptually separate "draw lists".
Edit: also, having render objects decoupled from gameplay entities means gameplay entities could be in one vector but render objects in separate vectors depending on their material.
Last edited: