Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dear Crosire!Please help with Correcting/Remove night pixelshader effect of Operation Flashpoint 1.96 #142

Open
NATO2000 opened this issue Apr 18, 2022 · 53 comments

Comments

@NATO2000
Copy link

Dear Crosire, have you played Operation Flashpoint? This year is my 19 year as a player of Operation Flashpoint.

Operation Flashpoint will accompany me throughout my life.

Operation Flashpoint has a unique problem, that is, starting from the DX9 graphics card, the night image effect in the game will become black and white.
FLASHPOINT1 2021-10-12 15-44-02-48
FLASHPOINT1 2021-10-12 15-45-34-16

[as you see,the second in game night time picture was amost black and grey]

The rendering on the DX8 graphics card is all normal.

I have checked the official technical information and player forums. They mentioned that the night rendering of the game performed abnormally on the DX9 graphics card, such as 6800GT, 7950GT and later graphics cards, but everything is normal on the FX5200 graphics card, because FX5200 is a DX8 graphics card, FX5200 The DX9 function is not complete.

What's more peculiar is that, among all the computer games in the world, Operation Flashpoint is the only game that has abnormal rendering problems with it's night images due to the upgrade of graphics card technology.

There is one ideas to solve this problem

There were two American (seem to be) players who have developed D3d8.dll for Operation Flashpoint, and matched it with Configurator.exe.

In Configurator.exe, there is such a setting:

Remove night pixelshader effect, after turning ON(not OFF) this option, the night image in the game can be rendered normally.
QQ截图20211012154826

But this D3d8.dll does not make any optimizations to the frame rate and performance.
QQ截图20211012155021

Those two authors had lost contact , their E-mailboxes wasn't existing anymore


and then your D3D8.DLL,https://github.com/crosire/d3d8to9/releases
provides a solution to improve the performance of the game.

This D3D8.DLL is really useful for improving the frame rate, but it does not support repairing the abnormal rendering of the game night image.

Your D3d8.dll file can effectively improve the game frame rate, but does not have the function of repairing night images, Two American Players's D3D8.DLL (DXDLL Tools
FOR OFP) has a visual effect optimization function, but does not have a frame rate lifting function, can you add the Remove Night Pixelshader Effect function in your D3D8.DLL? (I only need this feature, just provide a dedicated version for OFP)

So please help me

================================================
Some other information with DXDLL for OFP :

To install, extract this archive to your Operation Flashpoint
directory. Run dxdll/configurator.exe to configure, or edit
the dxdll/config.cfg file with a text editor.

Note! Do NOT copy the d3d8.dll into your windows system
directory, doing so will break Direct3D from your system!

Dxdll adds various effects to OFP, including postprocessing
effects, reflective water and other enhancements.

Postprocessing effects include hard light effect, desaturation
effect and glare effect. For more information run the configu-
rator. All postprocessing effects require a video card with
at least pixel shader v1.1 support. Water reflections require
environmental bumpmampping and render to texture support.

Most effects and settings can also be changed with various
in-game shortcuts, press the application key and'H' while
playing for more information. When changing settings in-game,
they are not saved into the configuration so if you want to
do permanent changes you need to edit the configuration.

Note that due to the way the DLL works, it is likely that
there are compatibility problems with some video cards. If you
encounter problems, try these procedures:
-Disable some effects from the DXDLL configuration
-Make sure HW T&L is enabled from OFP Preferences
-Make sure multitexturing is enabled from video options
-Try increasing the texture size settings from OFP Preferences
-Try changing to 16bit or 32bit color
-Decrease the hardware acceleration setting from windows display properties
-Make sure you have the latest drivers installed for you video card

dxdll10.zip


Known bugs


-Changing screen resolution will crash the game

-Reflected objects appear "laggy" since they come from
the last rendered frame

-Glare fade effect often "burns" shapes into the image
which do not disappear until bright objects come to view

-Reflected objects are counted from farthest to nearest
so when the reflected objects count limit is hit, objects
near player will not be visible in the reflection

-Reflected objects distance is relative to player's position,
not the camera position, so when using 3rd person view or other
external camera, reflected objects can appear wrong

-Changes to OFP default textures, like changing the water
texture, causes the dll not to recognise them and can
cause some effect to not work properly.


Credits


DXDLL is made by Kegetys [email protected]
and Feersum Endjinn [email protected]

Includes code from the zlib library,
Copyright (C) 1995-2002 Mark Adler

@NATO2000
Copy link
Author

NATO2000 commented Apr 18, 2022

dxdll10.zip

please,download it here,if you need OFP 1.96 game file, please noted me

@elishacloud
Copy link
Contributor

I guess the best way to solve this is to modify (hack) the d3d8.dll that works with the configurator and have it load something like d3dx.dll. Then rename the d3d8to9 file to d3dx.dll.

@NATO2000
Copy link
Author

