1
0
mirror of https://github.com/DigvijaysinhGohil/Godot-Shader-Lib.git synced 2025-09-20 12:25:59 +08:00

ShaderInc files refactored for the ease of future improvements

This commit is contained in:
Digvijaysinh Gohil
2024-07-21 16:39:45 +05:30
parent 0a8948118f
commit e33f70baa9
125 changed files with 706 additions and 733 deletions

View File

@ -42,11 +42,10 @@ func _is_available(mode: Shader.Mode, type: VisualShader.Type) -> bool:
return false
func _get_global_code(mode: Shader.Mode) -> String:
var code: String = preload("MeshNode.gdshaderinc").code
return code
return "#include \"res://addons/ShaderLib/Geometry/Geometry.gdshaderinc\""
func _get_code(input_vars: Array[String], output_vars: Array[String], mode: Shader.Mode, type: VisualShader.Type) -> String:
var code: String
code = "%s = NODE_POSITION_WORLD;" % output_vars[0]
code += "\n%s = geometry_node_scale_world(MODEL_MATRIX);" % output_vars[1]
code += "\n%s = node_scale_world(MODEL_MATRIX);" % output_vars[1]
return code