After a short break , because of school , i work on a new project.But the i got my first problems with my 3d scene.
I add a Postprocess framework , some shader based water and a cold effect.
clear:
Code: Select all
#include "RealisticWater.h"
#include "CloudSceneNode.h"
#include "PostProcessBloom.h"
Code: Select all
IrrlichtDevice *device = createDeviceEx(params);
//...
video::IGPUProgrammingServices* gpu = driver->getGPUProgrammingServices();
Code: Select all
IPostProcessBloom *Bloom = new IPostProcessBloom(smgr->getRootSceneNode(), smgr, 666);
PPE_Bloom_Setup setup;
setup.sampleDist=0.008;
setup.strength=3;
setup.multiplier=5;
Bloom->initiate(1024,512,setup,smgr);
RealisticWaterSceneNode* water = new RealisticWaterSceneNode(smgr, 512, 512, driver->getTexture("data/waterbump.png"));
smgr->getRootSceneNode()->addChild(water);
cloudLayer1 = new scene::CCloudSceneNode(smgr->getRootSceneNode(), smgr);
cloudLayer1->setTranslation(core::vector2d<f32>(0.008f, 0.0f));
cloudLayer1->getMaterial(0).setTexture(0, driver->getTexture("cloud01.png"));
cloudLayer1->setCloudHeight(0.5f, 0.1f, -0.05f);
//...
Code: Select all
s32 lastFPS = -1;
while(device->run())
if (device->isWindowActive())
{
driver->beginScene(true, true, SColor(255,255,255,255));
driver->setRenderTarget(Bloom->rt0, true, true, video::SColor(0,0,0,0));
smgr->drawAll();
driver->setRenderTarget(0);
Bloom->render();
driver->setMaterial(driver->getMaterial2D());
env->drawAll();
driver->endScene();
const s32 fps = driver->getFPS();
if (lastFPS != fps)
{
core::stringw str = L"Venom game";
str += driver->getName();
str += "FPS:";
str += fps;
device->setWindowCaption(str.c_str());
lastFPS = fps;
}
}
smgr->getRootSceneNode()->removeChild(water);
device->drop();
return 0;
}
Code: Select all
driver->setRenderTarget(Bloom->rt0, true, true, video::SColor(0,0,0,0));
//...
driver->setRenderTarget(0);
Bloom->render();
Console says nothing about any big shader fails or code errors only 'Unsupported texture format' but this should not have a black screen as render result
Code: Select all
Using renderer: OpenGL 4.0.0
GeForce GTX 460/PCI/SSE2/3DNOW!: NVIDIA Corporation
OpenGL driver version is 1.2 or better.
GLSL version: 4.0
Loaded texture: d:/#venom/venom_game/venom_game/gamedata/skyboxes/calm_north.bmp
Loaded texture: d:/#venom/venom_game/venom_game/gamedata/skyboxes/calm_south.bmp
Loaded texture: d:/#venom/venom_game/venom_game/gamedata/skyboxes/calm_west.bmp
Loaded texture: d:/#venom/venom_game/venom_game/gamedata/skyboxes/calm_east.bmp
Loaded texture: d:/#venom/venom_game/venom_game/gamedata/skyboxes/calm_down.bmp
Loaded texture: d:/#venom/venom_game/venom_game/gamedata/skyboxes/calm_up.bmp
Unsupported texture format
Unsupported texture format
Loaded texture: d:/#venom/venom_game/venom_game/gamedata/data/waterbump.png
Unsupported texture format
Unsupported texture format
Unsupported texture format
Loaded texture: d:/#venom/venom_game/venom_game/gamedata/clouds/cloud01.png
Loaded texture: d:/#venom/venom_game/venom_game/gamedata/clouds/cloud02.png
Loaded texture: d:/#venom/venom_game/venom_game/gamedata/textures/cloud03.png
Resizing window (800 600)
Luis