Comments (10)
I believe this one should solve the issue. Can you try it once more?
from d3d8to9.
I am pretty sure the issue here is with the PixelShader. We are removing a modifier from a constant because modifiers are not allowed in constants in d3d9 (unlike d3d8).
There are several PixelShaders with this issue but in Silent Hill 2 they are all almost identical. Here is an example of one:
Redirecting 'IDirect3DDevice8::CreatePixelShader(09956B50, 008A41E0, 01F802C4)' ...
> Disassembling shader and translating assembly to Direct3D 9 compatible code ...
> Dumping translated shader assembly:
ps_1_1
tex t0
tex t1
tex t2
dp3_sat r0, t2_bx2, c1 /* removed modifier _bx2 */
dp3 r1.xyz, t2_bx2, v1_bx2
+ sub r0.w, r0, c2.w /* changed 'add' to 'sub' removed modifier - */
mul_sat r1.xyz, r1, t0.w
mul_sat r0.xyz, r0.w, r1
mul r1.xyz, t1, t0.w
mad_sat r0.xyz, r0, c2, v0
mul r0.xyz, r0, t0
+ mov r0.w, t0.w
mad r0.xyz, r1, c3, r0
// approximately 11 instruction slots used (3 texture, 8 arithmetic)
Notice that the _bx2
modifier is removed. I believe this is what is causing the issue.
Normally the simple solution is to add a new line and use a temporary register in place of the constant so that the modifier can remain. However adding a new line causes the arithmetic instructions to exceed 8, which is the maximum allowed for PixelShader 1.x (except 1.4).
The only other fix I know of would be to convert the shader into ps_1_4 (version 1.4), which is what the ENBSeries DX8 to DX9 Convertor does to solve this type of issue.
Can you check with the ENBSeries convertor to see if the same issue happens?
from d3d8to9.
@Markeron, I am having some trouble reproducing this issue. It seems to be related to 4 specific PixelShaders in the game. All of them are virtually identical to the one I shown above, with only minor differences in the instruction modifier (_sat
).
However, I think I have found a generic solution. Below is a quick and dirty patch with the PixelShaders hard coded so we can test it to see if it works. Can you try with this one to see if it fixes the issue?
from d3d8to9.
@Markeron, I was able to build a fairly simple PixelShader v1.1 to v1.4 translator. I tested with a few games and seems to work. Can you test with this updated one?
from d3d8to9.
Very good! This was a pretty big change. I added ~250 lines of code so I want to do an in-depth review of the code and full testing before I create a pull request.
from d3d8to9.
This should be fixed with the latest release v1.7.0.
from d3d8to9.
Thanks for the explanation. ENB converter has really solved the issue. Since using ASI Loader's d3d8to9 function I completely forgot ENB. Thanks you Elisha.
from d3d8to9.
It works Eli, the dirty patch fixes the issue.
The issue comes back if return to 1.6.0.0, with or without sweetfx 1.4
from d3d8to9.
It loads the shader but objects get 'rainbow' colours when they are exposed to flashlight.
from d3d8to9.
It did it. It's working perfectly. Now, also I can run the game in the first attempt! It used to always hang on the black screen and take four or five times to start. Thank you.
from d3d8to9.
Related Issues (20)
- RESHADE 3.0.8 ISSUE HOT 1
- Cricket 07 crashing at startup HOT 2
- Max Payne 2 crash HOT 17
- Direct3D 7 to 9 wrapper HOT 1
- crazyfrog racer 2
- Question about use HOT 4
- Popup message upon starting the game HOT 2
- How to use d3d8to9 with Gentool ? HOT 5
- Dear Crosire!Please help with Correcting/Remove night pixelshader effect of Operation Flashpoint 1.96 HOT 53
- Mafia The City Lost Heaven HOT 2
- [Crash] Pro Evolution Soccer 3 HOT 2
- Max Payne - WS Fix not working HOT 3
- .
- Consider collaborating with the d8vk project? HOT 1
- Consider recommending D3DX from NuGet instead of an old DirectX SDK HOT 3
- Ballistics (2001) - Junk polygons in menus
- C:\Microsoft\Cpp\Default\props not found HOT 1
- Rome Total War - Campaign Map Texture Issue HOT 6
- D3D8.1 Pixel and Vertex Shader Lifetimes Seem To Be Incorrect HOT 1
- Problems with character models. Pangya
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from d3d8to9.