CreatePerlinNoiseTurbulence() 공개 정적인 메소드

public static CreatePerlinNoiseTurbulence ( float baseFrequencyX, float baseFrequencyY, int numOctaves, float seed ) : SKShader
baseFrequencyX float
baseFrequencyY float
numOctaves int
seed float
리턴 SKShader
예제 #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);
                }
        }
예제 #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);
                        }
        }