summaryrefslogtreecommitdiffstats
path: root/cwd/assets/altcraft/shaders/frag/sky.fs
diff options
context:
space:
mode:
authorLaG1924 <lag1924@gmail.com>2021-11-27 17:08:58 +0100
committerLaG1924 <lag1924@gmail.com>2021-11-27 17:08:58 +0100
commitc905ede556c892d39fd69d3945026ba244567ce9 (patch)
tree86b0d1f5f3ba47358bfb3a89c1dba9ae9a344a39 /cwd/assets/altcraft/shaders/frag/sky.fs
parentAdded ShaderParametersBuffer to GalOgl (diff)
downloadAltCraft-c905ede556c892d39fd69d3945026ba244567ce9.tar
AltCraft-c905ede556c892d39fd69d3945026ba244567ce9.tar.gz
AltCraft-c905ede556c892d39fd69d3945026ba244567ce9.tar.bz2
AltCraft-c905ede556c892d39fd69d3945026ba244567ce9.tar.lz
AltCraft-c905ede556c892d39fd69d3945026ba244567ce9.tar.xz
AltCraft-c905ede556c892d39fd69d3945026ba244567ce9.tar.zst
AltCraft-c905ede556c892d39fd69d3945026ba244567ce9.zip
Diffstat (limited to 'cwd/assets/altcraft/shaders/frag/sky.fs')
-rw-r--r--cwd/assets/altcraft/shaders/frag/sky.fs10
1 files changed, 8 insertions, 2 deletions
diff --git a/cwd/assets/altcraft/shaders/frag/sky.fs b/cwd/assets/altcraft/shaders/frag/sky.fs
index 3763bdb..32b7da0 100644
--- a/cwd/assets/altcraft/shaders/frag/sky.fs
+++ b/cwd/assets/altcraft/shaders/frag/sky.fs
@@ -7,8 +7,14 @@ layout (location = 1) out vec4 normal;
layout (location = 2) out vec4 addColor;
layout (location = 3) out vec4 light;
+layout (std140) uniform Globals {
+ mat4 projView;
+ uvec2 viewportSize;
+ float globalTime;
+ float dayTime;
+};
+
uniform sampler2DArray textureAtlas;
-uniform float DayTime;
uniform vec4 sunTexture;
uniform float sunTextureLayer;
uniform vec4 moonTexture;
@@ -49,7 +55,7 @@ vec4 Moon() {
void main() {
vec4 starColor = vec4(0.0f, 0.04f, 0.06f, 1.0f);
- color = vec4(mix(starColor, DaySkyColor, DayTime).rgb, 1.0f);
+ color = vec4(mix(starColor, DaySkyColor, dayTime).rgb, 1.0f);
color += vec4(Sun().rgb, 1.0f);
color += vec4(Moon().rgb, 1.0f);
normal = vec4(0.0f, 0.0f, 0.0f, 1.0f);