I'm starting a new thread in the "Beginners Help" forum because I think it's more appropriate.
Been looking for a couple hours on how to accomplish this task. I learned a lot about shaders in the mean time and got some examples working. Pretty cool stuff.
So, as for my situation, lets say I load my map / mesh (BSP) in like this:
I'm not sure, but i think that the bsp node should have one material for each texture. so by getting the number of materials, looping trough each, getting the material and checking it against a certain texture, you could find the right material. Then you just have to change the material type. Good Luck.
If you don't have anything nice to say, don't say anything at all.
Luben wrote:I'm not sure, but i think that the bsp node should have one material for each texture. so by getting the number of materials, looping trough each, getting the material and checking it against a certain texture, you could find the right material. Then you just have to change the material type. Good Luck.
Thanks I'll take a look at the API for going through mesh materials.
Well I looked through some API information regarding mesh buffers, SMaterials, and getChildren. Did some testing but it doesn't seem like those are what I'm looking for.
Does irrLicht store any texture "filename" information when textures get loaded? How can I setup my BSP maps so that I can select specific textures later on through irrLicht so that I can use shaders on them?
Hopefully I'm not missing something totally obvious...
// sort through the textures to assign specific shaders...
for (int i = 0; i < EHwdwRoom->nodeRoom->getMaterialCount(); i++){
// if name matches for this shader...
if (EHwdwRoom->nodeRoom->getMaterial(i).Textures[0]->getName() == "textures/gothic_wall/goldbrick.jpg"){
EHwdwRoom->nodeRoom->getMaterial(i).setFlag(video::EMF_LIGHTING, false);
EHwdwRoom->nodeRoom->getMaterial(i).MaterialType = (video::E_MATERIAL_TYPE) newMaterialType1;
}
}