I've a problem with X-Effect: simply I see only a black window when using effect->update() but if I use smgr->DrawAll() my scene is rendered.
I followed the same passes of example 1 for shadow maps but it doesn't work.
Code: Select all
int main()
{
int i;
// crea il device di Irrlicht
IrrlichtDevice* device=createDevice(E_DRIVER_TYPE::EDT_DIRECT3D9,dimension2d<u32>(800,600),32);
if (!device)
return 1;
device->setWindowCaption(L"OpenTomb Alpha");
IVideoDriver* driver = device->getVideoDriver();
ISceneManager* smgr = device->getSceneManager();
IGUIEnvironment* guienv = device->getGUIEnvironment();
EffectHandler* effect = new EffectHandler(device, driver->getScreenSize(), true, true);
bool b=device->getFileSystem()->addFileArchive("C:/Users/Marco/Desktop/Progetti/OpenTomb/Debug/test.zip",true,true,E_FILE_ARCHIVE_TYPE::EFAT_ZIP,"");
IAnimatedMesh* msh=smgr->getMesh("rooms.x");
IMeshSceneNode* node=0;
if(msh)
node=smgr->addOctreeSceneNode(msh->getMesh(0),0,1);
ITriangleSelector* selector=0;
if(node)
{
selector=smgr->createOctreeTriangleSelector(node->getMesh(),node,1);
node->setTriangleSelector(selector);
}
scene::ICameraSceneNode* camera =
smgr->addCameraSceneNodeFPS(0, 100.0f, .03f, 0, 0, 0, true, 3.f);
camera->setPosition(core::vector3df(-410,20,400));
camera->setTarget(core::vector3df(-490,20,500));
if (selector)
{
scene::ISceneNodeAnimator* anim = smgr->createCollisionResponseAnimator(
selector, camera, core::vector3df(5,5,5),
core::vector3df(0,-10,0), core::vector3df(0,10,0));
selector->drop(); // As soon as we're done with the selector, drop it.
camera->addAnimator(anim);
anim->drop(); // And likewise, drop the animator when we're done referring to it.
}
for (i=0;i<node->getMaterialCount();i++)
node->getMaterial(0).Lighting=false;
effect->addShadowToNode(node,E_FILTER_TYPE::EFT_NONE);
effect->setAmbientColor(SColor(255, 64, 64, 64));
const stringc shaderExt = (driver->getDriverType() == EDT_DIRECT3D9) ? ".hlsl" : ".glsl";
effect->addPostProcessingEffectFromFile(core::stringc("C:/irrlicht/XEffects/Bin/shaders/BrightPass") + shaderExt);
effect->addPostProcessingEffectFromFile(core::stringc("C:/irrlicht/XEffects/Bin/shaders/BlurHP") + shaderExt);
effect->addPostProcessingEffectFromFile(core::stringc("C:/irrlicht/XEffects/Bin/shaders/BlurVP") + shaderExt);
effect->addPostProcessingEffectFromFile(core::stringc("C:/irrlicht/XEffects/Bin/shaders/BloomP") + shaderExt);
ILightSceneNode* node2 = smgr->addLightSceneNode(0,core::vector3df(-410,20,400),
video::SColorf(1.0f, 0.6f, 0.7f, 1.0f), 800.0f);
effect->addShadowLight(SShadowLight(512, vector3df(-410,20,400), vector3df(-49,2,50),
SColor(0, 255, 0, 0), 2.0f, 6000.0f, 30.0f * DEGTORAD));
// rendering
while(device->run())
{
driver->beginScene(true,true,SColor(0x0));
effect->getShadowLight(0).setPosition(node2->getPosition());
effect->update();
//smgr->drawAll();
driver->endScene();
}
device->drop();
return 0;
}