Files
LuaCsForBarotraumaEP/Barotrauma/BarotraumaShared/Content/damageshader.fx
T
juanjp600 4d225c65f2 Updated to MonoGame 3.6 + Directory refactor
- Barotrauma's projects are in the Barotrauma directory
- All libraries are in the Libraries directory
- MonoGame is now managed by NuGet, rather than referenced from the installed files (TODO: consider using PCL for easier cross-platform development?)
- NuGet libraries are not included in the repo, as getting the latest versions automatically should be preferred
- Removed Content/effects.mgfx as it didn't seem to be used anywhere
- Removed some references to Subsurface directory
- Renamed Launcher2 to Launcher
2017-06-27 09:52:57 -03:00

39 lines
802 B
HLSL

Texture xTexture;
sampler TextureSampler : register (s0) = sampler_state { Texture = <xTexture>; };
Texture xStencil;
sampler StencilSampler = sampler_state { Texture = <xStencil>; };
float aCutoff;
float aMultiplier;
float cCutoff;
float cMultiplier;
float4 main(float4 position : SV_Position, float4 color : COLOR0, float2 texCoord : TEXCOORD0) : COLOR0
{
float4 c = tex2D(TextureSampler, texCoord);
float4 stencilColor = tex2D(StencilSampler, texCoord);
float aDiff = stencilColor.a - aCutoff;
clip(aDiff);
float cDiff = stencilColor.a - cCutoff;
return float4(
lerp(stencilColor.rgb, c.rgb, clamp(cDiff * cMultiplier, 0.0f, 1.0f)),
min(aDiff * aMultiplier, c.a));
}
technique StencilShader
{
pass Pass1
{
PixelShader = compile ps_4_0_level_9_3 main();
}
}