CreatePerlinNoiseTurbulence() public static method

public static CreatePerlinNoiseTurbulence ( float baseFrequencyX, float baseFrequencyY, int numOctaves, float seed ) : SKShader
baseFrequencyX float
baseFrequencyY float
numOctaves int
seed float
return SKShader
Example #1
0
        public static void TurbulencePerlinNoiseShader(SKCanvas canvas, int width, int height)
        {
            canvas.Clear(SKColors.White);

            using (var shader = SKShader.CreatePerlinNoiseTurbulence(0.05f, 0.05f, 4, 0.0f))
                using (var paint = new SKPaint())
                {
                    paint.Shader = shader;
                    canvas.DrawPaint(paint);
                }
        }
Example #2
0
        public static void ComposeShader(SKCanvas canvas, int width, int height)
        {
            var colors = new [] { SKColors.Blue, SKColors.Yellow };
            var center = new SKPoint(width / 2f, height / 2f);

            using (var shader1 = SKShader.CreateRadialGradient(center, 180.0f, colors, null, SKShaderTileMode.Clamp))
                using (var shader2 = SKShader.CreatePerlinNoiseTurbulence(0.025f, 0.025f, 2, 0.0f))
                    using (var shader = SKShader.CreateCompose(shader1, shader2))
                        using (var paint = new SKPaint())
                        {
                            paint.Shader = shader;
                            canvas.DrawPaint(paint);
                        }
        }