XEffects - Reloaded - New Release (V 1.4)

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki
Post Reply
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

Catron wrote:As you can kind of see, I pass the resolution of my window directly to the constructor.
I don't think WindowSize is exactly what you want (For various reasons I think it might be off by a few pixels, thus resulting in a distorted, apparently low quality resolution), have you tried just passing (0, 0), how does that look?
vectorcorpse wrote:example 2 under linux or windows with ogl or dx runs always at low res runs at 38fps and all max at 17fps
(something is wrong here... probably the fact that i can't use the pci express 2 of my card because the motherboard only support pci express 1)
Nothing is wrong here, the point shadow example is very intense, and deliberately inefficient, this is because it's just a clever trick by rendering to 6 shadow maps. If you wanna try and speed it up, theres a cube mapping patch in the code snippets forum, if you know what you're doing you could modify it to use cubemaps, but unless such features are in the Irrlicht core I will not directly support them. As I explained earlier in this thread, point lights aren't always necessary, and with careful placement and tweaking of the FOV you could get similar results in certain situations using just the spotlights.
vectorcorpse wrote:(note: btw how do u do multi pass?? i am studing shaders with render monkey since lumina doesn't work with ati cards and i don't see how to get multi pass working with irr, on the forums alot of ppl say it isn't supported but u seamed to find a way arround it. thx in advance :D )
You seem to be caught up in this terminology fad, multi pass, deferred shading, HDR, people are throwing words around like crazy. Whoever is saying that is probably one of those people.
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
vectorcorpse
Posts: 86
Joined: Thu Feb 14, 2008 7:30 pm
Location: Portugal

Post by vectorcorpse »

Nothing is wrong here, the point shadow example is very intense, and deliberately inefficient, this is because it's just a clever trick by rendering to 6 shadow maps. If you wanna try and speed it up, theres a cube mapping patch in the code snippets forum, if you know what you're doing you could modify it to use cubemaps, but unless such features are in the Irrlicht core I will not directly support them. As I explained earlier in this thread, point lights aren't always necessary, and with careful placement and tweaking of the FOV you could get similar results in certain situations using just the spotlights.
sorry if i wasn´t clear enough. i didn't ment something was wrong with your code, when i said something is wrong here i ment here with my computer, has i was expecting a bit better performance from the card regarless off the heavy instruction set.
You seem to be caught up in this terminology fad, multi pass, deferred shading, HDR, people are throwing words around like crazy. Whoever is saying that is probably one of those people.
i didn't quite get what u mean, but what i was trying to say is that i am experimenting with a shader, i managed to set up the call back once but i need to update 1 variable and execute the shader at least 8 time with diferent values on that var and render the 8 executions per frame. at the moment it either only execute once or execute all 8 at the call back rendering only the last one ignoring the previous 7.
(sorry if i am saying something really stupid)
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

vectorcorpse wrote:sorry if i wasn´t clear enough. i didn't ment something was wrong with your code, when i said something is wrong here i ment here with my computer, has i was expecting a bit better performance from the card regarless off the heavy instruction set.
Don't worry, I get what you mean. That point light shadow algorithm requires a lot of passes (13), which makes the pipeline stall heaps and will slow down any video card heavily regardless of it's speed.
vectorcorpse wrote:i didn't quite get what u mean, but what i was trying to say is that i am experimenting with a shader, i managed to set up the call back once but i need to update 1 variable and execute the shader at least 8 time with diferent values on that var and render the 8 executions per frame. at the moment it either only execute once or execute all 8 at the call back rendering only the last one ignoring the previous 7.
(sorry if i am saying something really stupid)
I don't think you are saying something stupid. Take a look at the "update" function and the shader callbacks in XEffects, it may guide you to a solution.
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
dlangdev
Posts: 1324
Joined: Tue Aug 07, 2007 7:28 pm
Location: Beaverton OR
Contact:

Post by dlangdev »

I couldn't go above 512 for the RTT, it's related to my card. I'll have to buy an nVidia card to get higher RTT resolution.
Image
Anton1
Posts: 14
Joined: Fri Mar 09, 2007 7:47 am

Post by Anton1 »

First of all.. i find this one of the easier projects to incorporate in the forum.. and by easy i mean, i've written quite a large project (not really that large, but a few 100kb of written code... and within a few lines i managed to get post production effects (bloom being the one i've put so far, HDR glare i'll soon play around with...) into my project...

to think i almost felt like i was tired of waiting for multipass rendering to come around... you've rekindled my faith in this easy and monster of an engine when it was lingering on a thread...

one suggestion however...

i wan't to add a simple enough function to your effectWrapper class... however i thought it'd be a great suggestion to add it for future versions..

effectWrapper::removeAllPostProductionEffects()

for the reason that in the graphic settings for the game, i wan't to at the whim and fancy of the end-user be able to turn on or off graphic intensive effects that aren't really necessary but are rather eye-candy.. therefore when they turn on the bloom effect that will add the posteffects, whereas to the contrary they can remove them...

one problem...

oh and another thing... when i alt-tab out of my window, the window minimizes and when i try to give the engine its focus back the upon resizing the console nags.... "could not set pixel shader."
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

Yes, theres a few obvious clean up functions lacking here, since I only made a few simple demo scenes with no practical use in mind, the concept escaped me. I'll go through and add some useful clean up functions hopefully when I have time to work on this again.

The shader/window bug issue seems like a common problem with DX programs (If I guessed right), so you will either have to take it down with Irrlicht or find a work around by scouring the net for DX problems that sound similar and implementing that method in the low level part of Irrlicht then submit a patch or something. I heard OGRE was having a similar issue at one point and they might've solved it so you can try searching their forums for a similar issue, anyway it's very common, and theres nothing I can do from my end without modifying the engine or using some hacky work around.

Cheers
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Anton1
Posts: 14
Joined: Fri Mar 09, 2007 7:47 am

Post by Anton1 »

:D wow ... love the timeous response... argh, pity pity... i might revert back to opengl...

i have to say as a shader noob that its simple enough to use so brownie points there... any desire to add perhaps HDR and other shaders... its the second time i've mentioned HDR tonight... i guess its cause the flare looks absolutely gorgeous
Anton1
Posts: 14
Joined: Fri Mar 09, 2007 7:47 am

Post by Anton1 »

hmm... i've been messing around with shaders as i mentioned before...

another suggestion if you may... i looked at the update code and saw the brilliance behind the monster... however with one tweak it should be possible to allow writing to the usertexture, i.e perhaps:

Code: Select all

addPostProductionEffect(c8* shaderfilename, bool tousertexture = false);
ofcourse that just pseudo code... but if you set tousertexture to true then when its that postproductioneffects turn it will switch the rendertarget to the usertexture... that way for example you can can store a luminance and brightpass to process for hdr (forgive me if my theory on the hdr is messed up, i'm new to shaders [let alone postproduction])

btw, i've been using your shaders as reference and i must say they are pretty well coded...

thanks a ton maestro :P
sio2
Competition winner
Posts: 1003
Joined: Thu Sep 21, 2006 5:33 pm
Location: UK

Post by sio2 »

Anton1 wrote:HDR glare i'll soon play around with...)
I'm not sure if core Irrlicht supports floating-point framebuffers yet. Can anyone confirm? Anyway, if not, you would need to grab Nadro's patch and then include a final HDR-to-LDR tonemapping pass.
Anton1 wrote:to think i almost felt like i was tired of waiting for multipass rendering to come around...
Multipass rendering? Are you confusing this with something else?
Anton1 wrote:oh and another thing... when i alt-tab out of my window, the window minimizes and when i try to give the engine its focus back the upon resizing the console nags.... "could not set pixel shader."
Compile irrlicht with DX debug and/or enable the debug DX runtime in the control panel. See what it says. I think there may be a limitation in Irrlicht that non-managed DX resources are not recreated on events such as lost device, etc.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Floatingpoint buffers are not yet supported. The lost device issue has been adressed in SVN/trunk and should have a solution in Irrlicht 1.5. Shaders are not affected by this, though, but it might be the case that the framebuffer is lost and hence the shaders cannot be set...
Anton1
Posts: 14
Joined: Fri Mar 09, 2007 7:47 am

Post by Anton1 »

Loving the support guys, thanks for not coming down on me. My terminology sucks huge donkey balletjies, excusem mai...

and thanks for the DX help guys... i find that when i try running my engine on OpenGL that it only updates the screen once then doesn't do nothing else... so DX is my friend for the first time ever.

ok it seems i'm settling for a close to HDR effect... looking at the ogre shaders and the HDR Pipeline demo with the DXSDK i managed to find out what makes the HDR tick... however, the part when you tone the scene together i'm not too sure how to get it...

i've got the brightpass...

and the a basic downscaled luminance with enough luminance...

but to store the luminance in the user texture i changed the addPostProductionEffectFromFile to

Code: Select all

void addPostProcessingEffectFromFile(const irr::core::stringc& filename, bool tousertexture = false);
and added to the effectWrapper

Code: Select all

irr::core::array<bool> PostProcessToUserTexture;
then i added at the end of each postproduct loop

Code: Select all

/// adjustment ... if you want to temporarily store the current post process to the usertexture
if(i < PostProcessingRoutinesSize - 1 && PostProcessToUserTexture[i] && ScreenQuad.getMaterial().getTexture(3))
{
                driver->setRenderTarget(ScreenQuad.getMaterial().getTexture(3), true, true, ClearColour);
                ScreenQuad.render(driver);
}
maybe there is a way to make make it more efficient, but now by setting the final luminance pass to store in the user texture (register s3), i can restart the post product effects, to start with the brightpass...

basically this is my order...

luminance...
  • pass 1: grayscale and downscale
  • pass 2: downscale (repeat till its got an effective luminance sample - then store the last in the usertexture
brightpass...
  • pass 3: downsample and then bright clamp
  • pass 4: blur in both direction, letting the blur take an additive amount rather than an average for blur
Thats when i get stuck... i can try add the [ (brightpass+luminance center)*EXPOSURE_CONSTANT ] per pixel then blend that to the screen render... then i get a basic HDR feel...

But the point is, thanks to XEffect - Reloaded this is possible... i think irrlicht should have the option to do post production effects as easily as this, built in... seeing that the aim of irrlicht is to look good without to much hassle...
Anyway, if not, you would need to grab Nadro's patch and then include a final HDR-to-LDR tonemapping pass.
Tell me more about this patch if you may and how this effects what i'm doing?[/quote][/code][/url]
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

Tell me more about this patch if you may and how this effects what i'm doing?
Not to sound melodramatic but it's the WHOLE POINT of what you are doing 8)

You see, HDR stands for High Dynamic Range right? In opposed to Low Dynamic Range which can only store a limited range of color, HDR can store a large range of color.

Now the biggest precision texture format Irrlicht supports is your standard integer-based 32-bit RGBA color format with 8-bits per channel. This isn't gonna give you HDR without some screwing around (E.g. Using RGBE format (Hijacking alpha channel for storing the exponent, but you lose transparent objects, and it's not very accurate), store additional brightness information in another texture (Requires another pass), pack the data to 16-bit (Also needs another pass). All these methods are using an integer-format btw, which has been shown to produce losy results upon tonemapping such as banding etc.

So, the proper, sure fire way to get good actual High Dynamic Range, is to use a floating point format that allows you to store a range bigger than your traditional 0-255. Nadro's. patch allows this, the recommended format for quality/performance would be RGBA16F, Geforce 6 series + allow blending on this format.

Although it's possible to achieve HDR-looking tonemapping if you are creative enough with the RGBA8 you are provided with, and that's what you are doing and I encourage that, I always find it fun working around your limitations. (Maybe that's why I like using Irrlicht so much :P ... hehe jk)

EDIT: Can we see some screenshots of how your current effect looks? I must say I am intrigued.
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
goret
Posts: 2
Joined: Sun Feb 18, 2007 6:46 pm

Post by goret »

Huummmm, soooo good all this work !

Very cute, and easy to use !

I'm just wondering, after my first try with xeffect, I couldn't find how to display multiple cameras in different viewports.
Usually, in my softwares, I use a scene manager for the 3d world, and an another one for the hud.

I've seen the setActiveSceneManager that helps a lot, is it also possible to make the viewport parameters working ?

Elseway, I'm planning to make a 3rd scene with 2 quads that show the ScreenQuads cameras of the 2 scenes, but maybe that's not necessary.

Also, does I have ta create multiple effectHandler, do you think it's supported ?

thx !
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

You should be able to create multiple ones, although that is untested. Displaying multiple cameras should be straightforward, it worked right away in my irrEdit plugin, although you may have to set the viewport just before it renders to the screen (After it renders to all the rendertargets and not before this).

I might add an option for this later.
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Mel
Competition winner
Posts: 2292
Joined: Wed May 07, 2008 11:40 am
Location: Granada, Spain

Post by Mel »

It is not posible to use the A2R10G10B10 format of pixel in irrlicht? As a sample merely, it is what Devil May Cry 4 uses and has pretty nice HDR effects. :)
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
Post Reply