mirror of
https://github.com/Kbz-8/42_vox.git
synced 2026-01-11 06:33:36 +00:00
working on chunk generation
This commit is contained in:
20
ScopEngine/Runtime/Includes/Graphics/Enums.h
git.filemode.normal_file
20
ScopEngine/Runtime/Includes/Graphics/Enums.h
git.filemode.normal_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
|
||||
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user