D3DX9 Shader Mod

Any ideas for mods go here!
trey31
Hall of Fame
Posts: 1651
Joined: Mon Oct 06, 2014 1:48 pm
Contact:

D3DX9 Shader Mod

Postby trey31 » Tue Oct 03, 2017 11:41 am

`
`
`
Moved here with an Alpha release
`
`
`
`
`
This is a dump post/thread. Please excuse the mess.

Assassin's Creed II 4K screenshot showing D3DX9 Shader Compiler 9.11.519.0000
Spoiler:
Image
Github of D3DX9 Shader Compiler 9.11.519.0000. D3DX9 Shader Compiler 9.11.519.0000 Code:
Spoiler:

Code: Select all

#if 0
//
// Generated by Microsoft (R) D3DX9 Shader Compiler 9.11.519.0000
//
//   fxc /E VShade /T vs_2_0 /Fh Skinning_vs20_dx9.vsh SkinningShader.fx
//
//
// Parameters:
//
//   float4 MaterialAmbient;
//   float4 MaterialDiffuse;
//   float4 lhtDir;
//   float4x4 mViewProj;
//   float4x3 mWorldMatrixArray[26];
//
//
// Registers:
//
//   Name              Reg   Size
//   ----------------- ----- ----
//   mWorldMatrixArray c0      78
//   mViewProj         c78      4
//   lhtDir            c82      1
//   MaterialAmbient   c83      1
//   MaterialDiffuse   c84      1
//
//
// Default values:
//
//   lhtDir
//     c82  = { 0, 0, -1, 1 };
//
//   MaterialAmbient
//     c83  = { 0.1, 0.1, 0.1, 1 };
//
//   MaterialDiffuse
//     c84  = { 0.8, 0.8, 0.8, 1 };
//

    vs_2_0
    def c89, 255.001953, 765.005859, 3, 0
    def c85, 1, 0, 0, 0
    def c86, 0, 1, 0, 0
    def c87, 0, 0, 1, 0
    def c88, 0, 0, 0, 1
    defi i0, 3, 0, 0, 0
    dcl_position v0
    dcl_blendweight v1
    dcl_blendindices v2
    dcl_normal v3
    dcl_texcoord v4
    mul r2, v2.zyxw, c89.xxxy
    mov r1.xyz, c85.w
    mov r0.xyz, c85.w
    mov r1.w, c85.w
    mov r0.w, c85.w
    rep i0
      mova a0.z, r0.w
      dp3 r3.x, r2, c85[a0.z]
      mul r3.w, r3.x, c89.z
      mova a0.w, r3.w
      dp3 r5.x, v1, c85[a0.z]
      dp4 r4.x, v0, c0[a0.w]
      dp4 r4.y, v0, c1[a0.w]
      dp4 r4.z, v0, c2[a0.w]
      dp3 r3.z, v3, c2[a0.w]
      dp3 r3.x, v3, c0[a0.w]
      dp3 r3.y, v3, c1[a0.w]
      mad r1.xyz, r4, r5.x, r1
      mad r0.xyz, r3, r5.x, r0
      add r1.w, r1.w, r5.x
      add r0.w, r0.w, c85.x
    endrep
    mov r3.xyz, r0
    mov r0.w, r1.w
    mova a0.w, r2.w
    add r0.w, -r0.w, c85.x
    dp4 r0.x, v0, c0[a0.w]
    dp4 r0.y, v0, c1[a0.w]
    dp3 r2.z, v3, c2[a0.w]
    dp3 r2.x, v3, c0[a0.w]
    dp3 r2.y, v3, c1[a0.w]
    dp4 r0.z, v0, c2[a0.w]
    mad r2.xyz, r2, r0.w, r3
    mad r0.xyz, r0, r0.w, r1
    nrm r1.xyz, r2
    mov r0.w, c85.x
    dp3 r1.x, r1, c82
    dp4 oPos.w, r0, c81
    max r1.w, r1.x, c85.w
    mov r1.xyz, c84
    mad oD0.xyz, r1.w, r1, c83
    dp4 oPos.x, r0, c78
    dp4 oPos.y, r0, c79
    dp4 oPos.z, r0, c80
    mov oD0.w, c85.x
    mov oT0.xy, v4

// approximately 51 instruction slots used
#endif

