I draw some triangles with "draw2DVertexPrimitiveList" and try to set a Material with a Shader.
However the shader is not applied to that triangles, they just use the default solid material type.
This is my code to load the shader:
Code: Select all
video::IGPUProgrammingServices * const pGPUService = pDriver->getGPUProgrammingServices();
s32 GlassShader = pGPUService->addHighLevelShaderMaterialFromFiles(
"../../media/Glass.vert", "main", video::EVST_VS_1_1,
"../../media/Glass.frag", "main", video::EPST_PS_1_1,
nullptr, video::EMT_SOLID, 0, video::EGSL_DEFAULT);
irr::video::SMaterial Glass;
Glass.setFlag(irr::video::EMF_ZBUFFER, false);
Glass.setFlag(irr::video::EMF_BACK_FACE_CULLING, false);
Glass.setFlag(irr::video::EMF_FRONT_FACE_CULLING, false);
Glass.MaterialType = (video::E_MATERIAL_TYPE)GlassShader;
Code: Select all
pDriver->beginScene(true, true, irr::video::SColor(255,100,101,140));
pSceneManager->drawAll();
pDriver->getMaterial2D() = Glass;
pDriver->enableMaterial2D(true);
pDriver->setMaterial(Glass);
pDriver->draw2DVertexPrimitiveList(RectVertex, 4, Indices, 2, irr::video::EVT_STANDARD, irr::scene::EPT_TRIANGLES, irr::video::EIT_16BIT);
pDriver->enableMaterial2D(false);
pDriver->endScene();
So do I anything wrong in setting the 2D material or does 2D material simply not support custom shaders?
Best regards,
Graf Zahl