Author Topic: What happens after deferred lighting and shadows are done?  (Read 11926 times)

0 Members and 1 Guest are viewing this topic.

Offline Swifty

  • 210
  • I reject your fantasy & substitute my own
What happens after deferred lighting and shadows are done?
It's looking like the deferred lighting and soft shadows code has been stabilized based on the lack of bug reports I've been receiving. As a result, I've been thinking more and more about the future of Freespace Open's graphics and what needs to be done to continually keep the engine state of the art.

  • Physically-based rendering: Lighting in FSO is okay and for the most part, it looks really good. But we honestly can do a lot better. As video games start going into the PS4/Xbox One era, AAA games are beginning to take advantage of their increased shader capabilities of their GPUs. More ALU operations means more physically plausible lighting calculations which means more realistic lighting. More detailed information about it can be found on Crytek's website.
  • Gloss/Roughness Maps: Probably the most important feature for artists in a physically-based rendering pipeline. Gloss maps allow artists to control the shininess of their materials (Basically how big the specular highlight is with wide highlight = rough versus small highlight = smooth) while also indicating how blurry the environment relfection map is (Blurry reflection = rough versus sharp reflection = smooth). At the moment, artists can control the intensity of the environment map using the alpha channel in the specular map. It isn't much. Gloss maps makes materials such as brushed metals possible as opposed to always having highly polished metals or dull looking plastic.
  • Linear-space lighting: Freespace appears to do all it's lighting calculations in gamma-space rather than linear space which creates really harsh color contrasts. Part of getting a realistic lighting equation is making sure the engine gets all it's assets in linear color space, doing lighting correctly, and giving OpenGL a color corrected framebuffer.
  • HDR and Tone-mapping: And part of having linear-space lighting and a physically-based rendering system is to make sure we adequately account for all color ranges meaning being able to account for colors that go beyond a 0-255 range.
  • Area Lights: Featured in Killzone Shadow Fall, area lights allow an artist to define a light emitter as a simple shape rather than a point. Kind of similar to how we do tube lights for beams. We can use area lights to apply fixed lights to ships that can't necessarily be represented by a simple glowpoint. Think of a flourescent panel light (represented by a rectangular area light) or a light fixture (represented by a circular area light). Check out the Area Lights section of Guerrilla Game's presentation detailing the lighting in Killzone Shadow Fall.
  • Oculus Rift Support: It'll happen eventually. The debate is whether or not I should finish the task below this one or not.
  • OpenGL Core Profile Support: Sigh. The boner killer. But needed if we want the Macs in on all the cool stuff. Probably the first thing I have to do before any of the above get started. And I probably won't start it until deferred lighting and shadows hit trunk because of how invasive it will be.

Anyway, feel free to comment and raise any potential issues or pitfalls you may foresee!
« Last Edit: October 28, 2014, 03:01:58 am by Swifty »

 

Offline Kolgena

  • 211
Re: What happens after deferred lighting and shadows are done?
IMO HDR/tonemapping would have the greatest visual benefit without the need for asset updates. While FSO doesn't really lend itself to needing HDR per se, it'd be nice to have more realistic bloom, so that skyboxes aren't blown to hell if you want even subtly noticeable bloom on explosion effects and suns.

 

Offline Luis Dias

  • 211
Re: What happens after deferred lighting and shadows are done?
I think those points are fine, I know you've been testing ambient occlusion and found it somewhat worthless. I beg to disagree: ambient occlusion would work best in nebula settings and in capital ships. Nebula graphics could use some updates as well (the lightning effect is still the original!), but it appears some kind of novel research would be necessary in this, since nebula gameplay is somewhat unique in FreeSpace...

I am somewhat doubtful of the need to do area lights in FreeSpace. These things are very useful in closed first person shooter rooms, not in wider space. Could you give us a practical example where this would provide an increase of visual quality in FS?