const DWORD g_vs20_VShade[] =
{
    0xfffe0200, 0x005afffe, 0x42415443, 0x0000001c, 0x0000012f, 0xfffe0200,
    0x00000005, 0x0000001c, 0x00000100, 0x00000128, 0x00000080, 0x00530002,
    0x00020001, 0x00000090, 0x000000a0, 0x000000b0, 0x00540002, 0x00020001,
    0x00000090, 0x000000c0, 0x000000d0, 0x00520002, 0x00020001, 0x00000090,
    0x000000d8, 0x000000e8, 0x004e0002, 0x00020004, 0x000000f4, 0x00000000,
    0x00000104, 0x00000002, 0x0002004e, 0x00000118, 0x00000000, 0x6574614d,
    0x6c616972, 0x69626d41, 0x00746e65, 0x00030001, 0x00040001, 0x00000001,
    0x00000000, 0x3dcccccd, 0x3dcccccd, 0x3dcccccd, 0x3f800000, 0x6574614d,
    0x6c616972, 0x66666944, 0x00657375, 0x3f4ccccd, 0x3f4ccccd, 0x3f4ccccd,
    0x3f800000, 0x4474686c, 0xab007269, 0x00000000, 0x00000000, 0xbf800000,
    0x3f800000, 0x6569566d, 0x6f725077, 0xabab006a, 0x00030003, 0x00040004,
    0x00000001, 0x00000000, 0x726f576d, 0x614d646c, 0x78697274, 0x61727241,
    0xabab0079, 0x00030003, 0x00030004, 0x0000001a, 0x00000000, 0x325f7376,
    0x4d00305f, 0x6f726369, 0x74666f73, 0x29522820, 0x44334420, 0x53203958,
    0x65646168, 0x6f432072, 0x6c69706d, 0x39207265, 0x2e31312e, 0x2e393135,
    0x30303030, 0xababab00, 0x05000051, 0xa00f0059, 0x437f0080, 0x443f4060,
    0x40400000, 0x00000000, 0x05000051, 0xa00f0055, 0x3f800000, 0x00000000,
    0x00000000, 0x00000000, 0x05000051, 0xa00f0056, 0x00000000, 0x3f800000,
    0x00000000, 0x00000000, 0x05000051, 0xa00f0057, 0x00000000, 0x00000000,
    0x3f800000, 0x00000000, 0x05000051, 0xa00f0058, 0x00000000, 0x00000000,
    0x00000000, 0x3f800000, 0x05000030, 0xf00f0000, 0x00000003, 0x00000000,
    0x00000000, 0x00000000, 0x0200001f, 0x80000000, 0x900f0000, 0x0200001f,
    0x80000001, 0x900f0001, 0x0200001f, 0x80000002, 0x900f0002, 0x0200001f,
    0x80000003, 0x900f0003, 0x0200001f, 0x80000005, 0x900f0004, 0x03000005,
    0x800f0002, 0x90c60002, 0xa0400059, 0x02000001, 0x80070001, 0xa0ff0055,
    0x02000001, 0x80070000, 0xa0ff0055, 0x02000001, 0x80080001, 0xa0ff0055,
    0x02000001, 0x80080000, 0xa0ff0055, 0x01000026, 0xf0e40000, 0x0200002e,
    0xb0040000, 0x80ff0000, 0x04000008, 0x80010003, 0x80e40002, 0xa0e42055,
    0xb0aa0000, 0x03000005, 0x80080003, 0x80000003, 0xa0aa0059, 0x0200002e,
    0xb0080000, 0x80ff0003, 0x04000008, 0x80010005, 0x90e40001, 0xa0e42055,
    0xb0aa0000, 0x04000009, 0x80010004, 0x90e40000, 0xa0e42000, 0xb0ff0000,
    0x04000009, 0x80020004, 0x90e40000, 0xa0e42001, 0xb0ff0000, 0x04000009,
    0x80040004, 0x90e40000, 0xa0e42002, 0xb0ff0000, 0x04000008, 0x80040003,
    0x90e40003, 0xa0e42002, 0xb0ff0000, 0x04000008, 0x80010003, 0x90e40003,
    0xa0e42000, 0xb0ff0000, 0x04000008, 0x80020003, 0x90e40003, 0xa0e42001,
    0xb0ff0000, 0x04000004, 0x80070001, 0x80e40004, 0x80000005, 0x80e40001,
    0x04000004, 0x80070000, 0x80e40003, 0x80000005, 0x80e40000, 0x03000002,
    0x80080001, 0x80ff0001, 0x80000005, 0x03000002, 0x80080000, 0x80ff0000,
    0xa0000055, 0x00000027, 0x02000001, 0x80070003, 0x80e40000, 0x02000001,
    0x80080000, 0x80ff0001, 0x0200002e, 0xb0080000, 0x80ff0002, 0x03000002,
    0x80080000, 0x81ff0000, 0xa0000055, 0x04000009, 0x80010000, 0x90e40000,
    0xa0e42000, 0xb0ff0000, 0x04000009, 0x80020000, 0x90e40000, 0xa0e42001,
    0xb0ff0000, 0x04000008, 0x80040002, 0x90e40003, 0xa0e42002, 0xb0ff0000,
    0x04000008, 0x80010002, 0x90e40003, 0xa0e42000, 0xb0ff0000, 0x04000008,
    0x80020002, 0x90e40003, 0xa0e42001, 0xb0ff0000, 0x04000009, 0x80040000,
    0x90e40000, 0xa0e42002, 0xb0ff0000, 0x04000004, 0x80070002, 0x80e40002,
    0x80ff0000, 0x80e40003, 0x04000004, 0x80070000, 0x80e40000, 0x80ff0000,
    0x80e40001, 0x02000024, 0x80070001, 0x80e40002, 0x02000001, 0x80080000,
    0xa0000055, 0x03000008, 0x80010001, 0x80e40001, 0xa0e40052, 0x03000009,
    0xc0080000, 0x80e40000, 0xa0e40051, 0x0300000b, 0x80080001, 0x80000001,
    0xa0ff0055, 0x02000001, 0x80070001, 0xa0e40054, 0x04000004, 0xd0070000,
    0x80ff0001, 0x80e40001, 0xa0e40053, 0x03000009, 0xc0010000, 0x80e40000,
    0xa0e4004e, 0x03000009, 0xc0020000, 0x80e40000, 0xa0e4004f, 0x03000009,
    0xc0040000, 0x80e40000, 0xa0e40050, 0x02000001, 0xd0080000, 0xa0000055,
    0x02000001, 0xe0030000, 0x90e40004, 0x0000ffff
};
Using Shaders in Direct3D 9
Shadowing (Direct3D 9)
Bump Mapping (Direct3D 9)
Using Bump Mapping (Direct3D 9)

