1
0
mirror of https://gitlab.com/kelteseth/ScreenPlay.git synced 2024-11-26 12:42:34 +01:00
ScreenPlay/ScreenPlayShader/water.frag

60 lines
2.2 KiB
GLSL
Raw Normal View History

2020-09-13 19:51:20 +02:00
#ifdef GL_ES
precision mediump float;
#endif
2020-09-10 17:05:19 +02:00
uniform sampler2D qt_Texture0;
varying vec4 qt_TexCoord0;
2020-09-13 19:51:20 +02:00
//uniform float reflectionOffset; // allows player to control reflection position
//uniform float reflectionBlur ; // works only if projec's driver is set to GLES3, more information here https://docs.godotengine.org/ru/stable/tutorials/shading/screen-reading_shaders.html
//uniform float calculatedOffset ; // this is controlled by script, it takes into account camera position and water object position, that way reflection stays in the same place when camera is moving
//uniform float calculatedAspect ; // is controlled by script, ensures that noise is not affected by object scale
//uniform sampler2D noiseTexture;
//uniform float offsetStrength;
//uniform float maxOffset;
2020-09-10 17:05:19 +02:00
2020-09-13 19:51:20 +02:00
//uniform vec2 distortionScale;
//uniform vec2 distortionSpeed;
2020-09-10 17:05:19 +02:00
2020-09-13 19:51:20 +02:00
//uniform float waveSmoothing;
2020-09-10 17:05:19 +02:00
2020-09-13 19:51:20 +02:00
//uniform float mainWaveSpeed ;
//uniform float mainWaveFrequency ;
//uniform float mainWaveAmplitude;
2020-09-10 17:05:19 +02:00
2020-09-13 19:51:20 +02:00
//uniform float secondWaveSpeed ;
//uniform float secondWaveFrequency ;
//uniform float secondWaveAmplitude ;
2020-09-10 17:05:19 +02:00
2020-09-13 19:51:20 +02:00
//uniform float thirdWaveSpeed ;
//uniform float thirdWaveFrequency ;
//uniform float thirdWaveAmplitude ;
2020-09-10 17:05:19 +02:00
2020-09-13 19:51:20 +02:00
//uniform float squashing ;
2020-09-10 17:05:19 +02:00
2020-09-13 19:51:20 +02:00
//uniform vec4 shorelineColor; //: hint_color = vec4(1.);
//uniform float shorelineSize; //: hint_range(0., 0.1) = 0.0025;
//uniform float shorelineFoamSize ; // : hint_range(0., 0.1)
//uniform float foamSpeed;
//uniform vec2 foamScale;
2020-09-10 17:05:19 +02:00
uniform float time;
void main(void)
{
2020-09-13 19:51:20 +02:00
vec2 uv = fragCoord.xy / iResolution.xy;
vec4 texture_color = vec4(0.192156862745098, 0.6627450980392157, 0.9333333333333333, 1.0);
vec4 k = vec4(time)*0.8;
k.xy = uv * 7.0;
float val1 = length(0.5-fract(k.xyw*=mat3(vec3(-2.0,-1.0,0.0), vec3(3.0,-1.0,1.0), vec3(1.0,-1.0,-1.0))*0.5));
float val2 = length(0.5-fract(k.xyw*=mat3(vec3(-2.0,-1.0,0.0), vec3(3.0,-1.0,1.0), vec3(1.0,-1.0,-1.0))*0.2));
float val3 = length(0.5-fract(k.xyw*=mat3(vec3(-2.0,-1.0,0.0), vec3(3.0,-1.0,1.0), vec3(1.0,-1.0,-1.0))*0.5));
vec4 color = vec4 ( pow(min(min(val1,val2),val3), 7.0) * 3.0)+texture_color;
gl_FragColor = color;
//gl_FragColor = texture2D(qt_Texture0, qt_TexCoord0.st);
2020-09-10 17:05:19 +02:00
}