material-maker/addons/procedural_material/nodes/material.gd
RodZill4 d04a319944 Prepared all nodes for caching and added Image node
Added Image node that can be used to import textures
Renamed all get_shader_code methods to _get_shader code so a caching system can be integrated in node_base (and we can get rid of get_source_rgb and get_source_f functions)
2018-07-26 08:31:28 +02:00

24 lines
623 B
GDScript

tool
extends "res://addons/procedural_material/node_base.gd"
func _ready():
set_slot(0, true, 0, Color(0.5, 0.5, 1), false, 0, Color(0.5, 0.5, 1))
set_slot(1, true, 0, Color(0.5, 0.5, 1), false, 0, Color(0.5, 0.5, 1))
func _get_shader_code(uv):
var rv = { defs="", code="", f="0.0" }
var src = get_source()
if src != null:
rv = src.get_shader_code(uv)
rv.albedo = get_source_rgb(rv)
src = get_source(1)
if src != null:
var src_code = src.get_shader_code(uv)
rv.defs += src_code.defs
rv.code += src_code.code
rv.normal_map = get_source_rgb(src_code)
return rv
func _get_state_variables():
return [ ]