Bulk update nvpro-samples 03/10/22
This commit is contained in:
parent
7a2e7e6837
commit
08dab08b0b
7 changed files with 7 additions and 7 deletions
|
|
@ -56,7 +56,7 @@ void Offscreen::destroy()
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
// Creating an offscreen frame buffer and the associated render pass
|
// 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_colorTexture);
|
||||||
m_alloc->destroy(m_depthTexture);
|
m_alloc->destroy(m_depthTexture);
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ public:
|
||||||
void setup(const VkDevice& device, const VkPhysicalDevice& physicalDevice, nvvk::ResourceAllocator* allocator, uint32_t queueFamily);
|
void setup(const VkDevice& device, const VkPhysicalDevice& physicalDevice, nvvk::ResourceAllocator* allocator, uint32_t queueFamily);
|
||||||
void destroy();
|
void destroy();
|
||||||
|
|
||||||
void createFramebuffer(VkExtent2D& size);
|
void createFramebuffer(const VkExtent2D& size);
|
||||||
void createPipeline(VkRenderPass& renderPass);
|
void createPipeline(VkRenderPass& renderPass);
|
||||||
void createDescriptor();
|
void createDescriptor();
|
||||||
void updateDescriptorSet();
|
void updateDescriptorSet();
|
||||||
|
|
|
||||||
|
|
@ -216,7 +216,7 @@ int main(int argc, char** argv)
|
||||||
ImGui::ColorEdit3("Clear color", reinterpret_cast<float*>(&clearColor));
|
ImGui::ColorEdit3("Clear color", reinterpret_cast<float*>(&clearColor));
|
||||||
|
|
||||||
renderUI(helloVk);
|
renderUI(helloVk);
|
||||||
ImGui::SetNextTreeNodeOpen(true, ImGuiCond_Once);
|
ImGui::SetNextItemOpen(true, ImGuiCond_Once);
|
||||||
if(ImGui::CollapsingHeader("Ambient Occlusion"))
|
if(ImGui::CollapsingHeader("Ambient Occlusion"))
|
||||||
{
|
{
|
||||||
bool changed{false};
|
bool changed{false};
|
||||||
|
|
|
||||||
|
|
@ -76,8 +76,8 @@ public:
|
||||||
{1}, // model identity
|
{1}, // model identity
|
||||||
{10.f, 15.f, 8.f}, // lightPosition
|
{10.f, 15.f, 8.f}, // lightPosition
|
||||||
{0}, // instanceId to retrieve the transformation matrix
|
{0}, // instanceId to retrieve the transformation matrix
|
||||||
{100.f}, // lightIntensity
|
|
||||||
{-1.f, -1.f, -1.f}, // lightDirection
|
{-1.f, -1.f, -1.f}, // lightDirection
|
||||||
|
{100.f}, // lightIntensity
|
||||||
{cos(deg2rad(12.5f))}, // lightSpotCutoff
|
{cos(deg2rad(12.5f))}, // lightSpotCutoff
|
||||||
{cos(deg2rad(17.5f))}, // lightSpotOuterCutoff
|
{cos(deg2rad(17.5f))}, // lightSpotOuterCutoff
|
||||||
{0} // lightType 0: point, 1: infinite
|
{0} // lightType 0: point, 1: infinite
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@ static void onErrorCallback(int error, const char* description)
|
||||||
void renderUI(HelloVulkan& helloVk)
|
void renderUI(HelloVulkan& helloVk)
|
||||||
{
|
{
|
||||||
ImGuiH::CameraWidget();
|
ImGuiH::CameraWidget();
|
||||||
ImGui::SetNextTreeNodeOpen(true, ImGuiCond_Once);
|
ImGui::SetNextItemOpen(true, ImGuiCond_Once);
|
||||||
if(ImGui::CollapsingHeader("Light"))
|
if(ImGui::CollapsingHeader("Light"))
|
||||||
{
|
{
|
||||||
ImGui::RadioButton("Point", &helloVk.m_pcRaster.lightType, 0);
|
ImGui::RadioButton("Point", &helloVk.m_pcRaster.lightType, 0);
|
||||||
|
|
|
||||||
|
|
@ -77,8 +77,8 @@ struct PushConstantRaster
|
||||||
mat4 modelMatrix; // matrix of the instance
|
mat4 modelMatrix; // matrix of the instance
|
||||||
vec3 lightPosition;
|
vec3 lightPosition;
|
||||||
uint objIndex;
|
uint objIndex;
|
||||||
float lightIntensity;
|
|
||||||
vec3 lightDirection;
|
vec3 lightDirection;
|
||||||
|
float lightIntensity;
|
||||||
float lightSpotCutoff;
|
float lightSpotCutoff;
|
||||||
float lightSpotOuterCutoff;
|
float lightSpotOuterCutoff;
|
||||||
int lightType;
|
int lightType;
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,7 @@ void renderUI(HelloVulkan& helloVk)
|
||||||
ImGui::SliderFloat3("Position", &helloVk.m_pcRaster.lightPosition.x, -20.f, 20.f);
|
ImGui::SliderFloat3("Position", &helloVk.m_pcRaster.lightPosition.x, -20.f, 20.f);
|
||||||
ImGui::SliderFloat("Intensity", &helloVk.m_pcRaster.lightIntensity, 0.f, 150.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());
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue