Direct3D 11 via DDraw.dll

A Forum dedicated to the Suggestion, Creation and Editing of XWA Dynamic Link Library Files

Moderator: JeremyaFr

Post Reply

Direct3D 11 via DDraw.dll

User avatar
JeremyaFr
XWAU Member
Posts: 3918
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Mon Sep 01, 2014 8:22 pm

Hello,
I am writing a custom ddraw.dll using Direct3D 11 api.

https://github.com/JeremyAnsel/xwa_ddra ... ses/latest
Last edited by JeremyaFr on Mon Sep 22, 2014 1:10 am, edited 1 time in total.

User avatar
Forceflow
Fleet Admiral (Administrator)
Posts: 7198
Joined: Wed Oct 20, 1999 11:01 pm
Contact:

Post by Forceflow » Tue Sep 02, 2014 4:25 am

Every busy I see :) Good luck with that! Would that mean the game might finally work better with newer card drivers?
Murphy was an optimist! I am a pessimist!
And always remember that a smile is cheaper than a bullet! (District 9)
Webmaster of the X-Wing Alliance Upgrade Project

User avatar
JeremyaFr
XWAU Member
Posts: 3918
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Wed Sep 03, 2014 9:21 pm

It seems that the newer graphics drivers tend to not support old versions of DirectX. So by using a more recent version the game may work better.

User avatar
JeremyaFr
XWAU Member
Posts: 3918
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Sat Sep 06, 2014 7:50 pm

Here is the dll:
xwa_ddraw_d3d11.zip
Last edited by JeremyaFr on Wed Nov 05, 2014 6:50 pm, edited 3 times in total.

User avatar
Ramshu
Cadet 2nd Class
Posts: 74
Joined: Sat Sep 21, 2013 10:42 am
Contact:

Post by Ramshu » Sun Sep 07, 2014 10:27 am

When use your dll and start game i have a black screen, i dont view menu.

Windows 7 x64
Nvidia GTX 770 - 340.52 WHQL

"Nasios pa vola"

User avatar
Darksaber
Vice Admiral
Posts: 10931
Joined: Mon Jan 10, 2000 12:01 am
Contact:

Post by Darksaber » Sun Sep 07, 2014 1:18 pm

