diff options
author | Malfurious <m@lfurio.us> | 2023-04-24 07:50:00 -0400 |
---|---|---|
committer | Malfurious <m@lfurio.us> | 2023-04-24 07:50:00 -0400 |
commit | 97dd79339284b033774ac74a04dd4a255475261a (patch) | |
tree | 951d3c29e676c14c9f165b32143e9aaae8ec4f6a /godot3-prototype/custom_shaders/liquid.gdshader | |
parent | 53091fce91ce03aae208bd0c61ee28830b34387d (diff) | |
download | project-s-master.tar.gz project-s-master.zip |
Signed-off-by: Malfurious <m@lfurio.us>
Diffstat (limited to 'godot3-prototype/custom_shaders/liquid.gdshader')
-rw-r--r-- | godot3-prototype/custom_shaders/liquid.gdshader | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/godot3-prototype/custom_shaders/liquid.gdshader b/godot3-prototype/custom_shaders/liquid.gdshader new file mode 100644 index 0000000..529f25c --- /dev/null +++ b/godot3-prototype/custom_shaders/liquid.gdshader @@ -0,0 +1,26 @@ +shader_type spatial; + +//frag shader variables +uniform vec4 albedo : hint_color; +uniform float alpha : hint_range(0.0, 1.0); +uniform float normal_speed : hint_range(0.0, 1.0); +uniform float normal_map_scale : hint_range(0.0, 10.0); +uniform float roughness : hint_range(0.0, 1.0); +uniform sampler2D normal : hint_normal; + +//Vertex shader variables +uniform float wave_speed : hint_range(0.0, 10.0); +uniform float wave_height : hint_range(0.0, 10.0); + +void fragment() { + vec2 moving_uv = UV + (TIME * normal_speed); + + ALBEDO = albedo.rgb; + ALPHA = alpha; + ROUGHNESS = roughness; + NORMALMAP = texture(normal, moving_uv * normal_map_scale).xyz; +} + +void vertex() { + VERTEX.y = sin(TIME + VERTEX.x * wave_speed) * wave_height; +}
\ No newline at end of file |