diff options
Diffstat (limited to '')
-rw-r--r-- | cwd/assets/altcraft/shaders/frag/entity.fs | 12 | ||||
-rw-r--r-- | cwd/assets/altcraft/shaders/frag/face.fs | 4 | ||||
-rw-r--r-- | cwd/assets/altcraft/shaders/frag/fbo.fs | 12 | ||||
-rw-r--r-- | cwd/assets/altcraft/shaders/frag/light.fs | 8 | ||||
-rw-r--r-- | cwd/assets/altcraft/shaders/frag/rml.fs | 8 | ||||
-rw-r--r-- | cwd/assets/altcraft/shaders/frag/rmltex.fs | 12 | ||||
-rw-r--r-- | cwd/assets/altcraft/shaders/frag/sky.fs | 10 |
7 files changed, 40 insertions, 26 deletions
diff --git a/cwd/assets/altcraft/shaders/frag/entity.fs b/cwd/assets/altcraft/shaders/frag/entity.fs index 06d5759..be4da09 100644 --- a/cwd/assets/altcraft/shaders/frag/entity.fs +++ b/cwd/assets/altcraft/shaders/frag/entity.fs @@ -1,9 +1,15 @@ #version 330 core -out vec4 fragColor; +layout (location = 0) out vec4 color; +layout (location = 1) out vec4 normal; +layout (location = 2) out vec4 addColor; +layout (location = 3) out vec4 light; -uniform vec3 color; +uniform vec3 entityColor; void main() { - fragColor = vec4(color, 1); + color = vec4(entityColor, 1.0f); + normal = vec4(0.0f, 0.0f, 0.0f, 1.0f); + addColor = vec4(0.0f, 0.0f, 0.0f, 1.0f); + light = vec4(1.0f, 1.0f, 0.0f, 1.0f); } diff --git a/cwd/assets/altcraft/shaders/frag/face.fs b/cwd/assets/altcraft/shaders/frag/face.fs index 57ea0ec..ebda304 100644 --- a/cwd/assets/altcraft/shaders/frag/face.fs +++ b/cwd/assets/altcraft/shaders/frag/face.fs @@ -1,6 +1,6 @@ #version 330 core -in vec3 faceTexture; +in vec3 faceTextureUv; in vec3 faceAddColor; in vec3 faceNormal; in vec2 faceLight; @@ -13,7 +13,7 @@ layout (location = 3) out vec4 light; uniform sampler2DArray textureAtlas; void main() { - vec4 col = texture(textureAtlas, faceTexture); + vec4 col = texture(textureAtlas, faceTextureUv); if (col.a < 0.3) discard; diff --git a/cwd/assets/altcraft/shaders/frag/fbo.fs b/cwd/assets/altcraft/shaders/frag/fbo.fs index df624b3..a5a7a2b 100644 --- a/cwd/assets/altcraft/shaders/frag/fbo.fs +++ b/cwd/assets/altcraft/shaders/frag/fbo.fs @@ -1,11 +1,11 @@ #version 330 core -out vec4 FragColor; -in vec2 TexCoords; +in vec2 uv; + +out vec4 fragColor; uniform sampler2D inputTexture; -void main() -{ - FragColor = texture(inputTexture, TexCoords); -}
\ No newline at end of file +void main() { + fragColor = texture(inputTexture, uv); +} diff --git a/cwd/assets/altcraft/shaders/frag/light.fs b/cwd/assets/altcraft/shaders/frag/light.fs index 6d05884..07eb3ec 100644 --- a/cwd/assets/altcraft/shaders/frag/light.fs +++ b/cwd/assets/altcraft/shaders/frag/light.fs @@ -10,9 +10,15 @@ uniform sampler2D addColor; uniform sampler2D light; uniform sampler2D depthStencil; -uniform float dayTime; uniform int renderBuff; +layout (std140) uniform Globals { + mat4 projView; + uvec2 viewportSize; + float globalTime; + float dayTime; +}; + void main() { vec4 c = texture(color, uv); vec4 n = texture(normal, uv); diff --git a/cwd/assets/altcraft/shaders/frag/rml.fs b/cwd/assets/altcraft/shaders/frag/rml.fs index 54c3f36..fa1c596 100644 --- a/cwd/assets/altcraft/shaders/frag/rml.fs +++ b/cwd/assets/altcraft/shaders/frag/rml.fs @@ -1,12 +1,10 @@ #version 330 core -in VS_OUT { - vec4 color; - vec2 tex_coord; -} fs_in; +in vec4 color; +in vec2 uv; out vec4 fragColor; void main() { - fragColor = fs_in.color; + fragColor = color; } diff --git a/cwd/assets/altcraft/shaders/frag/rmltex.fs b/cwd/assets/altcraft/shaders/frag/rmltex.fs index d885b3b..af86b5b 100644 --- a/cwd/assets/altcraft/shaders/frag/rmltex.fs +++ b/cwd/assets/altcraft/shaders/frag/rmltex.fs @@ -1,14 +1,12 @@ #version 330 core -uniform sampler2D fontTexture; - -in VS_OUT { - vec4 color; - vec2 tex_coord; -} fs_in; +in vec4 color; +in vec2 uv; out vec4 fragColor; +uniform sampler2D fontTexture; + void main() { - fragColor = fs_in.color * texture(fontTexture, fs_in.tex_coord); + fragColor = color * texture(fontTexture, uv); } 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); |