mirror of
https://github.com/Relintai/material-maker.git
synced 2025-01-25 18:59:18 +01:00
9443940d9a
Added basic colorize and blend nodes Started implementing loading and saving texture graphs (most nodes need an update to support this)
19 lines
505 B
GDScript
19 lines
505 B
GDScript
tool
|
|
extends "res://addons/procedural_material/node_base.gd"
|
|
|
|
var subdivide
|
|
var u
|
|
var v
|
|
|
|
func _ready():
|
|
set_slot(0, false, 0, Color(0.5, 0.5, 1), true, 0, Color(0.5, 0.5, 1))
|
|
initialize_properties([ $GridContainer/subdivide, $GridContainer/u, $GridContainer/v ])
|
|
|
|
func get_shader_code(uv):
|
|
var rv = { defs="", code="" }
|
|
if !generated:
|
|
rv.defs = "float "+name+"_f(vec2 uv) { return iqnoise(uv, "+str(subdivide)+", "+str(u)+", "+str(v)+"); }\n"
|
|
generated = true
|
|
rv.f = name+"_f("+uv+")"
|
|
return rv
|