(C++)Irrlicht 1.1 : Fake Glow,Dream and Night Vision
To be sure, i tried all available renderer, used a "fresh" FPS-Camera, but no Effect appears. There are 3 possibilities left:
- either my code is wrong,
- effects are incompatible with 1.3 (actually impossible), or
- i don't understand that OnAnimate() function right, and that this is the function causing this problem, although it is never used.
- either my code is wrong,
- effects are incompatible with 1.3 (actually impossible), or
- i don't understand that OnAnimate() function right, and that this is the function causing this problem, although it is never used.
In order to get this code working with Irrlicht 1.3 i replaced OnPreRender() with the new method called OnRegisterSceneNode() (instead of OnAnimate() which actually isn't meant to be used for registering scene nodes for rendering anyways) and the code at least works. Allthough i am using my own ICameraSceneNode so the effects currently do not show up as expected...still looking for an idea how to fix that transformation stuff the right way...
bye
mrc
bye
mrc
Ok, i fixed that transformation problem just by adding a 'setRotation(vector3df(RotX, RotY, 0));' to my camera animation code.
The usual behavior is to just construct a temporary rotation matrix and update camera position and target accordingly. The position of the ICameraSceneNode was updated too (setPosition) but 'setRotation' was missing. At least in my code.
Now the transformation of the quads relative to the camera is correct.
The only strange thing left is that the effect seems to be heavily 'overdozed'. Looks like and endless feedback loop...
hmmm.
bye
mrc
The usual behavior is to just construct a temporary rotation matrix and update camera position and target accordingly. The position of the ICameraSceneNode was updated too (setPosition) but 'setRotation' was missing. At least in my code.
Now the transformation of the quads relative to the camera is correct.
The only strange thing left is that the effect seems to be heavily 'overdozed'. Looks like and endless feedback loop...
hmmm.
bye
mrc
-
- Posts: 81
- Joined: Sat Sep 09, 2006 6:46 am
Okay, I've figured it out. And yes, it runs fairly well on 1.3.
Follow these steps:
Add a deconstructor to the CPP and H files:
CPP: CQuadSceneNode::~CQuadSceneNode() {}
H: ~CQuadSceneNode();
Change onPreRender() to OnRegisterSceneNode():
CPP: void CQuadSceneNode::OnRegisterSceneNode()
H: virtual void OnRegisterSceneNode();
Call a create BEFORE the main loop:
EffectsLibrary::CreateGlow(cam,smgr,20);
Call Render AFTER endScene():
driver->endScene();
EffectsLibrary::RenderGlow(smgr,128,128,128,128,20);
I'll work on bettering the code and making it more advanced.
[Edit]
Here's a screenshot, running smooth on 1.3 :]
I'll have the updated setup at http://bladestrife.net/downloads.php soon enough :]
Fixes a few code problems (Defaults being in CPP, not H), and I'll translate it into english. Also, allow you to possibly set the resolution of the effects.
Follow these steps:
Add a deconstructor to the CPP and H files:
CPP: CQuadSceneNode::~CQuadSceneNode() {}
H: ~CQuadSceneNode();
Change onPreRender() to OnRegisterSceneNode():
CPP: void CQuadSceneNode::OnRegisterSceneNode()
H: virtual void OnRegisterSceneNode();
Call a create BEFORE the main loop:
EffectsLibrary::CreateGlow(cam,smgr,20);
Call Render AFTER endScene():
driver->endScene();
EffectsLibrary::RenderGlow(smgr,128,128,128,128,20);
I'll work on bettering the code and making it more advanced.
[Edit]
Here's a screenshot, running smooth on 1.3 :]
I'll have the updated setup at http://bladestrife.net/downloads.php soon enough :]
Fixes a few code problems (Defaults being in CPP, not H), and I'll translate it into english. Also, allow you to possibly set the resolution of the effects.
-
- Posts: 81
- Joined: Sat Sep 09, 2006 6:46 am
cool... can these be added into the core?
My company: http://www.kloena.com
My blog: http://www.zhieng.com
My co-working space: http://www.deskspace.info
My blog: http://www.zhieng.com
My co-working space: http://www.deskspace.info
-
- Posts: 81
- Joined: Sat Sep 09, 2006 6:46 am
There's no point in putting them into the engine... I'm going to look into a way to draw without the scene node, as well as looking for a way to hook into DX9's render device and be able to apply fullscreen effects there too. I'm not an expert, I just seem to stumble on good and useful ideas. If things go well, you'll see some of these findings in 1.4
u can download from here http://www.sendspace.com/file/agaq4x only 8kb
http://www.sendspace.com/file/agaq4x
http://www.sendspace.com/file/agaq4x