Original Post
I wrote a decal generater with the Alpha Tested Magnification method defined here http://www.valvesoftware.com/publications/2007/SIGGRAPH2007_AlphaTestedMagnification.pdf and I tried to implement the outer glow shader but I had a few questions
1) What is the appropriate valus for something like "GLOW_UV_OFFSET", "OUTER_GLOW_MIN_DVALUE" and "OUTER_GLOW_MIN_DVALUE"? I have tried used (-0.004, -0.004), 0.3 and 0.5.
2) What is the value for "mskUsed"?
I tried to implement this with the code below but it just looked terrible and not even noticeable. (I do have the rendering working without trying this effect).
float4 PS( PS_INPUT input) : SV_Target
{
float4 baseColor = float4(0.0f, 0.0f, 1.0f, 1.0f);
baseColor.a = txDiffuse.Sample(samLinear, input.Tex.xy).a;
float2 glowOffset = float2(-0.004f, -0.004f);
float4 glowColor = float4(0.0f, 0.0f, 0.0f, 1.0f);
float4 glowTexel = txDiffuse.Sample(samLinear, input.Tex.xy + glowOffset);
float4 glowc = glowColor * smoothstep(0.3f, 0.5f, glowTexel.a);
baseColor = lerp(glowc, baseColor, baseColor.a);
return baseColor;
}
1) What is the appropriate valus for something like "GLOW_UV_OFFSET", "OUTER_GLOW_MIN_DVALUE" and "OUTER_GLOW_MIN_DVALUE"? I have tried used (-0.004, -0.004), 0.3 and 0.5.
2) What is the value for "mskUsed"?
I tried to implement this with the code below but it just looked terrible and not even noticeable. (I do have the rendering working without trying this effect).
float4 PS( PS_INPUT input) : SV_Target
{
float4 baseColor = float4(0.0f, 0.0f, 1.0f, 1.0f);
baseColor.a = txDiffuse.Sample(samLinear, input.Tex.xy).a;
float2 glowOffset = float2(-0.004f, -0.004f);
float4 glowColor = float4(0.0f, 0.0f, 0.0f, 1.0f);
float4 glowTexel = txDiffuse.Sample(samLinear, input.Tex.xy + glowOffset);
float4 glowc = glowColor * smoothstep(0.3f, 0.5f, glowTexel.a);
baseColor = lerp(glowc, baseColor, baseColor.a);
return baseColor;
}