コード例 #1
0
    void init(String p_name, Algorithm p_algorithm, float p_scale, NoiseStyle p_style, float p_min, float p_max, Edge p_edge, float p_edge_threshold)
    {
        fractalEnabled             = false;
        fractalsettings            = new FractalSettings();
        fractalsettings.layers     = 1;
        fractalsettings.lacunarity = 1.0f;
        fractalsettings.gain       = 1.0f;

        name           = p_name;
        algorithm      = p_algorithm;
        scale          = p_scale;
        min            = p_min;
        max            = p_max;
        style          = p_style;
        edge           = p_edge;
        edge_threshold = p_edge_threshold;
    }
コード例 #2
0
    public static Texture2D Simplex2D(int width, int height, float scale, NoiseStyle style, float min, float max)
    {
        Texture2D noiseTexture = new Texture2D(width, height, TextureFormat.ARGB32, false);

        Noise noise = new Noise();
        noise.addChannel(new Channel("Color", Algorithm.Simplex2d, scale, style, min, max, Edge.Smooth));

        for (int x = 0; x < width; x++) {
            for (int y = 0; y < height; y++) {
                Vector3 vector = new Vector3((float)x, 0.0f, (float)y);

                float sample = noise.getNoise(vector, "Color");
                noiseTexture.SetPixel(x, y, new Color(sample, sample, sample, 1.0f));
            }
        }

        noiseTexture.Apply();
        return noiseTexture;
    }
コード例 #3
0
    public static Texture2D Simplex2D(int width, int height, float scale, NoiseStyle style, float min, float max)
    {
        Texture2D noiseTexture = new Texture2D(width, height, TextureFormat.ARGB32, false);

        Noise noise = new Noise();

        noise.addChannel(new Channel("Color", Algorithm.Simplex2d, scale, style, min, max, Edge.Smooth));

        for (int x = 0; x < width; x++)
        {
            for (int y = 0; y < height; y++)
            {
                Vector3 vector = new Vector3((float)x, 0.0f, (float)y);

                float sample = noise.getNoise(vector, "Color");
                noiseTexture.SetPixel(x, y, new Color(sample, sample, sample, 1.0f));
            }
        }

        noiseTexture.Apply();
        return(noiseTexture);
    }
コード例 #4
0
 public Channel(String name, Algorithm algorithm, float scale, NoiseStyle style, float min, float max, Edge edge)
 {
     init(name, algorithm, scale, style, min, max, edge, max * 0.5f);
 }
コード例 #5
0
 public Channel(String name, Algorithm algorithm, float scale, NoiseStyle style, float min, float max, Edge edge, float edge_threshold)
 {
     init(name, algorithm, scale, style, min, max, edge, edge_threshold);
 }
コード例 #6
0
ファイル: Noise.cs プロジェクト: kmoverall/DontLookBack
	void init(String p_name,Algorithm p_algorithm,float p_scale,NoiseStyle p_style,float p_min,float p_max,Edge p_edge,float p_edge_threshold)
	{
		fractalEnabled = false;
		fractalsettings = new FractalSettings();
		fractalsettings.layers = 1;
		fractalsettings.lacunarity = 1.0f;
		fractalsettings.gain = 1.0f;
		
		name = p_name;
		algorithm = p_algorithm;
		scale = p_scale;
		min = p_min;
		max = p_max;
		style = p_style;
		edge = p_edge;
		edge_threshold = p_edge_threshold;		
	}
コード例 #7
0
ファイル: Noise.cs プロジェクト: kmoverall/DontLookBack
	public Channel(String name,Algorithm algorithm,float scale,NoiseStyle style,float min,float max,Edge edge)
	{		
		init (name,algorithm,scale,style,min,max,edge,max*0.5f);
	}
コード例 #8
0
ファイル: Noise.cs プロジェクト: kmoverall/DontLookBack
	public Channel(String name,Algorithm algorithm,float scale,NoiseStyle style,float min,float max,Edge edge,float edge_threshold)
	{
		init (name,algorithm,scale,style,min,max,edge,edge_threshold);
	}