The Source is pretty straight, it just loads an irr file, and the meshes
Code: Select all
#include <iostream>
#include <irrlicht.h>
using namespace std;
using namespace irr;
int main(int argc, char* argv[]){
IrrlichtDevice *device;
SIrrlichtCreationParameters prm;
core::array< SJoystickInfo > joysticks;
scene::ISceneManager* smgr;
video::IVideoDriver* drv;
scene::IMeshSceneNode* level;
scene::ICameraSceneNode* camera;
scene::ILightSceneNode* luz1;
gui::IGUIEnvironment* gui;
prm.Bits = 32;
prm.DriverType = video::EDT_DIRECT3D9;
prm.Fullscreen = true;
prm.Stencilbuffer = true;
prm.Vsync = false;
prm.AntiAlias=4;
prm.WindowSize = core::dimension2d<u32>(1440,900);
device = createDeviceEx(prm);
if(device){
device->activateJoysticks(joysticks);
smgr=device->getSceneManager();
drv=device->getVideoDriver();
gui=device->getGUIEnvironment();
drv->setTextureCreationFlag(video::ETCF_OPTIMIZED_FOR_SPEED ,true);
smgr->loadScene("./data/scenes/Scene2.irr");
camera=smgr->addCameraSceneNodeFPS(
0,
50,
0.075
);
camera->setPosition(core::vector3df(-2000,0,0));
camera->setFarValue(5000);
camera->setFOV(core::PI/3);
/*luz1=smgr->addLightSceneNode(0,core::vector3df(-2000,2000,2000));
luz1->getLightData().Falloff=0;
luz1->getLightData().DiffuseColor=video::SColor(255,255,243,197);
luz1->setRadius(5000);*/
drv->setFog( video::SColor(0, 255, 255, 255),
video::EFT_FOG_LINEAR,
20.0f,
3000.0f,
0.001f) ;
//level=(scene::IMeshSceneNode*)smgr->getSceneNodeFromName("LevelRenderMesh0");
//level->getMesh()->setHardwareMappingHint(scene::EHM_STATIC,scene::EBT_NONE);
/*for(u32 i=0;i<level->getMaterialCount();i++){
level->getMaterial(i).AmbientColor=video::SColor(0,64,64,64);
level->getMaterial(i).DiffuseColor=video::SColor(0,128,128,128);
level->getMaterial(i).SpecularColor=video::SColor(0,250,250,250);
level->getMaterial(i).NormalizeNormals=true;
level->getMaterial(i).AntiAliasing=true;
}*/
int lastFPS = -1;
device->getCursorControl()->setVisible(false);
while(device->run()){
drv->beginScene(true, true, video::SColor(0,128,160,255));
smgr->drawAll();
drv->endScene();
int fps = drv->getFPS();
if (lastFPS != fps)
{
core::stringw str = L"Olimpus Asteroid Tech Demo [";
str += drv->getName();
str += "] FPS:";
str += fps;
str += "-Triangles :";
str += drv->getPrimitiveCountDrawn();
device->setWindowCaption(str.c_str());
lastFPS = fps;
}
}
}
return 0;
}
The material is a reflection_2_layer, and is affecting the same to 4 diferent meshes. That is why i really can't point a posible source of the trouble, because there are other meshes which have also a reflection_2_layer material, and render fine. It iseems as if the textures weren't passed to the material or the like, it must be something that has changed since the v 1.6
It is compiled with Code::blocks and the Nov2008 DXSDK.
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt