Fixed wrong camera being used + materials

This commit is contained in:
antopilo
2025-01-12 22:33:13 -05:00
parent e52bc15eaa
commit 8c592ba87b
4 changed files with 9 additions and 8 deletions

View File

@@ -118,7 +118,6 @@ void SceneRenderPipeline::Render(PassRenderContext& ctx)
// ... other passes
};
ctx.cameraID = CurrentCameraID;
GBufferPipeline.Execute(ctx, pipelineInputs);
}

View File

@@ -27,12 +27,12 @@ namespace Nuake
// This is what is present on the shader as a structured buffer
struct MaterialBufferStruct
{
bool HasAlbedo;
int HasAlbedo;
Vector3 AlbedoColor;
bool HasNormal;
bool HasMetalness;
bool HasRoughness;
bool HasAO;
int HasNormal;
int HasMetalness;
int HasRoughness;
int HasAO;
float MetalnessValue;
float RoughnessValue;
float AoValue;

View File

@@ -320,6 +320,7 @@ void GPUResources::RecreateBindlessCameras()
void GPUResources::UpdateBuffers()
{
// Tranforms
{
void* mappedData;
vmaMapMemory(VulkanAllocator::Get().GetAllocator(), (VkRenderer::Get().GetCurrentFrame().ModelStagingBuffer->GetAllocation()), &mappedData);

View File

@@ -119,7 +119,7 @@ void VkSceneRenderer::BeginScene(RenderContext inContext)
}
}
// All transforms & materials
// All transforms & materials`
{
uint32_t currentIndex = 0;
uint32_t currentMaterialIndex = 0;
@@ -290,9 +290,10 @@ void VkSceneRenderer::BeginScene(RenderContext inContext)
}
}
//passCtx.cameraID = GPUResources::Get().GetBindlessCameraID(Context.CameraID);
//GBufferPipeline.Execute(passCtx);
// Set back the camera ID to the actual desired camera.
passCtx.cameraID = GPUResources::Get().GetBindlessCameraID(inContext.CameraID);
sceneRenderPipeline->Render(passCtx);
}