1
0
mirror of https://github.com/DigvijaysinhGohil/Godot-Shader-Lib.git synced 2025-01-05 00:53:36 +08:00

Code refactored to incorporate #6

This commit is contained in:
Digvijaysinh Gohil 2024-09-28 00:45:16 +05:30
parent 199f4a772a
commit a98305fa5f
49 changed files with 85 additions and 83 deletions

View File

@ -1,5 +1,5 @@
@tool
class_name VisualShaderNodeAdjustmentContrast extends VisualShaderNodeCustom
class_name VisualShaderNodeAdjustmentContrast extends ShaderLib
func _get_name() -> String:
return "Contrast"
@ -47,7 +47,7 @@ func _get_output_port_type(port: int) -> PortType:
return PORT_TYPE_VECTOR_3D
func _get_global_code(mode: Shader.Mode) -> String:
return "#include \"res://addons/ShaderLib/Artistic/Artistic.gdshaderinc\""
return "#include \"res://addons/ShaderLib_%s/Artistic/Artistic.gdshaderinc\"" % [version]
func _get_code(input_vars: Array[String], output_vars: Array[String], mode: Shader.Mode, type: VisualShader.Type) -> String:
var input: String = "vec3(1.0)"

View File

@ -1,5 +1,5 @@
@tool
class_name VisualShaderNodeAdjustmentHue extends VisualShaderNodeCustom
class_name VisualShaderNodeAdjustmentHue extends ShaderLib
func _get_name() -> String:
return "Hue"
@ -59,7 +59,7 @@ func _get_property_options(index: int) -> PackedStringArray:
return ["Degrees", "Normalize"]
func _get_global_code(mode: Shader.Mode) -> String:
return "#include \"res://addons/ShaderLib/Artistic/Artistic.gdshaderinc\""
return "#include \"res://addons/ShaderLib_%s/Artistic/Artistic.gdshaderinc\"" % [version]
func _get_code(input_vars: Array[String], output_vars: Array[String], mode: Shader.Mode, type: VisualShader.Type) -> String:
var range_index: int = get_option_index(0)

View File

@ -1,5 +1,5 @@
@tool
class_name VisualShaderNodeAdjustmentReplaceColor extends VisualShaderNodeCustom
class_name VisualShaderNodeAdjustmentReplaceColor extends ShaderLib
func _get_name() -> String:
return "ReplaceColor"
@ -55,7 +55,7 @@ func _get_output_port_type(port: int) -> PortType:
return PORT_TYPE_VECTOR_3D
func _get_global_code(mode: Shader.Mode) -> String:
return "#include \"res://addons/ShaderLib/Artistic/Artistic.gdshaderinc\""
return "#include \"res://addons/ShaderLib_%s/Artistic/Artistic.gdshaderinc\"" % [version]
func _get_code(input_vars: Array[String], output_vars: Array[String], mode: Shader.Mode, type: VisualShader.Type) -> String:
var input: String = "vec3(1.0)"

View File

@ -1,5 +1,5 @@
@tool
class_name VisualShaderNodeAdjustmentSaturation extends VisualShaderNodeCustom
class_name VisualShaderNodeAdjustmentSaturation extends ShaderLib
func _get_name() -> String:
@ -48,7 +48,7 @@ func _get_output_port_type(port: int) -> PortType:
return PORT_TYPE_VECTOR_3D
func _get_global_code(mode: Shader.Mode) -> String:
return "#include \"res://addons/ShaderLib/Artistic/Artistic.gdshaderinc\""
return "#include \"res://addons/ShaderLib_%s/Artistic/Artistic.gdshaderinc\"" % [version]
func _get_code(input_vars: Array[String], output_vars: Array[String], mode: Shader.Mode, type: VisualShader.Type) -> String:
var input: String = "vec3(1.0)"

View File

@ -1,5 +1,5 @@
@tool
class_name VisualShaderNodeWhiteBalance extends VisualShaderNodeCustom
class_name VisualShaderNodeWhiteBalance extends ShaderLib
func _get_name() -> String:
return "WhiteBalance"
@ -49,7 +49,7 @@ func _get_output_port_type(port: int) -> PortType:
return PORT_TYPE_VECTOR_3D
func _get_global_code(mode: Shader.Mode) -> String:
return "#include \"res://addons/ShaderLib/Artistic/Artistic.gdshaderinc\""
return "#include \"res://addons/ShaderLib_%s/Artistic/Artistic.gdshaderinc\"" % [version]
func _get_code(input_vars: Array[String], output_vars: Array[String], mode: Shader.Mode, type: VisualShader.Type) -> String:
var input: String = "vec3(1.0)"

