Deferred rendering buffer visualization helper widget

Deferred rendering buffer visualization helper widget

Discuss Lua based Spring scripts (LuaUI widgets, mission scripts, gaia scripts, mod-rules scripts, scripted keybindings, etc...)

Moderator: Moderators

Post Reply
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Deferred rendering buffer visualization helper widget

Post by Beherith »

Draws a selected buffer on the right half of the screen.

Deferred Buffer visualizer: cycle through buffers with /luaui prevbuffer|nextbuffer, show alpha in red with /luaui alphabuffer

Hope it helps someone else too!

http://imolarpg.dyndns.org/trac/balates ... alizer.lua
Image
gajop
Moderator
Posts: 3051
Joined: 05 Aug 2009, 20:42

Re: Deferred rendering buffer visualization helper widget

Post by gajop »

Didn't try yet, but very cool
hokomoko
Spring Developer
Posts: 593
Joined: 02 Jun 2014, 00:46

Re: Deferred rendering buffer visualization helper widget

Post by hokomoko »

what did you do with it?
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Re: Deferred rendering buffer visualization helper widget

Post by Beherith »

hokomoko wrote:what did you do with it?
Sorry, I dont understand the question.
Its just gl.TexRect over half the screen. One can watch all map and model buffers too.
hokomoko
Spring Developer
Posts: 593
Joined: 02 Jun 2014, 00:46

Re: Deferred rendering buffer visualization helper widget

Post by hokomoko »

Hope it helps someone else too!
I'll rephrase: What did you use it for?
How was it helpful for you?
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Re: Deferred rendering buffer visualization helper widget

Post by Beherith »

I used it to debug why model buffer bloom was way stonger and lighter than screencopy bloom.
It really helped tweak some other things in forward vs deferred, made sure the correct normals were passed.

There is also an ongoing issue where units under construction also drawn onto the diffuse buffer, but not with customunitshaders (so I had no control over it), and white/very light teamcolors cause heavy bloom on units under construction.

E.G.:
Image
On this image, the building under construction is show along with the emittex.
The issue is as follows. I use the green channel of the emittex as a stencil buffer, and write it to 1 in the fragment shader for CUS. This is visible on the right.
The bloom uses the diffusetex, and emittex as sources, and the diffusetex is premultiplied with the green channel of emittex before looking for illumination thresholds for bloom. So logically, stuff that doesnt have the emittex green as 1 shouldnt contribute to bloom. Yet it does.

Edit: ok, as expected, it was my fault :)
Post Reply

Return to “Lua Scripts”