1
0
mirror of https://github.com/DigvijaysinhGohil/Godot-Shader-Lib.git synced 2025-01-05 00:53:36 +08:00
Digvijaysinh Gohil 64dead8a82 RotateUV node updated
- RotateUV node now has a much intuitive dropdown for Degrees and Radians.
2024-01-12 00:36:04 +05:30
2024-01-12 00:36:04 +05:30
2023-10-15 00:17:16 +05:30
2023-10-12 00:17:14 +05:30
2024-01-12 00:36:04 +05:30
2023-12-24 20:18:30 +05:30
2023-12-24 20:56:10 +05:30

Godot-Shader-Lib

Visual shader node library for Godot engine. The addon supports Godot versions 4.x!

Adds various extra nodes to use in built-in visual shader editor.

Installation

Copy the contents of addons/ShaderLib into the same folder in your project. No activation needed. Custom visual shader nodes work the same way as standard visual shader nodes.

If you don't immediatly see new nodes under Addons category, simply reload your project.

Uninstallation

Delete the contents of addons/ShaderLib folder from your project. Make sure to delete it using the Godot editor instead of your default file system program.

Nodes documentation

Geometry nodes

Node Scale World node

Provides accees to node scale in world space.

Outputs

Name Type Binding Description
scale vec3 None Node/object scale in world space


Maths nodes

Wave

Noise Sine Wave node

Returns the sine of the value of input in. For variance, psuedo-random noise is added to the amplitude of the sine wave, within a range determined by input min max.

Inputs

Name Type Binding Description
in Dynamic vector none Input value
min max vec2 none Minimum and Maximum values for noise intensity

Outputs

Name Type Binding Description
out Dynamic vector None Output value

Sawtooth Wave node

Returns a sawtooth wave from the value of input in. Resulting output values will be between -1 and 1.

Inputs

Name Type Binding Description
in Dynamic vector none Input value

Outputs

Name Type Binding Description
out Dynamic vector None Output value

Square Wave node

Returns a square wave from the value of input in. Resulting output values will be between -1 and 1.

Inputs

Name Type Binding Description
in Dynamic vector none Input value

Outputs

Name Type Binding Description
out Dynamic vector None Output value

Triangle Wave node

Returns a triangle wave from the value of input in. Resulting output values will be between -1 and 1.

Inputs

Name Type Binding Description
in Dynamic vector none Input value

Outputs

Name Type Binding Description
out Dynamic vector None Output value


Procedural nodes

Checker Board node

Generates a checkerboard of alternating colors between inputs color A and color B based on input UV.

Inputs

Name Type Binding Description
uv vec2 UV Input UV value
color a vec3 none First checker color
color b vec3 none Second checker color
frequency vec2 none Scale of checkerboard per axis

Outputs

Name Type Binding Description
output vec3 None Output checkerboard value

Noise

Gradient Noise node

Generates a gradient, or Perlin noise based on input UV. The resulting output values will be between -1 and 1.

Inputs

Name Type Binding Description
uv vec2 UV Input UV value
scale float none Noise scale

Outputs

Name Type Binding Description
output float None Output noise value

Pseudo Random Noise node

Generates a pseudo random noise based on input seed. The resulting output values will be between 0 and 1.

Inputs

Name Type Binding Description
seed float none Input seed

Outputs

Name Type Binding Description
output float None Output noise value

Simple Noise node

Generates a simplex, or value noise based on input UV. The resulting output values will be between 0 and 1.

Inputs

Name Type Binding Description
uv vec2 UV Input UV value
scale float none Noise scale

Outputs

Name Type Binding Description
output float None Output noise value

Voronoi node

Generates a Voronoi or Worley noise based on input UV. Voronoi noise is generated by calculating distances between a pixel and a lattice of points. By offsetting these points by a pseudo-random number, controlled by angle offset, a cluster of cells can be generated.

Inputs

Name Type Binding Description
uv vec2 UV Input UV value
cell density float none Density of generated cells
angle offset float none Offset values for points

Outputs

Name Type Binding Description
output float None Output noise value
cells float None Raw cell data

Shapes

Ellipse node

Generates an ellipse shape based on input UV at the size specified by inputs width and height. The generated shape can be offset or tiled by connecting a TilingAndOffset node. Note that in order to preserve the ability to offset the shape within the UV space the shape will not automatically repeat if tiled. To achieve a repeating dot effect first connect your TilingAndOffset output through a Fract node.

Inputs

Name Type Binding Description
uv vec2 UV Input UV value
width float none Ellipse width
height float none Ellipse height

Outputs

Name Type Binding Description
output float None Output ellipse value

Polygon node

Generates a regular polygon shape based on input UV at the size specified by inputs width and height. The polygon's amount of sides is determined by input sides. The generated shape can be offset or tiled by connecting a TilingAndOffset node. Note that in order to preserve the ability to offset the shape within the UV space the shape will not automatically repeat if tiled. To achieve a repeating polygon effect first connect your TilingAndOffset output through a Fract node.

Inputs

Name Type Binding Description
uv vec2 UV Input UV value
sides int none Number of sides of the polygon
width float none Polygon width
height float none Polygon height

