I created Patches (AKA curved surfaces) but I don't know how to apply a GLSL shader on it
I converted my patch to a brush entity (lets say f_wall) the entity is shown but it seem that I cannot aaply GLSL shader on it, it still uses the default Irrlicht material render regardless of the shader
(I absolutely need to use GLSL shaders, I don't want to use Q3 shaders)
The same code works on classic brush entities, but it seem that I need to do something to make it work with the patches...
I'm using Irrlicht v1.9
Have you any ideas?
If that not possible, is there a way to smooth brush normals?
What I want to do is to have a seamless curved glass
Here is how I am trying to apply the shader:
Code: Select all
MyGame::entities::WallEntity* wallE = ...;
irr::scene::IMeshSceneNode* node = wallE->getNode();
// This one not work (the node still use default Irrlicht material renderer) :(
node->setMaterialType(
gpu->addHighLevelShaderMaterialFromFiles(...)
);
// But those one are working (probably because it still uses the default renderer)
if (wallE->isDoubleSided())
node->getMaterial(i).BackfaceCulling = false;
if (wallE->isShiny())
node->getMaterial(i).Shininess = 32.0;