Page 1 of 4

bloom effect.

Posted: 20 Oct 2007, 21:26
by DZHIBRISH
Is there a way to add a light bloom effect to spring?i think it might make the units look much better since it wil cover a bit for their edginess.

Posted: 20 Oct 2007, 23:23
by AF
Lua + OpenGL

Posted: 20 Oct 2007, 23:24
by Snipawolf
:roll:

*Snipa hates bloom, for your information*

Posted: 21 Oct 2007, 04:02
by j5mello
Pic related

Image

Posted: 21 Oct 2007, 07:22
by DZHIBRISH
Thats funny stuff.+1

Posted: 21 Oct 2007, 08:03
by jK
No, atm it is not possible with lua.

You need floating point textures for this (the lua api don't support them yet). Also the engine itself would have to render everything into a fbo (+fp texture), too.
Only reducing the colorspace into something more brown is possible (trepan already wrote something like this), but that's ... ehmm ... ugly.

Posted: 21 Oct 2007, 10:18
by trepan
jK

Three strikes ... and you're out ;-)

1. The current lua OpenGL interface does support float textures.
http://trepan.bzflag.bz/spring/floattex.lua

2. You can do a lot more then just make things "more brown".
The example you're probably referring to was one of my very
first spring test shaders, intended to make spring look more
like an old photograph. It really had nothing to do with the
bloom shader effect, no more so than my grayscaling shader
that is was based on. Note that the weird interference lines
in the picture are supposed to be there, they look neat when
animated, imo.
http://trepan.bzflag.bz/spring/sepia.jpg

3. There are bloom shaders kicking around that do not use
fullscreen float textures. Besides rendering specific bright
objects into a float texture (not the whole scene), there are
also bloom shaders that simply do the blur filter on an integer
screen buffer. They naturally aren't is nice as a full blown
float texture setup. Google is your friend if you want more info.


Quiet is better than wrong.

Posted: 21 Oct 2007, 10:43
by jK
1.
LuaTextures.cpp

Code: Select all

...
	GLenum dataFormat = GL_RGBA;
	GLenum dataType   = GL_UNSIGNED_BYTE;
	if ((tex.format == GL_DEPTH_COMPONENT) ||
	    (tex.format == GL_DEPTH_COMPONENT16) ||
	    (tex.format == GL_DEPTH_COMPONENT24) ||
	    (tex.format == GL_DEPTH_COMPONENT32)) {
		dataFormat = GL_DEPTH_COMPONENT;
		dataType = GL_FLOAT;
	}

	glClearErrors();
	glTexImage2D(tex.target, 0, tex.format,
	             tex.xsize, tex.ysize, tex.border,
	             dataFormat, dataType, NULL);
...
-> dataType is always GL_UNSIGNED_BYTE, except for depthtextures

2. you tried to get 3 points? o_O
* it has something to do with a bloom shader, because it reduce the colorspace
* I know that you can do a lot more, but they requested a BLOOM shader

3. Yeah it is possible to redraw only specific stuff and blur this, I already do so in my Halo/Outline shader (also i plan a special bloom particle in LuaPaticleSystem). But a bloom shader is quite uninteresting for units (cause they don't emit light by themselves and their reflection leave
rarely the colorspace), and you can't (and don't want to) redraw the terrain/skybox within lua, but that would be the main part of a bloom effect. Also you can't use it with the ceg, what would be the 2nd main usage of bloom shaders.

Posted: 21 Oct 2007, 10:57
by trepan
1. You should read the glTexImage2D a few times before
pointing to code that you obviously don't understand. It also
appears as though you didn't even bother to test the code
that I wrote to prove that they do work.

2. The sepia shader is a grayscale filter with a slight brown
tint, intended to reduce the image quality. Bloom shaders
aren't really meant to "reduce the colorspace". They smear
the bright sources across an area. Pick a better example if
you want to make a comparison with the intent of displaying
a limitation.

3. I'll paraphrase your response: yes, you can do bloom shaders
without float textures, even if jK originally said that it could not be
done.

Posted: 21 Oct 2007, 11:20
by jK
1. i did, it seems glTexImage2D() overwrites bad dataTypes, but this is not mentioned on its man page :wink:

2. "tone mapping" is THE problem of any HDR, it is also a science for itself (there are multiple ways to reduce the colorspace into visible space). A gaussian blur is easily written, the tone mapping is not.
(e.g. in the cartoon first the colorspace is reduced to brown, then darkened)

3. no, it is not. They requested a bloom shader, but atm it is only possible to blur the rarely occured overblending on units, what is not a Bloom effect (i.e. in the cartoon the enviroment is blurred). W/o blurring the enviroment you cut out the units (->don't want).

Posted: 23 Oct 2007, 16:45
by Quanto042
I agree with snipa and j5mello, Bloom is made of fail and gay. we don't need it

Posted: 23 Oct 2007, 17:01
by smoth
I like bloom and it would work in some mods. Say if someone did a heavy magical mod with faeries and shit.

Posted: 23 Oct 2007, 17:47
by Forboding Angel
Blooms on explosions would look nice.

I am in support of as many features as we can get.

Posted: 23 Oct 2007, 23:56
by PicassoCT
Bloom allows for realistically looking organic Units. And some Effects can be better composed..

Posted: 24 Oct 2007, 01:50
by rattle
Bloom is a pain in the eyes when it's being overused. But that's not the point, a blooming filter would still be nice.

Posted: 24 Oct 2007, 09:11
by Otherside
bloom is ok if used in moderation but imo its a unesscary comp strain id like nicer looking stuff without the need of bloom and bloom noawdays is over used

and i dont like how bloom looks on explosions tbh

but any feature wud help as said and modders coulc choose to use it in the mod just dont think bloom suits the TA based mods but for other ideas could look cool

but over bloomers must burn in hell ;]

Re: bloom effect.

Posted: 01 May 2008, 06:02
by smoth
Regular spring
Image
Fake bloom(done in photoshop and quite cheesy)
Image

I would really like a bloom gadget.

Re: bloom effect.

Posted: 01 May 2008, 07:34
by KDR_11k
I hate bloom because the only time I see it happen in real life is when my glasses are dirty.

Re: bloom effect.

Posted: 01 May 2008, 12:29
by HoneyFox
:? looks likethe bloom effect "may" be good. but... can it be a widget to switch on/off? then it would be convenient and if one with a poor computer has bad performance and low fps, he could switch it off easily at any time.

Re: bloom effect.

Posted: 01 May 2008, 15:45
by pktm
HoneyFox wrote::? looks likethe bloom effect "may" be good. but... can it be a widget to switch on/off? then it would be convenient and if one with a poor computer has bad performance and low fps, he could switch it off easily at any time.
But usually, u don't play from this camera mode don't you? And if you cannot recognize your units because of the bloom effect, it's crappy, i think.