Approximate Global Illumination Shaders

Need help editing the game? Check for help here!

Moderators: Darksaber, General_Trageton, Forceflow

Re: Approximate Global Illumination Shaders

User avatar
Trevor
Cadet 1st Class
Posts: 188
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
General_Trageton

Fleet Admiral (Administrator)
Posts: 12130
Joined: Fri Apr 27, 2001 11:01 pm
Contact:

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

:shock: .... what he said !
Your ship, Captain. I need a drink. - Vince Trageton
Vince T's Modding HQ | Blue Phantom Chronicles WIki | My Steam Workshop

blue_max
Ensign
XWAU Member
Posts: 328
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
Recruit
Posts: 3
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
General_Trageton

Fleet Admiral (Administrator)
Posts: 12130
Joined: Fri Apr 27, 2001 11:01 pm
Contact:

Post by General_Trageton » 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 Modding HQ | Blue Phantom Chronicles WIki | My Steam Workshop

blue_max
Ensign
XWAU Member
Posts: 328
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.

blue_max
Ensign
XWAU Member
Posts: 328
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.

blue_max
Ensign
XWAU Member
Posts: 328
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 3rd Class
Posts: 34
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
Recruit
Posts: 3
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
Cadet 1st Class
Rebel Alliance
Posts: 160
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

blue_max
Ensign
XWAU Member
Posts: 328
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.

blue_max
Ensign
XWAU Member
Posts: 328
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
Lieutenant Commander
XWAU Member
Posts: 1308
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!

MTD industries
WIPs: REBCP version 2

blue_max
Ensign
XWAU Member
Posts: 328
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!

Post Reply