OTOH, volume lighting could be really really REALLY cool in nebulas. I mean, REALLY cool. Did I say it would... yeah I said it.

You know what would also be really REALLY cool in nebulas? A way to blur out (in direct proportion to the z buffer) beams. The further away a beam is, the more blurred out it is. Bonus points if you could fake the nebula itself around it to be lit. Note: I'm not saying make a really physically correct rendering of a beam lighting a fog, I'm not mental. I'm saying perhaps it could be faked?

« Last Edit: October 28, 2014, 05:45:40 am by Luis Dias »

 

Offline Kolgena

  • 211
Re: What happens after deferred lighting and shadows are done?
AO is pretty expensive for how little gain you'd see in most Freespace settings. Baked AO will be superior to any screenspace techniques in pretty much all circumstances when there is very little object-object overlap/contact. Even then, baked AO has pretty minimal benefits in FS (but it's free along with baked lighting on glowmaps, so it's pretty popular in newer models and can look really good)

As for nebulae effect, I'd be already really happy if sunshafts were visible even if the star wasn't on screen. That, and somehow fixing the annoying ship pop-in glitch that somehow still plagues the engine (capship will randomly be fully visible for a few moments when it's pretty far away).

 

Offline The E

  • He's Ebeneezer Goode
  • Moderator
  • 213
  • Nothing personal, just tech support.
    • Steam
    • Twitter
Re: What happens after deferred lighting and shadows are done?
I think those points are fine, I know you've been testing ambient occlusion and found it somewhat worthless. I beg to disagree: ambient occlusion would work best in nebula settings and in capital ships. Nebula graphics could use some updates as well (the lightning effect is still the original!), but it appears some kind of novel research would be necessary in this, since nebula gameplay is somewhat unique in FreeSpace...

Consider: AO only concerns itself with close-up geometry. You can't do it efficiently at large ranges. Baked AO is way superior in terms of visual impact vs performance impact.
Quote
I am somewhat doubtful of the need to do area lights in FreeSpace. These things are very useful in closed first person shooter rooms, not in wider space. Could you give us a practical example where this would provide an increase of visual quality in FS?

Sunlight, or indirect light from planets.
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 Veers

  • 29
Re: What happens after deferred lighting and shadows are done?
Will someone point me in the right direction of more information about the last point, the OpenGL Core Profile Support. Please and Thank You. :)

As I'm not involved with any of the development and have no knowledge of any of it. I'm quite happy with the graphical levels at the moment and reckon something more back-end could be the next aim.
Current Activities/Projects: Ideas and some storyline completed.

ArmA 2&3 Mission Designer and player.


WoD - I like Crystal. <3

 

Offline Luis Dias

  • 211
Re: What happens after deferred lighting and shadows are done?
I think those points are fine, I know you've been testing ambient occlusion and found it somewhat worthless. I beg to disagree: ambient occlusion would work best in nebula settings and in capital ships. Nebula graphics could use some updates as well (the lightning effect is still the original!), but it appears some kind of novel research would be necessary in this, since nebula gameplay is somewhat unique in FreeSpace...

Consider: AO only concerns itself with close-up geometry. You can't do it efficiently at large ranges. Baked AO is way superior in terms of visual impact vs performance impact.

I understand. The quality / performance issue kills it. It would be a better visual solution because you could then control AO by ambient lighting, and it would not pollute direct light situations. Perhaps a solution wherein you would have an "ambient mapping", and thus you could stop baking it directly in diffuse mapping would be a really great improvement.

Quote
Quote
I am somewhat doubtful of the need to do area lights in FreeSpace. These things are very useful in closed first person shooter rooms, not in wider space. Could you give us a practical example where this would provide an increase of visual quality in FS?

Sunlight, or indirect light from planets.

A really close planet indirect lighting would be better rendered in area lighting, yes, but the improvement would mostly come from better smooth shadows from the area lighting... is it worth the predictable framerate drop? Well perhaps it is. I'm a bit dubious but I'd be really excited if you proved me wrong!

 

