I'm currently writing a custom material renderer implementing the IMaterialRenderer interface.
But my custom material renderer is only useful for me if there is both, a Direct3D version and an OpenGL version and if it does not need to include or edit Irrlicht Sources(!)
I've got a problem to implement the OnSetMaterial method of IMaterialRenderer correctly cause i can't call "setTexture" of the VideoDriver since IVideoDriver has no method called "setTexture", but both CDirect3D9Driver and COpenGLDriver has it with exactly the same function signature.
-> shouldn't setTexture be part of IVideoDriver? Why not?
In IVideoDriver.h it says about writing an own material renderer right bevore addMaterialRenderer():
Code: Select all
//! Adds a new material renderer to the video device.
/** Use this method to extend the VideoDriver with new MaterialTypes. To extend the
engine using this method do the following:
Derive a class from IMaterialRenderer and override the methods you need. For setting the right renderstates, you can try to get a pointer to the real rendering device using IVideoDriver::getExposedVideoData().
For example COpenGLShaderMaterialRenderer does it like this:
Code: Select all
void COpenGLShaderMaterialRenderer::OnSetMaterial(...)
{
Driver->setTexture(3, material.Textures[3]);
Driver->setTexture(2, material.Textures[2]);
Driver->setTexture(1, material.Textures[1]);
Driver->setTexture(0, material.Textures[0]);
...
}
So i can't set textures as the comment above tells me to.
-> shouldn't setTexture be part of IVideoDriver? Why not?
And yes, i need all 4 textures for my material renderer to be set.
Any solutions?
Remember: I don't want to edit or include Irrlicht Sources.
Thanks, pyrokar