A simple, robust and extendible postprocessing class

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki
sp00n
Posts: 114
Joined: Wed Sep 13, 2006 9:39 am

Post by sp00n »

nice one :)
do you read how to render water as postprocess?
it would be nice to see it in Irrlicht :)
DavidJE13
Posts: 165
Joined: Tue Jan 09, 2007 7:17 pm

Post by DavidJE13 »

impressive water.

Too complicated for me I'm afraid, and needs access to all sorts of info about the scene that I don't know how to get without requiring lots of strange render passes, but I might be able to make a simplified version. I'll see what I can come up with.
Escen
Competition winner
Posts: 167
Joined: Sun Jul 19, 2009 11:27 am
Location: the Netherlands
Contact:

Post by Escen »

Thanks for posting this.
DavidJE13
Posts: 165
Joined: Tue Jan 09, 2007 7:17 pm

Post by DavidJE13 »

hmm, having some trouble with water - I'm trying to get the world coordinates of each point from just the x,y screen coord and z-depth. I think it should be possible but it isn't quite working :(

I've updated the download to include my attempts so far (as well as a couple of improvements to the rest that I've forgotten). If you use the EXAMPLE_SANDBOX you can see that the height of the water varies with the camera (I did take the camera position into account, not sure what's causing the bug). No waves, sun or surf yet, but has water depth colouring and faded edges.
edit: forgot to mention; this is very limited in size, because I can only fake an 8-bit zbuffer. If I could get a 16 or 32-bit buffer this wouldn't be limited in size.

I'm done with this for now, going back to my other project (which was the reason I started this). anybody else is welcome to make improvements.
Adler1337
Posts: 471
Joined: Sat Aug 09, 2008 6:10 pm
Location: In your base.

Post by Adler1337 »

Looks awesome. I will definitely try to use this in my project. :D
multum in parvo
Adler1337
Posts: 471
Joined: Sat Aug 09, 2008 6:10 pm
Location: In your base.

Post by Adler1337 »

Hi
I am trying to use this PostProcessor in my project, which is also using irrPhysx. The problem i am having is the cloth is not being rendered. If i render it separately it looks messed up. Does anyone have an idea how to fix this?
multum in parvo
DavidJE13
Posts: 165
Joined: Tue Jan 09, 2007 7:17 pm

Post by DavidJE13 »

I've never used irrPhysX. possibly it has a special way of drawing the scene.
If you need to have anything other than this;

Code: Select all

driver->beginScene( );
smgr->drawAll( );
guienv->drawAll( );
driver->endScene( ); 
between beginScene and endScene, you'll need to replace the smgr->drawAll( ); line in CRendererPostProc.cpp (everything except beginScene, endScene and guienv->drawAll will need to go there)

if that doesn't work, irrPhysX probably needs to do some special stuff with post processing itself, which I'll have to look into.
Adler1337
Posts: 471
Joined: Sat Aug 09, 2008 6:10 pm
Location: In your base.

Post by Adler1337 »

You render irrPhysx the same way you render a scene without it. I replaced the smgr->drawAll(); with line in CRenderPostProc.cpp. Strange, it is not doing it today. The only thing that i noticed today is, if you are using motion blur and lens flare and have the lens flare near the cloth and look at the cloth, it disappears. Not really sure if that's a bug though.
multum in parvo
DavidJE13
Posts: 165
Joined: Tue Jan 09, 2007 7:17 pm

Post by DavidJE13 »

hmm, very odd - I'll take a look at IrrPhysx and get back to you
Adler1337
Posts: 471
Joined: Sat Aug 09, 2008 6:10 pm
Location: In your base.

Post by Adler1337 »

This is very strange, I tried the motion blur and lens flare again, and it seems to be working fine now. Maybe it's something wrong with my code, or my eyes :lol:
multum in parvo
DavidJE13
Posts: 165
Joined: Tue Jan 09, 2007 7:17 pm

Post by DavidJE13 »

Well I really have no idea then! I might be using irrPhysx in my own project soon, in which case I'll be able to look into this further, but for now I can't see anything in either set of code that would cause the error.
Since you say it's intermittent, my mind goes to the simulate and fetchResults calls; maybe fetchResults isn't waiting for the results to be available, and it's only by chance if they are? unlikely but it's all I can find. and I can't see anything that would change from using my code with it, other than the amount of hardware memory and processing time used.
Adler1337
Posts: 471
Joined: Sat Aug 09, 2008 6:10 pm
Location: In your base.

Post by Adler1337 »

Well thanks for looking into it. It's not causing any problems now.
multum in parvo
Adler1337
Posts: 471
Joined: Sat Aug 09, 2008 6:10 pm
Location: In your base.

Post by Adler1337 »

One more thing. When i try to use the old monitor effect, why does it only affect the top right 4th of my screen, and make the rest black?
multum in parvo
DavidJE13
Posts: 165
Joined: Tue Jan 09, 2007 7:17 pm

Post by DavidJE13 »

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.

in other news,
*another update*

Despite saying I was done with this for now, I fixed the water effect (still a very basic implementation, and not yet flexible), and changed the z-buffer to use a non-linear scale, which makes it able to cover the full scene. It's not perfect - I'd like to update to a 16-bit z-buffer to get rid of the jagged edges but for now that would require a third render, which I don't like. The jagged edges aren't too bad considering, but they're not really suitable for final releases.

The new z buffer means the other depth-related effects are better too (not confined to first 200 units any more), but you will need to change the parameters you use with them - they now work in scene coordinates. Multiply any depths you set by 20 to get the old results. The default values have been changed to match this.
m_krzywy
Posts: 133
Joined: Sat Nov 04, 2006 2:05 pm

Post by m_krzywy »

Great news with that water. Can you post some screenshots of it?

Also for Ambient Oclussion i see that it works with terrain/models -> billboard but don't with model -> model.

Look at the boxes and tree vs terrain. And now look at the tree where the background is cloud billboard.

Image
Post Reply