Outputs

Name Type Binding Description
output float None Output polygon value

Rectangle node

Generates a rectangle shape based on input UV at the size specified by inputs width and height. The generated shape can be offset or tiled by connecting a TilingAndOffset node. Note that in order to preserve the ability to offset the shape within the UV space the shape will not automatically repeat if tiled. To achieve a repeating rectangle effect first connect your TilingAndOffset output through a Fract node.

Inputs

Name Type Binding Description
uv vec2 UV Input UV value
width float none Rectangle width
height float none Rectangle height

Outputs

Name Type Binding Description
output float None Output rectangle value

Rounded Polygon node

Generates a rounded polygon shape based on input UV at the size specified by inputs width and height. The polygon's amount of sides is determined by input sides. The radius of each corner is defined by input roundnesss. The generated shape can be offset or tiled by connecting a TilingAndOffset node. Note that in order to preserve the ability to offset the shape within the UV space the shape will not automatically repeat if tiled. To achieve a repeating rounded polygon effect first connect your TilingAndOffset output through a Fract node.

Inputs

Name Type Binding Description
uv vec2 UV Input UV value
width float none Rounded polygon width
height float none Rounded polygon height
sides int none Number of sides of the polygon
roundness float none Corner radius

Outputs

Name Type Binding Description
output float None Output rounded polygon value

Rounded Rectangle node

Generates a rounded rectangle shape based on input UV at the size specified by inputs width and height. The radius of each corner is defined by input radius. The generated shape can be offset or tiled by connecting a TilingAndOffset node. Note that in order to preserve the ability to offset the shape within the UV space the shape will not automatically repeat if tiled. To achieve a repeating rounded rectangle effect first connect your TilingAndOffset output through a Fract node.

Inputs

Name Type Binding Description
uv vec2 UV Input UV value
width float none Rounded rectangle width
height float none Rounded rectangle height
radius float none Corner radius

Outputs

Name Type Binding Description
output float None Output rounded rectangle value


UV nodes

Default value for uv input will be vec2(0, 0) for shader modes PARTICLES, SKY and FOG to avoid errors becouse UV variable is not available for these modes.

Flipbook node

Creates a flipbook, or texture sheet animation, of the UVs supplied to input UV. The amount of tiles on the sheet are defined by the values of the inputs rows and columns. This node can be used to create a texture animation functionality, commonly used for particle effects and sprites.

This node is only available in shader modes SPATIAL and CANVAS ITEM.

Inputs

Name Type Binding Description
uv vec2 UV Input UV value
rows int none Amount of horizontal tiles in texture sheet
columns int none Amount of vertical tiles in texture sheet
start frame int none Start tile index texture sheet
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

Parallax mapping node

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.

This node is only available in shader modes SPATIAL and CANVAS ITEM.

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
uv vec2 None Output UV value

Radial Shear node

Applies a radial shear warping effect similar to a wave to the value of input UV.

Inputs

Name Type Binding Description
uv vec2 UV Input UV value
center vec2 none Center reference point
strength float none Strength of the effect
offset vec2 none Individual channel offsets

Outputs

Name Type Binding Description
uv vec2 None Output UV value

Rotate node

Rotates value of input UV around a reference point defined by input center by the amount of input rotation.

Inputs

Name Type Binding Description
uv vec2 UV Input UV value
center vec2 none Center reference point
rotation float none Rotation amount in radians
use degrees bool none Use degrees instead of radians for rotation amount

Outputs

Name Type Binding Description
uv vec2 None Output UV value

Spherize node

Applies a spherical warping effect similar to a fisheye camera lens to the value of input UV.

Inputs

Name Type Binding Description
uv vec2 UV Input UV value
center vec2 none Center reference point
strength float none Strength of the effect
offset vec2 none Individual channel offsets

Outputs

Name Type Binding Description
uv vec2 None Output UV value

Swirl node

Applies a swirl warping effect similar to a black hole to the value of input UV. Very similar to Twirl node, key difference is it uses the inverse of vector length (One minus).

Inputs

Name Type Binding Description
uv vec2 UV Input UV value
center vec2 none Center reference point
strength float none Strength of the effect
offset vec2 none Individual channel offsets

Outputs

Name Type Binding Description
uv vec2 None Output UV value

Tiling and Offset node

Tiles and offsets the value of input UV by the inputs tiling and offset respectively. This is commonly used for detail maps and scrolling textures over TIME.

Inputs

Name Type Binding Description
uv vec2 UV Input UV value
tiling vec2 none Amount of tiling to apply per channel
offset vec2 none Amount of offset to apply per channel

Outputs

Name Type Binding Description
uv vec2 None Output UV value

Twirl node

Applies a twirl warping effect similar to a black hole to the value of input UV. Very similar to Swirl node, key difference is it uses the length of a vector.

Inputs

Name Type Binding Description
uv vec2 UV Input UV value
center vec2 none Center reference point
strength float none Strength of the effect
offset vec2 none Individual channel offsets

Outputs

Name Type Binding Description
uv vec2 None Output UV value

Description
Godot引擎的视觉着色器库
Readme MIT
Languages
GDScript 100%