I guess the best way to solve this is to modify (hack) the d3d8.dll that works with the configurator and have it load something like d3dx.dll. Then rename the d3d8to9 file to d3dx.dll.
This is hard to say, ordinary players do not have the ability to modify ".dll", the only thing they can do is to feed back the test results to crosire.

Incorporating color correction into the new d3d8 should be easy for crosire, but for us it was very difficult

@elishacloud
Copy link
Contributor

I quickly hacked the Configurator dll to have it load d3dx.dll and added d3d8to9 dll to the package as d3dx.dll. This should allow for all the features of the Configurator dll while using d3d8to9. I don't have Operation Flashpoint so I could not test it. But I think it should work.

Hacked package update: dxdll10_hacked.zip

@NATO2000
Copy link
Author

Copy that I'll test it immediately!

@NATO2000
Copy link
Author

NATO2000 commented Apr 19, 2022

I quickly hacked the Configurator dll to have it load d3dx.dll and added d3d8to9 dll to the package as d3dx.dll. This should allow for all the features of the Configurator dll while using d3d8to9. I don't have Operation Flashpoint so I could not test it. But I think it should work.

Hacked package update: dxdll10_hacked.zip

The test is over, the game fails to start, and no errors are reported, just double-click to open but the program doesn't respond. I deleted d3dx.dll and kept d3d8.dll, same as above.
After I delete d3d8.dll, the game starts normally, and whether d3dx.dll is retained or deleted, it has no effect on the game startup.

The effect of d3dx.dll on the game frame rate: unknown, after deleting d3d8.dll, the screen is gray and white, no correction effect,

is there any other information can I check for you?

@NATO2000
Copy link
Author

I quickly hacked the Configurator dll to have it load d3dx.dll and added d3d8to9 dll to the package as d3dx.dll. This should allow for all the features of the Configurator dll while using d3d8to9. I don't have Operation Flashpoint so I could not test it. But I think it should work.

Hacked package update: dxdll10_hacked.zip

https://www.legendsworld.net/shooter/game/1730
https://www.legendsworld.net/site/download.php?mirror=7479
you can download here if you need

@NATO2000
Copy link
Author

I quickly hacked the Configurator dll to have it load d3dx.dll and added d3d8to9 dll to the package as d3dx.dll. This should allow for all the features of the Configurator dll while using d3d8to9. I don't have Operation Flashpoint so I could not test it. But I think it should work.

Hacked package update: dxdll10_hacked.zip

hello elishacloud,could you continue to help us?it is our honour!

@elishacloud
Copy link
Contributor

Ok, try this one. I think it should work for you now. I fixed the hack so that the Configurator dll loads d3dx.dll and added d3d8to9 dll to the package as d3dx.dll.

New version: dxdll10_hacked_d3dx.zip

@HerMajestyDrMona
Copy link
Contributor

I tested and it seems to work on my test installation :) Not sure about the night effect as @NATO2000 has to confirm it, but the game started and both .dlls were loaded.

Nice job with the fix @elishacloud. The PUSH OFFSET thing didn't seem to work (I tried that on the same day), but you nicely solved it by jumping to a fixed address where bytes are directly written MOV DWORD PTR DS:[EAX],78643364 :)

@NATO2000
Copy link
Author

@elishacloud @HerMajestyDrMona The second test is over, and the results are as follows: The night image correction function is effective, but some of the original features of the DXLL tool fail, such as turning off vertical sync. This defeats the purpose of fusing the dll files, because our purpose is to fix the night screen + increase the game frame rate.

When the OFP frame rate is 60FPS, there is a serious mouse floating problem. 90% of players around the world may not realize this problem. They are used to the state of the mouse floating around. However, increasing the game frame rate to more than 80FPS can greatly improve the game operation experience.

@elishacloud
Copy link
Contributor

The night image correction function is effective

Good.

but some of the original features of the DXLL tool fail, such as turning off vertical sync.

This is probably a bug with d3d8to9. I've seen this in other games. If this is the only issue, we should focus on fixing this.

@ThirteenAG
Copy link
Contributor

This is probably a bug with d3d8to9. I've seen this in other games. If this is the only issue, we should focus on fixing this.

That reminds me of another thing, I haven't tested myself but there are reports that enb converter fixes flickering of shadows in original Mafia: ThirteenAG/WidescreenFixesPack#1022

Would be interesting to know why, and why d3d8to9 doesn't.

@HerMajestyDrMona
Copy link
Contributor

HerMajestyDrMona commented Apr 26, 2022

A few years ago, I fixed the FPS limit in my project, by adding:

	if (DirectX9ForceDisablingVsync) {
		//No, bug on VM with Win 8.1!!!
		//output.SwapEffect = D3DSWAPEFFECT_COPY;
		Output.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE;
	}
	//End of Dr Mona Lisas

At the end of this function:

void ConvertPresentParameters(D3DPRESENT_PARAMETERS8 &Input, D3DPRESENT_PARAMETERS &Output)

(note that I'm not sure if it's really disabling the Vsync, but seems to do exactly what I needed).

You can test it by using this d3dx.dll file (compiled with the /MT runtime library):

