Author Topic: Post-processing  (Read 69387 times)

0 Members and 2 Guests are viewing this topic.

Offline Hery

  • 26
Hi,
I thought it would be nice if fs2_open supported post-processing...

Full pack (patch, builds, demo mission, shaders)
Original pack (with some bugs): Full pack

Almost everything (but HUD and some other things) is rendered to a texture (using Frame Buffer Object) and then drawn using shaders pair "post-*.sdr". This enables huge number of new effects to use in fs2_open, I've implemented the simplest ones: (de)saturation, contrast, distort noise. Additionally, now it would be easy to implement full frame motion blur.

In order to customize post-processing effects I added three new sexps: set-saturation (0% - 100%), set-contrast (from -100% to +100%), set-distort-noise (0 - 100).

I believe this patch can be improved in the area of code reusability - I'm still not very familiar with all source code and fs2_open internal architecture doesn't help. Any feedback will be appreciated.

Post-procesing requires glsl and fbo enabled and flag -post_process set.

Example Screenshots:
Saturation: 0%
Saturation: 0%, Distort Noise: 50
Saturation: 100%, Distort Noise: 50

Demo mission after 5 seconds sets saturation to 0, then after next 10 seconds sets distort noise to 50, then after 15 seconds sets saturation back to 100% and finally after 10 seconds sets contrast to +25%.
« Last Edit: November 11, 2009, 02:16:18 pm by Hery »

 

Offline Tolwyn

  • The Admiral
  • Administrator
  • 214
  • Ridiculously Old Fraud
    • Wing Commander Saga
Interesting effect: would this allow HDR effects, like bloom?
Wing Commander Saga: A Legend Is Reborn | WingCenter
 
Tolwyn’s reputation for risk taking with other people’s lives was considered  to understate the facts. The admiral’s willingness to sacrifice anyone or anything to achieve his objectives had long been lauded in the popular press. He was “the man who got things done”.- Colonel Blair

No errors, no random CTDs, just pure fun and proof of why getting hit with missiles is a bad thing.
-WC Saga's beta tester


Report Wing Commander Saga bugs with Mantis

 

Offline Hery

  • 26
Bloom, tone mapping, deferred shading, motion blur, heat haze, depth of field, etc - all these can be done using postprocessing.

 

Offline The E

  • He's Ebeneezer Goode
  • Moderator
  • 213
  • Nothing personal, just tech support.
    • Steam
    • Twitter
While this is certainly a good thing, I just have to ask if it wouldn't be a better idea to do a new rendering engine from the ground up, instead of hacking solutions like this into the existing code?
If I'm just aching this can't go on
I came from chasing dreams to feel alone
There must be changes, miss to feel strong
I really need lifе to touch me
--Evergrey, Where August Mourns

 

Offline Hery

  • 26
It appears that many things in fs2_open should be rewritten, but post-processing is relatively easy to implement and it is often quite independent from the other parts of code. What I want to say is that it will be very easy to adapt this patch to the new rendering engine. That's why I decided to implement it now, despite the fact I'm considering improving fs2_open architecture.

 

Offline DaBrain

  • Screensniper
  • 212
    • Shadows of Lylat board
@The E

I agree, however... till somebody picks up the huge task of writing a new rendering engine, the graphical development of FS2 will stagnate.

For projects like SoL and Diaspora, a new rendering engine will probably be ready too late to be used in the release. (At least in the initial one.)


At least we already got normal maps for all our models, so in the end, the content can be used regardless of the rendering engine.
--------------------------------------------------
SoL is looking for a sound effect artist
Please PM me in case you want to apply
---------------------------------
Shadows of Lylat - A Freespace 2 total conversion
(hosted by Game-Warden)
----------------------------------

 

Offline Sushi

  • Art Critic
  • 211
Hery, you're my hero of the week. :) Nothing like having someone pop out of nowhere and drop some nifty engine enhancements to brighten the day!

Some quick questions, though:

1. What implications does this have in terms of video-card compatibility? What video card features are needed to support this? What happens if they aren't supported?

2. What impact does this have on overall performance and framerate?

I'm really excited about all of this. Thanks for the contributions! :D

 

Offline The E

  • He's Ebeneezer Goode
  • Moderator
  • 213
  • Nothing personal, just tech support.
    • Steam
    • Twitter
I can tell you that if your card can run the old shaders, these should pose no problem.
If I'm just aching this can't go on
I came from chasing dreams to feel alone
There must be changes, miss to feel strong
I really need lifе to touch me
--Evergrey, Where August Mourns

 

Offline Hery

  • 26
ad 2. Fortunately, performance loss is minimal (at least on my hardware) I haven't profiled it but while playing I haven't notice anything disturbing. Nevertheless, it will require more tests on bigger variety of hardware to know if there isn't any performance problem.

 

Offline DaBrain

  • Screensniper
  • 212
    • Shadows of Lylat board
I'll test it on my notebook tomorrow. It has a slightly less powerful gfx chip (GF 9600M GT).

I think that should be around the lower mainstream class of gfx cards today. So pretty much the minimum for FS2 to run on decent quality settings.


P.S. You should just have received a PM from me.
--------------------------------------------------
SoL is looking for a sound effect artist
Please PM me in case you want to apply
---------------------------------
Shadows of Lylat - A Freespace 2 total conversion
(hosted by Game-Warden)
----------------------------------

 

