- Bump maps on features
Bump maps on units with no lua unit shaders overhead (in my experience, the overhead there is massive, nearly 50% less fps when many (100+) units are on screen
Bump maps for units under construction
1. Where to store the normal map/unit assignments?
Currently, i hard coded to load a texture that is called the same as texture1 (e.g. Arm1.dds -> Arm1_normal.dds)
Code: Select all
S3DModel* CS3OParser::Load(const std::string& name) ... model->tex3 = (char*) &fileBuf[header.texture1]; model->tex3 = model->tex3.insert( model->tex3.find_last_of("."), "_normal"); //horrible hacks by beherith ...
I figured that normal maps are nearly 100% tied to the diffuse texture1, this would be an 'ok', if hackish solution.
Also, if a normal map cannot be loaded, this allocates a single pixel dummy normal map. Which brings me to my next point
2. Texture caching.
I did a horrible hack to change the 'hash' function:
#define TEX_MAT_UID(pTxID, sTxID) ((boost::uint64_t(pTxID) << 32u) | boost::uint64_t(sTxID))
#define TEX_MAT_UID(pTxID, sTxID, tTxID) ((boost::uint64_t(pTxID) << 32u) | (boost::uint64_t(sTxID) << 16u ) | tTxID))
As I saw that texID's seem to be small values, incrementally assigned, and the chance of a collision seemed very low.
Just a screenshot of features and units having engine-level normal maps: Any thoughts are welcome