2021-10-01 00:54:13 +02:00
|
|
|
tool
|
2021-10-04 11:54:52 +02:00
|
|
|
extends MMNode
|
2021-10-01 00:54:13 +02:00
|
|
|
|
2021-10-02 18:45:29 +02:00
|
|
|
var NoisePerlin = preload("res://addons/mat_maker_gd/nodes/common/noise_perlin.gd")
|
2021-10-01 23:07:05 +02:00
|
|
|
|
2021-10-01 00:54:13 +02:00
|
|
|
var image : Image
|
|
|
|
var tex : ImageTexture
|
|
|
|
|
2021-10-04 13:15:18 +02:00
|
|
|
export(Vector2) var scale : Vector2 = Vector2(4, 4)
|
|
|
|
export(int) var iterations : int = 3
|
|
|
|
export(float) var persistence : float = 0.5
|
2021-10-01 00:54:13 +02:00
|
|
|
|
2021-10-04 13:15:18 +02:00
|
|
|
func get_value_for(uv : Vector2, slot_idx : int, pseed : int) -> Color:
|
|
|
|
return NoisePerlin.perlinc(uv, scale, iterations, persistence, pseed)
|
2021-10-01 00:54:13 +02:00
|
|
|
|
2021-10-04 13:09:43 +02:00
|
|
|
func register_methods(mm_graph_node) -> void:
|
|
|
|
mm_graph_node.add_slot_texture(0, 0, "recalculate_image", "")
|
2021-10-01 00:54:13 +02:00
|
|
|
|