View File

@ -1,5 +1,5 @@
@tool
class_name VisualShaderNodeMaskColorMask extends VisualShaderNodeCustom
class_name VisualShaderNodeMaskColorMask extends ShaderLib
func _get_name() -> String:
return "ColorMask"
@ -53,7 +53,7 @@ func _get_output_port_type(port: int) -> PortType:
return PORT_TYPE_VECTOR_4D
func _get_global_code(mode: Shader.Mode) -> String:
return "#include \"res://addons/ShaderLib/Artistic/Artistic.gdshaderinc\""
return "#include \"res://addons/ShaderLib_%s/Artistic/Artistic.gdshaderinc\"" % [version]
func _get_code(input_vars: Array[String], output_vars: Array[String], mode: Shader.Mode, type: VisualShader.Type) -> String:
var input: String = "vec3(0.0)"

View File

@ -1,5 +1,5 @@
@tool
class_name VisualShaderNodeGeometryMeshNode extends VisualShaderNodeCustom
class_name VisualShaderNodeGeometryMeshNode extends ShaderLib
func _get_name() -> String:
return "MeshNode"
@ -42,7 +42,7 @@ func _is_available(mode: Shader.Mode, type: VisualShader.Type) -> bool:
return false
func _get_global_code(mode: Shader.Mode) -> String:
return "#include \"res://addons/ShaderLib/Geometry/Geometry.gdshaderinc\""
return "#include \"res://addons/ShaderLib_%s/Geometry/Geometry.gdshaderinc\"" % [version]
func _get_code(input_vars: Array[String], output_vars: Array[String], mode: Shader.Mode, type: VisualShader.Type) -> String:
var code: String

View File

@ -1,5 +1,5 @@
@tool
class_name VisualShaderNodeScalarSmoothMax extends VisualShaderNodeCustom
class_name VisualShaderNodeScalarSmoothMax extends ShaderLib
func _get_name() -> String:
return "SmoothMax"
@ -45,7 +45,7 @@ func _get_output_port_type(port: int) -> PortType:
return PORT_TYPE_SCALAR
func _get_global_code(mode: Shader.Mode) -> String:
return "#include \"res://addons/ShaderLib/Maths/Maths.gdshaderinc\""
return "#include \"res://addons/ShaderLib_%s/Maths/Maths.gdshaderinc\"" % [version]
func _get_code(input_vars: Array[String], output_vars: Array[String], mode: Shader.Mode, type: VisualShader.Type) -> String:
var a: String = input_vars[0]

View File

@ -1,5 +1,5 @@
@tool
class_name VisualShaderNodeScalarSmoothMin extends VisualShaderNodeCustom
class_name VisualShaderNodeScalarSmoothMin extends ShaderLib
func _get_name() -> String:
return "SmoothMin"
@ -45,7 +45,7 @@ func _get_output_port_type(port: int) -> PortType:
return PORT_TYPE_SCALAR
func _get_global_code(mode: Shader.Mode) -> String:
return "#include \"res://addons/ShaderLib/Maths/Maths.gdshaderinc\""
return "#include \"res://addons/ShaderLib_%s/Maths/Maths.gdshaderinc\"" % [version]
func _get_code(input_vars: Array[String], output_vars: Array[String], mode: Shader.Mode, type: VisualShader.Type) -> String:
var a: String = input_vars[0]

View File

