Exemplo n.º 1
0
    /// <inheritdoc/>
    public float4 Execute()
    {
        float2 scenePos = D2D.GetScenePosition().XY;

        float xo = scenePos.X - (this.width >> 1);
        float yo = scenePos.Y - (this.height >> 1);

        float rm = 0.5f * this.diameter;
        float km = 0.7f / this.diameter * MathF.PI;
        float w  = rm / 10.0f;

        float yd = yo * yo;
        float xd = xo * xo;
        float d  = xd + yd;
        float v  = 1.0f + (1.0f + Hlsl.Tanh((rm - Hlsl.Sqrt(d)) / w)) * Hlsl.Sin(km * d) * 0.5f;

        return(new Float4(v, v, v, 1.0f));
    }