working on chunk generation

This commit is contained in:
2025-05-09 18:29:41 +02:00
parent 8c94d86fd4
commit 18dd89f485
10 changed files with 221 additions and 23 deletions

20
ScopEngine/Runtime/Includes/Graphics/Enums.h git.filemode.normal_file
View File

@@ -0,0 +1,20 @@
#ifndef __SCOP_GRAPHICS_ENUMS__
#define __SCOP_GRAPHICS_ENUMS__
#include <cstddef>
namespace Scop
{
enum class CullMode
{
None = 0,
Back,
Front,
FrontAndBack,
EndEnum
};
constexpr std::size_t CullModeCount = static_cast<std::size_t>(CullMode::EndEnum);
}
#endif

View File

@@ -7,6 +7,7 @@
#include <Utils/NonOwningPtr.h>
#include <Graphics/Enums.h>
#include <Graphics/Actor.h>
#include <Graphics/Narrator.h>
#include <Graphics/Sprite.h>
@@ -23,6 +24,7 @@ namespace Scop
{
std::shared_ptr<Shader> fragment_shader;
std::shared_ptr<BaseCamera> camera;
CullMode culling;
bool render_3D_enabled = true;
bool render_2D_enabled = true;
bool render_skybox_enabled = true;

View File

@@ -17,6 +17,7 @@ namespace Scop
Vertex() = default;
Vertex(Vec4f p, Vec4f c, Vec4f n, Vec2f u) : position(std::move(p)), color(std::move(c)), normal(std::move(n)), uv(std::move(u)) {}
Vertex(Vec4f p, Vec4f n, Vec2f u) : position(std::move(p)), normal(std::move(n)), uv(std::move(u)) {}
[[nodiscard]] inline static VkVertexInputBindingDescription GetBindingDescription();
[[nodiscard]] inline static std::array<VkVertexInputAttributeDescription, 4> GetAttributeDescriptions();

View File

@@ -29,6 +29,15 @@ namespace Scop
pipeline_descriptor.mode = VK_POLYGON_MODE_LINE;
pipeline_descriptor.clear_color_attachments = false;
pipeline_descriptor.name = "forward_pass_pipeline";
switch(scene.GetDescription().culling)
{
case CullMode::None: pipeline_descriptor.culling = VK_CULL_MODE_NONE; break;
case CullMode::Back: pipeline_descriptor.culling = VK_CULL_MODE_BACK_BIT; break;
case CullMode::Front: pipeline_descriptor.culling = VK_CULL_MODE_FRONT_BIT; break;
case CullMode::FrontAndBack: pipeline_descriptor.culling = VK_CULL_MODE_FRONT_AND_BACK; break;
default: break;
}
pipeline.Init(pipeline_descriptor);
}