Jump to content
Posted 13 January 2011 - 08:49 PM
Posted 16 January 2011 - 09:51 PM
Posted 16 January 2011 - 11:40 PM
baseColor.a *= smoothstep( SOFT_EDGE_MIN, SOFT_EDGE_MAX, baseColor.a );or
baseColor.a = step(0.5, baseColor.a);
Posted 21 January 2011 - 12:55 AM
GLOW_UV_OFFSET determines the number of pixels that the glow effect will be offset from the text by (for using glow as a drop shadow). This is in normalized texture coordinates --- so if your texture is 512x512, then 1 pixel = float2(1/512.0, 1/512.0).
OUTER_GLOW_MIN_DVALUE / OUTER_GLOW_MIN_DVALUE determine how far outside the shape the glow begins appearing, and when it reaches full opacity. The numbers to use here depend on how you generated your distance field....
0.5 means "right on the edge". 1.0 means "x units inside the shape". 0.0 means "x units outside the shape". Depending on how you generated the distance field, "x" is going to be a different number of pixels.
I would guess that baseColor.a is the right value to use in place of mskUsed, but before you do that part, you're missing eitherbaseColor.a *= smoothstep( SOFT_EDGE_MIN, SOFT_EDGE_MAX, baseColor.a );orbaseColor.a = step(0.5, baseColor.a);
Posted 24 January 2011 - 01:02 AM
float onePixelDistance = 1.0/255.0;//value determined by distance field generation tool float SOFT_EDGE_MIN = 0.5 - onePixelDistance * 3.0; float SOFT_EDGE_MAX = 0.5 + onePixelDistance * 3.0;
Posted 25 January 2011 - 11:59 PM