effect->enableDepthPass(true);
// Load the dwarf mesh.
IAnimatedMesh* dwarfmesh = smgr->getMesh("media/dwarf.x");
// We create 9 dwarves arranged in a grid in a nested loop.
for(int g = 0;g < 3;g++)
{
for(int v = 0;v < 3;v++)
{
// Add a dwarf animated mesh scene node.
IAnimatedMeshSceneNode* dwarf = smgr->addAnimatedMeshSceneNode(dwarfmesh);
dwarf->setAnimationSpeed(25);
dwarf->setScale(vector3df(0.05f, 0.05f, 0.05f));
dwarf->setPosition(vector3df(g * 4.5f, 0.5f, v * 3.5f + 1.0f));
// Disable the lighting here too, XEffects overlay will handle it.
dwarf->getMaterial(0).Lighting = false;
dwarf->getMaterial(1).Lighting = false;
// If its the first row add some effects.
if(g == 0)
{
dwarf->setMaterialTexture(0,driver->getTexture("media/red.bmp"));
effect->addEffectToNode(dwarf, (E_EFFECT_TYPE)(v + 1));
}
effect->addNodeToDepthPass(dwarf);
// Apply a shadow to the dwarf, notice we are applying it to all of them
// including the ones that have effects applied.
//effect->addShadowToNode(dwarf, filterType);
}
}
// Set the background clear color to orange.
effect->setClearColour(SColor(255, 250, 100, 0));
// Add some post processing effects, a very subtle bloom here.
core::stringc shaderExt = (driver->getDriverType() == EDT_DIRECT3D9) ? ".hlsl" : ".glsl";
effect->addPostProcessingEffectFromFile(core::stringc("shaders/EdgeDetect") + shaderExt);[quote][/quote]
first thing, you see that gray lines in the model?
i guess its with the depth map...
and the other thing, the outline is "faster" than the render. so if i move the camera left, the outline goes left, and then the model... so its moving...[/img]
The lines do not show up for me, are you using ATI? I think it has to do with having correct ScreenRTT resolution, if it does not match the screen resolution you can get these artifacts. The demo uses 512x512 if it is an ATI card for compatibility in OpenGL, but you can comment this out. Hopefully it will fix the problem. For the camera update, It will be fixed in the next release.
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net