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; }
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; }
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); }
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); }
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); }
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; }
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); }
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); }