Hmmm.
In case it was working as intended I started to write my own system/ approach yesterday with the hopes of it performing better for some reason. First I wrote a converter to replace all _bmap occurrences in my effect files with _AUTO. That converter scans through all *.c and *.h files as well for global materials, then outputs a single effect setup file with a structure as follows:
Quote:
fxFileName[material1,material2,...](textureAUTO1,textureAUTO1,...)
(In case some materials use the same effect file - probably unnecessary but I had material events and mtl switching in mind.)

Now an AUTOTextureInit() function reads that file, gets MATERIAL* and BMAP* pointers and saves the corresponding *_AUTO names.
An AUTOTextureUpdate() loop sets all _AUTO textures of each material. It's working, and luckily more performant - for whatever reason - than _bmap/ your code snippet.

I now get 1024fps in my "simple test scene (A)" (up from 500), and 1260fps if I don't call the update function (key press).
During actual gameplay in a real level I have found a performance increase of ~1.3ms (140->170, 170->220fps).


If I don't run the update function (for all materials) I obviously get a small speed boost on top of that. I'd like to do that, preferably by setting MATERIAL (and/ or BMAP?) flags (request update/ is postprocessing material/ ...).
This leads me to my last question for now:

Quote:
// note: all other flag bits are used internally and must not be modified!!
[...]
// MATERIAL flags
#define PASS_SOLID (1<<11) // enforce solid pass
#define TANGENT (1<<16)
#define ENABLE_RENDER (1<<17) // call event before object rendering
#define ENABLE_VIEW (1<<18) // call event before view rendering
#define ENABLE_TREE (1<<19) // call event before entity sorting
#define OVERRIDE (1<<22) // override view material
#define AUTORELOAD (1<<24) // reload effects when changed

// BMAP flags
#define BMPF_ARGB (1<<8) // bitmap contains alpha channel
#define BMPF_SAVE (1<<9) // bitmap was modified
#define BMPF_MIPMAPS (1<<10) // bmap->pixels contains 3 mipmaps


Could you please tell me 2-3 flags/ bits per MATERIAL and BMAP struct that are *not* used internally, despite the note?

Thanks for your time and the insight.


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends