How set more that one texture...

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Vinetu
Posts: 27
Joined: Wed Apr 07, 2004 6:57 am
Location: Lithuania
Contact:

How set more that one texture...

Post by Vinetu »

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
"Teach yourself DISCIPLINE."

Your sincerely,
Saulius Šunauskas
thesmileman
Posts: 360
Joined: Tue Feb 10, 2004 2:20 am
Location: Lubbock, TX

Post by thesmileman »

Is one of your textures transparent or have an alpha channel so that you can see through to the other texture?
Vinetu
Posts: 27
Joined: Wed Apr 07, 2004 6:57 am
Location: Lithuania
Contact:

Post by Vinetu »

My textures aren't transperant or with alpha channel.
"Teach yourself DISCIPLINE."

Your sincerely,
Saulius Šunauskas
puh
Posts: 356
Joined: Tue Aug 26, 2003 3:53 pm

Post by puh »

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.
Vinetu
Posts: 27
Joined: Wed Apr 07, 2004 6:57 am
Location: Lithuania
Contact:

Post by Vinetu »

Thanks puh, but I don't find in documentation. Can you say where is it?
"Teach yourself DISCIPLINE."

Your sincerely,
Saulius Šunauskas
puh
Posts: 356
Joined: Tue Aug 26, 2003 3:53 pm

Post by puh »

Example:

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);
setMaterialFlag
setMaterialType
Vinetu
Posts: 27
Joined: Wed Apr 07, 2004 6:57 am
Location: Lithuania
Contact:

Post by Vinetu »

Thanks a lot!
"Teach yourself DISCIPLINE."

Your sincerely,
Saulius Šunauskas
Post Reply