mirror of
https://github.com/Relintai/material-maker.git
synced 2024-12-23 21:16:54 +01:00
d04a319944
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)
24 lines
623 B
GDScript
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 [ ]
|