From 1a9fac5e21c08f2e90f62b4b161586e691cbb523 Mon Sep 17 00:00:00 2001 From: Anish Bhobe Date: Fri, 4 Jul 2025 01:31:26 +0200 Subject: [PATCH] Fixed handedness of view and proj. --- Blaze/Blaze.vcxproj | 2 +- Blaze/Source/Blaze.cpp | 4 ++-- Blaze/Source/MiscData.cpp | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Blaze/Blaze.vcxproj b/Blaze/Blaze.vcxproj index 710debe..b69db14 100644 --- a/Blaze/Blaze.vcxproj +++ b/Blaze/Blaze.vcxproj @@ -122,7 +122,7 @@ %(AdditionalLibraryDirectories) - slangc %(FullPath) -profile sm_6_6 -target spirv -o %(Filename).spv + slangc %(FullPath) -profile sm_6_6 -target spirv -matrix-layout-column-major -o %(Filename).spv Compiling %(Filename) diff --git a/Blaze/Source/Blaze.cpp b/Blaze/Source/Blaze.cpp index 6391f27..fbe2077 100644 --- a/Blaze/Source/Blaze.cpp +++ b/Blaze/Source/Blaze.cpp @@ -78,7 +78,7 @@ SDL_AppResult SDL_AppInit( void** appstate, int, char** ) Blaze::MiscData::DirectionalLight dir_light[] = { { - .direction = { 1.0f, -1.0f, 0.0f }, + .direction = { -1.0f, -1.0f, -1.0f }, .color = { 12.0f, 10.0f, 5.0f }, }, }; @@ -143,7 +143,7 @@ SDL_AppResult SDL_AppIterate( void* appstate ) VK_CHECK( vkAcquireNextImageKHR( render_device.device, render_device.swapchain, - std::numeric_limits::max(), + UINT32_MAX, current_frame.imageAcquiredSemaphore, nullptr, ¤t_image_index ) ); diff --git a/Blaze/Source/MiscData.cpp b/Blaze/Source/MiscData.cpp index f0203de..c1b31c0 100644 --- a/Blaze/Source/MiscData.cpp +++ b/Blaze/Source/MiscData.cpp @@ -161,7 +161,7 @@ bool MiscData::Init( RenderDevice const& render_device ) .depthClampEnable = VK_TRUE, .rasterizerDiscardEnable = VK_FALSE, .polygonMode = VK_POLYGON_MODE_FILL, - .cullMode = VK_CULL_MODE_NONE, + .cullMode = VK_CULL_MODE_BACK_BIT, .frontFace = VK_FRONT_FACE_COUNTER_CLOCKWISE, .depthBiasEnable = VK_FALSE, .depthBiasConstantFactor = 0.0f, @@ -268,12 +268,12 @@ bool MiscData::Init( RenderDevice const& render_device ) // Camera { - cameraData.cameraPosition = DirectX::XMVectorSet( 0.0f, 2.0f, -2.0f, 1.0f ); + cameraData.cameraPosition = DirectX::XMVectorSet( 0.0f, 1.0f, 2.0f, 1.0f ); cameraTarget = DirectX::XMVectorSet( 0.0f, 0.0f, 0.0f, 1.0f ); cameraUp = DirectX::XMVectorSet( 0.0f, 1.0f, 0.0f, 1.0f ); - cameraData.viewMatrix = DirectX::XMMatrixLookAtLH( cameraData.cameraPosition, cameraTarget, cameraUp ); + cameraData.viewMatrix = DirectX::XMMatrixLookAtRH( cameraData.cameraPosition, cameraTarget, cameraUp ); cameraData.projectionMatrix = - DirectX::XMMatrixPerspectiveFovLH( DirectX::XMConvertToRadians( 70.0f ), 16.0f / 9.0f, 0.1f, 1000.0f ); + DirectX::XMMatrixPerspectiveFovRH( DirectX::XMConvertToRadians( 70.0f ), 16.0f / 9.0f, 0.1f, 1000.0f ); cameraUniformBufferSize = sizeof( CameraData ) + sizeof( LightData ); }