OpenArena Message Boards

OpenArena Contributions => Development => Topic started by: fromhell on October 21, 2011, 01:25:08 AM



Title: Bloom reflection effect
Post by: fromhell on October 21, 2011, 01:25:08 AM
look what I hacked up (http://www.youtube.com/watch?v=aJzacJ9hW8o)


Obviously too distracting for a default option, it's actually quite a simple tr_bloom.c edit


Title: Re: Bloom reflection effect
Post by: Cacatoes on October 21, 2011, 04:21:34 AM
Looks sunny and warming, though a bit imperfect and overdistracting as you said. Liz would love it.


Title: Re: Bloom reflection effect
Post by: Udi on October 21, 2011, 05:55:20 AM
Can you filter it by source? The reflection coming from the skybox is neat, but the flag and explosions seem unrealistic.


Title: Re: Bloom reflection effect
Post by: Gig on October 21, 2011, 07:03:30 AM
Very nice, it looks better than classic lens flare... but maybe it is distracting (more items cause bloom than lens flare).


Title: Re: Bloom reflection effect
Post by: Graion Dilach on October 21, 2011, 09:16:48 AM
I love that effect.

Distracting but nice.


Title: Re: Bloom reflection effect
Post by: WingedPanther on October 21, 2011, 12:33:02 PM
Looks cool, but I would immediately turn it off, just like rocket smoke :)


Title: Re: Bloom reflection effect
Post by: dbX on October 21, 2011, 01:50:43 PM
The effect is cool, but it should be only limited to sky boxes and some other light sources, not rockets and grenades and such because it's really weird and distracting.