d3dx_D3DPRESENT_INTERVAL_IMMEDIATE.zip

I remember it was discussed before that d3d8to9 could have some configuration file where such tweaks could be applied. Maybe if that's confirmed to work we could focus on the config file if @crosire has nothing against it.

@elishacloud
Copy link
Contributor

but some of the original features of the DXLL tool fail, such as turning off vertical sync.

How do you disable vertical sync with DXLL? I could not find the option. We could hard code it off, but I prefer to fix the issue. In the version of the game I have it is sending D3DPRESENT_INTERVAL_ONE to Direct3D8, so in this case d3d8to9 is doing what it should.

@NATO2000
Copy link
Author

The night image correction function is effective

Good.

but some of the original features of the DXLL tool fail, such as turning off vertical sync.

This is probably a bug with d3d8to9. I've seen this in other games. If this is the only issue, we should focus on fixing this.

@elishacloud Thank you very much for your efforts and help! Next, I use other computers to test different versions of d3d8tod9.dll of crosire one by one. I speculate that there may be differences in the improvement of frame rate between different versions of d3d8tod9.dll. There may be a version that maximizes the frame rate of OFP, and this version requires I found out by testing.

At the same time, if possible, is it possible to issue instructions through dll or Configurator.exe to make the game implement 16X anisotropic filtering mode.

This is because many OFP players may use the integrated graphics card to play OFP, and the integrated graphics driver, you know, is very simple and basically cannot provide any effective optimization options. I can only describe it as horror.

Doing this, however, may greatly increase your workload.

Let's find out what caused the vertical sync function to be turned on again.

@NATO2000
Copy link
Author

but some of the original features of the DXLL tool fail, such as turning off vertical sync.

How do you disable vertical sync with DXLL? I could not find the option. We could hard code it off, but I prefer to fix the issue. In the version of the game I have it is sending D3DPRESENT_INTERVAL_ONE to Direct3D8, so in this case d3d8to9 is doing what it should.

check the DXDLL TOOLS for OFP,may be can find some lead, it was disable vertical sync automaticly

@elishacloud
Copy link
Contributor

check the DXDLL TOOLS for OFP,may be can find some lead, it was disable vertical sync automaticly

What is the DXDLL TOOLS? All I have is the DXDLL Configurator:

image

@elishacloud
Copy link
Contributor

At the same time, if possible, is it possible to issue instructions through dll or Configurator.exe to make the game implement 16X anisotropic filtering mode.

It sounds like you want more options. d3d8to9 is just a straight conversation from Direct3D8 to Direct3D9. My dxwrapper project has other options.

You can use this dll instead, which uses d3d8to9, but adds all kinds of options: d3dx.zip

@NATO2000
Copy link
Author

check the DXDLL TOOLS for OFP,may be can find some lead, it was disable vertical sync automaticly

What is the DXDLL TOOLS? All I have is the DXDLL Configurator:

image

Yes,it is,DXDLL TOOS for OFP contains Configurator,d3d8.dll and config.cfg,there is "no disable vertical sync" in the Configurator but it is indeed already turn the vertical sync off,I don't know this due to d3d8.dll or Configurator,so it may be a lead about disabling vertical sync

@elishacloud
Copy link
Contributor

there is "no disable vertical sync" in the Configurator but it is indeed already turn the vertical sync off

I checked the parameters that are sent to Direct3D8 and neither Configurator nor the d3d8.dll turns off vertical sync. Maybe this is a bug in Direct3D8? But they are definitely turning ON vertical sync.

The game is sending D3DPRESENT_INTERVAL_ONE and D3DSWAPEFFECT_DISCARD, which clearly states in the Microsoft documentation that:

"The driver will wait for the vertical retrace period. Present operations will not be affected more frequently than the screen refresh."

AND

"Unless this value is D3DPRESENT_INTERVAL_IMMEDIATE, the presentation will be synchronized with the vertical sync of the monitor."

@HerMajestyDrMona
Copy link
Contributor

@elishacloud, I noticed it before too, on EE2 in DX8 mode on Windows 10/11. 60Hz laptop:

  • DirectX 8 -> Full Screen Mode -> 100+ FPS.
  • d8to9 -> Full Screen Mode -> 60 FPS.

Windows is doing some strange things with DX8 games (Nvidia and AMD drivers too). I'd say it's the best to simply workaround it in d3d8to9.

@NATO2000
Copy link
Author

oh my god,it is a bug?

@NATO2000
Copy link
Author

there is "no disable vertical sync" in the Configurator but it is indeed already turn the vertical sync off

I checked the parameters that are sent to Direct3D8 and neither Configurator nor the d3d8.dll turns off vertical sync. Maybe this is a bug in Direct3D8? But they are definitely turning ON vertical sync.

The game is sending D3DPRESENT_INTERVAL_ONE and D3DSWAPEFFECT_DISCARD, which clearly states in the Microsoft documentation that:

