Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The general idea is to render the white text first, then blur it. And finally to use the blurred white text as the background image for the black text.</p> <p>Your shader is a correct blur, but it's somewhat inefficient (redundant samples for x=0, for example). You can create a good large blur with two passes: one horizontal and one vertical blur. HLSL code:</p> <pre><code>float4 PS_BlurHorizontal( float2 Tex : TEXCOORD0 ) : COLOR0 { float Color = 0.0f; Color += tex2D(sampler, float2(Tex.x - 3.0*blurSizeX, Tex.y)) * 0.09f; Color += tex2D(sampler, float2(Tex.x - 2.0*blurSizeX, Tex.y)) * 0.11f; Color += tex2D(sampler, float2(Tex.x - blurSizeX, Tex.y)) * 0.18f; Color += tex2D(sampler, Tex) * 0.24f; Color += tex2D(sampler, float2(Tex.x + blurSizeX, Tex.y)) * 0.18f; Color += tex2D(sampler, float2(Tex.x + 2.0*blurSizeX, Tex.y)) * 0.11f; Color += tex2D(sampler, float2(Tex.x + 3.0*blurSizeX, Tex.y)) * 0.09f; return Color; } float4 PS_BlurVertical( float2 Tex : TEXCOORD0 ) : COLOR0 { float Color = 0.0f; Color += tex2D(sampler, float2(Tex.x, Tex.y - 3.0*blurSizeY)) * 0.09f; Color += tex2D(sampler, float2(Tex.x, Tex.y - 2.0*blurSizeY)) * 0.11f; Color += tex2D(sampler, float2(Tex.x, Tex.y - blurSizeY)) * 0.18f; Color += tex2D(sampler, Tex) * 0.24f; Color += tex2D(sampler, float2(Tex.x, Tex.y + blurSizeY)) * 0.18f; Color += tex2D(sampler, float2(Tex.x, Tex.y + 2.0*blurSizeY)) * 0.11f; Color += tex2D(sampler, float2(Tex.x, Tex.y + 3.0*blurSizeY)) * 0.09f; return Color; } // weights: 0.09 + 0.11 + 0.18 + 0.24 + 0.18 + 0.11 + 0.9 = 1 // By default, weigths are symmetrical and sum up to 1, // but they don't necessarily have to. // You can change the weights to create more fancy results. </code></pre> <p>These two 7-sample passes simulate a 7x7 gaussian blur (14 samples instead of 49). You can use more samples to improve the result (make blur wider) or just adjust the weights to create more soft look.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload