Bloom effects without HDR?

Started by
9 comments, last by evolutional 17 years, 9 months ago
Hello everybody.. I just read some tuts on bloom shaders but they all used some kind of HDR textures. So I was wondering whether it's possible to get this effect of a rendered scene without having used any kind of floating point textures. I'm using OpenGL and GLSL so my thoughts were the following: 1. Render complete scene to FBO 2. brighten up the (already) bright parts of the scene 3. do horizontal and vertical blur => Bloom effect (hopefully) The usual way I saw is to blur before brightening up, but that doesn't make sense in my eyes, because then the neighbouring pixels to those which were brightened up get mixed with the "dark" color and not the bright one...
Advertisement
Hi,

the bloom/glow effect doesnt really depend on HDR (funny that most talk about HDR never mentions tonemapping but mostly bloom effects :)) neither does it on FP textures.
In Tron there was even a DX8 path for the glow effect.

http://www.gamasutra.com/features/20040526/james_01.shtml

- You render your scene normally.
- (*) Determine glowing parts
- (optionally resize and ) blur the glow texture
- render the blured glow texture additively ontop of your normal scene.

Now there are 2 ways to do (*)
- either you store a glow factor somewhere, maybe in the alpha channel and explicitely define which parts of your scene glow or show blooming
- or you extract that information from your normal scene
e.g. compute luminance of the scene and use a threshold beyond which
things start to glow.

regards,
stephan
hdr is not necessary, the best method for bloom is create a bloom texture by rendering all the objects that u wanna glow into it + perform the blur on this. much better results than what most/all games do just using the framebuffer even with hdr it looks crap. the downside though is its generally more expensive
I added bloom into the HL1 engine without having to add extra render stages or change pixel formats or anything.


TEXTURE#1 is the same resolution as the screen.
TEXTURE#2 is a lower resolution texture (say 512x512) for performance reasons
SHADER#1 returns out.colour = TEXTURE#1.colour ^3 (colour*colour*colour etc... basically raise to some power. The higher the power, the brighter areas need to be before they bloom)
SHADER#2 implements a convulsion blur filter using TEXTURE#2 in 4 tex units.

Basically, after the world has been rendered, but before you draw the 2D HUD (or simmilar 2d overlays) copy the screen to TEXTURE#1.

Activate SHADER#1 and draw a quad with this texture in an ortho projection, then copy the screen to TEXTURE#2.

Activate SHADER#2 and draw a quad using TEXTURE#2 in 4 different texture units over the whole screen. The texture coordinates for each texture unit should be shifted in different directions to create the blur.

Capture the result of this back into TEXTURE#2, render TEXTURE#1 back over the whole screen (restore the original image), then add TEXTURE#2 over the top.

The result is that any bright areas get covered with a bright blur.
Allways question authority......unless you're on GameDev.net, then it will hurt your rating very badly so just shut the fuck up.
I don't know if I got you correctly:

Do I have to render my whole scene into the bloom (blured glow) texture or only the bright parts?
As far as I understood PhilMorton I just have to add some power of the original color value of the whole scene to the scene-texture by adding the bloom texture, right?

So (pseudocode)
for each pixel in screenTexture{//the normal scene  bloomTexture.colorAtThisPixel(screenTexture.colorAtThisPixel^somePower)}

And then I add it several times using multitexturing and some different tex-coords...
I had read an interesting article on the making of shadow of colossus (PS2). They had discussed how they had doen the bloom effect in their game. Here is the link to the article:

http://www.dyingduck.com/sotc/making_of_sotc.html

I hope this helps.
Quote:Do I have to render my whole scene into the bloom (blured glow) texture

normally u use whatevers in the framebuffer, ie screen capture (downscaled) ie u dont rerender your scene again

Quote:or only the bright parts?
if u want a better quality bloom u do this (but more expensive since u have to rerender the scene again)
Ok, thanks guys... I'll try it when I get my FBO-Class running..
Or knows anyone a good FBO tutorial which he can show me?
For bloom, you don't even need to use shaders nor FBO's. At least my approach does not use them. ;*)

Here's what I did.

1. Render your scene to texture ( use a 64 * 64 texture)
2. Upload your scene to system mem (glReadPixels)
3. Do a filter (smoothing works) Also a per pixel alpha test should be fast enough to limit what glows.
4. Draw your scene again to the frame buffer
5. SuperImpose your glow texture to the frambuffer with additive blending.

Here's an example.
Used the bloom effect here to do a volumetric light.
Space to change the render mode.

http://fileanchor.com/47481-d
Hi.
Thx in advance, I'll try it next time I use this strange thing... ahm Win XP... [wink]
But because I use FBO's (it works!!) and GLSL anyway... why not use it?

This topic is closed to new replies.

Advertisement