Bloom hack fun

Discuss programming topics that involve the OpenGL API.
Post Reply
leileilol
Posts: 2783
Joined: Fri Oct 15, 2004 3:23 am

Bloom hack fun

Post by leileilol »

So I coded this crappy effect yesterday. It's supposed to simulate lens flare but by abusing the bloom texture, though i'd really want to only have the flares and skyboxes rendered in it instead of everything
i should not be here
mh
Posts: 2292
Joined: Sat Jan 12, 2008 1:38 am

Re: Bloom hack fun

Post by mh »

That's actually really neat. I always think bloom is overdone (when even bricks have bloom on them you know something is wrong) but this looks like it could evolve into something cool.
We had the power, we had the space, we had a sense of time and place
We knew the words, we knew the score, we knew what we were fighting for
Chip
Posts: 575
Joined: Wed Jan 21, 2009 9:12 am
Location: Dublin, Ireland
Contact:

Re: Bloom hack fun

Post by Chip »

Wow, that looks really cool and not at all crappy.

How did you do it? Changed the bloom plane angles and orientation?

I'm really interested in this because that's what I am working on, but I was doing it with tracelines and view-oriented sprites. That's crappy. Yours looks like it has real volume.
QuakeWiki
getButterfly - WordPress Support Services
Roo Holidays

Fear not the dark, but what the dark hides.
leileilol
Posts: 2783
Joined: Fri Oct 15, 2004 3:23 am

Re: Bloom hack fun

Post by leileilol »

here it is so far - comments marked with LEILEI are where around my changes should be.

A bug currently is the aspect ratio inconsistency :(


it's a 'bag of tricks' effect:

- Take bloom texture
- Inverse coordinates
- Render it 16 more times with scaling offsets raised gradually
- Cross the rainbow gradually

It could be worked in a loop and maybe with more versatility. I calculated the colors by hand.
i should not be here
toneddu2000
Posts: 1395
Joined: Tue Feb 24, 2009 4:39 pm
Location: Italy

Re: Bloom hack fun

Post by toneddu2000 »

I think it's very good. When the player is outdoor, is great. In indoor IMO it should be disabled
Meadow Fun!! - my first commercial game, made with FTEQW game engine
Chip
Posts: 575
Joined: Wed Jan 21, 2009 9:12 am
Location: Dublin, Ireland
Contact:

Re: Bloom hack fun

Post by Chip »

Thanks @leilei, let me see if I can integrate it in my engine. And maybe enhance it.
QuakeWiki
getButterfly - WordPress Support Services
Roo Holidays

Fear not the dark, but what the dark hides.
qbism
Posts: 1236
Joined: Thu Nov 04, 2004 5:51 am
Contact:

Re: Bloom hack fun

Post by qbism »

Suggest limit to looking-outside-through-window, looking-into-bright-light, looking-into-sun .... somehow. Maybe simple as checking current lightpoint.
IRL this effect occurs when viewer is in a dim room and suddenly looks into a bright light or outdoors.
leileilol
Posts: 2783
Joined: Fri Oct 15, 2004 3:23 am

Re: Bloom hack fun

Post by leileilol »

you mean like combine it with HDR!?

haha, hdr .......... that buzzword died so fast.
i should not be here
qbism
Posts: 1236
Joined: Thu Nov 04, 2004 5:51 am
Contact:

Re: Bloom hack fun

Post by qbism »

HDR is same result as hardware gamma? I was always confused. HDR makes sense IRL with cheap digital cameras.
Spike
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK
Contact:

Re: Bloom hack fun

Post by Spike »

hdr is to make bright stuff dark and dark stuff bright.
or something.

you could just update lightstyle values based upon which room you're in, note that you'll want some overbrighting stuff... the eye adjusts to different light levels over time anyway so map-based triggers could do it without any real issue.
mh
Posts: 2292
Joined: Sat Jan 12, 2008 1:38 am

Re: Bloom hack fun

Post by mh »

You could probably R_LightPoint the weapon model early in the frame (before drawing the world) and use that value. Might be some weirdness if you're standing in a dark spot in an otherwise bright room (or vice-versa) but otherwise it should work. You'd probably need to coarsen the scale a little so that you're not updating lightmaps every frame for miniscule/unnoticeable changes too (an alternative might be to pass a lightscaling value to your shader as a uniform, but of course you need shaders for that...) - and don't forget to be consistent and apply it to MDLs as well as brushes...

It's worth noting by the way that Rage does this (also blending in different colours and bloom levels). The first time you see it, it looks AWESOME, but after a short while (say, 5 seconds) it just becomes a pain in the ass and you wish there was a way of turning it off.
We had the power, we had the space, we had a sense of time and place
We knew the words, we knew the score, we knew what we were fighting for
Post Reply