A simple, robust and extendible postprocessing class
occlusion doesn't depend on the object type, just so long as all the objects render their z position into the alpha channel (specifically, with this new version they need to write 1.0 - 50.0 / (z + 50.0) into the z)
the reason you can't see anything between the tree and box/terrain is because there's very little distance between them, so the effect is barely noticeable. You can fix it by setting the multiplier higher, though this will make a thick outline against the clouds. It's a bit of a limitation with the effect - maybe it would be better if after a certain distance it began to fade out again, as it would in reality.
as for a screenshot of the water;
The general blocky-ness of the water is because of my crude wave generator. The jagged shoreline is because of the 8-bit depth buffer, and the black far-away water.. I don't know, I need to look into that. It's probably because it's very deep, but the reflection not refraction should be in effect there.
edit: duh! worked it out - the z coord is infinite there, so it can't work out where the water is. I'll see what I can do to fix that
the reason you can't see anything between the tree and box/terrain is because there's very little distance between them, so the effect is barely noticeable. You can fix it by setting the multiplier higher, though this will make a thick outline against the clouds. It's a bit of a limitation with the effect - maybe it would be better if after a certain distance it began to fade out again, as it would in reality.
as for a screenshot of the water;
The general blocky-ness of the water is because of my crude wave generator. The jagged shoreline is because of the 8-bit depth buffer, and the black far-away water.. I don't know, I need to look into that. It's probably because it's very deep, but the reflection not refraction should be in effect there.
edit: duh! worked it out - the z coord is infinite there, so it can't work out where the water is. I'll see what I can do to fix that
It only shows the top right quadrant, like the rest is just cut off, not compacted. Also, i noticed the lens flare doesn't get hidden by the black space. It would be awesome if you could fix this, because i really like the effect.well the old monitor effect isn't really supported. it's just me messing about. Might be able to fix it if you can tell me if it's showing the whole scene compacted, only the top-right quadrant (cropped), or the bottom left quadrant panned to the top right. What you describe implies I made a mistake with some texture size/copy function somewhere, which is worth tracking down.
multum in parvo
Hi David, it's great that you're still working with it
I'll look more detail at your code some later and may be make some additions.
Also, i want to say you can exclude a line from the main.cpp file, for mainly irrlicht projects we don't need a win32 functionality directly (it all is in the engine core)
Good luck
Edit: one more note - why don't you use a delete for your new operator? Another one - at the lens flare example you have two new operators for the same pointer - it's bad style
I'll look more detail at your code some later and may be make some additions.
Also, i want to say you can exclude a line
Code: Select all
#include <windows.h>
Good luck
Edit: one more note - why don't you use a delete for your new operator? Another one - at the lens flare example you have two new operators for the same pointer - it's bad style
oops, I'm always forgetting that stuff. I've added a delete for each new (in the example and in the classes), fixed that double set in the lens flare, and added a remove call for the camera made by the water node, so that should be everything tidied up
I'm going through now fixing the using namespace stuff so that it isn't needed by the classes. Should make it integrate with existing projects easier.
All this will be in the next update.
I'm going through now fixing the using namespace stuff so that it isn't needed by the classes. Should make it integrate with existing projects easier.
All this will be in the next update.
I don't see why you can't reproduce the bug. I am not doing anything special in my code that would mess with it. I just copied the code from the example. Maybe there is something wrong with the example code. Are you using the exact code from the example to test it?not being able to reproduce the bug is a problem
I would be happy to help.If it isn't, I'll put up a few tests you can run to help me track it down
PS: When do you think the next update will be available?
multum in parvo
Downoladed new release to test and implement lens flare. Recompiled and..
It seems that AO make it look how it looks. Disabled if for a while and all working fine.. Can you fix it somehow.
Edit:
Ther's also problem with LensFlare:
Code: Select all
IPostProc* ppRenderer = new CRendererPostProc( smgr, dimension2di( 1024, 512 ), true, true, SColor(255,100,101,140) );
ppBloom = new CEffectPostProc( ppRenderer, dimension2di( 1024, 512 ), PP_BLOOM, 2.4f);
CEffectPostProc* ppLighten = new CEffectPostProc( ppBloom, dimension2di( 1024, 512 ), PP_LIGHTEN, 0.95f);
CEffectPostProc* ppAO = new CEffectPostProc( ppLighten, dimension2di( 1024, 512 ), PP_OCCLUSION, 8.0f );
ppBlur = new CEffectPostProc( ppAO, dimension2di( 1024, 512 ),PP_BLURFINE,0.000f);
Edit:
Ther's also problem with LensFlare:
Code: Select all
[Linker error] undefined reference to `CLensFlarePostProc::CLensFlarePostProc(IPostProc*, irr::core::dimension2d<int>, irr::video::ITexture*, irr::scene::ISceneNode*)'
[Linker error] undefined reference to `CLensFlarePostProc::CLensFlarePostProc(IPostProc*, irr::core::dimension2d<int>, irr::video::ITexture*, irr::core::vector3d<float>)'
yes this is a known limitation. Bloom and Lighten (and many others) do not preserve the alpha, meaning they will mess up the z-depth information. To fix it, put the occlusion first, then do bloom and lighten. I won't change this because it makes more sense to do occlusion then bloom instead of the other way around anyway. As for lighten, it's already fixed in the next release, as are most of the other non-blurring effects.
This also applies to all other effects which depend on the z-depth - they must be early in the render sequence.
(if it was working for you before, I don't know why)
Your other problem; did you include CLensFlarePostProc.cpp in the build?
if you didn't, that's the problem! and if you did, chances are it's fixed in the new version (which uses much stricter types). The new version will be available within the next few hours.
btw, it seems you're not using special shaders on your scene - remember that to use occlusion properly, you must use a shader which writes the z depth to the alpha component (specifically sets alpha to 1.0 - 100.0 / (z + 100.0)). It's a pain, but until Irrlicht 1.6 is released I can't work around it.
I added some simple shaders which should work fine for your terrain, although you will need to edit the water yourself. I realise this is a problem for the trees and clouds, which use the alpha. In the next release, I have included a EMT_TRANSPARENT_ALPHA_REF equivalent to help with this. (but the clouds will still be problematic)
This also applies to all other effects which depend on the z-depth - they must be early in the render sequence.
(if it was working for you before, I don't know why)
Your other problem; did you include CLensFlarePostProc.cpp in the build?
if you didn't, that's the problem! and if you did, chances are it's fixed in the new version (which uses much stricter types). The new version will be available within the next few hours.
btw, it seems you're not using special shaders on your scene - remember that to use occlusion properly, you must use a shader which writes the z depth to the alpha component (specifically sets alpha to 1.0 - 100.0 / (z + 100.0)). It's a pain, but until Irrlicht 1.6 is released I can't work around it.
I added some simple shaders which should work fine for your terrain, although you will need to edit the water yourself. I realise this is a problem for the trees and clouds, which use the alpha. In the next release, I have included a EMT_TRANSPARENT_ALPHA_REF equivalent to help with this. (but the clouds will still be problematic)
Thanks for fast reply. New release is on the way by now but in the meantime i have changed AO to be beafore bloom and lighten. Same situation appeared.
I must say the AO do not work at all. I have removed all the effects let AO works. Black terrain and skydome.
But i noticed that i added sun (sphere) with white texture on it. And it appeared normally. Want code and screenshot?
Get LensFlare to working. It looks fantastic. Have some problems with object on the way camera -> sun but it's in development/beta stage so it's great! <3
Some screens for advertisment:
Used: Lighten, bloom, lens flare.
I must say the AO do not work at all. I have removed all the effects let AO works. Black terrain and skydome.
But i noticed that i added sun (sphere) with white texture on it. And it appeared normally. Want code and screenshot?
Get LensFlare to working. It looks fantastic. Have some problems with object on the way camera -> sun but it's in development/beta stage so it's great! <3
Some screens for advertisment:
Used: Lighten, bloom, lens flare.