Skip to content

Commit

Permalink
Cull correct side of skybox
Browse files Browse the repository at this point in the history
  • Loading branch information
Hjaltesorgenfrei committed Jan 9, 2024
1 parent 95132cb commit 19987d2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/renderer/BehPipelines.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ void BehPipeline::createGraphicsPipeline(PipelineConfigurationInfo &config, std:
.depthClampEnable = VK_FALSE,
.rasterizerDiscardEnable = VK_FALSE,
.polygonMode = config.polygonMode,
.cullMode = vk::CullModeFlagBits::eBack,
.cullMode = config.cullMode,
.frontFace = vk::FrontFace::eCounterClockwise,
.depthBiasEnable = VK_FALSE,
.depthBiasConstantFactor = 0.0f,
Expand Down
1 change: 1 addition & 0 deletions src/renderer/BehPipelines.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ struct PipelineConfigurationInfo {
vk::PipelineLayout pipelineLayout = nullptr;
vk::RenderPass renderPass = nullptr;
vk::PrimitiveTopology topology = vk::PrimitiveTopology::eTriangleList;
vk::CullModeFlags cullMode = vk::CullModeFlagBits::eBack;
float lineWidth = 1.0f;

vk::PipelineColorBlendAttachmentState colorBlendAttachment {
Expand Down
1 change: 1 addition & 0 deletions src/renderer/Renderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,7 @@ void Renderer::createSkyboxPipeline() {
.inputRate = vk::VertexInputRate::eVertex
}
};
pipelineConfig.cullMode = vk::CullModeFlagBits::eFront; // Done instead of swapping the cube inside out.
pipelineConfig.addShader("shaders/skybox.vert.spv", vk::ShaderStageFlagBits::eVertex);
pipelineConfig.addShader("shaders/skybox.frag.spv", vk::ShaderStageFlagBits::eFragment);
pipelineConfig.pipelineLayout = skyboxPipelineLayout;
Expand Down

0 comments on commit 19987d2

Please sign in to comment.