Offline Talon 1024

  • 29
  • How do you turn this on?
    • Mods, Games, and Stuff
This is awesome.  It doesn't just look fantastic, but you can use this to simulate a variety of things.  For example, combine medium noise distortion with radius 3 gaussian blur, and you'll be flying in heavy solar radiation.  Or desaturation and light noise distortion could simulate a camera on an old recon ship.  These simple effects might even help simulate depth of field.
To understand religion, you need to understand morality first. | WCSaga website | WCSaga Forum | 158th website | 158th forum | Project Leader: WC: Hostile Frontier | WCHF Thread at CIC | Wing Blender | Twist of Fate | Multipart turrets on angled surfaces, tutorial included. | My Google Drive stuff | To convert speeds from WC to WCS, multiply both the cruise speed and the Afterburner speed by 0.15625 (5/32)

FS2 Mods I'm waiting on: Inferno 10th Anniversary
Current Project: Contestant Android app, Learn4Life iOS app, Blender Commander (importer).
The FreeSpace Font Foundry is back in action!

 

Offline Dragon

  • Citation needed
  • 212
  • The sky is the limit.
I think that second cutscene in BP: AoA
Spoiler:
which is a footage from escape pod's flight recorder showing Lucifer's attack on Earth
could benefit from saturation and noise features.

 

Offline pecenipicek

  • Roast Chicken
  • 211
  • Powered by copious amounts of coffee and nicotine
    • Skype
    • Steam
    • Twitter
    • PeceniPicek's own deviantart page
lets put it this way. Intel E7500, Geforce 9600GT, 4 gigs of ram, vista x64. cinema 4d rendering out heavily in the background.

60 fps solid. didnt drop even once.


shaders give awesome sauce without much slowdowns on a graphic card thats considered out of date nowadays.
Skype: vrganjko
Ho, ho, ho, to the bottle I go
to heal my heart and drown my woe!
Rain may fall and wind may blow,
and many miles be still to go,
but under a tall tree I will lie!

The Apocalypse Project needs YOU! - recruiting info thread.

 

Offline blackhole

  • Still not over the rainbow
  • 29
  • Destiny can suck it
    • Black Sphere Studios
Damn it, I never got around to doing this and now someone's gone and done it already. Damn it damn it damn it damn it...

On a totally unrelated note, however, this patch inherently would allow for HDR support. Just change the texture your rendering to to a 32-bit one.

 

Offline Rodo

  • Custom tittle
  • 212
  • stargazer
    • Steam
could also be used for those "dreamy missions" also ^^

nice adding there, thnks!
el hombre vicio...

 

Offline pecenipicek

  • Roast Chicken
  • 211
  • Powered by copious amounts of coffee and nicotine
    • Skype
    • Steam
    • Twitter
    • PeceniPicek's own deviantart page
Damn it, I never got around to doing this and now someone's gone and done it already. Damn it damn it damn it damn it...

On a totally unrelated note, however, this patch inherently would allow for HDR support. Just change the texture your rendering to to a 32-bit one.
i'm trying to wiggle out something similar, hackishly of course...
Skype: vrganjko
Ho, ho, ho, to the bottle I go
to heal my heart and drown my woe!
Rain may fall and wind may blow,
and many miles be still to go,
but under a tall tree I will lie!

The Apocalypse Project needs YOU! - recruiting info thread.

 

Offline blackhole

  • Still not over the rainbow
  • 29
  • Destiny can suck it
    • Black Sphere Studios
I want to point out that while this system allows for simplistic effects, it does not inherently allow for either motion blur or HDR (at least not right now).

HDR requires multiple passes
Motion blur requires the previous frame to be stored in memory. This is usually done by using 2 framebuffer objects and swapping them out each frame. The previous texture must then also be passed to the shader.

While the second one could be hacked into the code fairly easily, the first is a little more difficult. This system would be of more benefit if the shader system in general was not completely bizarre. I'd code this myself but my code is way out of date and i don't have any goddamn time anymore :(

The problem is that as many people have pointed out, the current rendering engine makes implementing shaders in a sane way very difficult.

Note also that implementing HDR that uses tonemapping and doesn't make everything look stupid is also fairly difficult.

 
Hery: Freakin awesome!

 :jaw:
STRONGTEA. Why can't the x86 be sane?

 

Offline Galemp

  • Actual father of Samus
  • 212
  • Ask me about GORT!
    • Steam
    • User page on the FreeSpace Wiki
Wow... nice... I'd really like to see some distort noise applied instead of/along with that rumbling when you're in engine wash.

Distortion around shockwaves and bloom on beam impacts, if done subtly, could have amazing results.
"Anyone can do any amount of work, provided it isn't the work he's supposed to be doing at that moment." -- Robert Benchley

Members I've personally met: RedStreblo, Goober5000, Sandwich, Splinter, Su-tehp, Hippo, CP5670, Terran Emperor, Karajorma, Dekker, McCall, Admiral Wolf, mxlm, RedSniper, Stealth, Black Wolf...

 

Offline blackhole

  • Still not over the rainbow
  • 29
  • Destiny can suck it
    • Black Sphere Studios
Distortion, however, is decidedly more difficult to implement then a simple postprocess shader, because it must be done as a square block take out of the final render, distorted, and then rendered back on, and thats if you want it to distort the entire screen. If you want z-aware distortion, it gets even more difficult.

Of course if you manage to do it, it looks awesome :P