Soften Default
(soften:default
, 0x6398f08c75028d6f
)
This template is referenced 1 time by soften.
Technique ambient
Render States
More info can be found on the Direct3D Docs
enum D3DRENDERSTATETYPE {
D3DRS_ZENABLE = 0,
D3DRS_ZFUNC = 4,
D3DRS_ZWRITEENABLE = 0,
D3DRS_ALPHABLENDENABLE = 0,
D3DRS_CULLMODE = 1,
D3DRS_COLORWRITEENABLE = 15,
D3DRS_COLORWRITEENABLE1 = 15,
D3DRS_COLORWRITEENABLE2 = 15,
D3DRS_STENCILENABLE = 0,
D3DRS_STENCILFUNC = 1,
D3DRS_STENCILFAIL = 1,
D3DRS_STENCILMASK = 0,
D3DRS_STENCILPASS = 1,
D3DRS_STENCILREF = 0,
D3DRS_STENCILWRITEMASK = 0,
D3DRS_STENCILZFAIL = 1,
D3DRS_DEPTHBIAS = 0,
D3DRS_SLOPESCALEDEPTHBIAS = 0,
D3DRS_FOGENABLE = 0,
D3DRS_SPECULARENABLE = 0,
D3DRS_ADAPTIVETESS_X = 0,
D3DRS_ADAPTIVETESS_Z = 0,
D3DRS_ADAPTIVETESS_W = 0,
D3DRS_SRGBWRITEENABLE = 0,
D3DRS_SEPARATEALPHABLENDENABLE = 0,
D3DRS_ALPHATESTENABLE = 0,
};
Sampler States
More info can be found on the Direct3D Docs
Sampler 0
enum D3DSAMPLERSTATETYPE {
D3DSAMP_MIPMAPLODBIAS = 827606343,
D3DSAMP_SRGBTEXTURE = 0,
D3DSAMP_ADDRESSU = 3,
D3DSAMP_ADDRESSV = 3,
D3DSAMP_MAGFILTER = 2,
D3DSAMP_MINFILTER = 2,
D3DSAMP_MIPFILTER = 2,
};
Sampler 1
enum D3DSAMPLERSTATETYPE {
D3DSAMP_MIPMAPLODBIAS = 827606343,
D3DSAMP_SRGBTEXTURE = 0,
D3DSAMP_ADDRESSU = 3,
D3DSAMP_ADDRESSV = 3,
D3DSAMP_MAGFILTER = 2,
D3DSAMP_MINFILTER = 2,
D3DSAMP_MIPFILTER = 2,
};
Shaders
Vertex Shader
column_major float4x4 view_proj_matrix : register(vs_3_0, c0);
struct VertexMain_Input
{
float4 position : POSITION;
float4 texcoord : TEXCOORD;
float4 texcoord1 : TEXCOORD1;
float4 texcoord2 : TEXCOORD2;
};
struct VertexMain_Output
{
float4 position : POSITION;
float2 texcoord : TEXCOORD;
float2 texcoord1 : TEXCOORD1;
float2 texcoord2 : TEXCOORD2;
};
VertexMain_Output VertexMain(VertexMain_Input i)
{
VertexMain_Output o;
// dcl_position v0
// dcl_texcoord v1
// dcl_texcoord1 v2
// dcl_texcoord2 v3
// dcl_position o0
// dcl_texcoord o1.xy
// dcl_texcoord1 o2.xy
// dcl_texcoord2 o3.xy
// dp4 o0.x, v0, c0
o.position.x = dot(i.position, (view_proj_matrix._m00_m10_m20_m30));
// dp4 o0.y, v0, c1
o.position.y = dot(i.position, (view_proj_matrix._m01_m11_m21_m31));
// dp4 o0.z, v0, c2
o.position.z = dot(i.position, (view_proj_matrix._m02_m12_m22_m32));
// dp4 o0.w, v0, c3
o.position.w = dot(i.position, (view_proj_matrix._m03_m13_m23_m33));
// mov o1.xy, v1
o.texcoord = i.texcoord;
// mov o2.xy, v2
o.texcoord1 = i.texcoord1;
// mov o3.xy, v3
o.texcoord2 = i.texcoord2;
//
return o;
}
Decompiled by DXDecompiler.
Pixel Shader
sampler2D ambient_texture : register(ps_3_0, s1);
float ref_max : register(ps_3_0, c1);
float ref_threshold : register(ps_3_0, c0);
sampler2D self_illumination_texture : register(ps_3_0, s0);
struct PixelMain_Input
{
float2 texcoord1 : TEXCOORD1;
float2 texcoord2 : TEXCOORD2;
};
float4 PixelMain(PixelMain_Input i) : COLOR
{
float4 out_color;
float4 temp0, temp1, temp2;
// def c2, 0.27, 0.67, 0.06, 1
// def c3, 0, 0, 0, 0
// dcl_texcoord1 v0.xy
// dcl_texcoord2 v1.xy
// dcl_2d s0
// dcl_2d s1
// rcp r0.x, c0.x
temp0.x = 1.0f / ref_threshold.x;
// texld r1, v1, s1
temp1 = tex2D(ambient_texture, i.texcoord2.xy);
// dp3 r0.y, c2, r1
temp0.y = dot(float3(0.27, 0.67, 0.06), temp1.xyz);
// mad_sat r0.x, r0.y, -r0.x, c2.w
temp0.x = saturate(temp0.y * -temp0.x + float1(1));
// add r0.y, -r0.y, c0.x
temp0.y = -temp0.y + ref_threshold.x;
// mul r0.x, r0.x, c1.x
temp0.x = temp0.x * ref_max.x;
// texld r2, v0, s0
temp2 = tex2D(self_illumination_texture, i.texcoord1.xy);
// add r2, -r1, r2
temp2 = -temp1 + temp2;
// mul r2, r0.x, r2
temp2 = temp0.x * temp2;
// cmp r0, r0.y, r2, c3.x
temp0 = (temp0.y >= 0) ? temp2 : float4(0, 0, 0, 0);
// add oC0, r0, r1
out_color = temp0 + temp1;
//
return out_color;
}
Decompiled by DXDecompiler.