"The driver will wait for the vertical retrace period. Present operations will not be affected more frequently than the screen refresh."

AND

"Unless this value is D3DPRESENT_INTERVAL_IMMEDIATE, the presentation will be synchronized with the vertical sync of the monitor."

ok,OK, can you consider another solution, just write the function of removing black and white shader effects into d3d8tod9.dll?

@elishacloud
Copy link
Contributor

Windows is doing some strange things with DX8 games (Nvidia and AMD drivers too). I'd say it's the best to simply workaround it in d3d8to9.

This brings up a philosophical question. Should d3d8to9 just do direct translation from Driect3D8 to Direct3D9 or should it it try and copy how Direct3D8 works even if Direct3D8 is ignoring or not doing what the game requests?

Currently, d3d8to9 just does direct translation from Driect3D8 to Direct3D9. If we try to copy how Direct3D8 works then we would have to do some work reversing Direct3D8 to figure out what cases it to disable v-sync even when the game requests it to be enabled. This could lead to game settings not working when the user specifically enables it.

ok,OK, can you consider another solution, just write the function of removing black and white shader effects into d3d8tod9.dll?

@NATO2000 I don't think that will ever happen with d3d8to9 because it goes far outside the realm of what d3d8to9 is supposed to do. This is something more for a custom fix for Operation Flashpoint, which is what DXDLL seems to be doing. For other customizations I recommend using dxwrapper. I already gave you a build here that enables d3d8to9 and anisotropic filtering and disables v-sync.

@HerMajestyDrMona
Copy link
Contributor

HerMajestyDrMona commented Apr 27, 2022

This brings up a philosophical question. Should d3d8to9 just do direct translation from Driect3D8 to Direct3D9 or should it it try and copy how Direct3D8 works even if Direct3D8 is ignoring or not doing what the game requests?

In my opinion the first one (direct translation, as it's done currently). There are so many possibilities: Intel, AMD, Nvidia "tweaks", Windows fullscreen optimization option that also changes how things are rendered, dual graphics card laptops (Nvidia Optimus for example does not allow to use the better GPU for DX8 games), source. Not to mention that things might even differ depending on the output screen or GSync/FreeSync. Or... this weird Windows 10/11 Game Mode (but it's probably only settings CPU priorities). Oh, and there's Wine that actually tries to reproduce things just as they should be in documentation, and I know that some Linux users use d3d8to9 on it too.

A good solution would be a configuration file where users could overwrite the default d3d8to9 behaviour (for example the basic Vsync switch), but... It's already available in dxwrapper, so that also doesn't make much sense and only might cause more complications in projects that use d8to9 as source for the further enhancements.

I think this DX8 Vsync off thing causes a false first-impression when people are testing d3d8to9 for the first time. They might actually think it works "worse". Maybe adding extra information to the README could be helpful? But then, we still would need some confirmation of these philosophical theories.

@NATO2000
Copy link
Author

Windows is doing some strange things with DX8 games (Nvidia and AMD drivers too). I'd say it's the best to simply workaround it in d3d8to9.

This brings up a philosophical question. Should d3d8to9 just do direct translation from Driect3D8 to Direct3D9 or should it it try and copy how Direct3D8 works even if Direct3D8 is ignoring or not doing what the game requests?

Currently, d3d8to9 just does direct translation from Driect3D8 to Direct3D9. If we try to copy how Direct3D8 works then we would have to do some work reversing Direct3D8 to figure out what cases it to disable v-sync even when the game requests it to be enabled. This could lead to game settings not working when the user specifically enables it.

ok,OK, can you consider another solution, just write the function of removing black and white shader effects into d3d8tod9.dll?

@NATO2000 I don't think that will ever happen with d3d8to9 because it goes far outside the realm of what d3d8to9 is supposed to do. This is something more for a custom fix for Operation Flashpoint, which is what DXDLL seems to be doing. For other customizations I recommend using dxwrapper. I already gave you a build here that enables d3d8to9 and anisotropic filtering and disables v-sync.

Hello, today I changed a computer with a discrete graphics card, and did the final test of the previous New version: dxdll10_hacked_d3dx.zip, and also tested each version of d3d8tod9 individually.
Test results: dxdll10_hacked_d3dx.zip: The frame rate improvement function is effective, and the night image correction is effective. During the static scene test, the frame rate is slightly unstable, always at 580-600FPS, constantly changing.
Static scene test without any dll file: 460FPS, basically stable
d3d8to9 v1.11.0 static scene test: 590FPS, basically stable
d3d8to9 v1.3.0 (Jul 2017): 606FPS, basically stable
It looks like the earlier version has a slightly higher frame rate than the latest version, probably not much difference.

For discrete graphics card users, they can implement 16x anisotropic filtering and turn off VSync through the driver panel. Basically achieve the perfect ending.

For integrated graphics users, since VSync is enabled by default, dxdll10_hacked_d3dx.zip doesn't make much sense, either they use the original dxdll tool to fix night images, or they use dxwrapper, which cannot fix night images.

