mirror of
https://github.com/Relintai/material-maker.git
synced 2024-12-27 23:17:14 +01:00
ee0bc96f30
Updated all nodes so parameters are located in a "parameters" variable. Started writing a generic node model whose behavior is defined in a json file. Should be able to replace all generators so far. Wrote json files for bricks and noise nodes. Started preparing a custom node.
13 lines
390 B
GDScript
13 lines
390 B
GDScript
tool
|
|
extends "res://addons/material_maker/node_base.gd"
|
|
|
|
const SHAPES = [ "circle", "polygon", "star", "curved_star", "rays" ]
|
|
|
|
func _ready():
|
|
initialize_properties([ $shape, $sides, $radius, $edge ])
|
|
|
|
func _get_shader_code(uv):
|
|
var rv = { defs="", code="" }
|
|
rv.f = "%s(%s, %d, %f, %f)" % [ SHAPES[parameters.shape], uv, parameters.sides, parameters.radius, parameters.edge ]
|
|
return rv
|