From 08dab08b0b7d2359eec80c21b3532554150de497 Mon Sep 17 00:00:00 2001 From: Mathias Heyer Date: Thu, 10 Mar 2022 23:08:32 -0800 Subject: [PATCH] Bulk update nvpro-samples 03/10/22 --- ray_tracing__advance/offscreen.cpp | 2 +- ray_tracing__advance/offscreen.hpp | 2 +- ray_tracing_ao/main.cpp | 2 +- ray_tracing_callable/hello_vulkan.h | 2 +- ray_tracing_callable/main.cpp | 2 +- ray_tracing_callable/shaders/host_device.h | 2 +- ray_tracing_intersection/main.cpp | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ray_tracing__advance/offscreen.cpp b/ray_tracing__advance/offscreen.cpp index 7c898e4..99c972b 100644 --- a/ray_tracing__advance/offscreen.cpp +++ b/ray_tracing__advance/offscreen.cpp @@ -56,7 +56,7 @@ void Offscreen::destroy() //-------------------------------------------------------------------------------------------------- // Creating an offscreen frame buffer and the associated render pass // -void Offscreen::createFramebuffer(VkExtent2D& size) +void Offscreen::createFramebuffer(const VkExtent2D& size) { m_alloc->destroy(m_colorTexture); m_alloc->destroy(m_depthTexture); diff --git a/ray_tracing__advance/offscreen.hpp b/ray_tracing__advance/offscreen.hpp index fd70210..5d744d1 100644 --- a/ray_tracing__advance/offscreen.hpp +++ b/ray_tracing__advance/offscreen.hpp @@ -34,7 +34,7 @@ public: void setup(const VkDevice& device, const VkPhysicalDevice& physicalDevice, nvvk::ResourceAllocator* allocator, uint32_t queueFamily); void destroy(); - void createFramebuffer(VkExtent2D& size); + void createFramebuffer(const VkExtent2D& size); void createPipeline(VkRenderPass& renderPass); void createDescriptor(); void updateDescriptorSet(); diff --git a/ray_tracing_ao/main.cpp b/ray_tracing_ao/main.cpp index 6c5f1bc..1ca16b2 100644 --- a/ray_tracing_ao/main.cpp +++ b/ray_tracing_ao/main.cpp @@ -216,7 +216,7 @@ int main(int argc, char** argv) ImGui::ColorEdit3("Clear color", reinterpret_cast(&clearColor)); renderUI(helloVk); - ImGui::SetNextTreeNodeOpen(true, ImGuiCond_Once); + ImGui::SetNextItemOpen(true, ImGuiCond_Once); if(ImGui::CollapsingHeader("Ambient Occlusion")) { bool changed{false}; diff --git a/ray_tracing_callable/hello_vulkan.h b/ray_tracing_callable/hello_vulkan.h index a1659f8..73997f6 100644 --- a/ray_tracing_callable/hello_vulkan.h +++ b/ray_tracing_callable/hello_vulkan.h @@ -76,8 +76,8 @@ public: {1}, // model identity {10.f, 15.f, 8.f}, // lightPosition {0}, // instanceId to retrieve the transformation matrix - {100.f}, // lightIntensity {-1.f, -1.f, -1.f}, // lightDirection + {100.f}, // lightIntensity {cos(deg2rad(12.5f))}, // lightSpotCutoff {cos(deg2rad(17.5f))}, // lightSpotOuterCutoff {0} // lightType 0: point, 1: infinite diff --git a/ray_tracing_callable/main.cpp b/ray_tracing_callable/main.cpp index e82e50e..25ba778 100644 --- a/ray_tracing_callable/main.cpp +++ b/ray_tracing_callable/main.cpp @@ -54,7 +54,7 @@ static void onErrorCallback(int error, const char* description) void renderUI(HelloVulkan& helloVk) { ImGuiH::CameraWidget(); - ImGui::SetNextTreeNodeOpen(true, ImGuiCond_Once); + ImGui::SetNextItemOpen(true, ImGuiCond_Once); if(ImGui::CollapsingHeader("Light")) { ImGui::RadioButton("Point", &helloVk.m_pcRaster.lightType, 0); diff --git a/ray_tracing_callable/shaders/host_device.h b/ray_tracing_callable/shaders/host_device.h index 9f118b6..78e4e7d 100644 --- a/ray_tracing_callable/shaders/host_device.h +++ b/ray_tracing_callable/shaders/host_device.h @@ -77,8 +77,8 @@ struct PushConstantRaster mat4 modelMatrix; // matrix of the instance vec3 lightPosition; uint objIndex; - float lightIntensity; vec3 lightDirection; + float lightIntensity; float lightSpotCutoff; float lightSpotOuterCutoff; int lightType; diff --git a/ray_tracing_intersection/main.cpp b/ray_tracing_intersection/main.cpp index 47a952c..f3e815f 100644 --- a/ray_tracing_intersection/main.cpp +++ b/ray_tracing_intersection/main.cpp @@ -63,7 +63,7 @@ void renderUI(HelloVulkan& helloVk) ImGui::SliderFloat3("Position", &helloVk.m_pcRaster.lightPosition.x, -20.f, 20.f); ImGui::SliderFloat("Intensity", &helloVk.m_pcRaster.lightIntensity, 0.f, 150.f); } - ImGui::Text("Nb Spheres and Cubes: %llu", helloVk.m_spheres.size()); + ImGui::Text("Nb Spheres and Cubes: %lu", helloVk.m_spheres.size()); } //////////////////////////////////////////////////////////////////////////