Imperium Romanum DX9 game skybox fix

Post Reply
BigErn77
Two Eyed Hopeful
Posts: 55
Joined: Fri Feb 04, 2011 12:39 am

Imperium Romanum DX9 game skybox fix

Post by BigErn77 »

I'm using the latest version of Helixmod d3d9.dll. I pasted the dumped vertex shader for the skybox below. The skybox is currently at screen depth, and I would like to move it way back. If anyone has the skill, please explain how to do it. I already have the override folders set up, I just need to know what to edit in this vertex shader file.

Code: Select all

//
// Generated by Microsoft (R) D3DX9 Shader Compiler 9.12.589.0000
//
// Parameters:
//
//   float4x4 matProj;
//   float4x4 matView;
//
//
// Registers:
//
//   Name         Reg   Size
//   ------------ ----- ----
//   matView      c0       4
//   matProj      c4       4
//
//
// Default values:
//
//   matView
//     c0   = { 0, 0, 0, 0 };
//     c1   = { 0, 0, 0, 0 };
//     c2   = { 0, 0, 0, 0 };
//     c3   = { 0, 0, 0, 0 };
//
//   matProj
//     c4   = { 0, 0, 0, 0 };
//     c5   = { 0, 0, 0, 0 };
//     c6   = { 0, 0, 0, 0 };
//     c7   = { 0, 0, 0, 0 };
//

    preshader
    mov r0.x, c0.x
    mov r0.y, c1.x
    mov r0.z, c2.x
    mov r0.w, c3.x
    dot c4, r0, c4
    dot c5, r0, c5
    dot c6, r0, c6
    dot c7, r0, c7
    mov r0.x, c0.y
    mov r0.y, c1.y
    mov r0.z, c2.y
    mov r0.w, c3.y
    dot c4.yzwx, r0, c4
    dot c5.yzwx, r0, c5
    dot c6.yzwx, r0, c6
    dot c7.yzwx, r0, c7
    mov r0.x, c0.z
    mov r0.y, c1.z
    mov r0.z, c2.z
    mov r0.w, c3.z
    dot c4.zwxy, r0, c4
    dot c5.zwxy, r0, c5
    dot c6.zwxy, r0, c6
    dot c7.zwxy, r0, c7

// approximately 24 instructions used
//
// Generated by Microsoft (R) D3DX9 Shader Compiler 9.12.589.0000
//
// Parameters:
//
//   float4 TexRemap;
//   float4x4 matProj;
//
//
// Registers:
//
//   Name         Reg   Size
//   ------------ ----- ----
//   matProj      c0       4
//   TexRemap     c8       1
//
//
// Default values:
//
//   matProj
//     c0   = { 0, 0, 0, 0 };
//     c1   = { 0, 0, 0, 0 };
//     c2   = { 0, 0, 0, 0 };
//     c3   = { 0, 0, 0, 0 };
//
//   TexRemap
//     c8   = { 0, 0, 0, 0 };
//

    vs_1_1
    dcl_position v0
    dcl_texcoord v1
    mov r1.xyz, c4
    mov r1.w, c0.w
    mov r0.xyz, c5
    mov r0.w, c1.w
    dp4 oPos.x, v0, r1
    dp4 oPos.y, v0, r0
    mov r1.xyz, c6
    mov r1.w, c2.w
    mov r0.xyz, c7
    mov r0.w, c3.w
    dp4 oPos.z, v0, r1
    dp4 oPos.w, v0, r0
    mad oT0.x, v1.x, c8.y, c8.x
    mov oT0.y, v1.y

// approximately 14 instruction slots used
 
Ryzen 7 5800X, RTX3080, 32GB ram, Windows 10 21H2, nVidia 516.59, ASUS ROG Swift PG279Q, USB 3D Vision Emitter
3DNovice
Petrif-Eyed
Posts: 2398
Joined: Thu Mar 29, 2012 4:49 pm

Re: Imperium Romanum DX9 game skybox fix

Post by 3DNovice »

...
Last edited by 3DNovice on Sun Mar 17, 2024 1:00 pm, edited 1 time in total.
BigErn77
Two Eyed Hopeful
Posts: 55
Joined: Fri Feb 04, 2011 12:39 am

Re: Imperium Romanum DX9 game skybox fix

Post by BigErn77 »

3DNovice wrote: Tue May 09, 2023 5:51 am Yah, there was supposed to be a Skybox lesson in the shaderhacker school, but Lesson#8 was canceled.

The only thing I can recall, is W=1
I think that puts it at infinity.

I'd suggest looking at some old fixes, excluding Unreal 3 Engine games, since they were fixed using scripts.
Thanks for the tip. I modified the shader (pasted below), and it did move the skybox away from screen depth, but the skybox itself is now horizontally stretched to an extreme degree. I have no knowledge of shader programming and am really just shooting in the dark.

Code: Select all

    vs_3_0
    def c220, 8000, 0, 0, 0 //new
    dcl_position v0
    dcl_texcoord v1
    dcl_position o0
    dcl_texcoord o1.xy	
    mov r1.xyz, c4
    mov r1.w, c0.w
    mov r0.xyz, c5
    mov r0.w, c1.w
    dp4 r3.x, v0, r1 //new
    mul r3, r3, c220.x //new
    mov o0.x, r3  //new	
    dp4 o0.y, v0, r0
    mov r1.xyz, c6
    mov r1.w, c2.w
    mov r0.xyz, c7
    mov r0.w, c3.w
    dp4 o0.z, v0, r1
    dp4 o0.w, v0, r0
    mad o1.x, v1.x, c8.y, c8.x
    mov o1.y, v1.y

Ryzen 7 5800X, RTX3080, 32GB ram, Windows 10 21H2, nVidia 516.59, ASUS ROG Swift PG279Q, USB 3D Vision Emitter
3DNovice
Petrif-Eyed
Posts: 2398
Joined: Thu Mar 29, 2012 4:49 pm

Re: Imperium Romanum DX9 game skybox fix

Post by 3DNovice »

...
Last edited by 3DNovice on Sun Mar 17, 2024 1:00 pm, edited 1 time in total.
3DNovice
Petrif-Eyed
Posts: 2398
Joined: Thu Mar 29, 2012 4:49 pm

Re: Imperium Romanum DX9 game skybox fix

Post by 3DNovice »

...
Last edited by 3DNovice on Sun Mar 17, 2024 1:00 pm, edited 1 time in total.
BigErn77
Two Eyed Hopeful
Posts: 55
Joined: Fri Feb 04, 2011 12:39 am

Re: Imperium Romanum DX9 game skybox fix

Post by BigErn77 »

3DNovice wrote: Wed May 10, 2023 2:56 am I downloaded the fix, look at vertex shader 8ADC96BD.txt

You can see that Paul Dusler commented the shader // Skybox

and the added comments to his stereo corrections
mul r0.x, r0.x, c200.x // strech sky in x direction to prevent black borders
mul o10, r0, c200.y // push skybox

I'm guessing his stretch equals a scale to fit solution
BigErn77 wrote: the skybox itself is now horizontally stretched to an extreme degree
Perhaps there is an inverse or negative value that can be used to avoid the stretching? Dunno
Unfortunately multiplying y with various values positive or negative didn't move the skybox either. Oh well, I'll just disable that vertex shader, this game isn't worth all this trouble. Thanks anyway.
Ryzen 7 5800X, RTX3080, 32GB ram, Windows 10 21H2, nVidia 516.59, ASUS ROG Swift PG279Q, USB 3D Vision Emitter
Post Reply

Return to “Nvidia 3D Vision Fixes, Solutions and Troubleshooting”