Page 1 of 1

Bloom hack fun

Posted: Fri Oct 21, 2011 10:29 pm
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

Re: Bloom hack fun

Posted: Fri Oct 21, 2011 11:10 pm
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.

Re: Bloom hack fun

Posted: Sat Oct 22, 2011 6:03 pm
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.

Re: Bloom hack fun

Posted: Sat Oct 22, 2011 9:28 pm
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.

Re: Bloom hack fun

Posted: Sun Oct 23, 2011 8:45 am
by toneddu2000
I think it's very good. When the player is outdoor, is great. In indoor IMO it should be disabled

Re: Bloom hack fun

Posted: Sun Oct 23, 2011 1:11 pm
by Chip
Thanks @leilei, let me see if I can integrate it in my engine. And maybe enhance it.

Re: Bloom hack fun

Posted: Mon Oct 24, 2011 3:10 am
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.

Re: Bloom hack fun

Posted: Mon Oct 24, 2011 8:35 am
by leileilol
you mean like combine it with HDR!?

haha, hdr .......... that buzzword died so fast.

Re: Bloom hack fun

Posted: Mon Oct 24, 2011 5:04 pm
by qbism
HDR is same result as hardware gamma? I was always confused. HDR makes sense IRL with cheap digital cameras.

Re: Bloom hack fun

Posted: Mon Oct 24, 2011 6:56 pm
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.

Re: Bloom hack fun

Posted: Mon Oct 24, 2011 7:17 pm
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.