From ff5e9214e671af7a7c7c238207e5d6086eba2936 Mon Sep 17 00:00:00 2001 From: mikatomik Date: Tue, 19 Jul 2022 07:24:13 -0400 Subject: Add generic testing map Initial version of shipyard map implemented for testing. Base_char mesh and goo-gun meshes property "use in baked light" set to true during experiment with GI probes for global illumination. Label added to view model to display in-game FPS. Main camera "far" property turned up to 500 so the whole map can be drawn. General purpose liquid shader added for use as water in shipyard_map. World default environment updated for visual quality. Shader_Compiler.gd implemented to combat stuttering when compiling shaders on the fly. This may be obsolete with the release of Godot 3.5 that introduced async compilation. Signed-off-by: mikatomik --- custom_shaders/liquid.gdshader | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 custom_shaders/liquid.gdshader (limited to 'custom_shaders') 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 -- cgit v1.2.3