I'm almost finished with a material script loader for Irrlicht. I intend to finish it and publish it for your convenience It supports pretty much all Irrlicht's material related features.
I made it based on material sequences in the .ms3d format, i don't know about the sequences in other formats(perhaps someone could enlighten me?).
Functions available now:
- Apply script to node
- Apply list gotten from the materialloader to a node
- Register callback under name for shaders
- and unregister
C&c welcome!
Code: Select all
static irr::core::list<irr::video::SMaterial> *getMaterials( const irr::c8 *filename );
static void applyToNode( irr::core::list<irr::video::SMaterial> *matlist, irr::scene::ISceneNode *node );
static void applyToNode( const irr::c8 *filename, irr::scene::ISceneNode *node );
static void setDriver( irr::video::IVideoDriver *vd );
static int IMaterialLoader::createMaterialType(std::string vn=0,std::string ve=0,std::string pn=0,std::string pe=0,irr::video::E_MATERIAL_TYPE mt=irr::video::EMT_SOLID,std::string callbackname=0);
static void registerCallBack(irr::video::IShaderConstantSetCallBack *cb,std::string name);
static void unRegisterCallBack(std::string name);
Code: Select all
<root>
<!-- Irrlicht doesn't support multiple passes yet but who knows in the future -->
<!-- Every feature except shaders will default to whatever is Irrlicht's if it is not defined -->
<material>
<pass>
<emissive value1="0" value2="0" value3="255">
<specular value1="255" value2="255" value3="255">
<shininess value1="20">
<gouraud value1="true">
<materialtype value1="EMT_SPHERE_MAP">
<texture1 value1= "media/textures/1.jpg">
<texture2 value1= "media/textures/2.jpg">
<wireframe value1= "true">
</pass>
</material>
<material>
<pass>
<emissive value1="0" value2="255" value3="0">
<specular value1="255" value2="255" value3="255">
<shininess value1="20">
<gouraud value1="true">
<materialtype value1="EMT_SPHERE_MAP">
<texture1 value1 = "media/textures/1.jpg">
<texture2 value1 = "media/textures/2.jpg">
<vs value1 = "dx_hlsl" value2 = "media/shaders/shader.hlsl" value3 = "vertexMain">
<ps value1 = "dx_hlsl" value2 = "media/shaders/shader.hlsl" value3 = "pixelMain">
<shadercallback value1 = "callbacky">
</pass>
</material>
<material>
<pass>
<emissive value1="255" value2="0" value3="0">
<specular value1="255" value2="255" value3="255">
<shininess value1="20">
<gouraud value1="true">
<materialtype value1="EMT_SPHERE_MAP">
<texture1 value1 = "media/textures/1.jpg">
<texture2 value1 = "media/textures/2.jpg">
</pass>
</material>
</root>