init
This commit is contained in:
16
assets/shaders/water.vert
Normal file
16
assets/shaders/water.vert
Normal file
@@ -0,0 +1,16 @@
|
||||
#version 450 core
|
||||
#include "common.glsl"
|
||||
|
||||
layout(location = 0) in vec3 aPos;
|
||||
uniform float uWaveStrength;
|
||||
|
||||
out vec3 vWorld;
|
||||
|
||||
void main() {
|
||||
vec3 p = aPos;
|
||||
// Gentle swell; fine detail comes from per-pixel normals.
|
||||
p.y += (sin(p.x * 1.3 + uTime * 1.1) * cos(p.z * 1.1 + uTime * 0.9) +
|
||||
sin(p.x * 0.7 - p.z * 0.9 + uTime * 0.6) * 0.5) * 0.018 * uWaveStrength;
|
||||
vWorld = p;
|
||||
gl_Position = uViewProj * vec4(p, 1.0);
|
||||
}
|
||||
Reference in New Issue
Block a user