Approximate Global Illumination Shaders

Want to edit the game, build your own craft and missions? Here you'll find help, tools, guides and people to discuss with.

Re: Approximate Global Illumination Shaders

User avatar
Trevor
Lieutenant JG
Posts: 541
Joined: Thu Dec 04, 2014 7:11 pm

Post by Trevor » Thu Oct 31, 2019 11:31 pm

Holly crap... I cant wait to test, please upload that dll! :P

Trev

User avatar
Vince T
Fleet Admiral (Administrator)
Posts: 14045
Joined: Fri Apr 27, 2001 11:01 pm
Contact:

Post by Vince T » Fri Nov 01, 2019 11:23 am

:shock: .... what he said !
Your ship, Captain. I need a drink. - Vince Trageton
Vince T's X-Wing HQ - where the bad guys get their gear

User avatar
blue_max
XWAU Member
Posts: 2295
Joined: Wed Mar 20, 2019 5:12 am

Post by blue_max » Wed Nov 06, 2019 6:07 am

I've had to do a few compromises to remove some artifacts: dual-ssdo, for instance is probably not going to work; and I'm obscuring the edges of the screen because I sometimes see a big halo there... but anyway, if you guys are willing to forgive the occasional artifact, then yes, I think I can release something soon while I keep working on fixing issues. Maybe around this weekend.
ssdo9.jpg
BTW, I'm already thinking about the next effects. How about HDR rendering?
You do not have the required permissions to view the files attached to this post.

MamiyaOtaru
Cadet 4th Class
Posts: 18
Joined: Mon Nov 04, 2019 4:17 am

Post by MamiyaOtaru » Wed Nov 06, 2019 8:04 am

just me or is SSDO a fair amount darker looking than SSAO? and is ssao_type = directional the correct config? Would be nice to have an example ssao.cfg in the repo. Easy enough to compile, then I get to hunt through the source for the relevant config entries :) Or I could just wait for you to release but what fun is a gun without jumping it

User avatar
Vince T
Fleet Admiral (Administrator)
Posts: 14045
Joined: Fri Apr 27, 2001 11:01 pm
Contact:

Post by Vince T » Wed Nov 06, 2019 10:31 am

Newbie question: Am I right to assume the shader reads the data from the textures, not the rendered image?
I‘m wondering : Would it be possible to incorporate dedicated textures into the opt format which could act as actual bump maps?
Your ship, Captain. I need a drink. - Vince Trageton
Vince T's X-Wing HQ - where the bad guys get their gear

User avatar
blue_max
XWAU Member
Posts: 2295
Joined: Wed Mar 20, 2019 5:12 am

Post by blue_max » Wed Nov 06, 2019 6:58 pm

@MamiyaOtaru: From the pictures I've posted so far I can see why you'd believe that SSDO is much darker than SSAO; but in fact it can be configured in a number of ways. Two lights can be specified along with their color, there's another color for all the shadows and an ambient component. For instance, in this example I set the shadow color to red:
ssdo10.jpg
And here, the secondary light provides enough illumination so that the effect becomes subtle:
ssdo11.jpg
I'll upload a sample config file later today if you want to try it out before I do the official release.

@General Trageton: Normal mapping right now is reading the information from the screen, not the textures; but the effect fades with distance. However, I think it's possible to read a normal map from an external source and load it when necessary -- that would be much better. I would need a bit of help to read it from an OPT; but to do an experiment I was actually thinking of just loading from external files -- similar to what I'm already doing for the Dynamic Cockpit. Maybe both approaches can be combined: load normal maps when present and when not, do "fake" normal mapping from the screen.
You do not have the required permissions to view the files attached to this post.

User avatar
blue_max
XWAU Member
Posts: 2295
Joined: Wed Mar 20, 2019 5:12 am

Post by blue_max » Wed Nov 06, 2019 7:15 pm