@elishacloud
Copy link
Contributor

elishacloud commented Apr 28, 2022

either they use the original dxdll tool to fix night images, or they use dxwrapper, which cannot fix night images.

I think there is a misunderstanding here. dxwrapper can replace d3d8to9 and work in tandem with dxdll. In other words, you can get all the features of dxdll and the features of dxwrapper together.

With dxwrapper you can disable v-sync and enable anisotropic filtering. With dxdll you can fix the night sky. So with both of them you can get all of this. I gave you the build of dxwrapper to do this in the comment here. Just use the hacked version of dxdll I gave you and then overwrite the d3dx.dll file with the files from the comment listed and you will get everything you need.

To simplify this I created a package with both dxdll and dxwrapper: dxdll10_hacked_d3dx_dxwrapper.zip

@NATO2000
Copy link
Author

NATO2000 commented Apr 29, 2022

hello,

dxwrapper

@elishacloud Let me understand, your D3DX.dll is not the same thing as Crosire's D3D8toD9, but these two dlls serve the same purpose?
Or, your D3DX.dll is based on D3D8toD9, while using dxwrapper to achieve more powerful functions?
Not sure if my understanding is correct?
I always thought of Crosire as a person, could it be that Crosire is you?

Can you help me with my confusion, thanks a lot, haha


I quickly learned D3DX.INI

[d3d9]
AnisotropicFiltering=16
AntiAliasing = 0
EnableVSync = 0
EnableWindowMode = 0
ForceMixedVertexProcessing = 0
ForceSystemMemVertexCache = 0
ForceVsyncMode = 1
FullscreenWindowMode = 0
WindowModeBorder = 0

According to the underlying binary language, 0 is off and 1 is on
VSync is turned on when EnableVSync = 1.

However, AnisotropicFiltering=1, like the default, is trilinear filtering. I filled in 16, and it is still trilinear filtering. What is the code for 16 times anisotropic filtering?

Also, is there any code to limit the FPS, let's say when I need to limit the FPS that is too high, how can I write the code?

FPSlimits=144?
or maxframerate limits=144?

@elishacloud
Copy link
Contributor

Let me understand, your D3DX.dll is not the same thing as Crosire's D3D8toD9, but these two dlls serve the same purpose?

My dxwrapper includes all of Crosire's d3d8to9 code in it. Dxwrapper is a multi-purpose tool which includes lots of different tools.

Or, your D3DX.dll is based on D3D8toD9, while using dxwrapper to achieve more powerful functions?

My dxwrapper can do everything d3d8to9 can do and more.

I always thought of Crosire as a person, could it be that Crosire is you?

No, I am not Crosire.

According to the underlying binary language, 0 is off and 1 is on

Correct.

VSync is turned on when EnableVSync = 1.

Correct.

However, AnisotropicFiltering=1, like the default, is trilinear filtering. ... What is the code for 16 times anisotropic filtering?

When AnisotropicFiltering=1 then the code will query the GPU and use the highest available AnisotropicFiltering supported by the GPU. In most cases it is better to keep it at 1 than setting it to 16. But you could manually set it to 16 if you want.

Also, is there any code to limit the FPS, let's say when I need to limit the FPS that is too high, how can I write the code?

No, I have not created any code to limit the speed. The limit should be based on either some limit in the game or the limit of your hardware.

@NATO2000
Copy link
Author

@elishacloud Big news! Great discovery! At first I set AnisotropicFiltering=1 or 16, and the game defaults to trilinear filtering!
I thought it was my integrated graphics card that didn't support higher filtering modes!
Then I inadvertently minimized the game to the taskbar, then restored the game to a full-screen window, and the 16x anisotropic filter actually worked!

Then I immediately started repeating the experiment. The experimental results showed that the first entry into the game was indeed a tri-linear filtering mode, but by first minimizing and then maximizing, 16 times anisotropic filtering could be activated!

Ha ha ha ha

@NATO2000
Copy link
Author

@elishacloud My dear elishacloud, you have made outstanding contributions to OFP players around the world, and your new tools have greatly enhanced the vitality of OFP!

In addition, OFP has a fatal problem, the mouse is not accurate, unlike standard FPS games (such as Counter Strike, Half-Life, Quake, etc.), his mouse crosshair, whether in the game menu, or in In the actual game, there is a floating range of the crosshair.

I noticed that there are some settings related to mouse positioning and input in dxwrapper. I wonder if dxwrapper has a function to solve the inaccurate positioning of the crosshair of the game mouse?

@elishacloud
Copy link
Contributor

Then I inadvertently minimized the game to the taskbar, then restored the game to a full-screen window, and the 16x anisotropic filter actually worked!

That does not sound right. Can you try with this build and see if it helps. Keep your existing d3dx.ini and just replace the dll file with this one: d3dx.zip

I wonder if dxwrapper has a function to solve the inaccurate positioning of the crosshair of the game mouse?

I don't have anything in dxwrapper that could help with this. I wonder if it is similar to the issue here.

