Cheap water shader

Unshade cheap deform water, with texture BW caustics 256px.

Shader code
shader_type spatial;
render_mode specular_schlick_ggx, unshaded, cull_back, async_visible;//

uniform vec4 tint_color : hint_color = vec4( 0.3, 0.4, 0.45, 1.0);
uniform sampler2D caustics : hint_white;
uniform float slowdown : hint_range( 0.1, 10.0, 0.1 ) = 5.0;
uniform float time_caust : hint_range( 0.01, 1.0, 0.01 ) = 0.13;
uniform float caust_form : hint_range( 0.01, 1.0, 0.01 ) = 0.15;
uniform float tile: hint_range( 0.1, 16.0, 0.1 ) = 4.0;

void fragment() {

// Caustics
	float caustics_form = texture(caustics , UV * (tile + sin(TIME / slowdown) * time_caust )).r;//
	vec2 caustics_uv =  UV * (tile + cos(TIME / slowdown) * time_caust ) + caustics_form * caust_form ;
	float caustics_final = texture(caustics, caustics_uv).r;
	ALBEDO = (1.0-SCREEN_UV.y) * caustics_final * tint_color.rgb ;
	ALPHA = min(SCREEN_UV.y + 0.5, 1.0 ) * tint_color.a;
		
}
Tags
sea, water
The shader code and all code snippets in this post are under CC0 license and can be used freely without the author's permission. Images and videos, and assets depicted in those, do not fall under this license. For more info, see our License terms.

More from WaltGD

Cheap terrain with fake normal map or POM

Cheap caustics

Related shaders

Cheap terrain with fake normal map or POM

Cheap caustics

Anime-esque Water Shader

guest

0 Comments
Inline Feedbacks
View all comments