Ive been playing around a bit with the shaders in WoW, trying to reverse them. So far it looks good, get the following output:
Code:
============================================================
Shader properties for 'TerrainTexture.bls' (Pixelshader):
Input signature:
SV_POSITION0 - Float32 - None
COLOR0 - Float32 - ComponentX, ComponentY, ComponentZ
COLOR1 - Float32 - ComponentX, ComponentY, ComponentZ
TEXCOORD0 - Float32 - ComponentX, ComponentY, ComponentZ
TEXCOORD4 - Float32 - ComponentX, ComponentY, ComponentZ
FOG0 - Float32 - ComponentW
TEXCOORD5 - Float32 - ComponentX, ComponentY, ComponentZ
Output signature:
SV_TARGET0 - Float32 - None
Constant buffers (1):
Size: 128 - CPU access: Write
Resources (1):
Resource 1:
Dimension: Texture2D
Format: BC2_UNorm
MipLevels: 1
And the following code:
Code:
//
// Input signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------ ------
// SV_POSITION 0 xyzw 0 POS float
// COLOR 0 xyzw 1 NONE float xyz
// COLOR 1 xyzw 2 NONE float xyz
// TEXCOORD 0 xyzw 3 NONE float xyz
// TEXCOORD 4 xyz 4 NONE float xyz
// FOG 0 w 4 NONE float w
// TEXCOORD 5 xyz 5 NONE float xyz
//
//
// Output signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------ ------
// SV_TARGET 0 xyzw 0 TARGET float xyzw
//
ps_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb0[6], immediateIndexed
dcl_sampler s0, mode_default
dcl_resource_texture2d (float,float,float,float) t0
dcl_input_ps linear v1.xyz
dcl_input_ps linear v2.xyz
dcl_input_ps linear v3.xyz
dcl_input_ps linear v4.xyz
dcl_input_ps linear v4.w
dcl_input_ps linear v5.xyz
dcl_output o0.xyzw
dcl_temps 3
dp3 r0.x, v4.xyzx, v4.xyzx
rsq r0.x, r0.x
mad r0.xyz, v4.xyzx, r0.xxxx, cb0[4].xyzx
dp3 r0.w, r0.xyzx, r0.xyzx
rsq r0.w, r0.w
mul r0.xyz, r0.wwww, r0.xyzx
dp3 r0.x, -r0.xyzx, v5.xyzx
max r0.x, r0.x, l(0.000000)
log r0.x, r0.x
mul r0.x, r0.x, l(20.000000)
exp r0.x, r0.x
mul r0.xyz, r0.xxxx, cb0[5].xyzx
sample_indexable(texture2d)(float,float,float,float) r1.xyzw, v3.xyxx, t0.xyzw,
s0
mul r0.xyz, r0.xyzx, r1.wwww
mul r1.xyz, r1.xyzx, v1.xyzx
add r1.xyz, r1.xyzx, r1.xyzx
dp3 r0.w, -cb0[4].xyzx, v5.xyzx
max r0.w, r0.w, l(0.000000)
mad r2.xyz, cb0[5].xyzx, r0.wwww, v2.xyzx
add_sat r2.xyz, r2.xyzx, cb0[3].xyzx
mad r0.xyz, r1.xyzx, r2.xyzx, r0.xyzx
add r0.xyz, r0.xyzx, -cb0[2].xyzx
mad o0.xyz, v4.wwww, r0.xyzx, cb0[2].xyzx
mov o0.w, v3.z
ret
// Approximately 0 instruction slots used
Its a good start to begin manipulating things for the fun :P
Ahh, ye, its a screenshot thread, so lets add a screenshot...