Wall damage shader testing (WIP)

This commit is contained in:
Regalis
2016-09-16 14:47:08 +03:00
parent 0265d075a5
commit b24359464b
8 changed files with 124 additions and 11 deletions
+6
View File
@@ -43,3 +43,9 @@
/processorParam:DebugMode=Auto
/build:blurshader.fx
#begin damageshader.fx
/importer:EffectImporter
/processor:EffectProcessor
/processorParam:DebugMode=Auto
/build:damageshader.fx
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

+34
View File
@@ -0,0 +1,34 @@
Texture xTexture;
sampler TextureSampler : register (s0) = sampler_state { Texture = <xTexture>; };
Texture xStencil;
sampler StencilSampler = sampler_state { Texture = <xStencil>; };
float cutoff;
float multiplier;
float4 main(float4 position : SV_Position, float4 color : COLOR0, float2 texCoord : TEXCOORD0) : COLOR0
{
float4 c = tex2D(TextureSampler, texCoord);
float4 stencilColor = tex2D(StencilSampler, texCoord);
float a = stencilColor.a - cutoff;
clip(a);
a = min(a * multiplier, 1.0f);
c = lerp(c, stencilColor, 1.0f - a);
return c * a;
}
technique StencilShader
{
pass Pass1
{
PixelShader = compile ps_4_0_level_9_3 main();
}
}
Binary file not shown.