diff options
author | LaG1924 <12997935+LaG1924@users.noreply.github.com> | 2021-12-25 07:50:14 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-25 07:50:14 +0100 |
commit | 7ebc8e1bd33b6658b50153a26945814a87fba5f4 (patch) | |
tree | 51d377a4560a7e12b3b404b0b043d9f64981caf3 /src/Rml.cpp | |
parent | Merge pull request #77 from LaG1924/ftr/graphics-abstraction-layer (diff) | |
parent | Added smooth lighting settings parameter (diff) | |
download | AltCraft-7ebc8e1bd33b6658b50153a26945814a87fba5f4.tar AltCraft-7ebc8e1bd33b6658b50153a26945814a87fba5f4.tar.gz AltCraft-7ebc8e1bd33b6658b50153a26945814a87fba5f4.tar.bz2 AltCraft-7ebc8e1bd33b6658b50153a26945814a87fba5f4.tar.lz AltCraft-7ebc8e1bd33b6658b50153a26945814a87fba5f4.tar.xz AltCraft-7ebc8e1bd33b6658b50153a26945814a87fba5f4.tar.zst AltCraft-7ebc8e1bd33b6658b50153a26945814a87fba5f4.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Rml.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/Rml.cpp b/src/Rml.cpp index fa2d4e7..f6fff44 100644 --- a/src/Rml.cpp +++ b/src/Rml.cpp @@ -64,15 +64,15 @@ RmlRenderInterface::RmlRenderInterface() { { auto pipelineConfig = gal->CreatePipelineConfig(); - pipelineConfig->AddShaderParameter("viewportSize", Gal::Type::Vec2u32); pipelineConfig->AddShaderParameter("translation", Gal::Type::Vec2); pipelineConfig->SetTarget(gal->GetDefaultFramebuffer()); pipelineConfig->SetVertexShader(gal->LoadVertexShader(vertexSource)); pipelineConfig->SetPixelShader(gal->LoadPixelShader(pixelSource)); + pipelineConfig->SetBlending(Gal::Blending::Additive); auto vertBuffBind = pipelineConfig->BindVertexBuffer({ {"pos", Gal::Type::Vec2}, - {"color", Gal::Type::Vec4u8}, + {"col", Gal::Type::Vec4u8}, {"", Gal::Type::Vec2}, //it's not used in shader, so driver optimizes it away }); @@ -88,17 +88,17 @@ RmlRenderInterface::RmlRenderInterface() { { auto texPipelineConfig = gal->CreatePipelineConfig(); - texPipelineConfig->AddShaderParameter("viewportSize", Gal::Type::Vec2u32); texPipelineConfig->AddShaderParameter("translation", Gal::Type::Vec2); texPipelineConfig->AddShaderParameter("fontTexture", Gal::Type::Int32); texPipelineConfig->SetTarget(gal->GetDefaultFramebuffer()); texPipelineConfig->SetVertexShader(gal->LoadVertexShader(vertexSource)); texPipelineConfig->SetPixelShader(gal->LoadPixelShader(texPixelSource)); + texPipelineConfig->SetBlending(Gal::Blending::Additive); auto texVertBuffBind = texPipelineConfig->BindVertexBuffer({ {"pos", Gal::Type::Vec2}, - {"color", Gal::Type::Vec4u8}, - {"tex_coord", Gal::Type::Vec2}, + {"col", Gal::Type::Vec4u8}, + {"uvPos", Gal::Type::Vec2}, }); auto texIndexBuffBind = texPipelineConfig->BindIndexBuffer(); @@ -165,9 +165,6 @@ void RmlRenderInterface::ReleaseTexture(Rml::TextureHandle texture) { } void RmlRenderInterface::Update(unsigned int windowWidth, unsigned int windowHeight) { - pipeline->SetShaderParameter("viewportSize", glm::uvec2(windowWidth, windowHeight)); - texPipeline->SetShaderParameter("viewportSize", glm::uvec2(windowWidth, windowHeight)); - vpWidth = windowWidth; vpHeight = windowHeight; } |