From e02d3dbd590810df98b08c17fd81e6ce28711af8 Mon Sep 17 00:00:00 2001 From: LaG1924 Date: Sat, 20 Nov 2021 16:35:20 +0500 Subject: Fixed some broken graphics features --- src/Gal.hpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/Gal.hpp') diff --git a/src/Gal.hpp b/src/Gal.hpp index f448c89..4757e37 100644 --- a/src/Gal.hpp +++ b/src/Gal.hpp @@ -106,6 +106,8 @@ namespace Gal { virtual void SetScissor(bool enabled) = 0; + virtual void SetWireframe(bool enabled) = 0; + virtual std::shared_ptr CreateBuffer() = 0; -- cgit v1.2.3 From 7f3ed11618df0cce5c3d799e0b3f4c009714f2c3 Mon Sep 17 00:00:00 2001 From: LaG1924 Date: Sat, 27 Nov 2021 19:03:36 +0500 Subject: Added ShaderParametersBuffer to GalOgl --- src/Gal.hpp | 40 ++++++++++++++-------------------------- 1 file changed, 14 insertions(+), 26 deletions(-) (limited to 'src/Gal.hpp') diff --git a/src/Gal.hpp b/src/Gal.hpp index 4757e37..234e49a 100644 --- a/src/Gal.hpp +++ b/src/Gal.hpp @@ -20,7 +20,7 @@ namespace Gal { struct PipelineInstance; struct FramebufferConfig; struct Framebuffer; - struct ShaderParameters; + struct ShaderParametersBuffer; struct Shader; @@ -131,7 +131,7 @@ namespace Gal { virtual std::shared_ptr GetDefaultFramebuffer() = 0; - virtual std::shared_ptr GetGlobalShaderParameters() = 0; + virtual std::shared_ptr GetGlobalShaderParameters() = 0; virtual std::shared_ptr LoadVertexShader(std::string_view code) = 0; @@ -250,34 +250,22 @@ namespace Gal { virtual void SetTexture(size_t location, std::shared_ptr texture) = 0; }; - struct ShaderParameters { - virtual ~ShaderParameters() = default; + struct ShaderParametersBuffer { + virtual ~ShaderParametersBuffer() = default; - virtual void AddGlobalShaderParameter(std::string_view name, Type type) = 0; + template + T* Get() { + return reinterpret_cast(GetDataPtr()); + } - virtual void SetGlobalShaderParameter(std::string_view name, float value) = 0; + template + void Resize() { + Resize(sizeof(T)); + } - virtual void SetGlobalShaderParameter(std::string_view name, double value) = 0; + virtual std::byte* GetDataPtr() = 0; - virtual void SetGlobalShaderParameter(std::string_view name, int8_t value) = 0; - - virtual void SetGlobalShaderParameter(std::string_view name, int16_t value) = 0; - - virtual void SetGlobalShaderParameter(std::string_view name, int32_t value) = 0; - - virtual void SetGlobalShaderParameter(std::string_view name, uint8_t value) = 0; - - virtual void SetGlobalShaderParameter(std::string_view name, uint16_t value) = 0; - - virtual void SetGlobalShaderParameter(std::string_view name, uint32_t value) = 0; - - virtual void SetGlobalShaderParameter(std::string_view name, glm::vec2 value) = 0; - - virtual void SetGlobalShaderParameter(std::string_view name, glm::vec3 value) = 0; - - virtual void SetGlobalShaderParameter(std::string_view name, glm::vec4 value) = 0; - - virtual void SetGlobalShaderParameter(std::string_view name, glm::mat4 value) = 0; + virtual void Resize(size_t newSize) = 0; }; struct Shader { -- cgit v1.2.3 From 8286ddda96a5f2925d342d0ce115aa00ae5d94ec Mon Sep 17 00:00:00 2001 From: LaG1924 Date: Sun, 28 Nov 2021 16:16:29 +0500 Subject: Added gamma correction --- src/Gal.hpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/Gal.hpp') diff --git a/src/Gal.hpp b/src/Gal.hpp index 234e49a..8d7394a 100644 --- a/src/Gal.hpp +++ b/src/Gal.hpp @@ -158,6 +158,8 @@ namespace Gal { virtual void SetWrapping(Wrapping wrapping) = 0; + virtual void SetLinear(bool isLinear) = 0; + }; struct Texture { @@ -261,6 +263,7 @@ namespace Gal { template void Resize() { Resize(sizeof(T)); + *Get() = T{}; } virtual std::byte* GetDataPtr() = 0; -- cgit v1.2.3 From 3f122e57f118db1229a4bad2c54be624f2f8f19c Mon Sep 17 00:00:00 2001 From: LaG1924 Date: Sun, 5 Dec 2021 00:51:39 +0500 Subject: Added SSAO --- src/Gal.hpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/Gal.hpp') diff --git a/src/Gal.hpp b/src/Gal.hpp index 8d7394a..76db560 100644 --- a/src/Gal.hpp +++ b/src/Gal.hpp @@ -63,6 +63,7 @@ namespace Gal { D24S8, R8G8B8, R8G8B8A8, + R32G32B32A32F, }; enum class Filtering { -- cgit v1.2.3 From da66c30a110233f7c8b71b5e6aa8dd804879c1b6 Mon Sep 17 00:00:00 2001 From: LaG1924 Date: Sun, 5 Dec 2021 05:42:15 +0500 Subject: Added blending --- src/Gal.hpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/Gal.hpp') diff --git a/src/Gal.hpp b/src/Gal.hpp index 76db560..fe99dc7 100644 --- a/src/Gal.hpp +++ b/src/Gal.hpp @@ -86,6 +86,11 @@ namespace Gal { TriangleFan, }; + enum class Blending { + Opaque, + Additive, + }; + struct VertexAttribute { std::string name; Type type; @@ -186,6 +191,8 @@ namespace Gal { virtual void SetPrimitive(Primitive primitive) = 0; + virtual void SetBlending(Blending blendingMode) = 0; + virtual std::shared_ptr BindVertexBuffer(std::vector &&bufferLayout) = 0; virtual std::shared_ptr BindIndexBuffer() = 0; -- cgit v1.2.3 From a12779bc153425407b131bce541c0bb97cccca39 Mon Sep 17 00:00:00 2001 From: LaG1924 Date: Wed, 8 Dec 2021 20:33:09 +0500 Subject: Removed unnecessary framebuffers copying --- src/Gal.hpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/Gal.hpp') diff --git a/src/Gal.hpp b/src/Gal.hpp index fe99dc7..0aa61c7 100644 --- a/src/Gal.hpp +++ b/src/Gal.hpp @@ -171,6 +171,8 @@ namespace Gal { struct Texture { virtual ~Texture() = default; + virtual std::tuple GetSize() = 0; + virtual void SetData(std::vector&& data, size_t mipLevel = 0) = 0; virtual void SetSubData(size_t x, size_t y, size_t z, size_t width, size_t height, size_t depth, std::vector &&data, size_t mipLevel = 0) = 0; -- cgit v1.2.3 From 9202a3cab793a239a084414e4dddc7759f479fc2 Mon Sep 17 00:00:00 2001 From: LaG1924 Date: Sat, 11 Dec 2021 22:11:31 +0500 Subject: Even more optimization to GBuffer size --- src/Gal.hpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/Gal.hpp') diff --git a/src/Gal.hpp b/src/Gal.hpp index 0aa61c7..ed0b559 100644 --- a/src/Gal.hpp +++ b/src/Gal.hpp @@ -61,7 +61,10 @@ namespace Gal { enum class Format { D24S8, + R8, + R8G8, R8G8B8, + R8G8B8SN, R8G8B8A8, R32G32B32A32F, }; -- cgit v1.2.3