@ -1,5 +1,5 @@
@tool
class_name VisualShaderNodeMathsChebyshevDistance extends VisualShaderNodeCustom
class_name VisualShaderNodeMathsChebyshevDistance extends ShaderLib
func _get_name() -> String:
return "ChebyshevDistance"
@ -66,7 +66,7 @@ func _get_property_options(index: int) -> PackedStringArray:
return ["Vector2", "Vector3"]
func _get_global_code(mode: Shader.Mode) -> String:
return "#include \"res://addons/ShaderLib/Maths/Maths.gdshaderinc\""
return "#include \"res://addons/ShaderLib_%s/Maths/Maths.gdshaderinc\"" % [version]
func _get_code(input_vars: Array[String], output_vars: Array[String], mode: Shader.Mode, type: VisualShader.Type) -> String:
var point_a: String
@ -92,4 +92,3 @@ func _get_code(input_vars: Array[String], output_vars: Array[String], mode: Shad
return output_vars[0] + " = chebyshev_distance_2d(%s, %s, %s);" % [point_a, point_b, power]
_:
return output_vars[0] + " = chebyshev_distance_3d(%s, %s, %s);" % [point_a, point_b, power]

View File

@ -1,5 +1,5 @@
@tool
class_name VisualShaderNodeMathsManhattanDistance extends VisualShaderNodeCustom
class_name VisualShaderNodeMathsManhattanDistance extends ShaderLib
func _get_name() -> String:
return "ManhattanDistance"
@ -53,7 +53,7 @@ func _get_property_options(index: int) -> PackedStringArray:
return ["Vector2", "Vector3"]
func _get_global_code(mode: Shader.Mode) -> String:
return "#include \"res://addons/ShaderLib/Maths/Maths.gdshaderinc\""
return "#include \"res://addons/ShaderLib_%s/Maths/Maths.gdshaderinc\"" % [version]
func _get_code(input_vars: Array[String], output_vars: Array[String], mode: Shader.Mode, type: VisualShader.Type) -> String:
var point_a: String
@ -78,4 +78,3 @@ func _get_code(input_vars: Array[String], output_vars: Array[String], mode: Shad
return output_vars[0] + " = manhattan_distance_2d(%s, %s);" % [point_a, point_b]
_:
return output_vars[0] + " = manhattan_distance_3d(%s, %s);" % [point_a, point_b]

View File

@ -1,5 +1,5 @@
@tool
class_name VisualShaderNodeVectorProject extends VisualShaderNodeCustom
class_name VisualShaderNodeVectorProject extends ShaderLib
func _get_name() -> String:
return "Project"
@ -63,7 +63,7 @@ func _get_property_options(index: int) -> PackedStringArray:
return ["Vector2", "Vector3"]
func _get_global_code(mode: Shader.Mode) -> String:
return "#include \"res://addons/ShaderLib/Maths/Maths.gdshaderinc\""
return "#include \"res://addons/ShaderLib_%s/Maths/Maths.gdshaderinc\"" % [version]
func _get_code(input_vars: Array[String], output_vars: Array[String], mode: Shader.Mode, type: VisualShader.Type) -> String:
var vector_a: String = input_vars[0]

View File

@ -1,5 +1,5 @@
@tool
class_name VisualShaderNodeVectorProjectOnPlane extends VisualShaderNodeCustom
class_name VisualShaderNodeVectorProjectOnPlane extends ShaderLib
func _get_name() -> String:
return "ProjectOnPlane"
@ -36,7 +36,7 @@ func _get_output_port_type(port: int) -> PortType:
return PORT_TYPE_VECTOR_3D
func _get_global_code(mode: Shader.Mode) -> String:
return "#include \"res://addons/ShaderLib/Maths/Maths.gdshaderinc\""
return "#include \"res://addons/ShaderLib_%s/Maths/Maths.gdshaderinc\"" % [version]
func _get_code(input_vars: Array[String], output_vars: Array[String], mode: Shader.Mode, type: VisualShader.Type) -> String:
var vector_a: String = input_vars[0]

View File

@ -1,5 +1,5 @@
@tool
class_name VisualShaderNodeVectorTransform extends VisualShaderNodeCustom
class_name VisualShaderNodeVectorTransform extends ShaderLib
func _get_name() -> String:
return "VectorTransform"
@ -55,7 +55,7 @@ func _is_available(mode: Shader.Mode, type: VisualShader.Type) -> bool:
return mode == Shader.MODE_SPATIAL
func _get_global_code(mode: Shader.Mode) -> String:
return "#include \"res://addons/ShaderLib/Maths/Maths.gdshaderinc\""
return "#include \"res://addons/ShaderLib_%s/Maths/Maths.gdshaderinc\"" % [version]
func _get_code(input_vars: Array[String], output_vars: Array[String], mode: Shader.Mode, type: VisualShader.Type) -> String:
var code: String

View File

@ -1,5 +1,5 @@
@tool
class_name VisualShaderNodeMathsNoiseSineWave extends VisualShaderNodeCustom
class_name VisualShaderNodeMathsNoiseSineWave extends ShaderLib
func _get_name() -> String:
return "NoiseSineWave"
@ -87,7 +87,7 @@ func _get_property_options(index: int) -> PackedStringArray:
return ["Vector1", "Vector2", "Vector3", "Vector4"]
func _get_global_code(mode: Shader.Mode) -> String:
return "#include \"res://addons/ShaderLib/Maths/Maths.gdshaderinc\""
return "#include \"res://addons/ShaderLib_%s/Maths/Maths.gdshaderinc\"" % [version]
func _get_code(input_vars: Array[String], output_vars: Array[String], mode: Shader.Mode, type: VisualShader.Type) -> String:
var input: String

View File

@ -1,5 +1,5 @@
@tool
class_name VisualShaderNodeMathsSawtoothWave extends VisualShaderNodeCustom
class_name VisualShaderNodeMathsSawtoothWave extends ShaderLib
func _get_name() -> String:
return "SawtoothWave"
@ -71,7 +71,7 @@ func _get_property_options(index: int) -> PackedStringArray:
return ["Vector1", "Vector2", "Vector3", "Vector4"]
func _get_global_code(mode: Shader.Mode) -> String:
return "#include \"res://addons/ShaderLib/Maths/Maths.gdshaderinc\""
return "#include \"res://addons/ShaderLib_%s/Maths/Maths.gdshaderinc\"" % [version]
func _get_code(input_vars: Array[String], output_vars: Array[String], mode: Shader.Mode, type: VisualShader.Type) -> String:
var input: String

View File

@ -1,5 +1,5 @@
@tool
class_name VisualShaderNodeMathsSquareWave extends VisualShaderNodeCustom
class_name VisualShaderNodeMathsSquareWave extends ShaderLib
func _get_name() -> String:
@ -72,7 +72,7 @@ func _get_property_options(index: int) -> PackedStringArray:
return ["Vector1", "Vector2", "Vector3", "Vector4"]
func _get_global_code(mode: Shader.Mode) -> String:
return "#include \"res://addons/ShaderLib/Maths/Maths.gdshaderinc\""
return "#include \"res://addons/ShaderLib_%s/Maths/Maths.gdshaderinc\"" % [version]
func _get_code(input_vars: Array[String], output_vars: Array[String], mode: Shader.Mode, type: VisualShader.Type) -> String:
var input: String

View File

@ -1,5 +1,5 @@
@tool
class_name VisualShaderNodeMathsTriangleWave extends VisualShaderNodeCustom
class_name VisualShaderNodeMathsTriangleWave extends ShaderLib
func _get_name() -> String:
return "TriangleWave"
@ -70,7 +70,7 @@ func _get_property_options(index: int) -> PackedStringArray:
return ["Vector1", "Vector2", "Vector3", "Vector4"]
func _get_global_code(mode: Shader.Mode) -> String:
return "#include \"res://addons/ShaderLib/Maths/Maths.gdshaderinc\""
return "#include \"res://addons/ShaderLib_%s/Maths/Maths.gdshaderinc\"" % [version]
func _get_code(input_vars: Array[String], output_vars: Array[String], mode: Shader.Mode, type: VisualShader.Type) -> String:
var input: String

View File

@ -1,5 +1,5 @@
@tool
class_name VisualShaderNodeProceduralCheckerBoard extends VisualShaderNodeCustom
class_name VisualShaderNodeProceduralCheckerBoard extends ShaderLib
func _init() -> void:
output_port_for_preview = 0
@ -60,7 +60,7 @@ func _get_output_port_type(port: int) -> VisualShaderNode.PortType:
return PORT_TYPE_VECTOR_3D
func _get_global_code(mode: Shader.Mode) -> String:
return "#include \"res://addons/ShaderLib/Procedural/Procedural.gdshaderinc\""
return "#include \"res://addons/ShaderLib_%s/Procedural/Procedural.gdshaderinc\"" % [version]
func _get_code(input_vars: Array[String], output_vars: Array[String], mode: Shader.Mode, type: VisualShader.Type) -> String:
var uv: String = "UV"

View File

@ -1,5 +1,5 @@
@tool
class_name VisualShaderNodeProceduralKochFractal extends VisualShaderNodeCustom
class_name VisualShaderNodeProceduralKochFractal extends ShaderLib
func _init() -> void:
output_port_for_preview = 0
@ -68,7 +68,7 @@ func _get_output_port_type(port: int) -> PortType:
return PORT_TYPE_SCALAR
func _get_global_code(mode: Shader.Mode) -> String:
return "#include \"res://addons/ShaderLib/Procedural/Procedural.gdshaderinc\""
return "#include \"res://addons/ShaderLib_%s/Procedural/Procedural.gdshaderinc\"" % [version]
func _get_code(input_vars: Array[String], output_vars: Array[String], mode: Shader.Mode, type: VisualShader.Type) -> String:
var uv: String = "UV"
@ -82,4 +82,3 @@ func _get_code(input_vars: Array[String], output_vars: Array[String], mode: Shad
var height: String = input_vars[4]
return output_vars[0] + " = koch_fractal(%s, %s, %s, %s, %s, %s);" % [uv, thickness, iterations, width, height, output_vars[1]]

View File

@ -1,5 +1,5 @@
@tool
class_name VisualShaderNodeProceduralHeightToNormal extends VisualShaderNodeCustom
class_name VisualShaderNodeProceduralHeightToNormal extends ShaderLib
func _get_name() -> String:
return "HeightToNormal"
@ -52,7 +52,7 @@ func _get_output_port_type(port: int) -> PortType:
return PORT_TYPE_VECTOR_3D
func _get_global_code(mode: Shader.Mode) -> String:
return "#include \"res://addons/ShaderLib/Procedural/Procedural.gdshaderinc\""
return "#include \"res://addons/ShaderLib_%s/Procedural/Procedural.gdshaderinc\"" % [version]
func _get_code(input_vars: Array[String], output_vars: Array[String], mode: Shader.Mode, type: VisualShader.Type) -> String:
var uv: String = "UV"

View File

@ -1,5 +1,5 @@
@tool
class_name VisualShaderNodeProceduralGradientNoise extends VisualShaderNodeCustom
class_name VisualShaderNodeProceduralGradientNoise extends ShaderLib
func _init() -> void:
output_port_for_preview = 0
@ -52,7 +52,7 @@ func _get_output_port_type(port: int) -> VisualShaderNode.PortType:
return PORT_TYPE_SCALAR
func _get_global_code(mode: Shader.Mode) -> String:
return "#include \"res://addons/ShaderLib/Procedural/Procedural.gdshaderinc\""
return "#include \"res://addons/ShaderLib_%s/Procedural/Procedural.gdshaderinc\"" % [version]
func _get_code(input_vars: Array[String], output_vars: Array[String], mode: Shader.Mode, type: VisualShader.Type) -> String:
var uv: String = "UV"

View File

@ -1,5 +1,5 @@
@tool
class_name VisualShaderNodeProceduralGyroidNoise extends VisualShaderNodeCustom
class_name VisualShaderNodeProceduralGyroidNoise extends ShaderLib
func _init() -> void:
output_port_for_preview = 0
@ -62,7 +62,7 @@ func _get_output_port_type(port: int) -> PortType:
return PORT_TYPE_SCALAR
func _get_global_code(mode: Shader.Mode) -> String:
return "#include \"res://addons/ShaderLib/Procedural/Procedural.gdshaderinc\""
return "#include \"res://addons/ShaderLib_%s/Procedural/Procedural.gdshaderinc\"" % [version]
func _get_code(input_vars: Array[String], output_vars: Array[String], mode: Shader.Mode, type: VisualShader.Type) -> String:
var uv: String = "UV"

View File

@ -1,5 +1,5 @@
@tool
class_name VisualShaderNodePseudoRandomNoise extends VisualShaderNodeCustom
class_name VisualShaderNodePseudoRandomNoise extends ShaderLib
func _init() -> void:
output_port_for_preview = 0
@ -41,5 +41,8 @@ func _get_output_port_name(port: int) -> String:
func _get_output_port_type(port: int) -> PortType:
return PORT_TYPE_SCALAR
func _get_global_code(mode: Shader.Mode) -> String:
return "#include \"res://addons/ShaderLib_%s/Procedural/Procedural.gdshaderinc\"" % [version]
func _get_code(input_vars: Array[String], output_vars: Array[String], mode: Shader.Mode, type: VisualShader.Type) -> String:
return output_vars[0] + " = pseudo_random_noise(UV, %s);" % input_vars[0]

View File

@ -1,5 +1,5 @@
@tool
class_name VisualShaderNodeProceduralSimpleNoise extends VisualShaderNodeCustom
class_name VisualShaderNodeProceduralSimpleNoise extends ShaderLib
func _init() -> void:
output_port_for_preview = 0
@ -56,7 +56,7 @@ func _get_output_port_type(port: int) -> VisualShaderNode.PortType:
return PORT_TYPE_SCALAR
func _get_global_code(mode: Shader.Mode) -> String:
return "#include \"res://addons/ShaderLib/Procedural/Procedural.gdshaderinc\""
return "#include \"res://addons/ShaderLib_%s/Procedural/Procedural.gdshaderinc\"" % [version]
func _get_code(input_vars: Array[String], output_vars: Array[String], mode: Shader.Mode, type: VisualShader.Type) -> String:
var uv: String = "UV"

View File

@ -1,5 +1,5 @@
@tool
class_name VisualShaderNodeProceduralVoronoi extends VisualShaderNodeCustom
class_name VisualShaderNodeProceduralVoronoi extends ShaderLib
func _init() -> void:
output_port_for_preview = 0
@ -101,7 +101,7 @@ func _get_property_options(index: int) -> PackedStringArray:
return ["Euclidean", "Manhattan", "Chebyshev"]
func _get_global_code(mode: Shader.Mode) -> String:
return "#include \"res://addons/ShaderLib/Procedural/Procedural.gdshaderinc\""
return "#include \"res://addons/ShaderLib_%s/Procedural/Procedural.gdshaderinc\"" % [version]
func _get_code(input_vars: Array[String], output_vars: Array[String], mode: Shader.Mode, type: VisualShader.Type) -> String:
var uv: String = "UV"

View File

@ -1,4 +1,4 @@
#include "res://addons/ShaderLib/Maths/Maths.gdshaderinc"
#include "res://addons/ShaderLib_v2_2_4/Maths/Maths.gdshaderinc"
vec3 checker_board(vec2 uv, vec3 color_a, vec3 color_b, vec2 frequency) {
uv = (uv.xy + 0.5) * frequency;

View File

@ -1,5 +1,5 @@
@tool
class_name VisualShaderNodeProceduralEllipse extends VisualShaderNodeCustom
class_name VisualShaderNodeProceduralEllipse extends ShaderLib
func _init() -> void:
output_port_for_preview = 0
@ -54,7 +54,7 @@ func _get_output_port_type(port: int) -> VisualShaderNode.PortType:
return PORT_TYPE_SCALAR
func _get_global_code(mode: Shader.Mode) -> String:
return "#include \"res://addons/ShaderLib/Procedural/Procedural.gdshaderinc\""
return "#include \"res://addons/ShaderLib_%s/Procedural/Procedural.gdshaderinc\"" % [version]
func _get_code(input_vars: Array[String], output_vars: Array[String], mode: Shader.Mode, type: VisualShader.Type) -> String:
var uv: String = "UV"

View File

@ -1,5 +1,5 @@
@tool
class_name VisualShaderNodeProceduralPolygon extends VisualShaderNodeCustom
class_name VisualShaderNodeProceduralPolygon extends ShaderLib
func _init() -> void:
output_port_for_preview = 0
@ -60,7 +60,7 @@ func _get_output_port_type(port: int) -> VisualShaderNode.PortType:
return PORT_TYPE_SCALAR
func _get_global_code(mode: Shader.Mode) -> String:
return "#include \"res://addons/ShaderLib/Procedural/Procedural.gdshaderinc\""
return "#include \"res://addons/ShaderLib_%s/Procedural/Procedural.gdshaderinc\"" % [version]
func _get_code(input_vars: Array[String], output_vars: Array[String], mode: Shader.Mode, type: VisualShader.Type) -> String:
var uv: String = "UV"

View File

@ -1,5 +1,5 @@
@tool
class_name VisualShaderNodeProceduralRectangle extends VisualShaderNodeCustom
class_name VisualShaderNodeProceduralRectangle extends ShaderLib
func _init() -> void:
output_port_for_preview = 0
@ -54,7 +54,7 @@ func _get_output_port_type(port: int) -> VisualShaderNode.PortType:
return PORT_TYPE_SCALAR
func _get_global_code(mode: Shader.Mode) -> String:
return "#include \"res://addons/ShaderLib/Procedural/Procedural.gdshaderinc\""
return "#include \"res://addons/ShaderLib_%s/Procedural/Procedural.gdshaderinc\"" % [version]
func _get_code(input_vars: Array[String], output_vars: Array[String], mode: Shader.Mode, type: VisualShader.Type) -> String:
var uv: String = "UV"

View File

@ -1,5 +1,5 @@
@tool
class_name VisualShaderNodeProceduralRoundedPolygon extends VisualShaderNodeCustom
class_name VisualShaderNodeProceduralRoundedPolygon extends ShaderLib
func _init() -> void:
output_port_for_preview = 0
@ -61,7 +61,7 @@ func _get_output_port_type(port: int) -> VisualShaderNode.PortType:
return PORT_TYPE_SCALAR
func _get_global_code(mode: Shader.Mode) -> String:
return "#include \"res://addons/ShaderLib/Procedural/Procedural.gdshaderinc\""
return "#include \"res://addons/ShaderLib_%s/Procedural/Procedural.gdshaderinc\"" % [version]
func _get_code(input_vars: Array[String], output_vars: Array[String], mode: Shader.Mode, type: VisualShader.Type) -> String:
var uv: String = "UV"

View File

@ -1,5 +1,5 @@
@tool
class_name VisualShaderNodeProceduralRoundedRectangle extends VisualShaderNodeCustom
class_name VisualShaderNodeProceduralRoundedRectangle extends ShaderLib
func _init() -> void:
output_port_for_preview = 0
@ -58,7 +58,7 @@ func _get_output_port_type(port: int) -> VisualShaderNode.PortType:
return PORT_TYPE_SCALAR
func _get_global_code(mode: Shader.Mode) -> String:
return "#include \"res://addons/ShaderLib/Procedural/Procedural.gdshaderinc\""
return "#include \"res://addons/ShaderLib_%s/Procedural/Procedural.gdshaderinc\"" % [version]
func _get_code(input_vars: Array[String], output_vars: Array[String], mode: Shader.Mode, type: VisualShader.Type) -> String:
var uv: String = "UV"

View File

@ -1,5 +1,5 @@
@tool
class_name VisualShaderNodeRayMarch extends VisualShaderNodeCustom
class_name VisualShaderNodeRayMarch extends ShaderLib
func _get_name() -> String:
return "RayMarch"
@ -183,7 +183,7 @@ func _get_output_port_type(port: int) -> PortType:
return PORT_TYPE_SCALAR
func _get_global_code(mode: Shader.Mode) -> String:
return "#include \"res://addons/ShaderLib/RayMarching/SignedDistanceFunctions.gdshaderinc\""
return "#include \"res://addons/ShaderLib_%s/RayMarching/SignedDistanceFunctions.gdshaderinc\"" % [version]
func _get_code(input_vars: Array[String], output_vars: Array[String], mode: Shader.Mode, type: VisualShader.Type) -> String:
var sdf_index: int = get_option_index(0)
@ -222,4 +222,3 @@ func _get_code(input_vars: Array[String], output_vars: Array[String], mode: Shad
var small_radius: String = input_vars[7]
var big_radius: String = input_vars[8]
return output_vars[0] + " = ray_march_sd_torus(%s, %s, %s, %s, %s, %s, %s, %s, %s);" % [ray_origin, ray_direction, max_steps, max_dist, dist_threshold, torus_pos, eulers, small_radius, big_radius]

View File

@ -0,0 +1,3 @@
class_name ShaderLib extends VisualShaderNodeCustom
var version: String = "v2_2_4"

View File

@ -1,5 +1,5 @@
@tool
class_name VisualShaderNodeUVFlipbook extends VisualShaderNodeCustom
class_name VisualShaderNodeUVFlipbook extends ShaderLib
func _get_name() -> String:
return "Flipbook"
@ -57,7 +57,7 @@ func _get_output_port_type(port: int) -> VisualShaderNode.PortType:
return PORT_TYPE_VECTOR_2D
func _get_global_code(mode: Shader.Mode) -> String:
return "#include \"res://addons/ShaderLib/UV/UV.gdshaderinc\""
return "#include \"res://addons/ShaderLib_%s/UV/UV.gdshaderinc\"" % [version]
func _is_available(mode: Shader.Mode, type: VisualShader.Type) -> bool:
match mode:

View File

@ -1,5 +1,5 @@
@tool
class_name VisualShaderNodeUVParallaxMapping extends VisualShaderNodeCustom
class_name VisualShaderNodeUVParallaxMapping extends ShaderLib
func _get_name() -> String:
return "ParallaxMapping"
@ -55,7 +55,7 @@ func _is_available(mode: Shader.Mode, type: VisualShader.Type) -> bool:
return false
func _get_global_code(mode: Shader.Mode) -> String:
return "#include \"res://addons/ShaderLib/UV/UV.gdshaderinc\""
return "#include \"res://addons/ShaderLib_%s/UV/UV.gdshaderinc\"" % [version]
func _get_code(input_vars: Array[String], output_vars: Array[String], mode: Shader.Mode, type: VisualShader.Type) -> String:
var height_map: String = input_vars[0]

View File

@ -1,5 +1,5 @@
@tool
class_name VisualShaderNodeUVRadialShear extends VisualShaderNodeCustom
class_name VisualShaderNodeUVRadialShear extends ShaderLib
func _get_name() -> String:
return "RadialShear"
@ -57,7 +57,7 @@ func _get_output_port_type(port: int) -> VisualShaderNode.PortType:
return PORT_TYPE_VECTOR_2D
func _get_global_code(mode: Shader.Mode) -> String:
return "#include \"res://addons/ShaderLib/UV/UV.gdshaderinc\""
return "#include \"res://addons/ShaderLib_%s/UV/UV.gdshaderinc\"" % [version]
func _get_code(input_vars: Array[String], output_vars: Array[String], mode: Shader.Mode, type: VisualShader.Type) -> String:
var uv: String

View File

@ -1,5 +1,5 @@
@tool
class_name VisualShaderNodeUVRotate extends VisualShaderNodeCustom
class_name VisualShaderNodeUVRotate extends ShaderLib
func _get_name() -> String:
return "Rotate"
@ -65,7 +65,7 @@ func _get_property_options(index: int) -> PackedStringArray:
return ["Degrees", "Radians"]
func _get_global_code(mode: Shader.Mode) -> String:
return "#include \"res://addons/ShaderLib/UV/UV.gdshaderinc\""
return "#include \"res://addons/ShaderLib_%s/UV/UV.gdshaderinc\"" % [version]
func _get_code(input_vars: Array[String], output_vars: Array[String], mode: Shader.Mode, type: VisualShader.Type) -> String:
var uv: String

View File

@ -1,5 +1,5 @@
@tool
class_name VisualShaderNodeUVSpherize extends VisualShaderNodeCustom
class_name VisualShaderNodeUVSpherize extends ShaderLib
func _get_name() -> String:
return "Spherize"
@ -57,7 +57,7 @@ func _get_output_port_type(port: int) -> VisualShaderNode.PortType:
return PORT_TYPE_VECTOR_2D
func _get_global_code(mode: Shader.Mode) -> String:
return "#include \"res://addons/ShaderLib/UV/UV.gdshaderinc\""
return "#include \"res://addons/ShaderLib_%s/UV/UV.gdshaderinc\"" % [version]
func _get_code(input_vars: Array[String], output_vars: Array[String], mode: Shader.Mode, type: VisualShader.Type) -> String:
var uv: String

View File

@ -1,5 +1,5 @@
@tool
class_name VisualShaderNodeUVSwirl extends VisualShaderNodeCustom
class_name VisualShaderNodeUVSwirl extends ShaderLib
func _get_name() -> String:
return "Swirl"
@ -57,7 +57,7 @@ func _get_output_port_type(port: int) -> VisualShaderNode.PortType:
return PORT_TYPE_VECTOR_2D
func _get_global_code(mode: Shader.Mode) -> String:
return "#include \"res://addons/ShaderLib/UV/UV.gdshaderinc\""
return "#include \"res://addons/ShaderLib_%s/UV/UV.gdshaderinc\"" % [version]
func _get_code(input_vars: Array[String], output_vars: Array[String], mode: Shader.Mode, type: VisualShader.Type) -> String:
var uv: String

View File

@ -1,5 +1,5 @@
@tool
class_name VisualShaderNodeUVTilingAndOffset extends VisualShaderNodeCustom
class_name VisualShaderNodeUVTilingAndOffset extends ShaderLib
func _get_name() -> String:
return "TilingAndOffset"

View File

@ -1,5 +1,5 @@
@tool
class_name VisualShaderNodeUVTwirl extends VisualShaderNodeCustom
class_name VisualShaderNodeUVTwirl extends ShaderLib
func _get_name() -> String:
return "Twirl"
@ -57,7 +57,7 @@ func _get_output_port_type(port: int) -> VisualShaderNode.PortType:
return PORT_TYPE_VECTOR_2D
func _get_global_code(mode: Shader.Mode) -> String:
return "#include \"res://addons/ShaderLib/UV/UV.gdshaderinc\""
return "#include \"res://addons/ShaderLib_%s/UV/UV.gdshaderinc\"" % [version]
func _get_code(input_vars: Array[String], output_vars: Array[String], mode: Shader.Mode, type: VisualShader.Type) -> String:
var uv: String