mirror of
https://github.com/Relintai/broken_seals.git
synced 2025-01-29 02:29:18 +01:00
Cleaned up the noises folder.
This commit is contained in:
parent
a317240526
commit
dade6413b3
@ -1,8 +1,6 @@
|
|||||||
[gd_resource type="Resource" load_steps=46 format=2]
|
[gd_resource type="Resource" load_steps=42 format=2]
|
||||||
|
|
||||||
[ext_resource path="res://addons/mat_maker_gd/nodes/mm_material.gd" type="Script" id=1]
|
[ext_resource path="res://addons/mat_maker_gd/nodes/mm_material.gd" type="Script" id=1]
|
||||||
[ext_resource path="res://addons/mat_maker_gd/nodes/noise/perlin.gd" type="Script" id=2]
|
|
||||||
[ext_resource path="res://addons/mat_maker_gd/nodes/noise/noise.gd" type="Script" id=3]
|
|
||||||
[ext_resource path="res://addons/mat_maker_gd/nodes/simple/shape.gd" type="Script" id=4]
|
[ext_resource path="res://addons/mat_maker_gd/nodes/simple/shape.gd" type="Script" id=4]
|
||||||
[ext_resource path="res://addons/mat_maker_gd/nodes/mm_node_universal_property.gd" type="Script" id=5]
|
[ext_resource path="res://addons/mat_maker_gd/nodes/mm_node_universal_property.gd" type="Script" id=5]
|
||||||
[ext_resource path="res://addons/mat_maker_gd/nodes/other/output_image.gd" type="Script" id=6]
|
[ext_resource path="res://addons/mat_maker_gd/nodes/other/output_image.gd" type="Script" id=6]
|
||||||
@ -13,20 +11,6 @@
|
|||||||
[ext_resource path="res://addons/mat_maker_gd/nodes/filter/colorize.gd" type="Script" id=11]
|
[ext_resource path="res://addons/mat_maker_gd/nodes/filter/colorize.gd" type="Script" id=11]
|
||||||
[ext_resource path="res://addons/mat_maker_gd/nodes/pattern/bricks.gd" type="Script" id=12]
|
[ext_resource path="res://addons/mat_maker_gd/nodes/pattern/bricks.gd" type="Script" id=12]
|
||||||
|
|
||||||
[sub_resource type="Resource" id=1]
|
|
||||||
script = ExtResource( 2 )
|
|
||||||
graph_position = Vector2( -520, -340 )
|
|
||||||
scale = Vector2( 15, 4 )
|
|
||||||
iterations = 3
|
|
||||||
persistence = 0.5
|
|
||||||
|
|
||||||
[sub_resource type="Resource" id=2]
|
|
||||||
script = ExtResource( 3 )
|
|
||||||
graph_position = Vector2( 440, 20 )
|
|
||||||
bmin = Vector2( 0.1, 0.1 )
|
|
||||||
bmax = Vector2( 1, 1 )
|
|
||||||
refresh = false
|
|
||||||
|
|
||||||
[sub_resource type="Resource" id=3]
|
[sub_resource type="Resource" id=3]
|
||||||
script = ExtResource( 5 )
|
script = ExtResource( 5 )
|
||||||
default_type = 1
|
default_type = 1
|
||||||
@ -63,7 +47,7 @@ sides = 11
|
|||||||
radius = SubResource( 4 )
|
radius = SubResource( 4 )
|
||||||
edge = SubResource( 3 )
|
edge = SubResource( 3 )
|
||||||
|
|
||||||
[sub_resource type="Resource" id=28]
|
[sub_resource type="Resource" id=40]
|
||||||
script = ExtResource( 5 )
|
script = ExtResource( 5 )
|
||||||
default_type = 5
|
default_type = 5
|
||||||
default_int = 0
|
default_int = 0
|
||||||
@ -75,7 +59,7 @@ default_color = Color( 0, 0, 0, 1 )
|
|||||||
[sub_resource type="Resource" id=6]
|
[sub_resource type="Resource" id=6]
|
||||||
script = ExtResource( 6 )
|
script = ExtResource( 6 )
|
||||||
graph_position = Vector2( 300, -400 )
|
graph_position = Vector2( 300, -400 )
|
||||||
image = SubResource( 28 )
|
image = SubResource( 40 )
|
||||||
postfix = "-test"
|
postfix = "-test"
|
||||||
|
|
||||||
[sub_resource type="Resource" id=9]
|
[sub_resource type="Resource" id=9]
|
||||||
@ -307,4 +291,4 @@ corner = 0.3
|
|||||||
[resource]
|
[resource]
|
||||||
script = ExtResource( 1 )
|
script = ExtResource( 1 )
|
||||||
image_size = Vector2( 128, 128 )
|
image_size = Vector2( 128, 128 )
|
||||||
nodes = [ SubResource( 1 ), SubResource( 2 ), SubResource( 5 ), SubResource( 6 ), SubResource( 12 ), SubResource( 15 ), SubResource( 18 ), SubResource( 21 ), SubResource( 24 ), SubResource( 27 ), SubResource( 39 ) ]
|
nodes = [ SubResource( 5 ), SubResource( 6 ), SubResource( 12 ), SubResource( 15 ), SubResource( 18 ), SubResource( 21 ), SubResource( 24 ), SubResource( 27 ), SubResource( 39 ) ]
|
||||||
|
@ -1,68 +0,0 @@
|
|||||||
tool
|
|
||||||
extends MMNode
|
|
||||||
|
|
||||||
var Commons = preload("res://addons/mat_maker_gd/nodes/common/commons.gd")
|
|
||||||
|
|
||||||
var image : Image
|
|
||||||
var tex : ImageTexture
|
|
||||||
|
|
||||||
export(Vector2) var bmin : Vector2 = Vector2(0.1, 0.1)
|
|
||||||
export(Vector2) var bmax : Vector2 = Vector2(1, 1)
|
|
||||||
|
|
||||||
export(bool) var refresh setget reff,reffg
|
|
||||||
|
|
||||||
func _ready():
|
|
||||||
if !Engine.editor_hint:
|
|
||||||
gen()
|
|
||||||
|
|
||||||
|
|
||||||
func gen() -> void:
|
|
||||||
if !image:
|
|
||||||
image = Image.new()
|
|
||||||
image.create(300, 300, false, Image.FORMAT_RGBA8)
|
|
||||||
|
|
||||||
if !tex:
|
|
||||||
tex = ImageTexture.new()
|
|
||||||
|
|
||||||
# var bmin : Vector2 = Vector2(0.1, 0.1)
|
|
||||||
# var bmax : Vector2 = Vector2(1, 1)
|
|
||||||
|
|
||||||
image.lock()
|
|
||||||
|
|
||||||
var w : float = image.get_width()
|
|
||||||
var h : float = image.get_width()
|
|
||||||
|
|
||||||
var pseed : float = randf() + randi()
|
|
||||||
|
|
||||||
for x in range(image.get_width()):
|
|
||||||
for y in range(image.get_height()):
|
|
||||||
var v : Vector2 = Vector2(x / w, y / h)
|
|
||||||
|
|
||||||
# var f : float = pattern(v, 4, 4, CombinerType.MULTIPLY, CombinerAxisType.SINE, CombinerAxisType.SINE)
|
|
||||||
|
|
||||||
var col : Color = sinewave(v)
|
|
||||||
# var col : Color = beehive_2_col(v)
|
|
||||||
# var col : Color = beehive_3_col(v)
|
|
||||||
|
|
||||||
image.set_pixel(x, y, col)
|
|
||||||
|
|
||||||
|
|
||||||
image.unlock()
|
|
||||||
|
|
||||||
tex.create_from_image(image)
|
|
||||||
#texture = tex
|
|
||||||
|
|
||||||
var p_o7136_amplitude = 0.500000000;
|
|
||||||
var p_o7136_frequency = 2.000000000;
|
|
||||||
var p_o7136_phase = 0.000000000;
|
|
||||||
|
|
||||||
func sinewave(uv : Vector2) -> Color:
|
|
||||||
return Commons.sinewave(uv, p_o7136_amplitude, p_o7136_frequency, p_o7136_phase)
|
|
||||||
|
|
||||||
func reffg():
|
|
||||||
return false
|
|
||||||
|
|
||||||
func reff(bb):
|
|
||||||
if bb:
|
|
||||||
gen()
|
|
||||||
|
|
@ -1,96 +0,0 @@
|
|||||||
tool
|
|
||||||
extends MMNode
|
|
||||||
|
|
||||||
var NoiseFBM = preload("res://addons/mat_maker_gd/nodes/common/noise_fbm.gd")
|
|
||||||
|
|
||||||
var image : Image
|
|
||||||
var tex : ImageTexture
|
|
||||||
|
|
||||||
export(Vector2) var bmin : Vector2 = Vector2(0.1, 0.1)
|
|
||||||
export(Vector2) var bmax : Vector2 = Vector2(1, 1)
|
|
||||||
|
|
||||||
export(bool) var refresh setget reff,reffg
|
|
||||||
|
|
||||||
func _ready():
|
|
||||||
if !Engine.editor_hint:
|
|
||||||
gen()
|
|
||||||
|
|
||||||
|
|
||||||
func gen() -> void:
|
|
||||||
if !image:
|
|
||||||
image = Image.new()
|
|
||||||
image.create(300, 300, false, Image.FORMAT_RGBA8)
|
|
||||||
|
|
||||||
if !tex:
|
|
||||||
tex = ImageTexture.new()
|
|
||||||
|
|
||||||
# var bmin : Vector2 = Vector2(0.1, 0.1)
|
|
||||||
# var bmax : Vector2 = Vector2(1, 1)
|
|
||||||
|
|
||||||
image.lock()
|
|
||||||
|
|
||||||
var w : float = image.get_width()
|
|
||||||
var h : float = image.get_width()
|
|
||||||
|
|
||||||
var pseed : float = randf() + randi()
|
|
||||||
|
|
||||||
for x in range(image.get_width()):
|
|
||||||
for y in range(image.get_height()):
|
|
||||||
var v : Vector2 = Vector2(x / w, y / h)
|
|
||||||
|
|
||||||
# var f : float = pattern(v, 4, 4, CombinerType.MULTIPLY, CombinerAxisType.SINE, CombinerAxisType.SINE)
|
|
||||||
|
|
||||||
# var col : Color = fbmval(v)
|
|
||||||
# var col : Color = perlin(v)
|
|
||||||
# var col : Color = cellular(v)
|
|
||||||
# var col : Color = cellular2(v)
|
|
||||||
# var col : Color = cellular3(v)
|
|
||||||
# var col : Color = cellular4(v)
|
|
||||||
# var col : Color = cellular5(v)
|
|
||||||
var col : Color = cellular6(v)
|
|
||||||
|
|
||||||
image.set_pixel(x, y, col)
|
|
||||||
|
|
||||||
|
|
||||||
image.unlock()
|
|
||||||
|
|
||||||
tex.create_from_image(image)
|
|
||||||
# texture = tex
|
|
||||||
|
|
||||||
var seed_o33355 = 26177;
|
|
||||||
var p_o33355_scale_x = 2.000000000;
|
|
||||||
var p_o33355_scale_y = 2.000000000;
|
|
||||||
var p_o33355_iterations = 5.000000000;
|
|
||||||
var p_o33355_persistence = 0.500000000;
|
|
||||||
|
|
||||||
func fbmval(uv : Vector2) -> Color:
|
|
||||||
return NoiseFBM.fbmval(uv, Vector2(p_o33355_scale_x, p_o33355_scale_y), 1, int(p_o33355_iterations), p_o33355_persistence, float(seed_o33355))
|
|
||||||
|
|
||||||
func perlin(uv : Vector2) -> Color:
|
|
||||||
return NoiseFBM.perlin(uv, Vector2(p_o33355_scale_x, p_o33355_scale_y), 1, int(p_o33355_iterations), p_o33355_persistence, float(seed_o33355))
|
|
||||||
|
|
||||||
func cellular(uv : Vector2) -> Color:
|
|
||||||
return NoiseFBM.cellular(uv, Vector2(p_o33355_scale_x, p_o33355_scale_y), 1, int(p_o33355_iterations), p_o33355_persistence, float(seed_o33355))
|
|
||||||
|
|
||||||
func cellular2(uv : Vector2) -> Color:
|
|
||||||
return NoiseFBM.cellular2(uv, Vector2(p_o33355_scale_x, p_o33355_scale_y), 1, int(p_o33355_iterations), p_o33355_persistence, float(seed_o33355))
|
|
||||||
|
|
||||||
func cellular3(uv : Vector2) -> Color:
|
|
||||||
return NoiseFBM.cellular3(uv, Vector2(p_o33355_scale_x, p_o33355_scale_y), 1, int(p_o33355_iterations), p_o33355_persistence, float(seed_o33355))
|
|
||||||
|
|
||||||
func cellular4(uv : Vector2) -> Color:
|
|
||||||
return NoiseFBM.cellular4(uv, Vector2(p_o33355_scale_x, p_o33355_scale_y), 1, int(p_o33355_iterations), p_o33355_persistence, float(seed_o33355))
|
|
||||||
|
|
||||||
func cellular5(uv : Vector2) -> Color:
|
|
||||||
return NoiseFBM.cellular5(uv, Vector2(p_o33355_scale_x, p_o33355_scale_y), 1, int(p_o33355_iterations), p_o33355_persistence, float(seed_o33355))
|
|
||||||
|
|
||||||
func cellular6(uv : Vector2) -> Color:
|
|
||||||
return NoiseFBM.cellular6(uv, Vector2(p_o33355_scale_x, p_o33355_scale_y), 1, int(p_o33355_iterations), p_o33355_persistence, float(seed_o33355))
|
|
||||||
|
|
||||||
func reffg():
|
|
||||||
return false
|
|
||||||
|
|
||||||
func reff(bb):
|
|
||||||
if bb:
|
|
||||||
gen()
|
|
||||||
|
|
@ -1,64 +0,0 @@
|
|||||||
tool
|
|
||||||
extends MMNode
|
|
||||||
|
|
||||||
var Commons = preload("res://addons/mat_maker_gd/nodes/common/commons.gd")
|
|
||||||
|
|
||||||
var image : Image
|
|
||||||
var tex : ImageTexture
|
|
||||||
|
|
||||||
export(Vector2) var bmin : Vector2 = Vector2(0.1, 0.1)
|
|
||||||
export(Vector2) var bmax : Vector2 = Vector2(1, 1)
|
|
||||||
|
|
||||||
export(bool) var refresh setget reff,reffg
|
|
||||||
|
|
||||||
func _ready():
|
|
||||||
if !Engine.editor_hint:
|
|
||||||
gen()
|
|
||||||
|
|
||||||
|
|
||||||
func gen() -> void:
|
|
||||||
if !image:
|
|
||||||
image = Image.new()
|
|
||||||
image.create(300, 300, false, Image.FORMAT_RGBA8)
|
|
||||||
|
|
||||||
if !tex:
|
|
||||||
tex = ImageTexture.new()
|
|
||||||
|
|
||||||
# var bmin : Vector2 = Vector2(0.1, 0.1)
|
|
||||||
# var bmax : Vector2 = Vector2(1, 1)
|
|
||||||
|
|
||||||
image.lock()
|
|
||||||
|
|
||||||
var w : float = image.get_width()
|
|
||||||
var h : float = image.get_width()
|
|
||||||
|
|
||||||
var pseed : float = randf() + randi()
|
|
||||||
|
|
||||||
for x in range(image.get_width()):
|
|
||||||
for y in range(image.get_height()):
|
|
||||||
var v : Vector2 = Vector2(x / w, y / h)
|
|
||||||
|
|
||||||
# var f : float = pattern(v, 4, 4, CombinerType.MULTIPLY, CombinerAxisType.SINE, CombinerAxisType.SINE)
|
|
||||||
|
|
||||||
var col : Color = nc(v)
|
|
||||||
|
|
||||||
image.set_pixel(x, y, col)
|
|
||||||
|
|
||||||
|
|
||||||
image.unlock()
|
|
||||||
|
|
||||||
tex.create_from_image(image)
|
|
||||||
# texture = tex
|
|
||||||
|
|
||||||
var seed_o26210 = 7313;
|
|
||||||
|
|
||||||
func nc(uv : Vector2) -> Color:
|
|
||||||
return Commons.noise_color(uv, seed_o26210)
|
|
||||||
|
|
||||||
func reffg():
|
|
||||||
return false
|
|
||||||
|
|
||||||
func reff(bb):
|
|
||||||
if bb:
|
|
||||||
gen()
|
|
||||||
|
|
@ -1,78 +0,0 @@
|
|||||||
tool
|
|
||||||
extends MMNode
|
|
||||||
|
|
||||||
var NoiseVoronoi = preload("res://addons/mat_maker_gd/nodes/common/noise_voronoi.gd")
|
|
||||||
|
|
||||||
var image : Image
|
|
||||||
var tex : ImageTexture
|
|
||||||
|
|
||||||
export(Vector2) var bmin : Vector2 = Vector2(0.1, 0.1)
|
|
||||||
export(Vector2) var bmax : Vector2 = Vector2(1, 1)
|
|
||||||
|
|
||||||
export(bool) var refresh setget reff,reffg
|
|
||||||
|
|
||||||
func _ready():
|
|
||||||
if !Engine.editor_hint:
|
|
||||||
gen()
|
|
||||||
|
|
||||||
|
|
||||||
func gen() -> void:
|
|
||||||
if !image:
|
|
||||||
image = Image.new()
|
|
||||||
image.create(300, 300, false, Image.FORMAT_RGBA8)
|
|
||||||
|
|
||||||
if !tex:
|
|
||||||
tex = ImageTexture.new()
|
|
||||||
|
|
||||||
# var bmin : Vector2 = Vector2(0.1, 0.1)
|
|
||||||
# var bmax : Vector2 = Vector2(1, 1)
|
|
||||||
|
|
||||||
image.lock()
|
|
||||||
|
|
||||||
var w : float = image.get_width()
|
|
||||||
var h : float = image.get_width()
|
|
||||||
|
|
||||||
var pseed : float = randf() + randi()
|
|
||||||
|
|
||||||
for x in range(image.get_width()):
|
|
||||||
for y in range(image.get_height()):
|
|
||||||
var v : Vector2 = Vector2(x / w, y / h)
|
|
||||||
|
|
||||||
# var f : float = pattern(v, 4, 4, CombinerType.MULTIPLY, CombinerAxisType.SINE, CombinerAxisType.SINE)
|
|
||||||
|
|
||||||
# var col : Color = voron_1(v)
|
|
||||||
# var col : Color = voron_2(v)
|
|
||||||
var col : Color = voron_3(v)
|
|
||||||
|
|
||||||
image.set_pixel(x, y, col)
|
|
||||||
|
|
||||||
|
|
||||||
image.unlock()
|
|
||||||
|
|
||||||
tex.create_from_image(image)
|
|
||||||
# texture = tex
|
|
||||||
|
|
||||||
var seed_o8689 = 11667;
|
|
||||||
var p_o8689_scale_x = 4.000000000;
|
|
||||||
var p_o8689_scale_y = 4.000000000;
|
|
||||||
var p_o8689_stretch_x = 1.000000000;
|
|
||||||
var p_o8689_stretch_y = 1.000000000;
|
|
||||||
var p_o8689_intensity = 1.000000000;
|
|
||||||
var p_o8689_randomness = 0.750000000;
|
|
||||||
|
|
||||||
func voron_1(uv : Vector2) -> Color:
|
|
||||||
return NoiseVoronoi.voronoi_1(uv, Vector2(p_o8689_scale_x, p_o8689_scale_y), Vector2(p_o8689_stretch_y, p_o8689_stretch_x), p_o8689_intensity, p_o8689_randomness, seed_o8689)
|
|
||||||
|
|
||||||
func voron_2(uv : Vector2) -> Color:
|
|
||||||
return NoiseVoronoi.voronoi_2(uv, Vector2(p_o8689_scale_x, p_o8689_scale_y), Vector2(p_o8689_stretch_y, p_o8689_stretch_x), p_o8689_intensity, p_o8689_randomness, seed_o8689)
|
|
||||||
|
|
||||||
func voron_3(uv : Vector2) -> Color:
|
|
||||||
return NoiseVoronoi.voronoi_3(uv, Vector2(p_o8689_scale_x, p_o8689_scale_y), Vector2(p_o8689_stretch_y, p_o8689_stretch_x), p_o8689_intensity, p_o8689_randomness, seed_o8689)
|
|
||||||
|
|
||||||
func reffg():
|
|
||||||
return false
|
|
||||||
|
|
||||||
func reff(bb):
|
|
||||||
if bb:
|
|
||||||
gen()
|
|
||||||
|
|
@ -1,73 +0,0 @@
|
|||||||
tool
|
|
||||||
extends MMNode
|
|
||||||
|
|
||||||
var Commons = preload("res://addons/mat_maker_gd/nodes/common/commons.gd")
|
|
||||||
|
|
||||||
var image : Image
|
|
||||||
var tex : ImageTexture
|
|
||||||
|
|
||||||
export(Vector2) var bmin : Vector2 = Vector2(0.1, 0.1)
|
|
||||||
export(Vector2) var bmax : Vector2 = Vector2(1, 1)
|
|
||||||
|
|
||||||
export(bool) var refresh setget reff,reffg
|
|
||||||
|
|
||||||
func _ready():
|
|
||||||
if !Engine.editor_hint:
|
|
||||||
gen()
|
|
||||||
|
|
||||||
|
|
||||||
func gen() -> void:
|
|
||||||
if !image:
|
|
||||||
image = Image.new()
|
|
||||||
image.create(300, 300, false, Image.FORMAT_RGBA8)
|
|
||||||
|
|
||||||
if !tex:
|
|
||||||
tex = ImageTexture.new()
|
|
||||||
|
|
||||||
# var bmin : Vector2 = Vector2(0.1, 0.1)
|
|
||||||
# var bmax : Vector2 = Vector2(1, 1)
|
|
||||||
|
|
||||||
image.lock()
|
|
||||||
|
|
||||||
var w : float = image.get_width()
|
|
||||||
var h : float = image.get_width()
|
|
||||||
|
|
||||||
var pseed : float = randf() + randi()
|
|
||||||
|
|
||||||
for x in range(image.get_width()):
|
|
||||||
for y in range(image.get_height()):
|
|
||||||
var v : Vector2 = Vector2(x / w, y / h)
|
|
||||||
|
|
||||||
# var f : float = pattern(v, 4, 4, CombinerType.MULTIPLY, CombinerAxisType.SINE, CombinerAxisType.SINE)
|
|
||||||
|
|
||||||
var col : Color = sinewave(v)
|
|
||||||
# var col : Color = beehive_2_col(v)
|
|
||||||
# var col : Color = beehive_3_col(v)
|
|
||||||
|
|
||||||
image.set_pixel(x, y, col)
|
|
||||||
|
|
||||||
|
|
||||||
image.unlock()
|
|
||||||
|
|
||||||
tex.create_from_image(image)
|
|
||||||
# texture = tex
|
|
||||||
|
|
||||||
var seed_o28198 = 53932;
|
|
||||||
var p_o28198_scale_x = 4.000000000;
|
|
||||||
var p_o28198_scale_y = 4.000000000;
|
|
||||||
var p_o28198_iterations = 3.000000000;
|
|
||||||
var p_o28198_persistence = 0.500000000;
|
|
||||||
|
|
||||||
func sinewave(uv : Vector2) -> Color:
|
|
||||||
|
|
||||||
var f : Vector3 = Commons.perlin_color(((uv)), Vector2(p_o28198_scale_x, p_o28198_scale_y), int(p_o28198_iterations), p_o28198_persistence, seed_o28198);
|
|
||||||
|
|
||||||
return Color(f.x, f.y, f.z, 1)
|
|
||||||
|
|
||||||
func reffg():
|
|
||||||
return false
|
|
||||||
|
|
||||||
func reff(bb):
|
|
||||||
if bb:
|
|
||||||
gen()
|
|
||||||
|
|
@ -1,76 +0,0 @@
|
|||||||
tool
|
|
||||||
extends MMNode
|
|
||||||
|
|
||||||
var Commons = preload("res://addons/mat_maker_gd/nodes/common/commons.gd")
|
|
||||||
var NoisePerlin = preload("res://addons/mat_maker_gd/nodes/common/noise_perlin.gd")
|
|
||||||
|
|
||||||
var image : Image
|
|
||||||
var tex : ImageTexture
|
|
||||||
|
|
||||||
export(Vector2) var bmin : Vector2 = Vector2(0.1, 0.1)
|
|
||||||
export(Vector2) var bmax : Vector2 = Vector2(1, 1)
|
|
||||||
|
|
||||||
export(bool) var refresh setget reff,reffg
|
|
||||||
|
|
||||||
func _ready():
|
|
||||||
if !Engine.editor_hint:
|
|
||||||
gen()
|
|
||||||
|
|
||||||
|
|
||||||
func gen() -> void:
|
|
||||||
if !image:
|
|
||||||
image = Image.new()
|
|
||||||
image.create(300, 300, false, Image.FORMAT_RGBA8)
|
|
||||||
|
|
||||||
if !tex:
|
|
||||||
tex = ImageTexture.new()
|
|
||||||
|
|
||||||
# var bmin : Vector2 = Vector2(0.1, 0.1)
|
|
||||||
# var bmax : Vector2 = Vector2(1, 1)
|
|
||||||
|
|
||||||
image.lock()
|
|
||||||
|
|
||||||
var w : float = image.get_width()
|
|
||||||
var h : float = image.get_width()
|
|
||||||
|
|
||||||
var pseed : float = randf() + randi()
|
|
||||||
|
|
||||||
for x in range(image.get_width()):
|
|
||||||
for y in range(image.get_height()):
|
|
||||||
var v : Vector2 = Vector2(x / w, y / h)
|
|
||||||
|
|
||||||
# var f : float = pattern(v, 4, 4, CombinerType.MULTIPLY, CombinerAxisType.SINE, CombinerAxisType.SINE)
|
|
||||||
|
|
||||||
var col : Color = perlin_warp_1(v)
|
|
||||||
# var col : Color = beehive_2_col(v)
|
|
||||||
# var col : Color = beehive_3_col(v)
|
|
||||||
|
|
||||||
image.set_pixel(x, y, col)
|
|
||||||
|
|
||||||
|
|
||||||
image.unlock()
|
|
||||||
|
|
||||||
tex.create_from_image(image)
|
|
||||||
# texture = tex
|
|
||||||
|
|
||||||
var p_o41835_translate_x = 0.500000000;
|
|
||||||
var p_o41835_translate_y = 0.500000000;
|
|
||||||
var p_o41835_rotate = 0.000000000;
|
|
||||||
var p_o41835_scale_x = 1.000000000;
|
|
||||||
var p_o41835_scale_y = 1.000000000;
|
|
||||||
var seed_o41836 = 31052;
|
|
||||||
var p_o41836_scale_x = 4.000000000;
|
|
||||||
var p_o41836_scale_y = 4.000000000;
|
|
||||||
var p_o41836_iterations = 3.000000000;
|
|
||||||
var p_o41836_persistence = 0.500000000;
|
|
||||||
|
|
||||||
func perlin_warp_1(uv : Vector2) -> Color:
|
|
||||||
return NoisePerlin.perlin_warp_1(uv, Vector2(p_o41835_scale_x, p_o41835_scale_y), int(p_o41836_iterations), p_o41836_persistence, seed_o41836, Vector2(p_o41835_translate_x, p_o41835_translate_y), p_o41835_rotate, Vector2(p_o41836_scale_x, p_o41836_scale_y))
|
|
||||||
|
|
||||||
func reffg():
|
|
||||||
return false
|
|
||||||
|
|
||||||
func reff(bb):
|
|
||||||
if bb:
|
|
||||||
gen()
|
|
||||||
|
|
@ -1,82 +0,0 @@
|
|||||||
tool
|
|
||||||
extends MMNode
|
|
||||||
|
|
||||||
var Commons = preload("res://addons/mat_maker_gd/nodes/common/commons.gd")
|
|
||||||
var NoisePerlin = preload("res://addons/mat_maker_gd/nodes/common/noise_perlin.gd")
|
|
||||||
|
|
||||||
var image : Image
|
|
||||||
var tex : ImageTexture
|
|
||||||
|
|
||||||
export(Vector2) var bmin : Vector2 = Vector2(0.1, 0.1)
|
|
||||||
export(Vector2) var bmax : Vector2 = Vector2(1, 1)
|
|
||||||
|
|
||||||
export(bool) var refresh setget reff,reffg
|
|
||||||
|
|
||||||
func _ready():
|
|
||||||
if !Engine.editor_hint:
|
|
||||||
gen()
|
|
||||||
|
|
||||||
|
|
||||||
func gen() -> void:
|
|
||||||
if !image:
|
|
||||||
image = Image.new()
|
|
||||||
image.create(300, 300, false, Image.FORMAT_RGBA8)
|
|
||||||
|
|
||||||
if !tex:
|
|
||||||
tex = ImageTexture.new()
|
|
||||||
|
|
||||||
# var bmin : Vector2 = Vector2(0.1, 0.1)
|
|
||||||
# var bmax : Vector2 = Vector2(1, 1)
|
|
||||||
|
|
||||||
image.lock()
|
|
||||||
|
|
||||||
var w : float = image.get_width()
|
|
||||||
var h : float = image.get_width()
|
|
||||||
|
|
||||||
var pseed : float = randf() + randi()
|
|
||||||
|
|
||||||
for x in range(image.get_width()):
|
|
||||||
for y in range(image.get_height()):
|
|
||||||
var v : Vector2 = Vector2(x / w, y / h)
|
|
||||||
|
|
||||||
# var f : float = pattern(v, 4, 4, CombinerType.MULTIPLY, CombinerAxisType.SINE, CombinerAxisType.SINE)
|
|
||||||
|
|
||||||
var col : Color = perlin_warp_2(v)
|
|
||||||
# var col : Color = beehive_2_col(v)
|
|
||||||
# var col : Color = beehive_3_col(v)
|
|
||||||
|
|
||||||
image.set_pixel(x, y, col)
|
|
||||||
|
|
||||||
|
|
||||||
image.unlock()
|
|
||||||
|
|
||||||
tex.create_from_image(image)
|
|
||||||
# texture = tex
|
|
||||||
|
|
||||||
var p_o56044_translate_x = 0.500000000;
|
|
||||||
var p_o56044_translate_y = 0.500000000;
|
|
||||||
var p_o56044_rotate = 0.000000000;
|
|
||||||
var p_o56044_scale_x = 1.000000000;
|
|
||||||
var p_o56044_scale_y = 1.000000000;
|
|
||||||
var p_o56039_translate_x = 0.500000000;
|
|
||||||
var p_o56039_translate_y = 0.500000000;
|
|
||||||
var p_o56039_rotate = 0.000000000;
|
|
||||||
var p_o56039_scale_x = 1.000000000;
|
|
||||||
var p_o56039_scale_y = 1.000000000;
|
|
||||||
var seed_o56040 = 26697;
|
|
||||||
var p_o56040_scale_x = 4.000000000;
|
|
||||||
var p_o56040_scale_y = 4.000000000;
|
|
||||||
var p_o56040_iterations = 3.000000000;
|
|
||||||
var p_o56040_persistence = 0.500000000;
|
|
||||||
|
|
||||||
func perlin_warp_2(uv : Vector2) -> Color:
|
|
||||||
return NoisePerlin.perlin_warp_2(uv, Vector2(p_o56044_scale_x, p_o56044_scale_y), int(p_o56040_iterations), p_o56040_persistence, seed_o56040, Vector2(p_o56044_translate_x, p_o56044_translate_y), p_o56044_rotate, Vector2(p_o56040_scale_x, p_o56040_scale_y))
|
|
||||||
|
|
||||||
|
|
||||||
func reffg():
|
|
||||||
return false
|
|
||||||
|
|
||||||
func reff(bb):
|
|
||||||
if bb:
|
|
||||||
gen()
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user