diff options
author | LaG1924 <lag1924@gmail.com> | 2022-12-15 11:53:56 +0100 |
---|---|---|
committer | LaG1924 <lag1924@gmail.com> | 2022-12-15 11:53:56 +0100 |
commit | 12923669214ba73a809f4e221a634244888b0146 (patch) | |
tree | 9fe8a85f8fc9a5e3fa9f4e6a9418144090595730 /cwd/assets/altcraft/shaders/vert | |
parent | Fixed OpenSans font downloading (diff) | |
download | AltCraft-12923669214ba73a809f4e221a634244888b0146.tar AltCraft-12923669214ba73a809f4e221a634244888b0146.tar.gz AltCraft-12923669214ba73a809f4e221a634244888b0146.tar.bz2 AltCraft-12923669214ba73a809f4e221a634244888b0146.tar.lz AltCraft-12923669214ba73a809f4e221a634244888b0146.tar.xz AltCraft-12923669214ba73a809f4e221a634244888b0146.tar.zst AltCraft-12923669214ba73a809f4e221a634244888b0146.zip |
Diffstat (limited to '')
-rw-r--r-- | cwd/assets/altcraft/shaders/vert/liquid_face.vs | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/cwd/assets/altcraft/shaders/vert/liquid_face.vs b/cwd/assets/altcraft/shaders/vert/liquid_face.vs new file mode 100644 index 0000000..101e4d0 --- /dev/null +++ b/cwd/assets/altcraft/shaders/vert/liquid_face.vs @@ -0,0 +1,38 @@ +#version 330 core + +in vec3 pos[4]; +in vec2 uv[4]; +in vec2 light[4]; +in vec3 normal; +in vec3 color; +in vec3 layerAnimationAo; + +out vec3 faceTextureUv; +out vec3 faceNormal; +out vec3 faceAddColor; +out vec2 faceLight; +out float faceAmbientOcclusion; + +layout (std140) uniform Globals { + mat4 projView; + mat4 proj; + mat4 invProj; + mat4 view; + uvec2 viewportSize; + vec4 ssaoKernels[64]; + float globalTime; + float dayTime; + float gamma; +}; + +void main() { + gl_Position = projView * vec4(pos[gl_VertexID], 1.0f); + + faceTextureUv = vec3(uv[gl_VertexID], layerAnimationAo.r); + faceTextureUv.y -= (uv[2].y - uv[0].y) * trunc(mod(globalTime * 4.0f, layerAnimationAo.g)); + + faceNormal = (view * vec4(normal, 0.0f)).xyz; + faceAddColor = color; + faceLight = light[gl_VertexID]; + faceAmbientOcclusion = layerAnimationAo.b; +} |