material-maker/addons/procedural_material/perlin.gd
RodZill4 9443940d9a More nodes and load/save
Added basic colorize and blend nodes
Started implementing loading and saving texture graphs (most nodes need an update to support this)
2018-07-22 23:25:05 +02:00

18 lines
498 B
GDScript

tool
extends "res://addons/procedural_material/node_base.gd"
var iterations
var turbulence
func _ready():
set_slot(0, false, 0, Color(0.5, 0.5, 1), true, 0, Color(0.5, 0.5, 1))
initialize_properties([ $GridContainer/iterations, $GridContainer/turbulence ])
func get_shader_code(uv):
var rv = { defs="", code="" }
if !generated:
rv.defs = "float "+name+"_f(vec2 uv) { return perlin(uv, "+str(iterations)+", "+str(turbulence)+"); }\n"
generated = true
rv.f = name+"_f("+uv+")"
return rv