Game Development Community

Blooming effect?

by Randy McMillen · in Torque Game Engine · 02/05/2006 (7:26 am) · 11 replies

Hello,

I have been working on some special effects in my free time and have been trying to implement a fake bloom. I would like to know the following: Is there an easy way of grabbing the screen, resizing it, blurring it and placing it as an overlay on top of the actual screen? Forgive me if this has been asked before. I have done a search and it has returned nothing of any use. Thank you in advance.

Randy McMillen

#2
02/05/2006 (2:55 pm)
I know that someone has been successful with bloom effects in TGE. I forget his name though. Do a search and it should come up.
#3
02/05/2006 (3:06 pm)
Thomas Einsporn has done it in TGE. Also has put in bump mapping in TGE.
#4
02/06/2006 (2:02 am)
If you look at the fullscreen effects in TGE (ie. whiteout or the underwater colouring - when you're completely underwater) you'll see where and howto implement a fullscreen effect. (see - I think- Underwater.cc)

Blurring should be quite easy to implement in the same fashion.
#5
02/06/2006 (3:22 am)
I seem to remember a fullscreen motionblur resource somewhere ?? screenfxmanager ??

hmm ... oh yeah, here it is ..
Motion Blur v1.2
I remember Manoel Neto saying that it needs some fixing to get going in 1.4 tough but it does provide you with a fullscreen effect that is pretty straight-forward.

Another handy resource would be a render to texture function:
Render To Texture

There is alot of free code on the net that gives you fake bloom, glow-like effects that you could drop in with a bit of "wrenching" :)
#6
02/06/2006 (11:01 am)
That motion blur resource is a nice start. We have been modifying it for a while, and we got a bloom effect in plain TGE. I had a post about these somewhere...

Normal setting (the one we'll use in-game - it sets a mood without offending):
img234.imageshack.us/img234/3176/weakglow7xt.th.jpg

Very strong setting (looks awesome but can give you headaches after a while):
img234.imageshack.us/img234/9606/strongglow2sl.th.jpg

But I am a bit overloaded right now, so it may take a while to resource-fy it (since it also involves lots of fixes and changes to the motion blur resource).
#7
02/06/2006 (12:27 pm)
Manoel > Are you feeding trough a .cg shader or are you still using fixed function to achieve the bloom ?
#8
02/06/2006 (10:10 pm)
Thank you all very much for the replies.
#9
02/06/2006 (10:49 pm)
Wow that looks awesome. would love to see that in action :)
#10
02/07/2006 (12:42 pm)
100% fixed function. It is implemented as another effect in the screenFxMgr resource (that basically copies the buffer to a texture, and allow you to code your own effects using that).

I render the captured buffer to an area 1/4th the size of viewport, blur it horizontally (by drawing it again 8 times, with different offsets and blend values), capture the small area, blur it vertically and capture again. Then I render the original texture back to the screen (to erase the mess caused by the blurring), and draw the stretched small blurred rect on top of it using glBlendFunc(GL_ONE_MINUS_DST_COLOR, GL_ONE ), that produced more atmospheric-like results than using plain GL_ONE GL_ONE.

I've been doing some intense hacks, I mean, *changes* in our TGE source, but not as far as sticking shader support into it (that's what we licensed TSE for).

It runs fine, but I think the performance can be improved by taking advantage of multiple texture units to do the blurring, but I couldn't get it right in the time I had.
#11
02/08/2006 (1:54 pm)
Thanks Manoel for the play by play, I have been meaning to try the shader based solution for some time but it is nice to have alternate routes if that gives me to much problems.