@NATO2000
Copy link
Author

NATO2000 commented May 4, 2022

Then I inadvertently minimized the game to the taskbar, then restored the game to a full-screen window, and the 16x anisotropic filter actually worked!

That does not sound right. Can you try with this build and see if it helps. Keep your existing d3dx.ini and just replace the dll file with this one: d3dx.zip

I wonder if dxwrapper has a function to solve the inaccurate positioning of the crosshair of the game mouse?

I don't have anything in dxwrapper that could help with this. I wonder if it is similar to the issue here.

Great it works well,Really!

@NATO2000
Copy link
Author

NATO2000 commented May 6, 2022

Then I inadvertently minimized the game to the taskbar, then restored the game to a full-screen window, and the 16x anisotropic filter actually worked!

That does not sound right. Can you try with this build and see if it helps. Keep your existing d3dx.ini and just replace the dll file with this one: d3dx.zip

I wonder if dxwrapper has a function to solve the inaccurate positioning of the crosshair of the game mouse?

I don't have anything in dxwrapper that could help with this. I wonder if it is similar to the issue here.
Hi, now I have a new problem. The latest version of D3DX dxwrapper is no longer available on Windows XP. I will provide you with errors reported by the system.

Crosire's D3D8TOD9 can be used in XP systems.

You may have questions, why use winXP system?
Because according to the test, the XP system and the old version of the graphics card driver have excellent compatibility with the old game, taking the OFP test report as an example.

Under the extreme scenario test,
In win7 system, OFP without any D3D8.DLL can reach 460FPS
In win7 system, OFP with D3D8toD9 can reach 580FPS (just D3D8toD9 1.11, if use D3D8toD9 1.7, it can reach 620FPS)

However, in XP system, OFP without any D3D8.DLL can directly reach 780FPS.
If any version of D3D8toD9.DLL is loaded, the framerate drops to 702FPS.

It's strange that OFP is so powerful in XP without any d3d8tod9 loaded.

It is more powerful than D3D8toD9 loaded in win7 system.

In XP, OFP killed win7+D3D8TOD9 with bare hands.

The above test results are very unexpected. Originally, I thought that the operating efficiency of OFP has reached its peak state in XP system. At this time, with the help of D3D8TOD9, the ultimate evolution of OFP can be achieved, but the test results are completely unexpected.

However, I have repeatedly tested more complex scenarios and found more interesting things. As the scenarios become more and more complex, XP+D3D8toD9.dll will indeed have some improvement, but the improvement is not as obvious as in the win7 system.

So, wondering if you can make a D3DX dxwrapper for XP systems?

I can do more tests.

@HerMajestyDrMona
Copy link
Contributor

HerMajestyDrMona commented May 6, 2022

So, wondering if you can make a D3DX dxwrapper for XP systems?

I sincerely hope this won't be even considered by @elishacloud.
Dxwrapper uses some external projects (e.g. for logging). Fixing the compatibility with XP would not only require spending dozens of hours on an useless thing, but also forking and improving external tools to find function replacements that work on that ancient operating system.
Besides that, a basic compilation of any program (that doesn't even use functions that are not available on XP) will result in the same runtime errors. It's because the newest versions of Visual Studio already use some XP-incompatible things on compiling time. So adding XP support would also require downgrade of the compiler version, which would be bad for the mainline version of the tool and result in more problems on devices that are supposed to use it than help for XP users.

If you still would like to test these things on XP, I would recommend you to install some old version of Visual Studio Community and try to compile the project yourself, based on the source code that is available. There's a few % of chance that the code would be compatible.

@mirh
Copy link

mirh commented May 6, 2022

You are all over the place man.

  1. Elisha is already supporting XP in a lot of his projects
  2. The last supporting toolset sits in vs 2017, which is far from ancient
  3. The only "too new" library is reportedly DDrawCompat (possibly due to this trivial bug)

I agree then it's far from being some pressing deal breaker, but not last due to the aforementioned (if confused) claims it would certainly be an interesting comparison. Though I doubt that could eventually really boil down to operating system differences native profiling hasn't been available for 10 years though by now).

@elishacloud
Copy link
Contributor

It would be very difficult for me to support dxwrapper on Windows XP. This goes against the purpose of dxwrapper, which is to get old games working on new operating systems.

I think it would be much easier to make a version of d3d8to9 with v-sync disabled, antialiasing enabled and anisotropic filtering enabled. Maybe in the future I will make a branch of d3d8to9 with these features.

@mirh
Copy link

mirh commented May 7, 2022

I mean, oldest games used to break there too.
But I see how I misjudged dxwrapper position.
Still, it would be interesting to know why performance is almost halved in w7.

@elishacloud
Copy link
Contributor

I believe the performance issues started with Vista. As I understand it the reason is that Microsoft changed their underlying architecture and removed support for anything older than DirectX 9. These older DirectX versions are simply emulated/re-implemented on top of their new architecture. This broke lots of games and made other games run slowly.

