Page 1 of 14

Direct3D 11 via DDraw.dll

Posted: Mon Sep 01, 2014 8:22 pm
by JeremyaFr
Hello,
I am writing a custom ddraw.dll using Direct3D 11 api.

https://github.com/JeremyAnsel/xwa_ddra ... ses/latest

Re: Direct3D 11

Posted: Tue Sep 02, 2014 4:25 am
by Forceflow
Every busy I see :) Good luck with that! Would that mean the game might finally work better with newer card drivers?

Re: Direct3D 11

Posted: Wed Sep 03, 2014 9:21 pm
by JeremyaFr
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.

Re: Direct3D 11

Posted: Sat Sep 06, 2014 7:50 pm
by JeremyaFr
Here is the dll:
xwa_ddraw_d3d11.zip

Re: Direct3D 11

Posted: Sun Sep 07, 2014 10:27 am
by Ramshu
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

Re: Direct3D 11

Posted: Sun Sep 07, 2014 1:18 pm
by Darksaber
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

Re: Direct3D 11

Posted: Sun Sep 07, 2014 6:07 pm
by JeremyaFr
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.

Re: Direct3D 11

Posted: Sun Sep 07, 2014 6:35 pm
by Darksaber
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

Re: Direct3D 11

Posted: Sun Sep 07, 2014 7:27 pm
by JeremyaFr
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.

Re: Direct3D 11

Posted: Sun Sep 07, 2014 9:03 pm
by Darksaber
Sorry didn't see your post

Here are the results


DeviceResources::RenderMain
Texture2D
The Parameter is incorrect

Re: Direct3D 11

Posted: Sun Sep 07, 2014 10:35 pm
by JeremyaFr
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.

Re: Direct3D 11

Posted: Sun Sep 07, 2014 11:25 pm
by Ramshu
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.

Re: Direct3D 11

Posted: Mon Sep 08, 2014 12:29 am
by Darksaber
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.

Re: Direct3D 11

Posted: Mon Sep 08, 2014 11:05 am
by Ramshu
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.

Re: Direct3D 11

Posted: Tue Sep 09, 2014 12:31 am
by JeremyaFr
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.

Re: Direct3D 11

Posted: Wed Sep 10, 2014 8:44 am
by Bman
This is awesome. Will this work with Reimar's patches ?

Re: Direct3D 11

Posted: Wed Sep 10, 2014 2:13 pm
by JeremyaFr
Yes, it works with or without Reimar's patches.

Re: Direct3D 11

Posted: Wed Sep 10, 2014 7:15 pm
by Reimar
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?

Re: Direct3D 11

Posted: Wed Sep 10, 2014 7:20 pm
by Reimar
> 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.

Re: Direct3D 11

Posted: Thu Sep 11, 2014 12:40 am
by JeremyaFr
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.

Re: Direct3D 11

Posted: Thu Sep 11, 2014 1:06 pm
by Ramshu
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.

Re: Direct3D 11

Posted: Sat Sep 13, 2014 9:24 pm
by JeremyaFr
The mipmap option affects the textures quality (with distance). It does not affect the aliasing.

Re: Direct3D 11

Posted: Sun Sep 14, 2014 10:34 pm
by JeremyaFr
Ramshu wrote:-When activate "Transparency AA" and "FXAA" on nvidia control panel at the same time, have a flickering problem in game menu.
Corrected.

Re: Direct3D 11

Posted: Tue Sep 16, 2014 9:01 pm
by Ramshu
-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?

Re: Direct3D 11

Posted: Wed Sep 17, 2014 12:42 pm
by FBK
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?