summaryrefslogtreecommitdiffstats
path: root/custom_shaders
diff options
context:
space:
mode:
authorMalfurious <m@lfurio.us>2022-09-08 20:31:19 -0400
committerMalfurious <m@lfurio.us>2022-09-08 20:31:19 -0400
commit7a79224edaebd9b1f9fefc3169114c8f1bcade1f (patch)
treeedd30e28055535583ebb07825b1c8b34e203f161 /custom_shaders
parent44e739bb05542d1249ccf8388bd15b3f0b052e0c (diff)
parentff5e9214e671af7a7c7c238207e5d6086eba2936 (diff)
downloadproject-s-7a79224edaebd9b1f9fefc3169114c8f1bcade1f.tar.gz
project-s-7a79224edaebd9b1f9fefc3169114c8f1bcade1f.zip
Merge tag 'pull-first-map-design' of https://normalmode.org/mika/project-s
Add generic testing map * tag 'pull-first-map-design' of https://normalmode.org/mika/project-s: Add generic testing map
Diffstat (limited to 'custom_shaders')
-rw-r--r--custom_shaders/liquid.gdshader28
1 files changed, 28 insertions, 0 deletions
diff --git a/custom_shaders/liquid.gdshader b/custom_shaders/liquid.gdshader
new file mode 100644
index 0000000..b5b913b
--- /dev/null
+++ b/custom_shaders/liquid.gdshader
@@ -0,0 +1,28 @@
+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