dxwrapper should work fine on Vista and newer. However, supporting XP would be difficult mainly because of the changes done in DDrawCompat.

@NATO2000
Copy link
Author

NATO2000 commented May 8, 2022

I mean, oldest games used to break there too. But I see how I misjudged dxwrapper position. Still, it would be interesting to know why performance is almost halved in w7.

Taking OFP as an example, I did a detailed performance comparison test on win7 (bothX64 and X86) and XP (only X86).

In any case, the frame rate of XP is twice as high as that of win7.

Even if I use the same version number of drivers like DRIVER 252.61 for XP and Win7.

@NATO2000
Copy link
Author

NATO2000 commented May 8, 2022

@elishacloud @HerMajestyDrMona In fact, there is another way to solve the problem, but it must require the use of an old graphics card and an old version of the driver.

RivaTuner 2.24C and previous versions can modify the graphics card driver and disable the pixel rendering function of the graphics card driver.

This fixes the nighttime imagery of Operation Flashpoint.

But RivaTuner2.24C is a very old thing, now RivaTuner has degenerated into video recording software (too bad)

When I found that the wrapper could not be used on the XP system, I used RivaTuner2.24C to force the pixel shader off.

Then place d3d8tod9 in the game root directory.

The problem is solved. But only for me.

There are very few people in the world like me who specially prepare a set of old computers for old games

if set an of old computers only for OFP. Maybe I am the only one in the whole world.

By the way, I haven't told you my configuration yet.

i7 4790K+B85 Gaming+16G DDR3 1600+Geforce 7900GTX / GTX 280

Geforce 7900GTX with 93.71 Driver can run 99% old games on the best

@MrDudeX
Copy link

MrDudeX commented May 15, 2022

I've tested the both DXDLL Version

  • dxdll10_hacked.zip
  • dxdll10_hacked_d3dx_dxwrapper.zip

But with the updated (dxdll10_hacked_d3dx_dxwrapper) now, I cannot use ReSade and DXDLL Water Effects together
and I found another problem.

With the first DXDLL (dxdll10_hacked) my textures are now very very bad and very blurry BUT ReShade is working fine.

Here you can see the blurry / pixel textures with the new DXDLL (dxdll10_hacked) with
PR Mod active + DXDLL hacked + ReShade

The games show original blurry textures I run the PR Mod with much better textures, but you will see also that the original textures will look much better with the OLD dxdll (first DXDLL Version)
PRModDXDLL-hacked

And this picture shows the same PR Mod and here are the textures fine (without DXDLL hacked)
PRModTextures

I'm very very happy that I can now use DXDLL water reflection together with ReShade, but unfortunately the textures are very blurry like original one.

So the main problem is that the hacked DXDLL don't allow the high quality custom textures from Mods.

Here, a short summary:

- dxdll10_hacked.zip = ReShade working, but textures are blurry also when mod has better textures.
- dxdll10_hacked_d3dx_dxwrapper.zip = ReShade isn't working anymore with this Version.

I hope you can fix and update it so ReShade is working and the custom textures of mods will be working.

If you need anything else, or I can help with testing, just write a message.

Thanks a lot in advance

@mirh
Copy link

mirh commented May 25, 2022

These older DirectX versions are simply emulated/re-implemented on top of their new architecture.