Yep same here, start the game just a black screen, no video, just freezes, and you have to use Task Manager to close XWA :(

Win 7 x64
ATI Radeon HD 5700 series 13.1
“You can please some of the people all of the time, you can please all of the people some of the time, but you can’t please all of the people all of the time”.”
- John Lydgate

Good Things Come To Those Who Wait....
Darksaber's X-Wing Station

User avatar
JeremyaFr
XWAU Member
Posts: 3918
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Sun Sep 07, 2014 6:07 pm

I have modified the dll to include better error messages.
Can you re-test and tell if an error message box appears ?
You can also check that Windows or your antivirus has not blocked the dll.

User avatar
Darksaber
Vice Admiral
Posts: 10931
Joined: Mon Jan 10, 2000 12:01 am
Contact:

Post by Darksaber » Sun Sep 07, 2014 6:35 pm

Ok excluded the Lucasarts folder from my Anti-virus

And got this error

DeviceResources::RenderMain
The Parameter is incorrect

Hope that helps a little :D
“You can please some of the people all of the time, you can please all of the people some of the time, but you can’t please all of the people all of the time”.”
- John Lydgate

Good Things Come To Those Who Wait....
Darksaber's X-Wing Station

User avatar
JeremyaFr
XWAU Member
Posts: 3918
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Sun Sep 07, 2014 7:27 pm

Thanks.
That helps.

I've improved the error message to indicate which rendering part has failed.
Apparently, Win 7 doesn't like one of the rendering parameters.

User avatar
Darksaber
Vice Admiral
Posts: 10931
Joined: Mon Jan 10, 2000 12:01 am
Contact:

Post by Darksaber » Sun Sep 07, 2014 9:03 pm

Sorry didn't see your post

Here are the results


DeviceResources::RenderMain
Texture2D
The Parameter is incorrect
“You can please some of the people all of the time, you can please all of the people some of the time, but you can’t please all of the people all of the time”.”
- John Lydgate

Good Things Come To Those Who Wait....
Darksaber's X-Wing Station

User avatar
JeremyaFr
XWAU Member
Posts: 3918
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Sun Sep 07, 2014 10:35 pm

OK,
I see what the problem is.

:kopfwand: I forget that starting from Direct3D 10, the 16-bit texture formats are only supported starting from Windows 8. :kopfwand:
From MSDN:
These formats require dxgi 1.2 or later. dxgi 1.2 types are only supported on systems with Direct3D 11.1 or later.
•DXGI_FORMAT_B5G6R5_UNORM
•DXGI_FORMAT_B5G5R5A1_UNORM
•DXGI_FORMAT_B4G4R4A4_UNORM
From MSDN:
Direct3D 10 through Direct3D 11: This value is defined for dxgi. However, Direct3D 10, 10.1, or 11 devices do not support this format.
I have uploaded a corrected dll.

User avatar
Ramshu
Cadet 2nd Class
Posts: 74
Joined: Sat Sep 21, 2013 10:42 am
Contact:

Post by Ramshu » Sun Sep 07, 2014 11:25 pm

Darksaber wrote:Sorry didn't see your post

Here are the results


DeviceResources::RenderMain
Texture2D
The Parameter is incorrect
Same problem. http://i61.tinypic.com/23mugps.jpg
JeremyaFr wrote:OK,
I see what the problem is.

:kopfwand: I forget that starting from Direct3D 10, the 16-bit texture formats are only supported starting from Windows 8. :kopfwand:
From MSDN:
These formats require dxgi 1.2 or later. dxgi 1.2 types are only supported on systems with Direct3D 11.1 or later.
•DXGI_FORMAT_B5G6R5_UNORM
•DXGI_FORMAT_B5G5R5A1_UNORM
•DXGI_FORMAT_B4G4R4A4_UNORM
From MSDN:
Direct3D 10 through Direct3D 11: This value is defined for dxgi. However, Direct3D 10, 10.1, or 11 devices do not support this format.
I have uploaded a corrected dll.
Black Screen with the new dll and don't show a error message.

"Nasios pa vola"

User avatar
Darksaber
Vice Admiral
Posts: 10931
Joined: Mon Jan 10, 2000 12:01 am
Contact:

Post by Darksaber » Mon Sep 08, 2014 12:29 am

The new Dll works ok now on my system, but..... on the concourse, and siderooms there are black bars down each side of the screen, in game this happens (still black bars down each side but the resolution is screwy (I don't have any sort resolution fix applied, just a straight install with DSUCP installed)

You can see what I mean here

Concourse
frontscreen0.jpg
640 x 480
flightscreen0.jpg
800 x 600
flightscreen1.jpg
1024 x 768
flightscreen2.jpg
1152 x 864
flightscreen3.jpg
1280 x 1024
flightscreen4.jpg
1600 x 1200
flightscreen5.jpg
The resolution for each is outside the screen until you get to 1600 x 1200 but then it too small to see anything

screenshot of concourse using Alt=o
frontscreen.jpg
Screenshot in-game using Ctrl=PrtScrn
flightscreen.jpg
As you can see you can't take screenshots using the usual keys, I had to use printscreen the exit game each time then paste the screenshot in a paint program and save.
You do not have the required permissions to view the files attached to this post.
“You can please some of the people all of the time, you can please all of the people some of the time, but you can’t please all of the people all of the time”.”
- John Lydgate

Good Things Come To Those Who Wait....
Darksaber's X-Wing Station

User avatar
Ramshu
Cadet 2nd Class
Posts: 74
Joined: Sat Sep 21, 2013 10:42 am
Contact:

Post by Ramshu » Mon Sep 08, 2014 11:05 am

Now works correctly, but i think antialiasing has been deactivated..

http://i57.tinypic.com/1pjgad.jpg

http://i60.tinypic.com/1zvc0g3.jpg

Edit
I've done more tests

Wins:
-FXAA seems to work fine now, no blurs letters.
-On fly "esc" menu look great, no more purple textures!
-Start menu high fps rate dosen't look issues
-nVidia cards have a font issue with SSAA activate, i dont look this issue.

Fails:
-SMAA and SSAA i think doesn't work fine.
-Have a problem with starfield, few stars and too many dark.
-A few starships engines looks wrong.

Neutral:
-When put "hardware mip mapping high" look best.

I think we're on the right path when the dll is finished will be another major breakthrough for XWA

Thanks you, Jeremy.

"Nasios pa vola"

User avatar
JeremyaFr
XWAU Member
Posts: 3918
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Tue Sep 09, 2014 12:31 am

An update:
I've enabled MSAA and anisotropy filtering (if supported by the system).
I've corrected the in-game scaling.
I've corrected a bug with one of the cutscene. Now, all of the cutscenes are played with their native resolution format.

Bman
Lieutenant Commander
Posts: 1167
Joined: Mon Apr 05, 2004 11:01 pm

Post by Bman » Wed Sep 10, 2014 8:44 am

This is awesome. Will this work with Reimar's patches ?
W-I-P: TFTC, MC Viscount Cr., ISD-II Avenger, NL-1 Platform, Ton-Falk Esc. Cr., & Misc.

User avatar
JeremyaFr
XWAU Member
Posts: 3918
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Wed Sep 10, 2014 2:13 pm

Yes, it works with or without Reimar's patches.

Reimar
Cadet 1st Class
Posts: 239
Joined: Mon Jan 19, 2009 11:45 am

Post by Reimar » Wed Sep 10, 2014 7:15 pm

Concerning that: Is there still a point in my 32 bit hack after that? (one of the bigger reasons for it was to make MSAA work, though it might also have improved graphical quality in general)
If yes, could this in some way help with the remaining issue of the wrong colors that hack has?

Reimar
Cadet 1st Class
Posts: 239
Joined: Mon Jan 19, 2009 11:45 am

Post by Reimar » Wed Sep 10, 2014 7:20 pm

> Have a problem with starfield, few stars and too many dark.

You are aware that the starfield (as far as I could figure it out) is drawn by directly accessing the (frame)buffer and drawing them directly into it?
It is one of the reasons why my 32 bit patch had to hack the starfield code to do a 16 bpp -> 32 bpp conversion.

User avatar
JeremyaFr
XWAU Member
Posts: 3918
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Thu Sep 11, 2014 12:40 am

I think the starfield is corrected:
flightscreen2.png
flightscreen3.jpg
The 32-bit hack is needed to take 32-bit screenshot (flightscreen). The resolution of frontscreen screenshot is 640x480x16 (hardcoded in the exe).
The fixedclear (Clear2 -> Blt color, Blt depth) is no longer needed.

The wrong colors issue ( menu and briefing review) with 32bitmode is corrected. When the game engine writes 16-bit colors in a 32-bit buffer, the colors are converted.
You do not have the required permissions to view the files attached to this post.

User avatar
Ramshu
Cadet 2nd Class
Posts: 74
Joined: Sat Sep 21, 2013 10:42 am
Contact:

Post by Ramshu » Thu Sep 11, 2014 1:06 pm

I'll try this latest version and I say something, I had no time to post what I found on the previous version.

Edit:
Most of the problems seem to be solved, nice work, only 3 details.

-For a correct display and correct MSAA works need "hardware mip map" option active inside the game.(Correct me if I'm wrong, but the mip maping should affect only the texture resolution by distance, not the AA)
-When activate "Transparency AA" and "FXAA" on nvidia control panel at the same time, have a flickering problem in game menu.
-When activate "FXAA" starfield display too dark again.

"Nasios pa vola"

User avatar
JeremyaFr
XWAU Member
Posts: 3918
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Sat Sep 13, 2014 9:24 pm

The mipmap option affects the textures quality (with distance). It does not affect the aliasing.

User avatar
JeremyaFr
XWAU Member
Posts: 3918
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Sun Sep 14, 2014 10:34 pm

Ramshu wrote:-When activate "Transparency AA" and "FXAA" on nvidia control panel at the same time, have a flickering problem in game menu.
Corrected.

User avatar
Ramshu
Cadet 2nd Class
Posts: 74
Joined: Sat Sep 21, 2013 10:42 am
Contact:

Post by Ramshu » Tue Sep 16, 2014 9:01 pm

-On map not see the blue grid, and I have the feeling that it looks darker than it should.

Edit:
-When use "alt + tab" I have problems moving between windows, it seems that XWA not properly minimized.
-Playing online with Voobly, the dll is overwritten by another and stops working, we tested with gameranger and not have this problem.

-Someone tried to update ati drivers to see if it works with the dll?

"Nasios pa vola"

FBK
Cadet 3rd Class
Posts: 32
Joined: Sat May 18, 2013 7:05 am

Post by FBK » Wed Sep 17, 2014 12:42 pm

Using this DLL and reimar changeres.bat you can change The game resolution over the 2048x1960 limits. I have tested 4000x720 using 3 monitors AND it looks great.
AND I would like to suggest a challenge:
As this dll makes The game DirectX 11 compatible, It could also works with oculus rift.....who will try it?

Post Reply