Build 1.1.4.0

This commit is contained in:
Markus Isberg
2023-03-31 18:40:44 +03:00
parent efba17e0ff
commit 9470edead3
483 changed files with 17487 additions and 8548 deletions
@@ -5,6 +5,8 @@ sampler TextureSampler : register (s0) = sampler_state { Texture = <xTexture>; }
Texture2D xStencil;
sampler StencilSampler = sampler_state { Texture = <xStencil>; };
float4 solidColor;
float4 inColor;
float aCutoff;
@@ -16,7 +18,6 @@ float cMultiplier;
float4 main(float4 position : POSITION0, float4 color : COLOR0, float2 texCoord : TEXCOORD0) : COLOR0
{
float4 c = xTexture.Sample(TextureSampler, texCoord) * inColor;
float4 stencilColor = xStencil.Sample(StencilSampler, texCoord);
float aDiff = stencilColor.a - aCutoff;
@@ -30,6 +31,18 @@ float4 main(float4 position : POSITION0, float4 color : COLOR0, float2 texCoord
min(aDiff * aMultiplier, c.a));
}
float4 solidColorStencil(float4 position : POSITION0, float4 color : COLOR0, float2 texCoord : TEXCOORD0) : COLOR0
{
float4 c = xTexture.Sample(TextureSampler, texCoord) * inColor;
float4 stencilColor = xStencil.Sample(StencilSampler, texCoord);
float aDiff = stencilColor.a - aCutoff;
clip(aDiff);
return float4(solidColor.rgb, solidColor.a * min(aDiff * aMultiplier, c.a));
}
technique StencilShader
{
pass Pass1
@@ -37,3 +50,11 @@ technique StencilShader
PixelShader = compile ps_4_0_level_9_1 main();
}
}
technique StencilShaderSolidColor
{
pass Pass1
{
PixelShader = compile ps_4_0_level_9_1 solidColorStencil();
}
}
@@ -5,6 +5,8 @@ sampler TextureSampler : register (s0) = sampler_state { Texture = <xTexture>; }
Texture xStencil;
sampler StencilSampler = sampler_state { Texture = <xStencil>; };
float4 solidColor;
float4 inColor;
float aCutoff;
@@ -16,7 +18,6 @@ float cMultiplier;
float4 main(float4 position : POSITION0, float4 color : COLOR0, float2 texCoord : TEXCOORD0) : COLOR0
{
float4 c = tex2D(TextureSampler, texCoord) * inColor;
float4 stencilColor = tex2D(StencilSampler, texCoord);
float aDiff = stencilColor.a - aCutoff;
@@ -30,6 +31,18 @@ float4 main(float4 position : POSITION0, float4 color : COLOR0, float2 texCoord
min(aDiff * aMultiplier, c.a));
}
float4 solidColorStencil(float4 position : POSITION0, float4 color : COLOR0, float2 texCoord : TEXCOORD0) : COLOR0
{
float4 c = tex2D(TextureSampler, texCoord) * inColor;
float4 stencilColor = tex2D(StencilSampler, texCoord);
float aDiff = stencilColor.a - aCutoff;
clip(aDiff);
return float4(solidColor.rgb, solidColor.a * min(aDiff * aMultiplier, c.a));
}
technique StencilShader
{
pass Pass1
@@ -37,3 +50,11 @@ technique StencilShader
PixelShader = compile ps_2_0 main();
}
}
technique StencilShaderSolidColor
{
pass Pass1
{
PixelShader = compile ps_2_0 solidColorStencil();
}
}
@@ -30,11 +30,18 @@ float xLosAlpha;
float4 xColor;
float blurDistance;
float4 mainPS(VertexShaderOutput input) : COLOR0
{
float4 sampleColor = xTexture.Sample(TextureSampler, input.TexCoords);
float4 losColor = xLosTexture.Sample(LosSampler, input.TexCoords);
float4 losColor = xLosTexture.Sample(LosSampler, float2(input.TexCoords.x + blurDistance, input.TexCoords.y + blurDistance));
losColor += xLosTexture.Sample(LosSampler, float2(input.TexCoords.x - blurDistance, input.TexCoords.y - blurDistance));
losColor += xLosTexture.Sample(LosSampler, float2(input.TexCoords.x + blurDistance, input.TexCoords.y - blurDistance));
losColor += xLosTexture.Sample(LosSampler, float2(input.TexCoords.x - blurDistance, input.TexCoords.y + blurDistance));
losColor = losColor * 0.25f;
float obscureAmount = 1.0f - losColor.r;
float4 outColor = float4(
@@ -53,4 +60,4 @@ technique LosShader
VertexShader = compile vs_4_0_level_9_1 mainVS();
PixelShader = compile ps_4_0_level_9_1 mainPS();
}
}
}
@@ -9,6 +9,8 @@ float aCutoff;
float4x4 wearableUvToClipperUv;
float clipperTexelSize;
float2 stencilUVmin, stencilUVmax;
float stencilSample(float2 texCoord, float2 offset)
{
return xStencil.Sample(
@@ -20,6 +22,12 @@ float4 main(float4 position : POSITION0, float4 color : COLOR0, float2 texCoord
{
float4 c = xTexture.Sample(TextureSampler, texCoord) * color;
float2 stencilUV = mul(float4(texCoord.x, texCoord.y, 0, 1), wearableUvToClipperUv).xy;
clip(stencilUV.x - stencilUVmin.x);
clip(stencilUV.y - stencilUVmin.y);
clip(stencilUVmax.y - stencilUV.x);
clip(stencilUVmax.y - stencilUV.y);
float minStencil = stencilSample(texCoord, float2(0,0));
minStencil = min(minStencil, stencilSample(texCoord, float2(-clipperTexelSize,0)));
minStencil = min(minStencil, stencilSample(texCoord, float2(clipperTexelSize,0)));
@@ -9,6 +9,8 @@ float aCutoff;
float4x4 wearableUvToClipperUv;
float clipperTexelSize;
float2 stencilUVmin, stencilUVmax;
float stencilSample(float2 texCoord, float2 offset)
{
return tex2D(
@@ -19,6 +21,12 @@ float stencilSample(float2 texCoord, float2 offset)
float4 main(float4 position : POSITION0, float4 color : COLOR0, float2 texCoord : TEXCOORD0) : COLOR0
{
float4 c = tex2D(TextureSampler, texCoord) * color;
float2 stencilUV = mul(float4(texCoord.x, texCoord.y, 0, 1), wearableUvToClipperUv).xy;
clip(stencilUV.x - stencilUVmin.x);
clip(stencilUV.y - stencilUVmin.y);
clip(stencilUVmax.y - stencilUV.x);
clip(stencilUVmax.y - stencilUV.y);
float minStencil = stencilSample(texCoord, float2(0,0));
minStencil = min(minStencil, stencilSample(texCoord, float2(-clipperTexelSize,0)));