Offline The E

  • He's Ebeneezer Goode
  • Moderator
  • 213
  • Nothing personal, just tech support.
    • Steam
    • Twitter
Re: What happens after deferred lighting and shadows are done?
Will someone point me in the right direction of more information about the last point, the OpenGL Core Profile Support. Please and Thank You. :)

As I'm not involved with any of the development and have no knowledge of any of it. I'm quite happy with the graphical levels at the moment and reckon something more back-end could be the next aim.

Short version: OpenGL since version 3 defines several different profiles. There are currently two that are of interest to us, the "Core Profile" and the "Compatibility Profile". A program using the Core profile can only use commands from the OpenGL 3 (or higher) API, a program using the Compat profile can use stuff from earlier versions. Switching our rendering to use the Core profile only has a few important sideeffects; the code becomes much more readable and easy to maintain (because the core profile is massively simplified compared to earlier GL versions), and since driver support gets better the closer you are to using the Core profile only, there will be fewer issues with things misbehaving between different drivers/manufacturers.
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 zookeeper

  • *knock knock* Who's there? Poe. Poe who?
  • 210
Re: What happens after deferred lighting and shadows are done?
It would be a better visual solution because you could then control AO by ambient lighting, and it would not pollute direct light situations. Perhaps a solution wherein you would have an "ambient mapping", and thus you could stop baking it directly in diffuse mapping would be a really great improvement.

I'd just like to note that even currently, absolutely nothing prevents one from having AO as a separate texture/channel which is affected by ambient light or lights in general separately from the diffuse texture. It would even be a rather simple thing to do.

 

