Hi all! I come back with new problems:))) I with DeleD editor create simple map. This map have two textures. I with LithUnwrap change material names and then load with Irrlicht. Geometry loads perfecty, but map has only one texture on it. I think it is problem with setMaterialTexture(). How to fix it? Does setMaterilaTexture(0, driver->getTexture("texture.bmp")) texture layer don't work? Any suggestions?
My code
-----------------------------------------------------------------------
#include <irrlicht.h>
using namespace irr;
#pragma comment (lib, "Irrlicht.lib")
int main()
{
IrrlichtDevice* device = createDevice(video::EDT_DIRECTX8,
core::dimension2d<s32>(640,480),16, false, false);
scene::ISceneManager* smgr = device->getSceneManager();
video::IVideoDriver* driver = device->getVideoDriver();
device->setWindowCaption(L"Project: Bandymai");
scene::ISceneNode* node = smgr->addAnimatedMeshSceneNode(smgr->getMesh("bandymas.x"));
if (node)
{
b]node->setMaterialTexture(0, driver->getTexture("BRICK4.BMP"));
node->setMaterialTexture(1, driver->getTexture("carpet3.bmp"));[/b]
node->setMaterialFlag(video::EMF_LIGHTING, false);
}
smgr->addCameraSceneNodeFPS();
while (device->run() && driver)
{
driver->beginScene(true, true, video::SColor(0, 100, 100, 100));
smgr->drawAll();
driver->endScene();
}
device->drop();
return 0;
}
-------------------------------------------------------------------------
Code ends here
How set more that one texture...
How set more that one texture...
"Teach yourself DISCIPLINE."
Your sincerely,
Saulius Šunauskas
Your sincerely,
Saulius Šunauskas
-
- Posts: 360
- Joined: Tue Feb 10, 2004 2:20 am
- Location: Lubbock, TX
Please, read API first:
http://irrlicht.sourceforge.net/docu/na ... o.html#a68
You should use different material mode to use 2 textures simultaneousely.
P.S. Next time enclose your code with [ code ] ... [ / code ] tags.
http://irrlicht.sourceforge.net/docu/na ... o.html#a68
You should use different material mode to use 2 textures simultaneousely.
P.S. Next time enclose your code with [ code ] ... [ / code ] tags.
Example:
setMaterialFlag
setMaterialType
Code: Select all
curNode->setMaterialTexture(0, driver->getTexture("media\\ext\\water0.jpg"));
curNode->setMaterialTexture(1, driver->getTexture("media\\ext\\water1.jpg"));
curNode->setMaterialFlag(video::EMF_LIGHTING, false);
curNode->setMaterialType(video::EMT_TRANSPARENT_REFLECTION_2_LAYER);
setMaterialType