-
Notifications
You must be signed in to change notification settings - Fork 63
Wrath Shaders
fallenoak edited this page Nov 29, 2016
·
23 revisions
This page includes the most basic permute of every shader present in 3.3.5a.
Note that the D3D9 shaders (SM3) still include fog logic in the most basic permute. OpenGL shaders (ARBFP1) do not.
-
c0
: ? -
c1
: ? -
c2
:vec4(fogColor.rgb, unk)
!!ARBfp1.0
OPTION ARB_fog_linear;
TEMP R0;
TEX R0.xyz, fragment.texcoord[0], texture[0], 2D;
MUL result.color.xyz, R0, fragment.color.primary;
MOV result.color.w, fragment.color.primary;
END
ps_3_0
dcl_color v0
dcl_texcoord v1.xy
dcl_fog v2.x
dcl_2d s0
texld r0, v1, s0
mul oC0.w, r0.w, v0.w
mad r0.xyz, r0, v0, -c2
mad oC0.xyz, v2.x, r0, c2
!!ARBfp1.0
OPTION ARB_fog_linear;
TEMP R0;
TEX R0, fragment.texcoord[0], texture[0], 2D;
MUL result.color, R0, fragment.color.primary;
END
!!ARBfp1.0
OPTION ARB_fog_linear;
TEMP R0;
TEX R0, fragment.texcoord[0], texture[0], 2D;
ADD result.color, fragment.color.primary, R0;
END
!!ARBfp1.0
OPTION ARB_fog_linear;
PARAM c[1] = { { 2 } };
TEMP R0;
TEMP R1;
TEX R0, fragment.texcoord[1], texture[1], 2D;
TEX R1.xyz, fragment.texcoord[0], texture[0], 2D;
MUL R0.xyz, R1, R0;
MUL R0.xyz, R0, fragment.color.primary;
MUL R0.w, R0, fragment.color.primary;
MUL result.color.xyz, R0, c[0].x;
MUL result.color.w, R0, c[0].x;
END
ps_3_0
dcl_color v0
dcl_texcoord v1.xy
dcl_texcoord1 v2.xy
dcl_fog v3.x
dcl_2d s0
dcl_2d s1
texld r0, v1, s0
texld r1, v2, s1
mad oC0.w, v0.w, r0.w, r1.w
mad r0.xyz, v0, r0, r1
add r0.xyz, r0, -c2
mad oC0.xyz, v3.x, r0, c2
!!ARBfp1.0
OPTION ARB_fog_linear;
TEMP R0;
TEMP R1;
TEX R1, fragment.texcoord[1], texture[1], 2D;
TEX R0, fragment.texcoord[0], texture[0], 2D;
MAD result.color, R0, fragment.color.primary, R1;
END
ps_3_0
def c0, 0, 0, 0, 0
dcl_color v0
dcl_texcoord v1.xy
dcl_texcoord1 v2.xy
dcl_fog v3.x
dcl_2d s0
dcl_2d s1
texld r0, v1, s0
mul r0.w, r0.w, v0.w
texld r1, v2, s1
dp2add oC0.w, r0.w, r1.w, c0.x
mul r0.xyz, r0, r1
add r0.xyz, r0, r0
mad r0.xyz, r0, v0, -c2
mad oC0.xyz, v3.x, r0, c2
!!ARBfp1.0
OPTION ARB_fog_linear;
PARAM c[1] = { { 2 } };
TEMP R0;
TEMP R1;
TEX R0, fragment.texcoord[0], texture[0], 2D;
TEX R1, fragment.texcoord[1], texture[1], 2D;
MUL R0.xyz, R0, R1;
MUL R0.w, R0, fragment.color.primary;
MUL R0.xyz, R0, fragment.color.primary;
MUL R0.w, R1, R0;
MUL result.color.xyz, R0, c[0].x;
MUL result.color.w, R0, c[0].x;
END
ps_3_0
def c0, 2, 0, 0, 0
dcl_color v0
dcl_texcoord v1.xy
dcl_fog v2.x
dcl_2d s0
texld r0, v1, s0
mul oC0.w, r0.w, v0.w
mul r0.xyz, r0, v0
mov r1.xyz, c2
mad r0.xyz, r0, c0.x, -r1
mad oC0.xyz, v2.x, r0, c2
-
c33
:vec4(lightDir.xyz, padding)
(lightDir is transformed by view matrix before upload to GPU) -
c34
:vec4(ambientColor.rgb, padding)
vs_3_0
def c11, 0, 1, 0, 0
dcl_position v0
dcl_normal v1
dcl_color v2
dcl_texcoord v3
dcl_texcoord1 v4
dcl_position o0
dcl_color o1
dcl_color1 o2
dcl_texcoord o3.xy
dcl_texcoord1 o4.xy
dcl_fog o5.x
mul r0, c6, v0.y
mad r0, v0.x, c5, r0
mad r0, v0.z, c7, r0
add r0, r0, c8
mul r1, r0.y, c1
mad r1, r0.x, c0, r1
mad r1, r0.z, c2, r1
mad o0, r0.w, c3, r1
mul r1.xy, c10, v3.y
mad r1.xy, v3.x, c9, r1
add o4.xy, r1, c12
mul r1.xy, c14, v4.y
mad r1.xy, v4.x, c13, r1
add o3.xy, r1, c16
mad r0.w, r0.z, c4.x, c4.y
max r0.w, r0.w, c11.x
pow r1.x, r0.w, c4.z
min o5.x, r1.x, c11.y
mul r1.xyz, c6, v1.y
mad r1.xyz, v1.x, c5, r1
mad r1.xyz, v1.z, c7, r1
dp3_sat r0.w, -c33, r1
mov r2.xyz, c35
mad r2.xyz, r2, r0.w, c34
mov r2.w, c11.y
mul o1, r2, v2
dp3 r0.w, r0, r0
rsq r0.w, r0.w
mad r0.xyz, r0, r0.w, c33
nrm r2.xyz, r0
dp3 r0.x, -r2, r1
max r0.x, r0.x, c11.x
pow r1.x, r0.x, c36.w
mul o2.xyz, r1.x, c36
mov o2.w, c11.y
-
c4
:vec4(fogColor.rgb, unk)
ps_3_0
def c0, 0.25, 0, 0, 0
dcl_color v0
dcl_color1 v1.xyz
dcl_texcoord v2.xy
dcl_texcoord1 v3.xy
dcl_fog v4.x
dcl_2d s0
dcl_2d s1
add r0.xyz, c0.x, v1
texld r1, v3, s1
mul r0.xyz, r0, r1.w
texld r2, v2, s0
mul r3.w, r2.w, v0.w
mad r3.xyz, v0, r2, r1
mov r0.w, c0.y
add r0, r0, r3
add r0.xyz, r0, -c4
mov oC0.w, r0.w
mad oC0.xyz, v4.x, r0, c4
ps_3_0
def c0, 1, 0, 0, 0
dcl_color v0.xyz
dcl_texcoord v1.xy
dcl_fog v2.x
dcl_2d s0
texld r0, v1, s0
mad r0.xyz, v0, r0, -c4
mad oC0.xyz, v2.x, r0, c4
mov oC0.w, c0.x
!!ARBfp1.0
PARAM c[1] = { { 0.125, 0.375 } };
TEMP R0;
TEMP R1;
TEX R0, fragment.texcoord[1], texture[1], 2D;
MUL R1, R0, c[0].y;
TEX R0, fragment.texcoord[0], texture[0], 2D;
MAD R1, R0, c[0].x, R1;
TEX R0, fragment.texcoord[2], texture[2], 2D;
MAD R1, R0, c[0].y, R1;
TEX R0, fragment.texcoord[3], texture[3], 2D;
MAD result.color, R0, c[0].x, R1;
END
-
s0
: Sampler for original frame buffer -
s1
: Sampler for gaussian blurred frame buffer
ps_2_0
def c0, 1, 0, 0, 0
dcl t0.xy
dcl t1.xy
dcl v0
dcl_2d s0
dcl_2d s1
texld r0, t0, s0
texld r1, t1, s1
lrp r2.xyz, v0.z, r1, r0
mul r0.xyz, r1, r1
mad r0.xyz, r0, v0.w, r2
mov r0.w, c0.x
mov oC0, r0
-
texture[0]
: Sampler for original frame buffer -
texture[1]
: Sampler for gaussian blurred frame buffer
!!ARBfp1.0
PARAM c[1] = { { 1 } };
TEMP R0;
TEMP R1;
TEMP R2;
TEX R0.xyz, fragment.texcoord[0], texture[0], 2D;
TEX R1.xyz, fragment.texcoord[1], texture[1], 2D;
ADD R2.xyz, R1, -R0;
MAD R0.xyz, fragment.color.primary.z, R2, R0;
MUL R1.xyz, R1, R1;
MAD result.color.xyz, R1, fragment.color.primary.w, R0;
MOV result.color.w, c[0].x;
END