Title: Re: Bloom reflection effect
Post by: fromhell on October 22, 2011, 02:09:01 PM
This is the new bloom function (combined with tcpp's cascaded bloom)

http://openarena.ws/crap/tr_bloom.c

it's a bit of a mess. What i'd like to do is use one more bloom texture with only the skybox and flares, with some depthwrite/read magic


Title: Re: Bloom reflection effect
Post by: fromhell on October 24, 2011, 04:13:43 AM
is oa too dark? (http://www.youtube.com/watch?v=1whbTQ6nbzI)


Title: Re: Bloom reflection effect
Post by: Gig on October 24, 2011, 04:52:00 AM
is oa too dark? (http://www.youtube.com/watch?v=1whbTQ6nbzI)
Unlplayable, but nice "trip"...


Title: Re: Bloom reflection effect
Post by: dbX on October 24, 2011, 05:17:36 AM
is oa too dark? (http://www.youtube.com/watch?v=1whbTQ6nbzI)

Look at all those pretty colors :D With this oa goes from "too dark" to too colorful, but unplayable.


Title: Re: Bloom reflection effect
Post by: Cacatoes on October 24, 2011, 06:51:14 AM
Ehe, that's experimental, I like it. The railgun hum is sweet, saturation gives analogic warmth.

Consider making the videos public.


Title: Re: Bloom reflection effect
Post by: WingedPanther on October 24, 2011, 07:51:47 AM
reflection bloom would give me a headache.  Ouchies.


Title: Re: Bloom reflection effect
Post by: Gig on November 06, 2011, 05:24:54 AM
Talking about Bloom ("classic" bloom, not the new effect Fromhell proposed above!)... I just tried with latest executable (22) and OAX (B50), and two bugs are still there.
One is the effect that, when it "exits" from the screens, appears for some pixels on the opposite side of the screen.
http://openarena.ws/board/index.php?topic=3578.msg33455#msg33455
The other is: if "bloom" is enabled (r_bloom 1) and the texture quality is set to 16 bits (r_texturebits 16), some sort of semi-transparent square appears on the bottom left corner of the screen. (first said here (http://openarena.ws/board/index.php?topic=3578.msg35196#msg35196)).


Title: Re: Bloom reflection effect
Post by: rambokalle on January 29, 2012, 05:46:26 AM
...
One is the effect that, when it "exits" from the screens, appears for some pixels on the opposite side of the screen.
http://openarena.ws/board/index.php?topic=3578.msg33455#msg33455
...[/url]).

There seems to be some bloom texture clamping issues in tr_bloom.c, so occasional bleeding on the screen edges can appear. This is really easy to fix, for example:

Code:

data = ri.Hunk_AllocateTempMemory( bloom.screen.width * bloom.screen.height * 4 );
Com_Memset( data, 0, bloom.screen.width * bloom.screen.height * 4 );
#ifdef GL_CLAMP_TO_EDGE
bloom.screen.texture = R_CreateImage( "***bloom screen texture***", data, bloom.screen.width, bloom.screen.height, qfalse, qfalse, GL_CLAMP_TO_EDGE );
#else
bloom.screen.texture = R_CreateImage( "***bloom screen texture***", data, bloom.screen.width, bloom.screen.height, qfalse, qfalse, GL_CLAMP );
#endif
ri.Hunk_FreeTempMemory( data );

data = ri.Hunk_AllocateTempMemory( bloom.effect.width * bloom.effect.height * 4 );
Com_Memset( data, 0, bloom.effect.width * bloom.effect.height * 4 );
#ifdef GL_CLAMP_TO_EDGE
bloom.effect.texture = R_CreateImage( "***bloom effect texture***", data, bloom.effect.width, bloom.effect.height, qfalse, qfalse, GL_CLAMP_TO_EDGE );
#else
bloom.effect.texture = R_CreateImage( "***bloom effect texture***", data, bloom.effect.width, bloom.effect.height, qfalse, qfalse, GL_CLAMP );
#endif
ri.Hunk_FreeTempMemory( data );
bloom.started = qtrue;


Now the bleeding should be gone.  ;)


Title: Re: Bloom reflection effect
Post by: Gig on January 29, 2012, 06:08:45 AM
From what I know, Fromhell already fixed that "bleeding" problem in version 25 (http://openarena.ws/board/index.php?topic=1933.msg41587#msg41587) executables (see (http://openarena.ws/board/index.php?topic=1933.msg41498#msg41498)). Maybe (s)he may compare the two solutions, maybe one is more efficient than the other one?

Anyway, if you are comfortable with bloom source code, maybe you may fix and resolve the other bloom problem that affected 0.8.5 executables: if texture quality was set to 16 bit, a strange semi-transparent "square" appeared in the lower left corner of the screen. Fromhell "worked around" that (again, from version 25 executables) by forcing bloom to shutdown itself unless the user had previously forced 32 bit textures (FH said that bloom was never designed to work with 16 bit textures): for me it's not a problem to do have bloom with 16 bit textures, but it's a problem to have people need to manually force another option -leaving default texture quality disables bloom, too- with no clear instructions in menu nor console to help users to understand what they have to do! Maybe you may find a fix for that 16 bit problem, and then that auto-disabling check may be removed?

OpenArena 0.8.8 executables will also introduce a new bloom version (http://openarena.ws/board/index.php?topic=4223.0), called "Cascaded blur" or "Cascaded bloom". This should have been the new default, but we found a problem with it (something that may resemble the "bleeding" bug, but not exactly the same, see this screenshot (http://openarena.ws/board/index.php?topic=1933.msg41626#msg41626)) and its author said he will not be able to work on it before march or similar... so for the moment the new kind of bloom has been disabled by default.


Title: Re: Bloom reflection effect
Post by: GrosBedo on February 05, 2012, 06:26:52 AM
Great visual effect! And it seems to be not take too much cpu cycles. I like it!

Will it ever be implemented in OA? Please write it down on the TODO list, the effect is very cool!


Title: Re: Bloom reflection effect
Post by: Neon_Knight on February 05, 2012, 06:47:49 AM
IICR, it's already present in 0.8.8.


Title: Re: Bloom reflection effect
Post by: GrosBedo on February 05, 2012, 08:41:50 AM
IICR, it's already present in 0.8.8.

Really? I thought it was the other version of the bloom effect. Great!


Title: Re: Bloom reflection effect
Post by: Gig on February 05, 2012, 06:08:48 PM
Then, how to enable it? Are you sure you are not confusing this with cascaded blur/cascaded bloom?


Title: Re: Bloom reflection effect
Post by: Neon_Knight on February 05, 2012, 06:17:40 PM
It's r_bloom_reflection we're talking about?


Title: Re: Bloom reflection effect
Post by: Gig on February 05, 2012, 06:20:30 PM
Sounds likely. You are the first that mentions that variable. I'll have to check this...