Wall damage shader testing (WIP)
This commit is contained in:
@@ -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 |
@@ -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.
Reference in New Issue
Block a user