So, the only way around that (and perhaps elishacloud/dxwrapper#111 if the last idea wasn't to work either) is to rewrite smoothly the crippled functions?

@MrDudeX
Copy link

MrDudeX commented May 25, 2022

I've tried to add "ForceHardwareVertexProcessing = 1" to the "d3dx.ini" at [d3d9] but nothing works.

Or do you have to add this to a new version?

@elishacloud
Copy link
Contributor

I'm very very happy that I can now use DXDLL water reflection together with ReShade, but unfortunately the textures are very blurry like original one.

Does it work fine without ReShade?

  • dxdll10_hacked_d3dx_dxwrapper.zip = ReShade isn't working anymore with this Version.

Have you tried disabling antialiasing and anisotropic filtering? Maybe ReShade does not support these functions? Are you sure this is not a bug with ReShade? I have used ReShade along side dxwrapper a number of times in the past.

I've tried to add "ForceHardwareVertexProcessing = 1" to the "d3dx.ini" at [d3d9] but nothing works. Or do you have to add this to a new version?

I have not added this feature yet.

@MrDudeX
Copy link

MrDudeX commented May 26, 2022

Does it work fine without ReShade?

Unfortunately no, I started the game only with DXDLL water reflections, but PR Mod has the same blurry textures with DXDLL activated

I also tried the first DXDLL version and the same happens

I have not added this feature yet. (ForceHardwareVertexProcessing )

Could you add this feature?

Do you have any ideas what could cause this problem?

If you need any more information just ask and if you can test I would be happy to help.

@MrDudeX
Copy link

MrDudeX commented May 26, 2022

If you want, you can test this PR Mod with really nice textures and models:

  1. Download "[email protected]" and then
  2. The file from the file "UPDATE"

https://drive.google.com/drive/folders/0B2Ftu_bXreoRcjAzcVFSU0F1Ums?resourcekey=0-GOKPBWsTuaB31mcYs_68Ew

@McSlavko
Copy link

update is not necessary when downloading the FULL version (I'm writing this as a mod author)

@MrDudeX
Copy link

MrDudeX commented Jun 2, 2022

The problem was solved with @NATO2000

In the "Configurator.exe" form DXDLL and under the "Postprocessing" the "Glare effect" have to be "Disabled"

grafik

Now I'm happy to use your first DXDLL version with ReShade.

But the issue with the version "dxdll10_hacked_d3dx_dxwrapper.zip" is still that ReShade isn't working anymore with this Version.

@MrDudeX
Copy link

MrDudeX commented Jun 3, 2022

Could anybody add this "d3d8.dll" to the latest version?

Or is this already added? This "d3d8" improves the FPS.

"This is a pseudo-driver module that intends to improve compatibility and stability in games using Direct3D 8 for rendering by converting all API calls and low-level shaders to equivalent Direct3D 9 ones."

https://forums.bohemia.net/forums/topic/232454-d3d8to9-the-ultimate-ofpacwa-performance-booster/

@mirh
Copy link

mirh commented Jun 3, 2022

It links here. We are the same thing.

@NATO2000
Copy link
Author

NATO2000 commented Sep 6, 2023

I quickly hacked the Configurator dll to have it load and added d3d8to9 dll to the package as . This should allow for all the features of the Configurator dll while using d3d8to9. I don't have Operation Flashpoint so I could not test it. But I think it should work.d3dx.dll``d3dx.dll

Hacked package update: dxdll10_hacked.zip
@elishacloud Hello, it's been more than a year since we last contacted.

The D3DX tool you invented is amazing, used by a lot of people, and they all know your name

Thank you very much for your outstanding contribution to OFP

There are still some unresolved issues, can you find a way to add frame limit in D3DX?

Because the use of external software or RTSS for frame limiting, it will increase the game input lag and increase the threshold for some players

The game self-limits frames to achieve the lowest input latency.

The second question, remember I once reported to you, there are some deadzone problems in OFP's mouse operation and aiming

By using the D3DX components you invented, turning off vsync, using a high-performance gaming mouse, and lowering the DPI to less than 200, you can significantly reduce the huge negative impact of deadzone, but the source of the problem has not been eliminated, and OFP still cannot achieve accurate mouse aiming and reaction speed like CS:GO.

I believe I consulted your posted input8 .dll, but it doesn't seem helpful for OFP

Let me describe the mouse features of OFP in detail:

The game engine seems to have a jumping phenomenon when processing mouse movements.
A normal crosshair is a continuous tracking of movement

The mouse of OFP is normal when dragged at high speed, but when aiming accurately at low speed, it starts to freeze

If the CS:GO gaming mouse trajectory is a line (————————————————)
Then the OFP gaming mouse trajectory is more like "" ▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪

Hope you will be interested in solving this problem

I'm very very happy that I can now use DXDLL water reflection together with ReShade, but unfortunately the textures are very blurry like original one.

Does it work fine without ReShade?

  • dxdll10_hacked_d3dx_dxwrapper.zip = ReShade isn't working anymore with this Version.

Have you tried disabling antialiasing and anisotropic filtering? Maybe ReShade does not support these functions? Are you sure this is not a bug with ReShade? I have used ReShade along side dxwrapper a number of times in the past.

I've tried to add "ForceHardwareVertexProcessing = 1" to the "d3dx.ini" at [d3d9] but nothing works. Or do you have to add this to a new version?

I have not added this feature yet.
@elishacloud Hello, it's been more than a year since we last contacted.

The D3DX tool you invented is amazing, used by a lot of people, and they all know your name

Thank you very much for your outstanding contribution to OFP

There are still some unresolved issues, can you find a way to add frame limit in D3DX?

Because the use of external software or RTSS for frame limiting, it will increase the game input lag and increase the threshold for some players

The game self-limits frames to achieve the lowest input latency.

The second question, remember I once reported to you, there are some deadzone problems in OFP's mouse operation and aiming

By using the D3DX components you invented, turning off vsync, using a high-performance gaming mouse, and lowering the DPI to less than 200, you can significantly reduce the huge negative impact of deadzone, but the source of the problem has not been eliminated, and OFP still cannot achieve accurate mouse aiming and reaction speed like CS:GO.

I believe I consulted your posted input8 .dll, but it doesn't seem helpful for OFP

Let me describe the mouse features of OFP in detail:

The game engine seems to have a jumping phenomenon when processing mouse movements.
A normal crosshair is a continuous tracking of movement

The mouse of OFP is normal when dragged at high speed, but when aiming accurately at low speed, it starts to freeze

If the CS:GO gaming mouse trajectory is a line (————————————————)
Then the OFP gaming mouse trajectory is more like "" ▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪

Hope you will be interested in solving this problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants