bloom effect.

bloom effect.

Requests for features in the spring code.

Moderator: Moderators

DZHIBRISH
Posts: 357
Joined: 16 Mar 2007, 22:28

bloom effect.

Post by DZHIBRISH » 20 Oct 2007, 21:26

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.
0 x

User avatar
AF
AI Developer
Posts: 20669
Joined: 14 Sep 2004, 11:32

Post by AF » 20 Oct 2007, 23:23

Lua + OpenGL
0 x

User avatar
Snipawolf
Posts: 4357
Joined: 12 Dec 2005, 01:49

Post by Snipawolf » 20 Oct 2007, 23:24

:roll:

*Snipa hates bloom, for your information*
0 x

j5mello
Posts: 1189
Joined: 26 Aug 2005, 05:40

Post by j5mello » 21 Oct 2007, 04:02

Pic related

Image
0 x

DZHIBRISH
Posts: 357
Joined: 16 Mar 2007, 22:28

Post by DZHIBRISH » 21 Oct 2007, 07:22

Thats funny stuff.+1
0 x

User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Post by jK » 21 Oct 2007, 08:03

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.
0 x

trepan
Former Engine Dev
Posts: 1200
Joined: 17 Nov 2005, 00:52

Post by trepan » 21 Oct 2007, 10:18

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.
0 x

User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Post by jK » 21 Oct 2007, 10:43

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.
Last edited by jK on 21 Oct 2007, 10:59, edited 1 time in total.
0 x

trepan
Former Engine Dev
Posts: 1200
Joined: 17 Nov 2005, 00:52

Post by trepan » 21 Oct 2007, 10:57

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.
0 x

User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Post by jK » 21 Oct 2007, 11:20

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).
0 x

User avatar
Quanto042
Basically OTA Developer
Posts: 778
Joined: 22 Feb 2006, 03:01

Post by Quanto042 » 23 Oct 2007, 16:45

I agree with snipa and j5mello, Bloom is made of fail and gay. we don't need it
0 x

User avatar
smoth
Posts: 22298
Joined: 13 Jan 2005, 00:46

Post by smoth » 23 Oct 2007, 17:01

I like bloom and it would work in some mods. Say if someone did a heavy magical mod with faeries and shit.
0 x

User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14599
Joined: 17 Nov 2005, 02:43

Post by Forboding Angel » 23 Oct 2007, 17:47

Blooms on explosions would look nice.

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

User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 10236
Joined: 24 Jan 2006, 21:12

Post by PicassoCT » 23 Oct 2007, 23:56

Bloom allows for realistically looking organic Units. And some Effects can be better composed..
0 x

User avatar
rattle
Damned Developer
Posts: 8278
Joined: 01 Jun 2006, 13:15

Post by rattle » 24 Oct 2007, 01:50

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.
0 x

User avatar
Otherside
Posts: 2296
Joined: 21 Feb 2006, 14:09

Post by Otherside » 24 Oct 2007, 09:11

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 ;]
0 x

User avatar
smoth
Posts: 22298
Joined: 13 Jan 2005, 00:46

Re: bloom effect.

Post by smoth » 01 May 2008, 06:02

Regular spring
Image
Fake bloom(done in photoshop and quite cheesy)
Image

I would really like a bloom gadget.
0 x

User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Re: bloom effect.

Post by KDR_11k » 01 May 2008, 07:34

I hate bloom because the only time I see it happen in real life is when my glasses are dirty.
0 x

HoneyFox
Posts: 20
Joined: 01 Aug 2007, 06:44

Re: bloom effect.

Post by HoneyFox » 01 May 2008, 12:29

:? 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.
0 x

pktm
Posts: 57
Joined: 05 Aug 2006, 15:49

Re: bloom effect.

Post by pktm » 01 May 2008, 15:45

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.
0 x

Post Reply

Return to “Feature Requests”