So, while I could create a new material for each cube I don't really want to do that (optimizations become impossible) so instead I declare some materials as such
Compare the values of the buffer material with the material after copying it. They should be identical - but maybe operator= in SMaterial has a bug? (I don't think so, but who knows...)
But something about materials:
- Why create one with new anyway? You can just use on on the stack.
- Nodes usually overwrite buffer materials unless you set IMeshSceneNode:: setReadOnlyMaterials to true. Meaning you can also set the node materials later on. Mentioning this as I said in another thread already you can just create one mesh and use that in all nodes. Just in case you don't do that because you need different materials at some point. There's no need to worry about that.
- And nodes having own material also means - if you set the lines above _after_ creating the node, then the node won't be affected.
I have no particular reason for creating the material with new really, it makes for easy testing though, as for why I don't just instance every mesh... that works fine if I only had maybe 12 different blocks but alas I have a lot more than that, my small testing set is 31 different ones and the final amount will be much greater.
Why would the node overwrite the buffer materials anyway? (the reason I'm declaring the materials before the mesh and then setting the buffer materials to these materials is to allow optimizing, greedy meshing only works on meshes with the same material)
No idea why that is the default - this decision was made before I joined Irrlicht. Maybe it's just a typical case that you use same mesh with different materials. I can only tell you it's there and how to disable it if you don't want that :-)
I'll disable that behavior as I set my own materials, anyway after experimenting it seems materials default to having bilinear filtering on, which is of course completely awful looking for low res (8x8px) textures.