1
0
mirror of https://github.com/DigvijaysinhGohil/Godot-Shader-Lib.git synced 2025-01-07 01:43:35 +08:00

Documentation for Parallax mapping node added

This commit is contained in:
Digvijaysinh Gohil 2023-12-24 20:54:36 +05:30
parent db2384c5df
commit d3a263f034
2 changed files with 24 additions and 0 deletions

View File

@ -307,6 +307,23 @@ This node can be used to create a texture animation functionality, commonly used
|end frame|int|none|End tile index texture sheet|
|anim speed|float|none|Animation speed|
**Outputs**
|Name|Type|Binding|Description|
|---|---|---|---|
|uv|vec2|None|Output UV value|
___
</details>
<details>
<summary><h3>Parallax mapping node</h3></summary>
The Parallax Mapping node lets you create a parallax effect that displaces a Material's UVs to create the illusion of depth inside a Material.<br><br><i>This node is only available in shader modes SPATIAL and CANVAS ITEM.</i>
<hr>
**Inputs**
|Name|Type|Binding|Description|
|---|---|---|---|
|height map|sampler2D|none|Height map texture|
|amplitude|float|none|amplitude or depth of the effect|
**Outputs**
|Name|Type|Binding|Description|
|---|---|---|---|

View File

@ -43,6 +43,13 @@ func _get_output_port_name(port: int) -> String:
func _get_output_port_type(port: int) -> VisualShaderNode.PortType:
return PORT_TYPE_VECTOR_2D
func _is_available(mode: Shader.Mode, type: VisualShader.Type) -> bool:
match mode:
0, 1:
return true
_:
return false
func _get_global_code(mode: Shader.Mode) -> String:
var code: String = preload("ParallaxMappingUV.gdshaderinc").code
return code