Closed wetcoder closed 6 years ago
@wetcoder, I have had some problem getting the game to work on Windows 10 and so have not looked into the issue yet. Can you tell me how you got it working on Windows 10?
Also can you send me a copy of the log file?
Thanks, I was able to get the game to run once I patched it to version 1.2. :-)
I can reproduce the issue now.
The reason v1.4.0 and v1.5.0 look different is because of an issue with the CreatePixelShader where the PixelShader failed to compile. The issue was introduced in v1.4.0 with check-in 5d3fb1a line 1756 and was fixed in v1.6.0 with check-in 26f482b line 1699-1700.
As far as the missing gloss on cars that has existed in all versions of d3d8to9 as far back as v1.3.0 (probably back to v1.0.0). More work needs to be done to figure out why the gloss is missing.
The issue is with the very first PixelShader created. It looks like this:
ps_1_1
tex t0
tex t1
tex t2
mul r0.xyz, v0, t1
+ mov_sat r0.w, c0.w
mul r0.xyz, t0, r0
+ add_sat r1.w, t0.w, 1-c2.w /* this line has the issue */
mul_x2 r1.xyz, t2, t0
+ mul_sat r1.w, r1.w, v0.w
lrp r0.xyz, r0.w, r1, r0
+ mul r0.w, 1-t0.w, 1-r1.w
lrp_x2 r0.xyz, r1.w, t2, r0
+ mov_sat t3.w, c0.z
lrp r0.w, t3.w, 1-r0.w, t0.w
The problem is with the 8th line that says + add_sat r1.w, t0.w, 1-c2.w
. In this line the constant c2
has the 1-
modifier on it, which is not allowed in d3d9. In older versions (prior to v1.4.0) of d3d8to9 the modifier was simply dropped. In the latest version (v1.7.0) this shader is converted to ps_1_4 and the modifier remains. However in both cases the glossy finish is lost.
I am not sure why converting to ps_1_4 does not fix this. Below is the converted ps_1_4 code. If anyone sees an issue here let me know.
ps_1_4 /* converted */
def c1, 0, 0, 0, 0 /* added line */
phase
texld r2, t2
texld r1, t1
texld r0, t0
mov r3, c2
mul r1.xyz, v0, r1
+ mov_sat r4.w, c0.w
mul r1.xyz, r0, r1
+ add_sat r5.w, r0.w, 1-r3.w
mul_x2 r5.xyz, r2, r0
+ mul_sat r5.w, r5.w, v0.w
lrp r1.xyz, r1.w, r5, r1
+ mul r1.w, 1-r0.w, 1-r5.w
lrp_x2 r1.xyz, r5.w, r2, r1
+ mov_sat r3.w, c0.z
lrp r1.w, r3.w, 1-r1.w, r0.w
I created a quick hack for Race Driver 2 by manually hard coding ps_1_1 PixelShaders that work. Below is the patch. However this only fixes the issue for this one game. I need to figure out a better generic solution.
Here is the patch for Race Driver 2: d3d8.zip
@elishacloud Thank you so much! The colors on the windshield and the body of the car differ slightly. Such a feeling that there is not enough of a layer and because of this the color / reflection effect is slightly different (but this is a trifle)
Is it possible to somehow disable log file creation when using d3d8tо9.dll?
Logs don't feel useful for end users at this point, I vote for them to be disabled by default IMO.
Simply, I run games from compressed images (ISZ - UltraISO compressed ISO image format) in which the log file can not be written. And when I start the game, I get the corresponding error about creating a log file
Anyway, it is possible to opt-out of logging by defining D3D8TO9NOLOG
in the code.
I created a tool called dxwrapper and while it does not have the logs fully disabled it does log less data. Also it has a feature to automatically load the ISO when the game starts and automatically unload the ISO when the game ends. No need to use UltraISO!
RD2.exe
exists: d3d8.ziprld-toc2.iso
.Note: this already has the glossy finish fix.
As far as the color issue, I don't believe that is related to this fix. The same issue happens with True Crime: New York City, see here. I suspect it has something to do with the D3DFORMAT
being different in d3d9. I am planning to look into the color issue when I look into issue #42.
@elishacloud I meant that I store and run games directly from compressed iso files (ISZ) (to save space on the hard drive). Ie, I do not need original disks to run games - in my case, games do not have any DRM. Approximately as disks with games for consoles, where games are started directly from disks.
I do not have installation iso with distributions - I have (ISZ) that I myself create from folders with already installed games in the UltraIso I just mount the ISZ file with WinMount, it opens as a folder in the explorer (essentially a virtual disk) and then i just run the exe file of the game. For example, Cuphead after installation takes 11 GB, but if you compress it into ISZ, it weighs only 2.29 GB The point is that most games have gaming archives with little compression, and some even gaming archives without compression - both can be compressed even more and after compression (up to 10 times) weigh approximately as a repack version - well, in any case, less than the distribution with the game And since the games are already installed and compressed (no need to store distributions and reinstall them, this is very convenient especially for old games), they can be run from any storage device and computer (in some cases it is required to add certain entries to the registry created after the installation of the game and which require some games) This works with all games that do not save settings and save files to the game folder (with the exe file)
As an option I will use dxwrapper which does not create a log file if you added support for ISZ files in dxwrapper (automatically load the ISZ when the game starts and automatically unload the ISZ when the game ends. No need to use UltraISO! OR ANY similar tool), I could definitely use it. It would be cool
You could try using the new LZX compression in Windows 10. It is not quite as good compression as compressed iso file (ISZ) but much easier to manage and no need for UltraISO.
if you added support for ISZ files in dxwrapper (automatically load the ISZ when the game starts and automatically unload the ISZ when the game ends. No need to use UltraISO! OR ANY similar tool), I could definitely use it.
DxWrapper can run any CLI. So if you have a CLI (or a batch file) that can load UltraISO and then unload it when done, this should work already.
Intel(R) HD Graphics (Gen7LP) - Intel(R) Atom(TM) CPU Z3795 Microsoft Windows 10 Home (64-bit) v1709 build 10.0.16299.192 (Win10 RS3) TOCA Race Driver 2 v1.2
this error occurs only in this game, using d3d8to9 in other games (there is no such problem) please fix this "error" in d3d8to9