I probably should've mentioned this earlier; but all the screenshots here were taken with XWA's shading system disabled. All the shading was computed 100% by SSDO. One of the differences with SSAO is that the shader takes the light direction and color into account. Here's an example of an SSDO "mask" with a blue light:
ssdo12.jpg
If this were SSAO, we would only get a grayscale image. This mask is blended multiplicatively with the regular color buffer and that's how shading gets applied. However, XWA's shading can be combined with this effect; but I haven't seen much value in doing that and disabling XWA's shading does seem to improve performance a little bit. Here's another sample:
ssdo13.jpg
You do not have the required permissions to view the files attached to this post.

User avatar
blue_max
XWAU Member
Posts: 2295
Joined: Wed Mar 20, 2019 5:12 am

Post by blue_max » Thu Nov 07, 2019 7:01 am

blue_max wrote:
Wed Nov 06, 2019 6:58 pm
I'll upload a sample config file later today if you want to try it out before I do the official release.
To be fair to everyone, I'm publishing a sample config file *and* a working ddraw.dll that can be put on top of release 1.0.8 for people who really can't wait for the official release:

https://www.dropbox.com/s/x07wqeplwj5du ... w.zip?dl=0

Kampher
Cadet 2nd Class
Posts: 79
Joined: Tue May 09, 2006 11:01 pm

Post by Kampher » Fri Nov 08, 2019 1:50 am

Thank you blue_max. This is amazing stuff!

MamiyaOtaru
Cadet 4th Class
Posts: 18
Joined: Mon Nov 04, 2019 4:17 am

Post by MamiyaOtaru » Fri Nov 08, 2019 7:32 am

Cool, this looks amazing. Thanks for the config (and the dll. am using the one you provided for this post). SSDO is quite nice having the light source/direction taken into account (if I am understanding right it just assumes it is the same place in every map?). Getting some pretty bad halos when a snub fighter passes over the better illuminated side of a cap ship though, which doesn't happen with SSAO. See http://chattypics.com/files/ssdo_6tutdih5kp.jpg Cockpit causes them too, and it's a bit noticeable for my tastes. The directional shading is too nice to ignore though it's a conundrum hah

For grins I put in enable_dual_ssao = 1 even though it says not to with SSDO, just to see. The (dark) halos on the better illuminated side of the ISD were gone but now there were light halos on the darker side of the ISD :D

Also I am playing in 1440p. A couple settings were resolution dependent, with examples given on either side of my resolution, so I used values in between for both.

User avatar
DarHan
Rebel Alliance
Posts: 325
Joined: Mon Dec 05, 2005 12:01 am
Contact:

Post by DarHan » Fri Nov 08, 2019 4:13 pm

Yeah, I noticed those halos too on my end.
“Red Four, nothing’s gone wrong yet.”
— Hobbie Klivian

User avatar
blue_max
XWAU Member
Posts: 2295
Joined: Wed Mar 20, 2019 5:12 am

Post by blue_max » Fri Nov 08, 2019 7:03 pm

Thanks for testing this pre-release guys. Yes, I know about the halos. It kind of happens with SSAO; but in SSAO the effect just fades to white and isn't very noticeable. In this case, since it's replacing the shading, it can be clearly seen. That's one of the things I still need to fix.

The position of the lights is determined by the config file, so it assumes it's the same for every map -- which may not be the case. I can read the light positions/directions from XWA, thanks to Jeremy; but when I tried to transform these lights, it just didn't work (the rotation matrix doesn't even look like a proper rotation, etc). I'll come back to that later, though.

User avatar
blue_max
XWAU Member
Posts: 2295
Joined: Wed Mar 20, 2019 5:12 am

Post by blue_max » Mon Nov 11, 2019 6:51 am

Alright, here's the official release:

https://www.dropbox.com/s/zphae74s8y45c ... 9.zip?dl=0
(EDIT: Updated the link above to include fixes to the SteamVR mode).

Honestly, this is *the same* ddraw.dll I posted earlier. I just added more details in the readme files. So if you've already got that, you won't see anything new in this package. I haven't had much chance to make progress in this area (or to fix the artifacts reported in this thread) and I keep getting side-tracked with other ideas I *just* want to try out right away. Suffice to say that there will be even more effects in the near future...

User avatar
DTM
Fleet Admiral (Administrator)
Posts: 2119
Joined: Tue Apr 22, 2003 11:01 pm
Contact:

Post by DTM » Thu Nov 14, 2019 9:39 pm

SSDO is great!!!

I have to report a bug, but maybe it is linked with the already known issues…
When I look at something that is self-illuminated, like the Sky, there is a terrible round halo all around the view:

Image

I hope you are able to fix it, because SSDO is really a revolutionary upgrade!

User avatar
blue_max
XWAU Member
Posts: 2295
Joined: Wed Mar 20, 2019 5:12 am

Post by blue_max » Fri Nov 15, 2019 8:17 am

Thanks for reporting that DTM. I suspect it's got to do with the size of the sky dome (it's about 26Km in radius?). I'll take a look!

User avatar
DTM
Fleet Admiral (Administrator)
Posts: 2119
Joined: Tue Apr 22, 2003 11:01 pm
Contact:

Post by DTM » Fri Nov 15, 2019 4:29 pm

Confirmed: 26,x km in radius (you may use Yavin mission for testing)

User avatar
AngeI
Lieutenant JG
Posts: 524
Joined: Sun Jan 24, 2016 5:27 pm

Post by AngeI » Sat Nov 16, 2019 1:52 pm

Just tried this out myself (non-VR), really looks good! Though I didn't change any of the settings directly, the bloom is a tad excessive on the lasers perhaps, but it really helps give all the ships extra life to them with the engine and window lights glow on them. Fantastic work :)

User avatar
blue_max
XWAU Member
Posts: 2295
Joined: Wed Mar 20, 2019 5:12 am

Post by blue_max » Sat Nov 16, 2019 6:23 pm

Thanks Angel. You can configure the intensity of the bloom effect in Bloom.cfg and tone down the lasers specifically if you want

User avatar
AngeI
Lieutenant JG
Posts: 524
Joined: Sun Jan 24, 2016 5:27 pm

Post by AngeI » Sun Nov 17, 2019 8:15 pm

Ok so I've played around with it quite a bit today and created myself a test mission pushing XWA to its ship limits (the 192 ship limit that is) with a massive scale fleet battle and I've recorded 4 videos with different settings on to show what I'm seeing. I've not adjusted the other settings much beyond the resolution sample radius as suggested for 1920x1080 in the SSAO config file and any other adjustments based on whether the 32bit hook is enabled or not. Overall the SSDO 32bit is definitely the best looking however I have found one issue and I wanted to ask what settings are best to try and resolve it. When you look either straight down or up, the texture colour of all ships goes extremely dark - regardless of distance. I've shown this towards the end in both SSDO videos, just skip to around the 3min mark to see what I mean.

https://youtu.be/nHzn0Z9XVIA - SSDO 32Bit Hook Enabled
https://youtu.be/6ISDx2Ylxpk - SSDO 32Bit Hook Disabled
https://youtu.be/nAdI2NS59_o - SSAO 32Bit Hook Enabled
https://youtu.be/_xuGeNr1ThA - SSAO 32Bit Hook Disabled

All vids have Diffuse and Lighting set to Off from the general settings though I did also record vids with those settings turned on but have not uploaded them.

Also if anyone wants the mission file I created here then I can put it in a dropbox link for download. All the capital ships are invincible and it has many waves of fighters so it will go on for quite some time if needed. The player ship is a neutral faction and won't be targeted.

User avatar
Jaeven
XWAU Member
Posts: 578
Joined: Mon Mar 30, 2015 3:18 am

Post by Jaeven » Sun Nov 17, 2019 11:08 pm

AngeI wrote:
Sun Nov 17, 2019 8:15 pm
Ok so I've played around with it quite a bit today and created myself a test mission pushing XWA to its ship limits (the 192 ship limit that is) with a massive scale fleet battle and I've recorded 4 videos with different settings on to show what I'm seeing. I've not adjusted the other settings much beyond the resolution sample radius as suggested for 1920x1080 in the SSAO config file and any other adjustments based on whether the 32bit hook is enabled or not. Overall the SSDO 32bit is definitely the best looking however I have found one issue and I wanted to ask what settings are best to try and resolve it. When you look either straight down or up, the texture colour of all ships goes extremely dark - regardless of distance. I've shown this towards the end in both SSDO videos, just skip to around the 3min mark to see what I mean.

https://youtu.be/nHzn0Z9XVIA - SSDO 32Bit Hook Enabled
https://youtu.be/6ISDx2Ylxpk - SSDO 32Bit Hook Disabled
https://youtu.be/nAdI2NS59_o - SSAO 32Bit Hook Enabled
https://youtu.be/_xuGeNr1ThA - SSAO 32Bit Hook Disabled

All vids have Diffuse and Lighting set to Off from the general settings though I did also record vids with those settings turned on but have not uploaded them.

Also if anyone wants the mission file I created here then I can put it in a dropbox link for download. All the capital ships are invincible and it has many waves of fighters so it will go on for quite some time if needed. The player ship is a neutral faction and won't be targeted.
Bit off topic, but is there any way you could upload that TIE Fighter soundtrack for XWA? It's magnificent.

User avatar
DTM
Fleet Admiral (Administrator)
Posts: 2119
Joined: Tue Apr 22, 2003 11:01 pm
Contact:

Post by DTM » Sun Nov 17, 2019 11:37 pm

In these years people used to say to me: "Why do you spend all this time working on a game that is years old? Forget it!" I'm glad I didn't listen to them.

User avatar
Phoenix Leader
Rebel Alliance
Posts: 437
Joined: Wed Aug 08, 2018 2:20 pm

Post by Phoenix Leader » Sun Nov 17, 2019 11:57 pm

"Why do you spend all this time working on a game that is years old?"
To commemorate all those victories in battles we fought against overwhelming forces.

Great work everyone!

User avatar
blue_max
XWAU Member
Posts: 2295
Joined: Wed Mar 20, 2019 5:12 am

Post by blue_max » Tue Nov 19, 2019 1:18 am

That's a known problem with the current implementation of SSDO, Angel. Sorry, I probably should've been more explicit. I think I mentioned that the implementation isn't 100% correct (or something to that effect) and this is one of the problems that I'll try to fix in the next release. There isn't much you can do right now -- sorry again.

User avatar
AngeI
Lieutenant JG
Posts: 524
Joined: Sun Jan 24, 2016 5:27 pm

Post by AngeI » Wed Nov 20, 2019 9:15 pm

blue_max wrote:
Tue Nov 19, 2019 1:18 am
That's a known problem with the current implementation of SSDO, Angel. Sorry, I probably should've been more explicit. I think I mentioned that the implementation isn't 100% correct (or something to that effect) and this is one of the problems that I'll try to fix in the next release. There isn't much you can do right now -- sorry again.
No worries, thanks for the clarification. Superb work otherwise. :)

Jaeven wrote:
Sun Nov 17, 2019 11:08 pm
Bit off topic, but is there any way you could upload that TIE Fighter soundtrack for XWA? It's magnificent.
I'll ask if its ok, its being used for TFTC which I'm helping BMan with by redoing all the missions :)

DTM wrote:
Sun Nov 17, 2019 11:37 pm
In these years people used to say to me: "Why do you spend all this time working on a game that is years old? Forget it!" I'm glad I didn't listen to them.
This and also the fact no one ever made a Star Wars flight sim game better than this. The modern Battlefront combat can quite frankly f**k right off :D

Wotan Weave
Cadet 3rd Class
Posts: 29
Joined: Thu Jun 16, 2011 7:23 pm

Post by Wotan Weave » Fri Dec 06, 2019 3:05 pm

This is pretty awesome looking. So, to use it, all I need to do is move the contents of the download into the root XWA folder, right?

Post Reply