diff options
author | LaG1924 <lag1924@gmail.com> | 2021-12-04 20:51:39 +0100 |
---|---|---|
committer | LaG1924 <lag1924@gmail.com> | 2021-12-04 20:56:29 +0100 |
commit | 3f122e57f118db1229a4bad2c54be624f2f8f19c (patch) | |
tree | 538ec737720cc8e344cbcfed1edcedff0d23a109 /cwd/assets/altcraft/shaders/vert | |
parent | Added gamma correction (diff) | |
download | AltCraft-3f122e57f118db1229a4bad2c54be624f2f8f19c.tar AltCraft-3f122e57f118db1229a4bad2c54be624f2f8f19c.tar.gz AltCraft-3f122e57f118db1229a4bad2c54be624f2f8f19c.tar.bz2 AltCraft-3f122e57f118db1229a4bad2c54be624f2f8f19c.tar.lz AltCraft-3f122e57f118db1229a4bad2c54be624f2f8f19c.tar.xz AltCraft-3f122e57f118db1229a4bad2c54be624f2f8f19c.tar.zst AltCraft-3f122e57f118db1229a4bad2c54be624f2f8f19c.zip |
Diffstat (limited to '')
-rw-r--r-- | cwd/assets/altcraft/shaders/vert/entity.vs | 6 | ||||
-rw-r--r-- | cwd/assets/altcraft/shaders/vert/face.vs | 6 | ||||
-rw-r--r-- | cwd/assets/altcraft/shaders/vert/fbo.vs | 3 | ||||
-rw-r--r-- | cwd/assets/altcraft/shaders/vert/light.vs | 3 | ||||
-rw-r--r-- | cwd/assets/altcraft/shaders/vert/pp.vs | 3 | ||||
-rw-r--r-- | cwd/assets/altcraft/shaders/vert/rml.vs | 3 | ||||
-rw-r--r-- | cwd/assets/altcraft/shaders/vert/sky.vs | 3 |
7 files changed, 27 insertions, 0 deletions
diff --git a/cwd/assets/altcraft/shaders/vert/entity.vs b/cwd/assets/altcraft/shaders/vert/entity.vs index 4acaa93..f90fbc1 100644 --- a/cwd/assets/altcraft/shaders/vert/entity.vs +++ b/cwd/assets/altcraft/shaders/vert/entity.vs @@ -2,11 +2,16 @@ in vec3 pos; +out vec4 entityWorldPos; + uniform mat4 model; layout (std140) uniform Globals { mat4 projView; + mat4 proj; + mat4 view; uvec2 viewportSize; + vec4 ssaoKernels[64]; float globalTime; float dayTime; float gamma; @@ -14,4 +19,5 @@ layout (std140) uniform Globals { void main() { gl_Position = projView * model * vec4(pos, 1); + entityWorldPos = view * model * vec4(pos, 1.0f); } diff --git a/cwd/assets/altcraft/shaders/vert/face.vs b/cwd/assets/altcraft/shaders/vert/face.vs index 70c24c8..e50e503 100644 --- a/cwd/assets/altcraft/shaders/vert/face.vs +++ b/cwd/assets/altcraft/shaders/vert/face.vs @@ -8,6 +8,7 @@ in float animation; in vec3 color; in vec2 light; +out vec4 faceWorldPos; out vec3 faceTextureUv; out vec3 faceNormal; out vec3 faceAddColor; @@ -15,7 +16,10 @@ out vec2 faceLight; layout (std140) uniform Globals { mat4 projView; + mat4 proj; + mat4 view; uvec2 viewportSize; + vec4 ssaoKernels[64]; float globalTime; float dayTime; float gamma; @@ -24,6 +28,8 @@ layout (std140) uniform Globals { void main() { gl_Position = projView * vec4(pos[gl_VertexID], 1.0f); + faceWorldPos = view * vec4(pos[gl_VertexID], 1.0f); + faceTextureUv = vec3(uv[gl_VertexID], uvLayer); faceTextureUv.y -= (uv[2].y - uv[0].y) * trunc(mod(globalTime * 4.0f, animation)); diff --git a/cwd/assets/altcraft/shaders/vert/fbo.vs b/cwd/assets/altcraft/shaders/vert/fbo.vs index cfde14e..0e05eaf 100644 --- a/cwd/assets/altcraft/shaders/vert/fbo.vs +++ b/cwd/assets/altcraft/shaders/vert/fbo.vs @@ -7,7 +7,10 @@ out vec2 uv; layout (std140) uniform Globals { mat4 projView; + mat4 proj; + mat4 view; uvec2 viewportSize; + vec4 ssaoKernels[64]; float globalTime; float dayTime; float gamma; diff --git a/cwd/assets/altcraft/shaders/vert/light.vs b/cwd/assets/altcraft/shaders/vert/light.vs index 4e551f8..118ea5b 100644 --- a/cwd/assets/altcraft/shaders/vert/light.vs +++ b/cwd/assets/altcraft/shaders/vert/light.vs @@ -7,7 +7,10 @@ out vec2 uv; layout (std140) uniform Globals { mat4 projView; + mat4 proj; + mat4 view; uvec2 viewportSize; + vec4 ssaoKernels[64]; float globalTime; float dayTime; float gamma; diff --git a/cwd/assets/altcraft/shaders/vert/pp.vs b/cwd/assets/altcraft/shaders/vert/pp.vs index 4e551f8..118ea5b 100644 --- a/cwd/assets/altcraft/shaders/vert/pp.vs +++ b/cwd/assets/altcraft/shaders/vert/pp.vs @@ -7,7 +7,10 @@ out vec2 uv; layout (std140) uniform Globals { mat4 projView; + mat4 proj; + mat4 view; uvec2 viewportSize; + vec4 ssaoKernels[64]; float globalTime; float dayTime; float gamma; diff --git a/cwd/assets/altcraft/shaders/vert/rml.vs b/cwd/assets/altcraft/shaders/vert/rml.vs index ea78825..c61a4a0 100644 --- a/cwd/assets/altcraft/shaders/vert/rml.vs +++ b/cwd/assets/altcraft/shaders/vert/rml.vs @@ -11,7 +11,10 @@ uniform vec2 translation; layout (std140) uniform Globals { mat4 projView; + mat4 proj; + mat4 view; uvec2 viewportSize; + vec4 ssaoKernels[64]; float globalTime; float dayTime; float gamma; diff --git a/cwd/assets/altcraft/shaders/vert/sky.vs b/cwd/assets/altcraft/shaders/vert/sky.vs index 617caed..7043584 100644 --- a/cwd/assets/altcraft/shaders/vert/sky.vs +++ b/cwd/assets/altcraft/shaders/vert/sky.vs @@ -8,7 +8,10 @@ uniform mat4 model; layout (std140) uniform Globals { mat4 projView; + mat4 proj; + mat4 view; uvec2 viewportSize; + vec4 ssaoKernels[64]; float globalTime; float dayTime; float gamma; |