diff options
-rw-r--r-- | cwd/assets/altcraft/shaders/frag/entity.fs | 4 | ||||
-rw-r--r-- | cwd/assets/altcraft/shaders/frag/face.fs | 6 | ||||
-rw-r--r-- | cwd/assets/altcraft/shaders/frag/light.fs | 6 | ||||
-rw-r--r-- | cwd/assets/altcraft/shaders/frag/sky.fs | 4 | ||||
-rw-r--r-- | src/RenderConfigs.cpp | 9 | ||||
-rw-r--r-- | src/RenderConfigs.hpp | 1 |
6 files changed, 7 insertions, 23 deletions
diff --git a/cwd/assets/altcraft/shaders/frag/entity.fs b/cwd/assets/altcraft/shaders/frag/entity.fs index 813a9af..a857da1 100644 --- a/cwd/assets/altcraft/shaders/frag/entity.fs +++ b/cwd/assets/altcraft/shaders/frag/entity.fs @@ -2,14 +2,12 @@ layout (location = 0) out vec4 color; layout (location = 1) out vec4 normal; -layout (location = 2) out vec4 addColor; -layout (location = 3) out vec4 light; +layout (location = 2) out vec4 light; uniform vec3 entityColor; void main() { color = vec4(entityColor, 1.0f); normal = vec4(0.0f, 0.0f, 0.0f, 1.0f); - addColor = vec4(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 ebda304..f8b795f 100644 --- a/cwd/assets/altcraft/shaders/frag/face.fs +++ b/cwd/assets/altcraft/shaders/frag/face.fs @@ -7,8 +7,7 @@ in vec2 faceLight; layout (location = 0) out vec4 color; layout (location = 1) out vec4 normal; -layout (location = 2) out vec4 addColor; -layout (location = 3) out vec4 light; +layout (location = 2) out vec4 light; uniform sampler2DArray textureAtlas; @@ -17,8 +16,7 @@ void main() { if (col.a < 0.3) discard; - color = vec4(col.rgb, 1.0f); + color = vec4(col.rgb * faceAddColor.rgb, 1.0f); normal = vec4(faceNormal, 1.0f); - addColor = vec4(faceAddColor, 1.0f); light = vec4(faceLight / 15.0f, 0.0f, 1.0f); } diff --git a/cwd/assets/altcraft/shaders/frag/light.fs b/cwd/assets/altcraft/shaders/frag/light.fs index 3876388..aa9e04e 100644 --- a/cwd/assets/altcraft/shaders/frag/light.fs +++ b/cwd/assets/altcraft/shaders/frag/light.fs @@ -7,7 +7,6 @@ in vec2 uv; uniform sampler2D depthStencil; uniform sampler2D color; uniform sampler2D normal; -uniform sampler2D addColor; uniform sampler2D light; uniform sampler2D ssao; @@ -37,7 +36,6 @@ void main() { n += 1.0f; n /= 2.0f; - vec4 ac = texture(addColor, uv); vec4 l = texture(light, uv); float depth = texture(depthStencil, uv).r; float d = (1.0f - depth) * 16.0f; @@ -52,7 +50,7 @@ void main() { } lightLevel = clamp(lightLevel, 0.005f, 1.0f); - vec4 finalColor = vec4(c.rgb * ac.rgb * lightLevel, 1.0f); + vec4 finalColor = vec4(c.rgb * lightLevel, 1.0f); finalColor.rgb = pow(finalColor.rgb, vec3(1.0f / gamma)); @@ -70,7 +68,7 @@ void main() { fragColor = vec4(RecoverViewWorldPos(uv, depth), 1.0f); break; case 4: - fragColor = ac; + fragColor = vec4(0.5f); break; case 5: fragColor = l; diff --git a/cwd/assets/altcraft/shaders/frag/sky.fs b/cwd/assets/altcraft/shaders/frag/sky.fs index f3830b8..731246a 100644 --- a/cwd/assets/altcraft/shaders/frag/sky.fs +++ b/cwd/assets/altcraft/shaders/frag/sky.fs @@ -4,8 +4,7 @@ in vec3 facePos; layout (location = 0) out vec4 color; layout (location = 1) out vec4 normal; -layout (location = 2) out vec4 addColor; -layout (location = 3) out vec4 light; +layout (location = 2) out vec4 light; layout (std140) uniform Globals { mat4 projView; @@ -65,7 +64,6 @@ void main() { color += vec4(Sun().rgb, 1.0f); color += vec4(Moon().rgb, 1.0f); normal = vec4(0.0f, 0.0f, 0.0f, 1.0f); - addColor = vec4(1.0f); light = vec4(1.0f, 1.0f, 0.0f, 1.0f); gl_FragDepth = 1.0f; } diff --git a/src/RenderConfigs.cpp b/src/RenderConfigs.cpp index d399818..8cc4ee1 100644 --- a/src/RenderConfigs.cpp +++ b/src/RenderConfigs.cpp @@ -183,11 +183,6 @@ Gbuffer::Gbuffer(size_t geomW, size_t geomH, size_t lightW, size_t lightH, int s normalConf->SetMaxFilter(Gal::Filtering::Bilinear); normal = gal->BuildTexture(normalConf); - auto addColorConf = gal->CreateTexture2DConfig(geomW, geomH, Gal::Format::R8G8B8); - addColorConf->SetMinFilter(Gal::Filtering::Bilinear); - addColorConf->SetMaxFilter(Gal::Filtering::Bilinear); - addColor = gal->BuildTexture(addColorConf); - auto lightConf = gal->CreateTexture2DConfig(geomW, geomH, Gal::Format::R8G8B8); lightConf->SetMinFilter(Gal::Filtering::Bilinear); lightConf->SetMaxFilter(Gal::Filtering::Bilinear); @@ -202,8 +197,7 @@ Gbuffer::Gbuffer(size_t geomW, size_t geomH, size_t lightW, size_t lightH, int s geomFbConf->SetDepthStencil(depthStencil); geomFbConf->SetTexture(0, color); geomFbConf->SetTexture(1, normal); - geomFbConf->SetTexture(2, addColor); - geomFbConf->SetTexture(3, light); + geomFbConf->SetTexture(2, light); geomFramebuffer = gal->BuildFramebuffer(geomFbConf); geomFramebuffer->SetViewport(0, 0, geomW, geomH); @@ -274,7 +268,6 @@ Gbuffer::Gbuffer(size_t geomW, size_t geomH, size_t lightW, size_t lightH, int s {"depthStencil", depthStencil}, {"color", color}, {"normal", normal}, - {"addColor", addColor}, {"light", light}, }; diff --git a/src/RenderConfigs.hpp b/src/RenderConfigs.hpp index 92ce90c..d0adfce 100644 --- a/src/RenderConfigs.hpp +++ b/src/RenderConfigs.hpp @@ -96,7 +96,6 @@ class Gbuffer { std::shared_ptr<Gal::Texture> depthStencil; std::shared_ptr<Gal::Texture> color; //RGB - color std::shared_ptr<Gal::Texture> normal; //RGB - normal - std::shared_ptr<Gal::Texture> addColor; //RGB - addColor std::shared_ptr<Gal::Texture> light; //R - faceLight, G - skyLight, B - unused std::shared_ptr<Gal::Framebuffer> geomFramebuffer; |