I got to testing this in 1.6 as I needed 6 textures in my Splat shader.
I changed IrrCompileConfig.h line 102 from this:
#define _IRR_MATERIAL_MAX_TEXTURES_ 4
to this:
#define _IRR_MATERIAL_MAX_TEXTURES_ 6
Here are my findings:
4: shaders appear normal
5: shaders did not appear
6: shaders did not appear
7: shaders did not appear
8: The engine crashes
I tested this on d3d9 and opengl.
Though the engine starts running, I believe that there are still things that need "fixing" in the area of more material textures
[no bug] Additional Textures cause problems in shaders
Vitek means that always, after add some important changes in Irrlicht headers (include), You have to rebuild engine from sources.
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
Exactly. If you change the value of _IRR_MATERIAL_MAX_TEXTURES_, you must rebuild the Irrlicht library for the changes to take effect.
The reason is that there is code inside the Irrlicht library that makes use of _IRR_MATERIAL_MAX_TEXTURES_. If the library was compiled with _IRR_MATERIAL_MAX_TEXTURES_ = 4, but your executable is compiled with _IRR_MATERIAL_MAX_TEXTURES_ = 8, your application will think that there are 8 textures, but the Irrlicht library only reserves space for and uses the 4 textures. When you access any texture past 4, you're actually asking the Irrlicht library to access one or more of its internal arrays past the end, which will cause crashes.
Of course it is a bug if the library attempts to index any of its internal arrays out of bounds. A bug report should be filed, and the issue should be fixed, but that won't actually resolve the problem that you will continue to see. Without rebuilding the library, you won't be able to access texture stages beyond 4.
Travis
The reason is that there is code inside the Irrlicht library that makes use of _IRR_MATERIAL_MAX_TEXTURES_. If the library was compiled with _IRR_MATERIAL_MAX_TEXTURES_ = 4, but your executable is compiled with _IRR_MATERIAL_MAX_TEXTURES_ = 8, your application will think that there are 8 textures, but the Irrlicht library only reserves space for and uses the 4 textures. When you access any texture past 4, you're actually asking the Irrlicht library to access one or more of its internal arrays past the end, which will cause crashes.
Of course it is a bug if the library attempts to index any of its internal arrays out of bounds. A bug report should be filed, and the issue should be fixed, but that won't actually resolve the problem that you will continue to see. Without rebuilding the library, you won't be able to access texture stages beyond 4.
Travis