Release v0.15.12.0
This commit is contained in:
@@ -67,3 +67,15 @@
|
||||
/processorParam:DebugMode=Auto
|
||||
/build:grainshader.fx
|
||||
|
||||
#begin thresholdtint.fx
|
||||
/importer:EffectImporter
|
||||
/processor:EffectProcessor
|
||||
/processorParam:DebugMode=Auto
|
||||
/build:thresholdtint.fx
|
||||
|
||||
#begin blueprintshader.fx
|
||||
/importer:EffectImporter
|
||||
/processor:EffectProcessor
|
||||
/processorParam:DebugMode=Auto
|
||||
/build:blueprintshader.fx
|
||||
|
||||
|
||||
@@ -67,3 +67,14 @@
|
||||
/processorParam:DebugMode=Auto
|
||||
/build:grainshader_opengl.fx
|
||||
|
||||
#begin blueprintshader_opengl.fx
|
||||
/importer:EffectImporter
|
||||
/processor:EffectProcessor
|
||||
/processorParam:DebugMode=Auto
|
||||
/build:blueprintshader_opengl.fx
|
||||
|
||||
#begin thresholdtint_opengl.fx
|
||||
/importer:EffectImporter
|
||||
/processor:EffectProcessor
|
||||
/processorParam:DebugMode=Auto
|
||||
/build:thresholdtint_opengl.fx
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
// vim:ft=hlsl
|
||||
sampler TextureSampler : register(s0);
|
||||
|
||||
float width;
|
||||
float height;
|
||||
|
||||
float3 sobel(float2 uv)
|
||||
{
|
||||
float x = 0;
|
||||
float y = 0;
|
||||
|
||||
float w = 1.0 / width;
|
||||
float h = 1.0 / height;
|
||||
|
||||
x += tex2D(TextureSampler, uv + float2(-w, -h)) * -1.0;
|
||||
x += tex2D(TextureSampler, uv + float2(-w, 0)) * -2.0;
|
||||
x += tex2D(TextureSampler, uv + float2(-w, h)) * -1.0;
|
||||
|
||||
x += tex2D(TextureSampler, uv + float2( w, -h)) * 1.0;
|
||||
x += tex2D(TextureSampler, uv + float2( w, 0)) * 2.0;
|
||||
x += tex2D(TextureSampler, uv + float2( w, h)) * 1.0;
|
||||
|
||||
y += tex2D(TextureSampler, uv + float2(-w, -h)) * -1.0;
|
||||
y += tex2D(TextureSampler, uv + float2( 0, -h)) * -2.0;
|
||||
y += tex2D(TextureSampler, uv + float2( w, -h)) * -1.0;
|
||||
|
||||
y += tex2D(TextureSampler, uv + float2(-w, h)) * 1.0;
|
||||
y += tex2D(TextureSampler, uv + float2( 0, h)) * 2.0;
|
||||
y += tex2D(TextureSampler, uv + float2( w, h)) * 1.0;
|
||||
|
||||
return sqrt(x * x + y * y);
|
||||
}
|
||||
|
||||
float4 blueprint(float4 position : SV_POSITION, float4 clr : COLOR0, float2 texCoord : TEXCOORD0) : COLOR0
|
||||
{
|
||||
float3 s = sobel(texCoord);
|
||||
float a = tex2D(TextureSampler, texCoord).a;
|
||||
a *= clr.a;
|
||||
return float4(clr.r + s.r, clr.g + s.g, clr.b + s.b, a);
|
||||
}
|
||||
|
||||
technique Blueprint
|
||||
{
|
||||
pass Pass1
|
||||
{
|
||||
PixelShader = compile ps_4_0_level_9_1 blueprint();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
// vim:ft=hlsl
|
||||
sampler TextureSampler : register(s0);
|
||||
|
||||
float width;
|
||||
float height;
|
||||
|
||||
float3 sobel(float2 uv)
|
||||
{
|
||||
float x = 0;
|
||||
float y = 0;
|
||||
|
||||
float w = 1.0 / width;
|
||||
float h = 1.0 / height;
|
||||
|
||||
x += tex2D(TextureSampler, uv + float2(-w, -h)) * -1.0;
|
||||
x += tex2D(TextureSampler, uv + float2(-w, 0)) * -2.0;
|
||||
x += tex2D(TextureSampler, uv + float2(-w, h)) * -1.0;
|
||||
|
||||
x += tex2D(TextureSampler, uv + float2( w, -h)) * 1.0;
|
||||
x += tex2D(TextureSampler, uv + float2( w, 0)) * 2.0;
|
||||
x += tex2D(TextureSampler, uv + float2( w, h)) * 1.0;
|
||||
|
||||
y += tex2D(TextureSampler, uv + float2(-w, -h)) * -1.0;
|
||||
y += tex2D(TextureSampler, uv + float2( 0, -h)) * -2.0;
|
||||
y += tex2D(TextureSampler, uv + float2( w, -h)) * -1.0;
|
||||
|
||||
y += tex2D(TextureSampler, uv + float2(-w, h)) * 1.0;
|
||||
y += tex2D(TextureSampler, uv + float2( 0, h)) * 2.0;
|
||||
y += tex2D(TextureSampler, uv + float2( w, h)) * 1.0;
|
||||
|
||||
return sqrt(x * x + y * y);
|
||||
}
|
||||
|
||||
float4 blueprint(float4 position : SV_POSITION, float4 clr : COLOR0, float2 texCoord : TEXCOORD0) : COLOR0
|
||||
{
|
||||
float3 s = sobel(texCoord);
|
||||
float a = tex2D(TextureSampler, texCoord).a;
|
||||
a *= clr.a;
|
||||
return float4(clr.r + s.r, clr.g + s.g, clr.b + s.b, a);
|
||||
}
|
||||
|
||||
technique Blueprint
|
||||
{
|
||||
pass Pass1
|
||||
{
|
||||
PixelShader = compile ps_3_0 blueprint();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
Texture2D xBaseTexture;
|
||||
sampler BaseTextureSampler = sampler_state { Texture = <xBaseTexture>; };
|
||||
Texture2D xTintMaskTexture;
|
||||
sampler TintMaskTextureSampler = sampler_state { Texture = <xTintMaskTexture>; };
|
||||
Texture2D xCutoffTexture;
|
||||
sampler CutoffTextureSampler = sampler_state { Texture = <xCutoffTexture>; };
|
||||
|
||||
float highlightThreshold;
|
||||
float highlightMultiplier;
|
||||
|
||||
float baseToCutoffSizeRatio;
|
||||
|
||||
float4 mainPS(float4 position : SV_POSITION, float4 clr : COLOR0, float2 texCoord : TEXCOORD0) : COLOR0
|
||||
{
|
||||
float4 baseSample = xBaseTexture.Sample(BaseTextureSampler, texCoord);
|
||||
float3 tintMaskSample = xTintMaskTexture.Sample(TintMaskTextureSampler, texCoord).rgb;
|
||||
float cutoffSample = xCutoffTexture.Sample(CutoffTextureSampler, texCoord * baseToCutoffSizeRatio).r;
|
||||
|
||||
float3 highlight = saturate((baseSample.rgb - (highlightThreshold * float3(1,1,1))) * highlightMultiplier);
|
||||
float3 tinted = saturate(baseSample.rgb * clr.rgb + highlight);
|
||||
return float4(
|
||||
(tinted * tintMaskSample) + (baseSample.rgb * (float3(1,1,1) - tintMaskSample)),
|
||||
baseSample.a * cutoffSample * clr.a);
|
||||
}
|
||||
|
||||
technique ThresholdTintShader
|
||||
{
|
||||
pass Pass1
|
||||
{
|
||||
PixelShader = compile ps_4_0_level_9_1 mainPS();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
Texture2D xBaseTexture;
|
||||
sampler BaseTextureSampler = sampler_state { Texture = <xBaseTexture>; };
|
||||
Texture2D xTintMaskTexture;
|
||||
sampler TintMaskTextureSampler = sampler_state { Texture = <xTintMaskTexture>; };
|
||||
Texture2D xCutoffTexture;
|
||||
sampler CutoffTextureSampler = sampler_state { Texture = <xCutoffTexture>; };
|
||||
|
||||
float highlightThreshold;
|
||||
float highlightMultiplier;
|
||||
|
||||
float baseToCutoffSizeRatio;
|
||||
|
||||
float4 mainPS(float4 position : SV_POSITION, float4 clr : COLOR0, float2 texCoord : TEXCOORD0) : COLOR0
|
||||
{
|
||||
float4 baseSample = tex2D(BaseTextureSampler, texCoord);
|
||||
float3 tintMaskSample = tex2D(TintMaskTextureSampler, texCoord).rgb;
|
||||
float cutoffSample = tex2D(CutoffTextureSampler, texCoord * baseToCutoffSizeRatio).r;
|
||||
|
||||
float3 highlight = saturate((baseSample.rgb - (highlightThreshold * float3(1,1,1))) * highlightMultiplier);
|
||||
float3 tinted = saturate(baseSample.rgb * clr.rgb + highlight);
|
||||
return float4(
|
||||
(tinted * tintMaskSample) + (baseSample.rgb * (float3(1,1,1) - tintMaskSample)),
|
||||
baseSample.a * cutoffSample * clr.a);
|
||||
}
|
||||
|
||||
technique ThresholdTintShader
|
||||
{
|
||||
pass Pass1
|
||||
{
|
||||
PixelShader = compile ps_2_0 mainPS();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user