Hard Light Productions Forums
Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: Swifty on November 13, 2013, 02:18:20 pm
-
In between job interviews I've been doing some clean up in the rendering code. I decided to add soft shadows using Valathil's shadow mapping as a base.
There's a bit of a performance cost unfortunately but I think my performance improvements in go_faster_and_prettier still gets us a net gain in performance to allow something like this. And there's a possibility of more optimizations to the graphics code that's still to be done.
(http://i.imgur.com/NCa3htG.jpg)
(http://i.imgur.com/9Ja1zIL.jpg)
(http://i.imgur.com/KUjtgnC.jpg)
(http://i.imgur.com/4jYdnaL.jpg)
(http://i.imgur.com/COQAEEt.png)
(http://i.imgur.com/Cavfj7n.png)
(http://i.imgur.com/6d7RSob.png)
-
sheeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeet
-
Looks way too cool to complain about minium performance hits. :yes:
-
Oh my~
-
It makes me really happy when super-cool stuff comes out of the blue like this. It made my day. Thanks Swifty! :yes:
-
Awesome. One more reason for me to buy a new computer sometime that can actually run FSO with the shader pipeline active. :yes:
-
oh my
-
whaaaaaaaaaaaaaaaaaaaaaaaat
-
I wonder if the shadow acne is completely gone by now?
-
How did...what is...bwuh...*brain melts*
(you know I think I posted about this same exact thing back when Valathil originally unveiled his shadow builds)
-
(http://segafans.com/wp-content/uploads/2013/08/mother-of-god.jpg)
-
Oh my ...
-
Swifty, I love you.
-
INCREDIBRUUU :D
no but really that's awesome.
So.... when is this thing actually coming to the main trunk already?!?!
-
I love HLP's wizards. It's like walking into a room and a crazy guy with a shotgun pops out from behind the couch and shoots you in the face, except that instead of the shot being made of lead, it's made of awesome.
-
I love HLP's wizards. It's like walking into a room and a crazy guy with a shotgun pops out from behind the couch and shoots you in the face, except that instead of the shot being made of lead, it's made of awesome.
quoted for truth. :yes: :yes:
-
Can mod makers parameterize how shadows are applied? (Possibly on a per mission basis) This would be great to simulate the difference say... between fighting in hard vacuum (hard shadows) vs nebulas or atmospheres.
(Note: let's not get bogged down in physics. The whole premise of a space combat dogfighting game is ridiculous and it only works because it rides on a tsunami made of awesome driven by the rule of cool...
I only ask since it's nice for modders to have better control of the aesthetics).
-
Good stuff, hopes to see more of this. I'd love to have this in my client :p
-
Can mod makers parameterize how shadows are applied? (Possibly on a per mission basis) This would be great to simulate the difference say... between fighting in hard vacuum (hard shadows) vs nebulas or atmospheres.
(Note: let's not get bogged down in physics. The whole premise of a space combat dogfighting game is ridiculous and it only works because it rides on a tsunami made of awesome driven by the rule of cool...
I only ask since it's nice for modders to have better control of the aesthetics).
No, it's not possible. The whole point of soft shadows is to basically cover up any details lost when rendering to a shadow map. Sorry.
-
Yes, his point was whether he could (or not) have access to some blur parameter of sorts. Like 0 = w/out blur, 1 = your version, 2 = double blur, 3,4 = triple, for times the blur (dense nebulas).
-
I love HLP's wizards. It's like walking into a room and a crazy guy with a shotgun pops out from behind the couch and shoots you in the face, except that instead of the shot being made of lead, it's made of awesome.
quoted again for great justice
that shizz is funny yo
-
Swifty, how's your variance soft shadow maps going on? I'd like to see it committed to main trunk very soon.
-
Well it's probably not something I'd immediately commit to trunk. I rewrote a lot of model rendering code so it'll probably be more prudent to do some bug testing. You'll probably start seeing it in the Test Builds section very soon.
-
Remember when our coders said that this was impossible?
:pimp:
-
Under the constraints of the previous times that it was brought up, it was. The engine didn't have any sort of framework for delivering this.
That started changing once Taylor introduced the shader pipeline and we got folks like Hery, The E, Valathil and Swifty involved into iterating on it. Because then it went from being impossible to plausible. Hell, it even took Triple-A a while to get into figuring out how to make it possible.
There's obviously still a good amount of progress to be made, especially in terms of making it something that will perform well. But we'll get there.
-
We've done the impossible, and
that makes us mighty shows how far we've gone. We couldn't have imagined this years ago, but it's becoming a reality.
Y'all make dreams come true.
-
So, the technique I've implemented has been using something called variance shadow maps. Long story short, this let's us prefilter the shadow maps using a separable filter like gaussian blur to get the softness we need.
Data from testing is showing that the gaussian blur is hitting people's machines really hard. That's due the number of texture fetches required to implement gaussian blur. I'm using four shadow maps for four different cascades, all 1024x1024. So 2048x2048 texels times 5 texel fetches for the vertical pass times 5 texel fetches for the horizontal pass... That's a lot of texture fetches. It also doesn't help that variance shadow mapping requires fatter floating point textures so we also take on a texture bandwidth hit.
So, I think I'm going to ditch the variance shadow mapping technique now that I discovered cheaper ways to sample shadow maps with the filter sizes we need without sacrificing quality and reducing the frametime footprint.
-
so, just a small tangent, is the fixed function pipeline supported anymore at all? or is it as deprecated as the non-htl code?
-
Fixed function should still work even with how I refactor the model render functions. If it doesn't, it's a bug. A big bug.