Intro To DirectX 9 Graphics Videos
Spoiler:

Shader Sample Videos
Spoiler:


You do not have the required permissions to view the files attached to this post.
My M08 mod work is all open-source to anyone who wants to use it in any way, no restrictions or permissions necessary.

D3DX9 Shader Mod

Sponsor

Sponsor
 

trey31
Hall of Fame
Posts: 1651
Joined: Mon Oct 06, 2014 1:48 pm
Contact:

Re: D3DX9 Shader Mod

Postby trey31 » Tue Oct 03, 2017 12:56 pm

Madden 08 uses cube maps for at least some shaders. In order to edit them and save the changes properly, using PS CS2 9.0, click Save, select .DDS, then when the NVIDIA DDS plugin dialog opens choose: 8.8.8 RGB 24-bit (the DDS cube's original default, at least for file 31) change 2D Texture to Cube Map in the second drop box, and select No MIP maps (it still creates the 6 separate textures this way via the Cube Map setting).

If you select 2D Texture, it flattens the cube map into a 1x6 panel texture, rather than 6-sided squares (hence, cube)

If you select Use Existing MIP maps, it will not save any changes you've made.
My M08 mod work is all open-source to anyone who wants to use it in any way, no restrictions or permissions necessary.

trey31
Hall of Fame
Posts: 1651
Joined: Mon Oct 06, 2014 1:48 pm
Contact:

Re: D3DX9 Shader Mod

Postby trey31 » Tue Oct 03, 2017 1:43 pm

This is a test... this is only a test.

Shader dds file #31 (zero-based arrays) modified with curves (+30/-30) and contrast (+33?). This is the result of modifying one shader dds. In this test Madden is completely vanilla. No other mods at all. First photo dump is of a light skinned player at 1pm with custom weather default warm temp.
Spoiler:
Image
Image
Image
Suffice to say, it has not been tweaked.

Example #2, focus on the jersey numbers and how they are significantly affected by the modified shader
Spoiler:
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
My M08 mod work is all open-source to anyone who wants to use it in any way, no restrictions or permissions necessary.

trey31
Hall of Fame
Posts: 1651
Joined: Mon Oct 06, 2014 1:48 pm
Contact:

Re: D3DX9 Shader Mod

Postby trey31 » Tue Oct 03, 2017 1:50 pm

Also, if anyone is curious, I've been trying to teach myself 3D rendering specific to DX rather than learning about modeling itself ala Maya or Blender. I want to modify Madden's models and in order to do that I need to understand DX. As a result, this (shaders) is a byproduct of reading dev material and watching videos. Madden also has code for bump-mapping. Haven't gotten into that much yet. No clue if it can be utilized/modified. No clue if I will ever do a shader mod. To be honest this is all secondary to my primary goal, modeling Madden.
My M08 mod work is all open-source to anyone who wants to use it in any way, no restrictions or permissions necessary.

trey31
Hall of Fame
Posts: 1651
Joined: Mon Oct 06, 2014 1:48 pm
Contact:

Re: D3DX9 Shader Mod

Postby trey31 » Tue Oct 03, 2017 2:29 pm

Image

Out of time for now, but I added some warmth and drastically increased white levels and it seems to be much brighter. Will do a specific comparison later. For now these are what shaders look like if you were curious. The center is default dds texture, the bottom is the first test (way too dark) from the photo dump above, the top is with the color added and white levels increased.

EDIT: why add color? Our son is yellow, not monochrome. I have seen this before in an Oblivion or Skyrim mod (IIRC) and thought it was a significant improvement to the "realism" of the screen captures.
My M08 mod work is all open-source to anyone who wants to use it in any way, no restrictions or permissions necessary.

User avatar
cyclone2426
All-Pro
Posts: 416
Joined: Sun Nov 23, 2014 9:06 pm

Re: D3DX9 Shader Mod

Postby cyclone2426 » Tue Oct 03, 2017 2:33 pm

Awesome research and development on this one. I think tweaking the shaders will definitely help modernize the game, then from there we can always try shooting for model edits

trey31
Hall of Fame
Posts: 1651
Joined: Mon Oct 06, 2014 1:48 pm
Contact:

Re: D3DX9 Shader Mod

Postby trey31 » Tue Oct 03, 2017 2:41 pm

cyclone2426 wrote:Awesome research and development on this one. I think tweaking the shaders will definitely help modernize the game, then from there we can always try shooting for model edits


Thanks. I'm learning all kinds of neat stuff about DX and I wanted to post this. I might not do an actual "mod" for it, but I wanted to post what I've been looking at/playing with so that if I don't get to it the knowledge will at least be posted.

And I think there are 20 different DDS shaders. The screens from above were just from tweaking one of them. :shock:
My M08 mod work is all open-source to anyone who wants to use it in any way, no restrictions or permissions necessary.

trey31
Hall of Fame
Posts: 1651
Joined: Mon Oct 06, 2014 1:48 pm
Contact:

Re: D3DX9 Shader Mod

Postby trey31 » Tue Oct 03, 2017 2:44 pm

cyclone2426 wrote:Awesome research and development on this one.


Also, any ideas about what I could do with File 30 (zero based)? It's not compressed but I don't know how to view it, but I'm fairly certain it is the game code for implementing the shaders and bump maps. I just can't view the code in a similar way to the code posted in Post #1 in this thread.
My M08 mod work is all open-source to anyone who wants to use it in any way, no restrictions or permissions necessary.

User avatar
cyclone2426
All-Pro
Posts: 416
Joined: Sun Nov 23, 2014 9:06 pm

Re: D3DX9 Shader Mod

Postby cyclone2426 » Tue Oct 03, 2017 2:50 pm

trey31 wrote:Out of time for now, but I added some warmth and drastically increased white levels and it seems to be much brighter. Will do a specific comparison later. For now these are what shaders look like if you were curious. The center is default dds texture, the bottom is the first test (way too dark) from the photo dump above, the top is with the color added and white levels increased.

EDIT: why add color? Our son is yellow, not monochrome. I have seen this before in an Oblivion or Skyrim mod (IIRC) and thought it was a significant improvement to the "realism" of the screen captures.


So would/could you do a cooler set for indoor games or is it all working off the same set?

As for that file, I'll have to look when I get home I forget which filetype that was.

User avatar
KeepinItTeal
Hall of Fame
Posts: 1122
Joined: Fri Feb 19, 2016 5:11 pm
Location: NE FLA

Re: D3DX9 Shader Mod

Postby KeepinItTeal » Tue Oct 03, 2017 4:16 pm

It would be great to find a fix for how player numbers "glow in the dark" whenever a player enters an area on the field that is shaded.


Return to “Mod Ideas”

Who is online

Users browsing this forum: No registered users and 2 guests