basic.gd 924 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. # meta-description: Visual shader's node plugin template
  2. @tool
  3. # Having a class name is required for a custom node.
  4. class_name VisualShaderNode_CLASS_
  5. extends _BASE_
  6. func _get_name() -> String:
  7. return "_CLASS_"
  8. func _get_category() -> String:
  9. return ""
  10. func _get_description() -> String:
  11. return ""
  12. func _get_return_icon_type() -> PortType:
  13. return PORT_TYPE_SCALAR
  14. func _get_input_port_count() -> int:
  15. return 0
  16. func _get_input_port_name(port: int) -> String:
  17. return ""
  18. func _get_input_port_type(port: int) -> PortType:
  19. return PORT_TYPE_SCALAR
  20. func _get_output_port_count() -> int:
  21. return 1
  22. func _get_output_port_name(port: int) -> String:
  23. return "result"
  24. func _get_output_port_type(port: int) -> PortType:
  25. return PORT_TYPE_SCALAR
  26. func _get_code(input_vars: Array[String], output_vars: Array[String],
  27. mode: Shader.Mode, type: VisualShader.Type) -> String:
  28. return output_vars[0] + " = 0.0;"