Offline Spoon

  • 212
  • ヾ(´︶`♡)ノ
Re: What happens after deferred lighting and shadows are done?
While all of these sound great and stuff, can I make a point for something else?

Shields

If there is something that desperately needs a graphical overhaul its the way shields are rendered.
I want nicer shields so much that I'm willing to put down actual money dollar/euros to the coder that takes up the task. If anyone wants to take me up on that offer, please.
Valathil started this:

and then never finished it. And it left me wanting.

The old method of 'paste animated bitmap on shield mesh' looks only half way decent on perfect bubble shields. Tends to look pretty bad overal on capital ships and all sorts of graphical glitches start occuring when a lot of shields are hit at once. I want this improved so badly.
Urutorahappī!!

[02:42] <@Axem> spoon somethings wrong
[02:42] <@Axem> critically wrong
[02:42] <@Axem> im happy with these missions now
[02:44] <@Axem> well
[02:44] <@Axem> with 2 of them

 

Offline Luis Dias

  • 211
Re: What happens after deferred lighting and shadows are done?
I'd just like to note that even currently, absolutely nothing prevents one from having AO as a separate texture/channel which is affected by ambient light or lights in general separately from the diffuse texture. It would even be a rather simple thing to do.

Yeah, my point precisely. I don't think FSO currently supports ambient lighting maps but it would be a simple addition.

 

Offline Alan Bolte

  • 28
  • Deneb III
    • @Compellor
Re: What happens after deferred lighting and shadows are done?
I guess as long as we're suggesting additions to the list, I'd still like to see some kind of workaround for the aliasing problems seen in beams and missile trails at sub-pixel widths (at long distance). That said, I'm not sure I'd prioritize that over getting Freespace to look like the stuff The E's been posting.
Anything worth doing is worth analyzing to death -Iranon

 

Offline AdmiralRalwood

  • 211
  • The Cthulhu programmer himself!
    • Skype
    • Steam
    • Twitter
Re: What happens after deferred lighting and shadows are done?
That, and somehow fixing the annoying ship pop-in glitch that somehow still plagues the engine (capship will randomly be fully visible for a few moments when it's pretty far away).
This bug should have been fixed. Are you still seeing it? If so, with what builds?
Ph'nglui mglw'nafh Codethulhu GitHub wgah'nagl fhtagn.

schrödinbug (noun) - a bug that manifests itself in running software after a programmer notices that the code should never have worked in the first place.

When you gaze long into BMPMAN, BMPMAN also gazes into you.

"I am one of the best FREDders on Earth" -General Battuta

<Aesaar> literary criticism is vladimir putin

<MageKing17> "There's probably a reason the code is the way it is" is a very dangerous line of thought. :P
<MageKing17> Because the "reason" often turns out to be "nobody noticed it was wrong".
(the very next day)
<MageKing17> this ****ing code did it to me again
<MageKing17> "That doesn't really make sense to me, but I'll assume it was being done for a reason."
<MageKing17> **** ME
<MageKing17> THE REASON IS PEOPLE ARE STUPID
<MageKing17> ESPECIALLY ME

<MageKing17> God damn, I do not understand how this is breaking.
<MageKing17> Everything points to "this should work fine", and yet it's clearly not working.
<MjnMixael> 2 hours later... "God damn, how did this ever work at all?!"
(...)
<MageKing17> so
<MageKing17> more than two hours
<MageKing17> but once again we have reached the inevitable conclusion
<MageKing17> How did this code ever work in the first place!?

<@The_E> Welcome to OpenGL, where standards compliance is optional, and error reporting inconsistent

<MageKing17> It was all working perfectly until I actually tried it on an actual mission.

<IronWorks> I am useful for FSO stuff again. This is a red-letter day!
* z64555 erases "Thursday" and rewrites it in red ink

<MageKing17> TIL the entire homing code is held up by shoestrings and duct tape, basically.

 

Offline Swifty

  • 210
  • I reject your fantasy & substitute my own
Re: What happens after deferred lighting and shadows are done?
The reason why I wanted area lights was because of capital ships. Freespace is a game with capital ship battles as the set pieces and I noticed a lot of people like decorating their ships with glow maps. So we have all these bright panels, nameplates being illuminated by light fixtures, flourescent lights in hangars, etc but none of them light up other ships nearby. I figured that if a modeller wants a bright panel represented by a glow map to be an actual light, they can just define a rectangular area light and they can set the light to match the irradiance characteristics of that drawn panel. As good as glowpoints are, they aren't adequate enough to actually light an actual environment and offer lighting solutions that a fictional ship would aesthetically have.

But honestly, this is probably not going to be a priority. A major pitfall I realized is the potential of light leaking out of ships because of the lack of shadowing for non-directional light sources. Maybe I'll tackle it sometime later when I figure out how to get shadows working beyond light coming from the local sun.

As for ambient occlusion, baked AO in the diffuse maps is still really useful. Yeah, dynamic ambient occlusion is really useful for other types of games where disparate objects are always close to each other and geometry is constantly drawn near the camera. But a space game like Freespace rarely has objects being that close to the camera and to each other. That's what I realized when playing around with my AO experiments which prompted me to trash it
« Last Edit: October 28, 2014, 09:50:01 pm by Swifty »

 

Offline Kolgena

  • 211
Re: What happens after deferred lighting and shadows are done?
That, and somehow fixing the annoying ship pop-in glitch that somehow still plagues the engine (capship will randomly be fully visible for a few moments when it's pretty far away).
This bug should have been fixed. Are you still seeing it? If so, with what builds?

Haven't played for a very long time. Probably latest I noticed it was a nightly a few months back, but might be earlier than that. If it's fixed, then great!

 

Offline AdmiralRalwood

  • 211
  • The Cthulhu programmer himself!
    • Skype
    • Steam
    • Twitter
Re: What happens after deferred lighting and shadows are done?
Haven't played for a very long time. Probably latest I noticed it was a nightly a few months back, but might be earlier than that. If it's fixed, then great!
It was fixed in mid-June, so if you last played on a build from before that, then it's been fixed since you last played.
Ph'nglui mglw'nafh Codethulhu GitHub wgah'nagl fhtagn.

schrödinbug (noun) - a bug that manifests itself in running software after a programmer notices that the code should never have worked in the first place.

When you gaze long into BMPMAN, BMPMAN also gazes into you.

"I am one of the best FREDders on Earth" -General Battuta

<Aesaar> literary criticism is vladimir putin

<MageKing17> "There's probably a reason the code is the way it is" is a very dangerous line of thought. :P
<MageKing17> Because the "reason" often turns out to be "nobody noticed it was wrong".
(the very next day)
<MageKing17> this ****ing code did it to me again
<MageKing17> "That doesn't really make sense to me, but I'll assume it was being done for a reason."
<MageKing17> **** ME
<MageKing17> THE REASON IS PEOPLE ARE STUPID
<MageKing17> ESPECIALLY ME

<MageKing17> God damn, I do not understand how this is breaking.
<MageKing17> Everything points to "this should work fine", and yet it's clearly not working.
<MjnMixael> 2 hours later... "God damn, how did this ever work at all?!"
(...)
<MageKing17> so
<MageKing17> more than two hours
<MageKing17> but once again we have reached the inevitable conclusion
<MageKing17> How did this code ever work in the first place!?

<@The_E> Welcome to OpenGL, where standards compliance is optional, and error reporting inconsistent

<MageKing17> It was all working perfectly until I actually tried it on an actual mission.

<IronWorks> I am useful for FSO stuff again. This is a red-letter day!
* z64555 erases "Thursday" and rewrites it in red ink

<MageKing17> TIL the entire homing code is held up by shoestrings and duct tape, basically.

 

Offline Trivial Psychic

  • 212
  • Snoop Junkie
Re: What happens after deferred lighting and shadows are done?
I wish to bring up the long-deprecated experimental feature of damage decals, which I would also like to see combined with persistent surface explosion effects to simulate massive damage from hull breaches.
The Trivial Psychic Strikes Again!

 

Offline Veers

  • 29
Re: What happens after deferred lighting and shadows are done?
Awesome!, thanks The E.
Current Activities/Projects: Ideas and some storyline completed.

ArmA 2&3 Mission Designer and player.


WoD - I like Crystal. <3

 

Offline CP5670

  • Dr. Evil
  • Global Moderator
  • 212
Re: What happens after deferred lighting and shadows are done?
I think HDR and decals would make the biggest difference in practice. I agree with others that AO would be useless for FS2, and often has a minimal impact even in FPS games given its performance hit.

Quote
The reason why I wanted area lights was because of capital ships. Freespace is a game with capital ship battles as the set pieces and I noticed a lot of people like decorating their ships with glow maps. So we have all these bright panels, nameplates being illuminated by light fixtures, flourescent lights in hangars, etc but none of them light up other ships nearby. I figured that if a modeller wants a bright panel represented by a glow map to be an actual light, they can just define a rectangular area light and they can set the light to match the irradiance characteristics of that drawn panel. As good as glowpoints are, they aren't adequate enough to actually light an actual environment and offer lighting solutions that a fictional ship would aesthetically have.

A bloom effect around lightmaps and glowpoints on ships may be easier to do and still look good. Many of the Volition renders have an effect like this.

 

Offline Hellzed

  • 28
Re: What happens after deferred lighting and shadows are done?
Decals could look great. I grew up near Atlantikwall fortifications, and always imagined FS2 capships looking a bit like these after battle.

Imagine beams turning heavy armour plating into this : http://thumbs.dreamstime.com/x/molten-metal-blob-10520869.jpg http://thumbs.dreamstime.com/x/trou-de-remboursement-fine-sur-l-obstacle-rouill%C3%A9-5954174.jpg
And BP2 mass drivers doing that kind of damage on a Deimos : http://i34.servimg.com/u/f34/11/29/35/99/100_3212.jpg
« Last Edit: November 02, 2014, 11:58:49 am by Hellzed »