2022-01-04 09:30:47 +01:00
|
|
|
# meta-description: Visual shader's node plugin template
|
|
|
|
|
|
|
|
@tool
|
2023-09-12 10:52:43 +02:00
|
|
|
# Having a class name is required for a custom node.
|
2022-01-04 09:30:47 +01:00
|
|
|
class_name VisualShaderNode_CLASS_
|
2022-03-28 04:00:02 +02:00
|
|
|
extends _BASE_
|
|
|
|
|
2022-01-04 09:30:47 +01:00
|
|
|
|
|
|
|
func _get_name() -> String:
|
|
|
|
return "_CLASS_"
|
|
|
|
|
2022-03-28 04:00:02 +02:00
|
|
|
|
2022-01-04 09:30:47 +01:00
|
|
|
func _get_category() -> String:
|
|
|
|
return ""
|
|
|
|
|
2022-03-28 04:00:02 +02:00
|
|
|
|
2022-01-04 09:30:47 +01:00
|
|
|
func _get_description() -> String:
|
|
|
|
return ""
|
|
|
|
|
2022-03-28 04:00:02 +02:00
|
|
|
|
2023-09-12 10:52:43 +02:00
|
|
|
func _get_return_icon_type() -> PortType:
|
2022-01-04 09:30:47 +01:00
|
|
|
return PORT_TYPE_SCALAR
|
|
|
|
|
2022-03-28 04:00:02 +02:00
|
|
|
|
2022-01-04 09:30:47 +01:00
|
|
|
func _get_input_port_count() -> int:
|
|
|
|
return 0
|
|
|
|
|
2022-03-28 04:00:02 +02:00
|
|
|
|
2022-01-04 09:30:47 +01:00
|
|
|
func _get_input_port_name(port: int) -> String:
|
|
|
|
return ""
|
|
|
|
|
2022-03-28 04:00:02 +02:00
|
|
|
|
2023-09-12 10:52:43 +02:00
|
|
|
func _get_input_port_type(port: int) -> PortType:
|
2022-01-04 09:30:47 +01:00
|
|
|
return PORT_TYPE_SCALAR
|
|
|
|
|
2022-03-28 04:00:02 +02:00
|
|
|
|
2022-01-04 09:30:47 +01:00
|
|
|
func _get_output_port_count() -> int:
|
|
|
|
return 1
|
|
|
|
|
2022-03-28 04:00:02 +02:00
|
|
|
|
2022-01-04 09:30:47 +01:00
|
|
|
func _get_output_port_name(port: int) -> String:
|
|
|
|
return "result"
|
|
|
|
|
2022-03-28 04:00:02 +02:00
|
|
|
|
2023-09-12 10:52:43 +02:00
|
|
|
func _get_output_port_type(port: int) -> PortType:
|
2022-01-04 09:30:47 +01:00
|
|
|
return PORT_TYPE_SCALAR
|
|
|
|
|
2022-03-28 04:00:02 +02:00
|
|
|
|
|
|
|
func _get_code(input_vars: Array[String], output_vars: Array[String],
|
2023-09-12 10:52:43 +02:00
|
|
|
mode: Shader.Mode, type: VisualShader.Type) -> String:
|
2022-01-04 09:30:47 +01:00
|
|
|
return output_vars[0] + " = 0.0;"
|