How to increase max count of material texture? I tried to change:
//! Maximum number of texture an SMaterial can have.
const u32 MATERIAL_MAX_TEXTURES = 4;
When I had changed value and recompiled engine, engine crashed. When I call any function from recompiled engine, I have random probability to catch unhandled exception.
Increase max count of material texture
-
- Admin
- Posts: 14143
- Joined: Wed Apr 19, 2006 9:20 pm
- Location: Oldenburg(Oldb), Germany
- Contact:
Ok, you're right. The Windows dll memory allocator problem does not exist under Linux, so I did not encounter the buffer overflow. The problem is that the current texture matrices are stored in the drivers. But these matrices are fixed to 4 textures so you get a buffer overflow when using more.
I'll have to check to to overcome this limit (probably at first by limiting the texture matrices to the first 4 textures. I move this post to the bug forum.
I'll have to check to to overcome this limit (probably at first by limiting the texture matrices to the first 4 textures. I move this post to the bug forum.
-
- Admin
- Posts: 14143
- Joined: Wed Apr 19, 2006 9:20 pm
- Location: Oldenburg(Oldb), Germany
- Contact:
A first quick hack would avoid to set the transform for textures larger than 4. The pretty solution is more involved because we have to get the correct size for the matrix array and several other things together with the necessary symbols inside an enum. I guess we have to add a large number of symbols and just not create all those matrices inside the driver. But I'm not sure about this.