Hi. I want to apply a different shader for each MeshBuffer of a Mesh. I have followed Tutorial 10 and no problems showing shaders in a whole Mesh, but I can't apply in a single MeshBuffer.
Your code is correct. This should work if certain conditions are met. Question is if meshbuffer 0 contains any geometry and is the one you want to alter. Also make sure you have the proper texture coords, maybe you need two sets or tangent meshes?
hybrid wrote:Your code is correct. This should work if certain conditions are met. Question is if meshbuffer 0 contains any geometry and is the one you want to alter. Also make sure you have the proper texture coords, maybe you need two sets or tangent meshes?
The Mesh is a group of 3 MeshBuffer, and all MeshBuffer has a geometry. I have tried to modify each one, and no results. Geometry doesn't need tangents nor binormals, shader code is very simply (it's the same shader code from the examples).
It's very odd, if I apply the shader to the whole Mesh it renders Perfectly.
Does Irrlicht need some type of call to a function for updating the material?
Try to change the other material parameters, e.g rendering in wireframe only one of the meshbuffers. This will make sure you're really changing the correct material. Besides that, nothing special is necessary.
Well, in the second case you alter the lighting color properties. If lighting is off, this obviously has no effect. So just try the same code with your shader.