Ray tracing samples can now also use the UI overlay
General cleanup, changed default settings.overlay value
This commit is contained in:
parent
d0f0e1698e
commit
3b1ff1eece
73 changed files with 129 additions and 87 deletions
|
|
@ -1,25 +1,105 @@
|
||||||
/*
|
/*
|
||||||
* Extended sample base class for ray tracing based samples
|
* Extended sample base class for ray tracing based samples
|
||||||
*
|
*
|
||||||
* Copyright (C) 2020 by Sascha Willems - www.saschawillems.de
|
* Copyright (C) 2020-2021 by Sascha Willems - www.saschawillems.de
|
||||||
*
|
*
|
||||||
* This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
|
* This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "VulkanRaytracingSample.h"
|
#include "VulkanRaytracingSample.h"
|
||||||
|
|
||||||
void VulkanRaytracingSample::enableExtensions(bool rayqueryOnly)
|
void VulkanRaytracingSample::updateRenderPass()
|
||||||
|
{
|
||||||
|
// Update the default render pass with different color attachment load ops to keep attachment contents
|
||||||
|
// With this change, we can e.g. draw an UI on top of the ray traced scene
|
||||||
|
|
||||||
|
vkDestroyRenderPass(device, renderPass, nullptr);
|
||||||
|
|
||||||
|
std::array<VkAttachmentDescription, 2> attachments = {};
|
||||||
|
// Color attachment
|
||||||
|
attachments[0].format = swapChain.colorFormat;
|
||||||
|
attachments[0].samples = VK_SAMPLE_COUNT_1_BIT;
|
||||||
|
attachments[0].loadOp = VK_ATTACHMENT_LOAD_OP_LOAD;
|
||||||
|
attachments[0].storeOp = VK_ATTACHMENT_STORE_OP_STORE;
|
||||||
|
attachments[0].stencilLoadOp = VK_ATTACHMENT_LOAD_OP_DONT_CARE;
|
||||||
|
attachments[0].stencilStoreOp = VK_ATTACHMENT_STORE_OP_DONT_CARE;
|
||||||
|
attachments[0].initialLayout = VK_IMAGE_LAYOUT_PRESENT_SRC_KHR;
|
||||||
|
attachments[0].finalLayout = VK_IMAGE_LAYOUT_PRESENT_SRC_KHR;
|
||||||
|
// Depth attachment
|
||||||
|
attachments[1].format = depthFormat;
|
||||||
|
attachments[1].samples = VK_SAMPLE_COUNT_1_BIT;
|
||||||
|
attachments[1].loadOp = VK_ATTACHMENT_LOAD_OP_CLEAR;
|
||||||
|
attachments[1].storeOp = VK_ATTACHMENT_STORE_OP_STORE;
|
||||||
|
attachments[1].stencilLoadOp = VK_ATTACHMENT_LOAD_OP_CLEAR;
|
||||||
|
attachments[1].stencilStoreOp = VK_ATTACHMENT_STORE_OP_DONT_CARE;
|
||||||
|
attachments[1].initialLayout = VK_IMAGE_LAYOUT_UNDEFINED;
|
||||||
|
attachments[1].finalLayout = VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL;
|
||||||
|
|
||||||
|
VkAttachmentReference colorReference = {};
|
||||||
|
colorReference.attachment = 0;
|
||||||
|
colorReference.layout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL;
|
||||||
|
|
||||||
|
VkAttachmentReference depthReference = {};
|
||||||
|
depthReference.attachment = 1;
|
||||||
|
depthReference.layout = VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL;
|
||||||
|
|
||||||
|
VkSubpassDescription subpassDescription = {};
|
||||||
|
subpassDescription.pipelineBindPoint = VK_PIPELINE_BIND_POINT_GRAPHICS;
|
||||||
|
subpassDescription.colorAttachmentCount = 1;
|
||||||
|
subpassDescription.pColorAttachments = &colorReference;
|
||||||
|
subpassDescription.pDepthStencilAttachment = &depthReference;
|
||||||
|
subpassDescription.inputAttachmentCount = 0;
|
||||||
|
subpassDescription.pInputAttachments = nullptr;
|
||||||
|
subpassDescription.preserveAttachmentCount = 0;
|
||||||
|
subpassDescription.pPreserveAttachments = nullptr;
|
||||||
|
subpassDescription.pResolveAttachments = nullptr;
|
||||||
|
|
||||||
|
// Subpass dependencies for layout transitions
|
||||||
|
std::array<VkSubpassDependency, 2> dependencies;
|
||||||
|
|
||||||
|
dependencies[0].srcSubpass = VK_SUBPASS_EXTERNAL;
|
||||||
|
dependencies[0].dstSubpass = 0;
|
||||||
|
dependencies[0].srcStageMask = VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT;
|
||||||
|
dependencies[0].dstStageMask = VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT;
|
||||||
|
dependencies[0].srcAccessMask = VK_ACCESS_MEMORY_READ_BIT;
|
||||||
|
dependencies[0].dstAccessMask = VK_ACCESS_COLOR_ATTACHMENT_READ_BIT | VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT;
|
||||||
|
dependencies[0].dependencyFlags = VK_DEPENDENCY_BY_REGION_BIT;
|
||||||
|
|
||||||
|
dependencies[1].srcSubpass = 0;
|
||||||
|
dependencies[1].dstSubpass = VK_SUBPASS_EXTERNAL;
|
||||||
|
dependencies[1].srcStageMask = VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT;
|
||||||
|
dependencies[1].dstStageMask = VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT;
|
||||||
|
dependencies[1].srcAccessMask = VK_ACCESS_COLOR_ATTACHMENT_READ_BIT | VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT;
|
||||||
|
dependencies[1].dstAccessMask = VK_ACCESS_MEMORY_READ_BIT;
|
||||||
|
dependencies[1].dependencyFlags = VK_DEPENDENCY_BY_REGION_BIT;
|
||||||
|
|
||||||
|
VkRenderPassCreateInfo renderPassInfo = {};
|
||||||
|
renderPassInfo.sType = VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO;
|
||||||
|
renderPassInfo.attachmentCount = static_cast<uint32_t>(attachments.size());
|
||||||
|
renderPassInfo.pAttachments = attachments.data();
|
||||||
|
renderPassInfo.subpassCount = 1;
|
||||||
|
renderPassInfo.pSubpasses = &subpassDescription;
|
||||||
|
renderPassInfo.dependencyCount = static_cast<uint32_t>(dependencies.size());
|
||||||
|
renderPassInfo.pDependencies = dependencies.data();
|
||||||
|
VK_CHECK_RESULT(vkCreateRenderPass(device, &renderPassInfo, nullptr, &renderPass));
|
||||||
|
}
|
||||||
|
|
||||||
|
void VulkanRaytracingSample::enableExtensions()
|
||||||
{
|
{
|
||||||
// Require Vulkan 1.1
|
// Require Vulkan 1.1
|
||||||
apiVersion = VK_API_VERSION_1_1;
|
apiVersion = VK_API_VERSION_1_1;
|
||||||
|
|
||||||
// Ray tracing related extensions required by this sample
|
// Ray tracing related extensions required by this sample
|
||||||
enabledDeviceExtensions.push_back(VK_KHR_ACCELERATION_STRUCTURE_EXTENSION_NAME);
|
enabledDeviceExtensions.push_back(VK_KHR_ACCELERATION_STRUCTURE_EXTENSION_NAME);
|
||||||
if (!rayqueryOnly) enabledDeviceExtensions.push_back(VK_KHR_RAY_TRACING_PIPELINE_EXTENSION_NAME);
|
if (!rayQueryOnly) {
|
||||||
|
enabledDeviceExtensions.push_back(VK_KHR_RAY_TRACING_PIPELINE_EXTENSION_NAME);
|
||||||
|
}
|
||||||
|
|
||||||
// Required by VK_KHR_acceleration_structure
|
// Required by VK_KHR_acceleration_structure
|
||||||
enabledDeviceExtensions.push_back(VK_KHR_BUFFER_DEVICE_ADDRESS_EXTENSION_NAME);
|
enabledDeviceExtensions.push_back(VK_KHR_BUFFER_DEVICE_ADDRESS_EXTENSION_NAME);
|
||||||
if (!rayqueryOnly) enabledDeviceExtensions.push_back(VK_KHR_DEFERRED_HOST_OPERATIONS_EXTENSION_NAME);
|
if (!rayQueryOnly) {
|
||||||
|
enabledDeviceExtensions.push_back(VK_KHR_DEFERRED_HOST_OPERATIONS_EXTENSION_NAME);
|
||||||
|
}
|
||||||
enabledDeviceExtensions.push_back(VK_EXT_DESCRIPTOR_INDEXING_EXTENSION_NAME);
|
enabledDeviceExtensions.push_back(VK_EXT_DESCRIPTOR_INDEXING_EXTENSION_NAME);
|
||||||
|
|
||||||
// Required for VK_KHR_ray_tracing_pipeline
|
// Required for VK_KHR_ray_tracing_pipeline
|
||||||
|
|
@ -199,6 +279,10 @@ void VulkanRaytracingSample::prepare()
|
||||||
vkCmdTraceRaysKHR = reinterpret_cast<PFN_vkCmdTraceRaysKHR>(vkGetDeviceProcAddr(device, "vkCmdTraceRaysKHR"));
|
vkCmdTraceRaysKHR = reinterpret_cast<PFN_vkCmdTraceRaysKHR>(vkGetDeviceProcAddr(device, "vkCmdTraceRaysKHR"));
|
||||||
vkGetRayTracingShaderGroupHandlesKHR = reinterpret_cast<PFN_vkGetRayTracingShaderGroupHandlesKHR>(vkGetDeviceProcAddr(device, "vkGetRayTracingShaderGroupHandlesKHR"));
|
vkGetRayTracingShaderGroupHandlesKHR = reinterpret_cast<PFN_vkGetRayTracingShaderGroupHandlesKHR>(vkGetDeviceProcAddr(device, "vkGetRayTracingShaderGroupHandlesKHR"));
|
||||||
vkCreateRayTracingPipelinesKHR = reinterpret_cast<PFN_vkCreateRayTracingPipelinesKHR>(vkGetDeviceProcAddr(device, "vkCreateRayTracingPipelinesKHR"));
|
vkCreateRayTracingPipelinesKHR = reinterpret_cast<PFN_vkCreateRayTracingPipelinesKHR>(vkGetDeviceProcAddr(device, "vkCreateRayTracingPipelinesKHR"));
|
||||||
|
// Update the render pass to keep the color attachment contents, so we can draw the UI on top of the ray traced output
|
||||||
|
if (!rayQueryOnly) {
|
||||||
|
updateRenderPass();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
VkStridedDeviceAddressRegionKHR VulkanRaytracingSample::getSbtEntryStridedDeviceAddressRegion(VkBuffer buffer, uint32_t handleCount)
|
VkStridedDeviceAddressRegionKHR VulkanRaytracingSample::getSbtEntryStridedDeviceAddressRegion(VkBuffer buffer, uint32_t handleCount)
|
||||||
|
|
@ -224,3 +308,24 @@ void VulkanRaytracingSample::createShaderBindingTable(ShaderBindingTable& shader
|
||||||
// Map persistent
|
// Map persistent
|
||||||
shaderBindingTable.map();
|
shaderBindingTable.map();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void VulkanRaytracingSample::drawUI(VkCommandBuffer commandBuffer, VkFramebuffer framebuffer)
|
||||||
|
{
|
||||||
|
VkClearValue clearValues[2];
|
||||||
|
clearValues[0].color = defaultClearColor;
|
||||||
|
clearValues[1].depthStencil = { 1.0f, 0 };
|
||||||
|
|
||||||
|
VkRenderPassBeginInfo renderPassBeginInfo = vks::initializers::renderPassBeginInfo();
|
||||||
|
renderPassBeginInfo.renderPass = renderPass;
|
||||||
|
renderPassBeginInfo.renderArea.offset.x = 0;
|
||||||
|
renderPassBeginInfo.renderArea.offset.y = 0;
|
||||||
|
renderPassBeginInfo.renderArea.extent.width = width;
|
||||||
|
renderPassBeginInfo.renderArea.extent.height = height;
|
||||||
|
renderPassBeginInfo.clearValueCount = 2;
|
||||||
|
renderPassBeginInfo.pClearValues = clearValues;
|
||||||
|
renderPassBeginInfo.framebuffer = framebuffer;
|
||||||
|
|
||||||
|
vkCmdBeginRenderPass(commandBuffer, &renderPassBeginInfo, VK_SUBPASS_CONTENTS_INLINE);
|
||||||
|
VulkanExampleBase::drawUI(commandBuffer);
|
||||||
|
vkCmdEndRenderPass(commandBuffer);
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,9 @@
|
||||||
|
|
||||||
class VulkanRaytracingSample : public VulkanExampleBase
|
class VulkanRaytracingSample : public VulkanExampleBase
|
||||||
{
|
{
|
||||||
|
protected:
|
||||||
|
// Update the default render pass with different color attachment load ops
|
||||||
|
virtual void updateRenderPass();
|
||||||
public:
|
public:
|
||||||
// Function pointers for ray tracing related stuff
|
// Function pointers for ray tracing related stuff
|
||||||
PFN_vkGetBufferDeviceAddressKHR vkGetBufferDeviceAddressKHR;
|
PFN_vkGetBufferDeviceAddressKHR vkGetBufferDeviceAddressKHR;
|
||||||
|
|
@ -45,7 +48,7 @@ public:
|
||||||
VkDeviceMemory memory = VK_NULL_HANDLE;
|
VkDeviceMemory memory = VK_NULL_HANDLE;
|
||||||
};
|
};
|
||||||
|
|
||||||
// Holds information for a ray tracing tracing acceleration structure
|
// Holds information for a ray tracing acceleration structure
|
||||||
struct AccelerationStructure {
|
struct AccelerationStructure {
|
||||||
VkAccelerationStructureKHR handle;
|
VkAccelerationStructureKHR handle;
|
||||||
uint64_t deviceAddress = 0;
|
uint64_t deviceAddress = 0;
|
||||||
|
|
@ -67,7 +70,10 @@ public:
|
||||||
VkStridedDeviceAddressRegionKHR stridedDeviceAddressRegion{};
|
VkStridedDeviceAddressRegionKHR stridedDeviceAddressRegion{};
|
||||||
};
|
};
|
||||||
|
|
||||||
void enableExtensions(bool rayqueryOnly = false);
|
// Set to true, to denote that the sample only uses ray queries (changes extension and render pass handling)
|
||||||
|
bool rayQueryOnly = false;
|
||||||
|
|
||||||
|
void enableExtensions();
|
||||||
ScratchBuffer createScratchBuffer(VkDeviceSize size);
|
ScratchBuffer createScratchBuffer(VkDeviceSize size);
|
||||||
void deleteScratchBuffer(ScratchBuffer& scratchBuffer);
|
void deleteScratchBuffer(ScratchBuffer& scratchBuffer);
|
||||||
void createAccelerationStructure(AccelerationStructure& accelerationStructure, VkAccelerationStructureTypeKHR type, VkAccelerationStructureBuildSizesInfoKHR buildSizeInfo);
|
void createAccelerationStructure(AccelerationStructure& accelerationStructure, VkAccelerationStructureTypeKHR type, VkAccelerationStructureBuildSizesInfoKHR buildSizeInfo);
|
||||||
|
|
@ -77,6 +83,8 @@ public:
|
||||||
void deleteStorageImage();
|
void deleteStorageImage();
|
||||||
VkStridedDeviceAddressRegionKHR getSbtEntryStridedDeviceAddressRegion(VkBuffer buffer, uint32_t handleCount);
|
VkStridedDeviceAddressRegionKHR getSbtEntryStridedDeviceAddressRegion(VkBuffer buffer, uint32_t handleCount);
|
||||||
void createShaderBindingTable(ShaderBindingTable& shaderBindingTable, uint32_t handleCount);
|
void createShaderBindingTable(ShaderBindingTable& shaderBindingTable, uint32_t handleCount);
|
||||||
|
// Draw the ImGUI UI overlay using a render pass
|
||||||
|
void drawUI(VkCommandBuffer commandBuffer, VkFramebuffer framebuffer);
|
||||||
|
|
||||||
virtual void prepare();
|
virtual void prepare();
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -200,7 +200,7 @@ public:
|
||||||
/** @brief Set to true if v-sync will be forced for the swapchain */
|
/** @brief Set to true if v-sync will be forced for the swapchain */
|
||||||
bool vsync = false;
|
bool vsync = false;
|
||||||
/** @brief Enable UI overlay */
|
/** @brief Enable UI overlay */
|
||||||
bool overlay = false;
|
bool overlay = true;
|
||||||
} settings;
|
} settings;
|
||||||
|
|
||||||
VkClearColorValue defaultClearColor = { { 0.025f, 0.025f, 0.025f, 1.0f } };
|
VkClearColorValue defaultClearColor = { { 0.025f, 0.025f, 0.025f, 1.0f } };
|
||||||
|
|
|
||||||
|
|
@ -97,7 +97,6 @@ public:
|
||||||
{
|
{
|
||||||
title = "Bloom (offscreen rendering)";
|
title = "Bloom (offscreen rendering)";
|
||||||
timerSpeed *= 0.5f;
|
timerSpeed *= 0.5f;
|
||||||
settings.overlay = true;
|
|
||||||
camera.type = Camera::CameraType::lookat;
|
camera.type = Camera::CameraType::lookat;
|
||||||
camera.setPosition(glm::vec3(0.0f, 0.0f, -10.25f));
|
camera.setPosition(glm::vec3(0.0f, 0.0f, -10.25f));
|
||||||
camera.setRotation(glm::vec3(7.5f, -343.0f, 0.0f));
|
camera.setRotation(glm::vec3(7.5f, -343.0f, 0.0f));
|
||||||
|
|
|
||||||
|
|
@ -96,7 +96,6 @@ public:
|
||||||
camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 512.0f);
|
camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 512.0f);
|
||||||
camera.setRotation(glm::vec3(-30.0f, -45.0f, 0.0f));
|
camera.setRotation(glm::vec3(-30.0f, -45.0f, 0.0f));
|
||||||
camera.setTranslation(glm::vec3(0.0f, 0.0f, -5.0f));
|
camera.setTranslation(glm::vec3(0.0f, 0.0f, -5.0f));
|
||||||
settings.overlay = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
~VulkanExample()
|
~VulkanExample()
|
||||||
|
|
|
||||||
|
|
@ -98,7 +98,6 @@ public:
|
||||||
camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 512.0f);
|
camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 512.0f);
|
||||||
camera.setTranslation(glm::vec3(0.5f, 0.0f, 0.0f));
|
camera.setTranslation(glm::vec3(0.5f, 0.0f, 0.0f));
|
||||||
camera.movementSpeed = 5.0f;
|
camera.movementSpeed = 5.0f;
|
||||||
settings.overlay = true;
|
|
||||||
memset(&indirectStats, 0, sizeof(indirectStats));
|
memset(&indirectStats, 0, sizeof(indirectStats));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -82,7 +82,6 @@ public:
|
||||||
VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION)
|
VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION)
|
||||||
{
|
{
|
||||||
title = "Compute shader N-body system";
|
title = "Compute shader N-body system";
|
||||||
settings.overlay = true;
|
|
||||||
camera.type = Camera::CameraType::lookat;
|
camera.type = Camera::CameraType::lookat;
|
||||||
camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 512.0f);
|
camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 512.0f);
|
||||||
camera.setRotation(glm::vec3(-26.0f, 75.0f, 0.0f));
|
camera.setRotation(glm::vec3(-26.0f, 75.0f, 0.0f));
|
||||||
|
|
|
||||||
|
|
@ -78,7 +78,6 @@ public:
|
||||||
VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION)
|
VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION)
|
||||||
{
|
{
|
||||||
title = "Compute shader particle system";
|
title = "Compute shader particle system";
|
||||||
settings.overlay = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
~VulkanExample()
|
~VulkanExample()
|
||||||
|
|
|
||||||
|
|
@ -81,7 +81,6 @@ public:
|
||||||
VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION)
|
VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION)
|
||||||
{
|
{
|
||||||
title = "Compute shader ray tracing";
|
title = "Compute shader ray tracing";
|
||||||
settings.overlay = true;
|
|
||||||
compute.ubo.aspectRatio = (float)width / (float)height;
|
compute.ubo.aspectRatio = (float)width / (float)height;
|
||||||
timerSpeed *= 0.25f;
|
timerSpeed *= 0.25f;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -74,7 +74,6 @@ public:
|
||||||
camera.setPosition(glm::vec3(0.0f, 0.0f, -2.0f));
|
camera.setPosition(glm::vec3(0.0f, 0.0f, -2.0f));
|
||||||
camera.setRotation(glm::vec3(0.0f));
|
camera.setRotation(glm::vec3(0.0f));
|
||||||
camera.setPerspective(60.0f, (float)width * 0.5f / (float)height, 1.0f, 256.0f);
|
camera.setPerspective(60.0f, (float)width * 0.5f / (float)height, 1.0f, 256.0f);
|
||||||
settings.overlay = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
~VulkanExample()
|
~VulkanExample()
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,6 @@ public:
|
||||||
VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION)
|
VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION)
|
||||||
{
|
{
|
||||||
title = "Conditional rendering";
|
title = "Conditional rendering";
|
||||||
settings.overlay = true;
|
|
||||||
camera.type = Camera::CameraType::lookat;
|
camera.type = Camera::CameraType::lookat;
|
||||||
camera.setPerspective(45.0f, (float)width / (float)height, 0.1f, 512.0f);
|
camera.setPerspective(45.0f, (float)width / (float)height, 0.1f, 512.0f);
|
||||||
camera.setRotation(glm::vec3(-2.25f, -52.0f, 0.0f));
|
camera.setRotation(glm::vec3(-2.25f, -52.0f, 0.0f));
|
||||||
|
|
|
||||||
|
|
@ -87,7 +87,6 @@ public:
|
||||||
VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION)
|
VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION)
|
||||||
{
|
{
|
||||||
title = "Conservative rasterization";
|
title = "Conservative rasterization";
|
||||||
settings.overlay = true;
|
|
||||||
|
|
||||||
camera.type = Camera::CameraType::lookat;
|
camera.type = Camera::CameraType::lookat;
|
||||||
camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 512.0f);
|
camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 512.0f);
|
||||||
|
|
|
||||||
|
|
@ -218,7 +218,6 @@ public:
|
||||||
VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION)
|
VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION)
|
||||||
{
|
{
|
||||||
title = "Debugging with VK_EXT_debug_marker";
|
title = "Debugging with VK_EXT_debug_marker";
|
||||||
settings.overlay = true;
|
|
||||||
camera.setRotation(glm::vec3(-4.35f, 16.25f, 0.0f));
|
camera.setRotation(glm::vec3(-4.35f, 16.25f, 0.0f));
|
||||||
camera.setRotationSpeed(0.5f);
|
camera.setRotationSpeed(0.5f);
|
||||||
camera.setPosition(glm::vec3(0.1f, 1.1f, -8.5f));
|
camera.setPosition(glm::vec3(0.1f, 1.1f, -8.5f));
|
||||||
|
|
|
||||||
|
|
@ -111,7 +111,6 @@ public:
|
||||||
camera.position = { 2.15f, 0.3f, -8.75f };
|
camera.position = { 2.15f, 0.3f, -8.75f };
|
||||||
camera.setRotation(glm::vec3(-0.75f, 12.5f, 0.0f));
|
camera.setRotation(glm::vec3(-0.75f, 12.5f, 0.0f));
|
||||||
camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 256.0f);
|
camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 256.0f);
|
||||||
settings.overlay = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
~VulkanExample()
|
~VulkanExample()
|
||||||
|
|
|
||||||
|
|
@ -102,7 +102,6 @@ public:
|
||||||
camera.setRotation(glm::vec3(-0.75f, 12.5f, 0.0f));
|
camera.setRotation(glm::vec3(-0.75f, 12.5f, 0.0f));
|
||||||
camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 256.0f);
|
camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 256.0f);
|
||||||
paused = true;
|
paused = true;
|
||||||
settings.overlay = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
~VulkanExample()
|
~VulkanExample()
|
||||||
|
|
|
||||||
|
|
@ -146,7 +146,6 @@ public:
|
||||||
camera.setPerspective(60.0f, (float)width / (float)height, zNear, zFar);
|
camera.setPerspective(60.0f, (float)width / (float)height, zNear, zFar);
|
||||||
timerSpeed *= 0.25f;
|
timerSpeed *= 0.25f;
|
||||||
paused = true;
|
paused = true;
|
||||||
settings.overlay = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
~VulkanExample()
|
~VulkanExample()
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,6 @@ public:
|
||||||
VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION)
|
VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION)
|
||||||
{
|
{
|
||||||
title = "Descriptor indexing";
|
title = "Descriptor indexing";
|
||||||
settings.overlay = true;
|
|
||||||
camera.type = Camera::CameraType::lookat;
|
camera.type = Camera::CameraType::lookat;
|
||||||
camera.setPosition(glm::vec3(0.0f, 0.0f, -10.0f));
|
camera.setPosition(glm::vec3(0.0f, 0.0f, -10.0f));
|
||||||
camera.setRotation(glm::vec3(-35.0f, 0.0f, 0.0f));
|
camera.setRotation(glm::vec3(-35.0f, 0.0f, 0.0f));
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,6 @@ public:
|
||||||
VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION)
|
VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION)
|
||||||
{
|
{
|
||||||
title = "Using descriptor Sets";
|
title = "Using descriptor Sets";
|
||||||
settings.overlay = true;
|
|
||||||
camera.type = Camera::CameraType::lookat;
|
camera.type = Camera::CameraType::lookat;
|
||||||
camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 512.0f);
|
camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 512.0f);
|
||||||
camera.setRotation(glm::vec3(0.0f, 0.0f, 0.0f));
|
camera.setRotation(glm::vec3(0.0f, 0.0f, 0.0f));
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,6 @@ public:
|
||||||
camera.setPosition(glm::vec3(0.0f, 0.0f, -1.25f));
|
camera.setPosition(glm::vec3(0.0f, 0.0f, -1.25f));
|
||||||
camera.setRotation(glm::vec3(-20.0f, 45.0f, 0.0f));
|
camera.setRotation(glm::vec3(-20.0f, 45.0f, 0.0f));
|
||||||
camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 256.0f);
|
camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 256.0f);
|
||||||
settings.overlay = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
~VulkanExample()
|
~VulkanExample()
|
||||||
|
|
|
||||||
|
|
@ -100,7 +100,6 @@ public:
|
||||||
camera.setPosition(glm::vec3(0.0f, 0.0f, -2.0f));
|
camera.setPosition(glm::vec3(0.0f, 0.0f, -2.0f));
|
||||||
camera.setRotation(glm::vec3(0.0f));
|
camera.setRotation(glm::vec3(0.0f));
|
||||||
camera.setPerspective(splitScreen ? 30.0f : 45.0f, (float)width / (float)(height * ((splitScreen) ? 0.5f : 1.0f)), 1.0f, 256.0f);
|
camera.setPerspective(splitScreen ? 30.0f : 45.0f, (float)width / (float)(height * ((splitScreen) ? 0.5f : 1.0f)), 1.0f, 256.0f);
|
||||||
settings.overlay = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
~VulkanExample()
|
~VulkanExample()
|
||||||
|
|
|
||||||
|
|
@ -101,7 +101,6 @@ public:
|
||||||
camera.setPosition(glm::vec3(0.0f, 0.0f, -30.0f));
|
camera.setPosition(glm::vec3(0.0f, 0.0f, -30.0f));
|
||||||
camera.setRotation(glm::vec3(0.0f));
|
camera.setRotation(glm::vec3(0.0f));
|
||||||
camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 256.0f);
|
camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 256.0f);
|
||||||
settings.overlay = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
~VulkanExample()
|
~VulkanExample()
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,6 @@ public:
|
||||||
camera.setRotation(glm::vec3(-23.75f, 41.25f, 21.0f));
|
camera.setRotation(glm::vec3(-23.75f, 41.25f, 21.0f));
|
||||||
camera.setPerspective(60.0f, (float)width / (float)height, 0.001f, 256.0f);
|
camera.setPerspective(60.0f, (float)width / (float)height, 0.001f, 256.0f);
|
||||||
timerSpeed *= 0.25f;
|
timerSpeed *= 0.25f;
|
||||||
settings.overlay = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
~VulkanExample()
|
~VulkanExample()
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,6 @@ public:
|
||||||
camera.setPosition(glm::vec3(0.0f, 0.0f, -1.0f));
|
camera.setPosition(glm::vec3(0.0f, 0.0f, -1.0f));
|
||||||
camera.setRotation(glm::vec3(0.0f, -25.0f, 0.0f));
|
camera.setRotation(glm::vec3(0.0f, -25.0f, 0.0f));
|
||||||
camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 128.0f);
|
camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 128.0f);
|
||||||
settings.overlay = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
~VulkanExample()
|
~VulkanExample()
|
||||||
|
|
|
||||||
|
|
@ -409,7 +409,6 @@ public:
|
||||||
camera.setPosition(glm::vec3(0.0f, -0.1f, -1.0f));
|
camera.setPosition(glm::vec3(0.0f, -0.1f, -1.0f));
|
||||||
camera.setRotation(glm::vec3(0.0f, -135.0f, 0.0f));
|
camera.setRotation(glm::vec3(0.0f, -135.0f, 0.0f));
|
||||||
camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 256.0f);
|
camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 256.0f);
|
||||||
settings.overlay = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
~VulkanExample()
|
~VulkanExample()
|
||||||
|
|
|
||||||
|
|
@ -291,7 +291,6 @@ VulkanExample::VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION)
|
||||||
camera.setPosition(glm::vec3(0.0f, 1.0f, 0.0f));
|
camera.setPosition(glm::vec3(0.0f, 1.0f, 0.0f));
|
||||||
camera.setRotation(glm::vec3(0.0f, -90.0f, 0.0f));
|
camera.setRotation(glm::vec3(0.0f, -90.0f, 0.0f));
|
||||||
camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 256.0f);
|
camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 256.0f);
|
||||||
settings.overlay = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
VulkanExample::~VulkanExample()
|
VulkanExample::~VulkanExample()
|
||||||
|
|
|
||||||
|
|
@ -649,7 +649,6 @@ VulkanExample::VulkanExample() :
|
||||||
camera.setPosition(glm::vec3(0.0f, 0.75f, -2.0f));
|
camera.setPosition(glm::vec3(0.0f, 0.75f, -2.0f));
|
||||||
camera.setRotation(glm::vec3(0.0f, 0.0f, 0.0f));
|
camera.setRotation(glm::vec3(0.0f, 0.0f, 0.0f));
|
||||||
camera.setPerspective(60.0f, (float) width / (float) height, 0.1f, 256.0f);
|
camera.setPerspective(60.0f, (float) width / (float) height, 0.1f, 256.0f);
|
||||||
settings.overlay = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
VulkanExample::~VulkanExample()
|
VulkanExample::~VulkanExample()
|
||||||
|
|
|
||||||
|
|
@ -109,7 +109,6 @@ public:
|
||||||
camera.setPosition(glm::vec3(0.0f, 0.0f, -6.0f));
|
camera.setPosition(glm::vec3(0.0f, 0.0f, -6.0f));
|
||||||
camera.setRotation(glm::vec3(0.0f, 0.0f, 0.0f));
|
camera.setRotation(glm::vec3(0.0f, 0.0f, 0.0f));
|
||||||
camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 256.0f);
|
camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 256.0f);
|
||||||
settings.overlay = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
~VulkanExample()
|
~VulkanExample()
|
||||||
|
|
|
||||||
|
|
@ -99,7 +99,6 @@ public:
|
||||||
camera.setRotation(glm::vec3(-12.0f, 159.0f, 0.0f));
|
camera.setRotation(glm::vec3(-12.0f, 159.0f, 0.0f));
|
||||||
camera.setTranslation(glm::vec3(0.4f, 1.25f, 0.0f));
|
camera.setTranslation(glm::vec3(0.4f, 1.25f, 0.0f));
|
||||||
camera.movementSpeed = 5.0f;
|
camera.movementSpeed = 5.0f;
|
||||||
settings.overlay = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
~VulkanExample()
|
~VulkanExample()
|
||||||
|
|
|
||||||
|
|
@ -72,7 +72,6 @@ public:
|
||||||
camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 256.0f);
|
camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 256.0f);
|
||||||
camera.movementSpeed = 4.0f;
|
camera.movementSpeed = 4.0f;
|
||||||
camera.rotationSpeed = 0.25f;
|
camera.rotationSpeed = 0.25f;
|
||||||
settings.overlay = true;
|
|
||||||
|
|
||||||
srand((unsigned int)time(0));
|
srand((unsigned int)time(0));
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -79,7 +79,6 @@ public:
|
||||||
camera.setPosition(glm::vec3(1.65f, 1.75f, -6.15f));
|
camera.setPosition(glm::vec3(1.65f, 1.75f, -6.15f));
|
||||||
camera.setRotation(glm::vec3(-12.75f, 380.0f, 0.0f));
|
camera.setRotation(glm::vec3(-12.75f, 380.0f, 0.0f));
|
||||||
camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 256.0f);
|
camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 256.0f);
|
||||||
settings.overlay = true;
|
|
||||||
UIOverlay.subpass = 1;
|
UIOverlay.subpass = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -79,7 +79,6 @@ public:
|
||||||
camera.setPosition(glm::vec3(5.5f, -1.85f, -18.5f));
|
camera.setPosition(glm::vec3(5.5f, -1.85f, -18.5f));
|
||||||
camera.setRotation(glm::vec3(-17.2f, -4.7f, 0.0f));
|
camera.setRotation(glm::vec3(-17.2f, -4.7f, 0.0f));
|
||||||
camera.setPerspective(60.0f, (float)width / (float)height, 1.0f, 256.0f);
|
camera.setPerspective(60.0f, (float)width / (float)height, 1.0f, 256.0f);
|
||||||
settings.overlay = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
~VulkanExample()
|
~VulkanExample()
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,6 @@ public:
|
||||||
camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 256.0f);
|
camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 256.0f);
|
||||||
camera.setRotation(glm::vec3(0.0f, -90.0f, 0.0f));
|
camera.setRotation(glm::vec3(0.0f, -90.0f, 0.0f));
|
||||||
camera.setTranslation(glm::vec3(2.5f, 2.5f, -7.5f));
|
camera.setTranslation(glm::vec3(2.5f, 2.5f, -7.5f));
|
||||||
settings.overlay = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
~VulkanExample()
|
~VulkanExample()
|
||||||
|
|
|
||||||
|
|
@ -103,7 +103,6 @@ public:
|
||||||
camera.setRotation(glm::vec3(0.0f));
|
camera.setRotation(glm::vec3(0.0f));
|
||||||
camera.setRotationSpeed(0.5f);
|
camera.setRotationSpeed(0.5f);
|
||||||
camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 256.0f);
|
camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 256.0f);
|
||||||
settings.overlay = true;
|
|
||||||
// Get number of max. concurrent threads
|
// Get number of max. concurrent threads
|
||||||
numThreads = std::thread::hardware_concurrency();
|
numThreads = std::thread::hardware_concurrency();
|
||||||
assert(numThreads > 0);
|
assert(numThreads > 0);
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,6 @@ public:
|
||||||
camera.setRotation(glm::vec3(0.0f, 90.0f, 0.0f));
|
camera.setRotation(glm::vec3(0.0f, 90.0f, 0.0f));
|
||||||
camera.setTranslation(glm::vec3(7.0f, 3.2f, 0.0f));
|
camera.setTranslation(glm::vec3(7.0f, 3.2f, 0.0f));
|
||||||
camera.movementSpeed = 5.0f;
|
camera.movementSpeed = 5.0f;
|
||||||
settings.overlay = true;
|
|
||||||
|
|
||||||
// Enable extension required for multiview
|
// Enable extension required for multiview
|
||||||
enabledDeviceExtensions.push_back(VK_KHR_MULTIVIEW_EXTENSION_NAME);
|
enabledDeviceExtensions.push_back(VK_KHR_MULTIVIEW_EXTENSION_NAME);
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,6 @@ public:
|
||||||
VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION)
|
VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION)
|
||||||
{
|
{
|
||||||
title = "Negative Viewport height";
|
title = "Negative Viewport height";
|
||||||
settings.overlay = true;
|
|
||||||
// [POI] VK_KHR_MAINTENANCE1 is required for using negative viewport heights
|
// [POI] VK_KHR_MAINTENANCE1 is required for using negative viewport heights
|
||||||
// Note: This is core as of Vulkan 1.1. So if you target 1.1 you don't have to explicitly enable this
|
// Note: This is core as of Vulkan 1.1. So if you target 1.1 you don't have to explicitly enable this
|
||||||
enabledDeviceExtensions.push_back(VK_KHR_MAINTENANCE1_EXTENSION_NAME);
|
enabledDeviceExtensions.push_back(VK_KHR_MAINTENANCE1_EXTENSION_NAME);
|
||||||
|
|
|
||||||
|
|
@ -67,7 +67,6 @@ public:
|
||||||
camera.setRotation(glm::vec3(0.0f, -123.75f, 0.0f));
|
camera.setRotation(glm::vec3(0.0f, -123.75f, 0.0f));
|
||||||
camera.setRotationSpeed(0.5f);
|
camera.setRotationSpeed(0.5f);
|
||||||
camera.setPerspective(60.0f, (float)width / (float)height, 1.0f, 256.0f);
|
camera.setPerspective(60.0f, (float)width / (float)height, 1.0f, 256.0f);
|
||||||
settings.overlay = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
~VulkanExample()
|
~VulkanExample()
|
||||||
|
|
|
||||||
|
|
@ -88,7 +88,6 @@ public:
|
||||||
camera.setRotation(glm::vec3(-2.5f, 0.0f, 0.0f));
|
camera.setRotation(glm::vec3(-2.5f, 0.0f, 0.0f));
|
||||||
camera.setRotationSpeed(0.5f);
|
camera.setRotationSpeed(0.5f);
|
||||||
camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 256.0f);
|
camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 256.0f);
|
||||||
settings.overlay = true;
|
|
||||||
// The scene shader uses a clipping plane, so this feature has to be enabled
|
// The scene shader uses a clipping plane, so this feature has to be enabled
|
||||||
enabledFeatures.shaderClipDistance = VK_TRUE;
|
enabledFeatures.shaderClipDistance = VK_TRUE;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -83,7 +83,6 @@ public:
|
||||||
camera.setPosition(glm::vec3(0.0f, 0.0f, -6.0f));
|
camera.setPosition(glm::vec3(0.0f, 0.0f, -6.0f));
|
||||||
camera.setRotation(glm::vec3(0.0f, 0.0f, 0.0f));
|
camera.setRotation(glm::vec3(0.0f, 0.0f, 0.0f));
|
||||||
camera.setPerspective(60.0f, (float) width / (float) height, 0.1f, 256.0f);
|
camera.setPerspective(60.0f, (float) width / (float) height, 0.1f, 256.0f);
|
||||||
settings.overlay = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
~VulkanExample()
|
~VulkanExample()
|
||||||
|
|
|
||||||
|
|
@ -70,7 +70,6 @@ public:
|
||||||
camera.setPosition(glm::vec3(0.0f, 1.25f, -1.5f));
|
camera.setPosition(glm::vec3(0.0f, 1.25f, -1.5f));
|
||||||
camera.setRotation(glm::vec3(-45.0f, 0.0f, 0.0f));
|
camera.setRotation(glm::vec3(-45.0f, 0.0f, 0.0f));
|
||||||
camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 256.0f);
|
camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 256.0f);
|
||||||
settings.overlay = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
~VulkanExample()
|
~VulkanExample()
|
||||||
|
|
|
||||||
|
|
@ -104,7 +104,6 @@ public:
|
||||||
camera.setPosition(glm::vec3(0.0f, 0.0f, -75.0f));
|
camera.setPosition(glm::vec3(0.0f, 0.0f, -75.0f));
|
||||||
camera.setRotation(glm::vec3(-15.0f, 45.0f, 0.0f));
|
camera.setRotation(glm::vec3(-15.0f, 45.0f, 0.0f));
|
||||||
camera.setPerspective(60.0f, (float)width / (float)height, 1.0f, 256.0f);
|
camera.setPerspective(60.0f, (float)width / (float)height, 1.0f, 256.0f);
|
||||||
settings.overlay = true;
|
|
||||||
timerSpeed *= 8.0f;
|
timerSpeed *= 8.0f;
|
||||||
rndEngine.seed(benchmark.active ? 0 : (unsigned)time(nullptr));
|
rndEngine.seed(benchmark.active ? 0 : (unsigned)time(nullptr));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -81,7 +81,6 @@ public:
|
||||||
camera.rotationSpeed = 0.25f;
|
camera.rotationSpeed = 0.25f;
|
||||||
paused = true;
|
paused = true;
|
||||||
timerSpeed *= 0.25f;
|
timerSpeed *= 0.25f;
|
||||||
settings.overlay = true;
|
|
||||||
|
|
||||||
// Setup some default materials (source: https://seblagarde.wordpress.com/2011/08/17/feeding-a-physical-based-lighting-mode/)
|
// Setup some default materials (source: https://seblagarde.wordpress.com/2011/08/17/feeding-a-physical-based-lighting-mode/)
|
||||||
materials.push_back(Material("Gold", glm::vec3(1.0f, 0.765557f, 0.336057f), 0.1f, 1.0f));
|
materials.push_back(Material("Gold", glm::vec3(1.0f, 0.765557f, 0.336057f), 0.1f, 1.0f));
|
||||||
|
|
|
||||||
|
|
@ -118,8 +118,6 @@ public:
|
||||||
materials.push_back(Material("Red", glm::vec3(1.0f, 0.0f, 0.0f)));
|
materials.push_back(Material("Red", glm::vec3(1.0f, 0.0f, 0.0f)));
|
||||||
materials.push_back(Material("Blue", glm::vec3(0.0f, 0.0f, 1.0f)));
|
materials.push_back(Material("Blue", glm::vec3(0.0f, 0.0f, 1.0f)));
|
||||||
|
|
||||||
settings.overlay = true;
|
|
||||||
|
|
||||||
for (auto material : materials) {
|
for (auto material : materials) {
|
||||||
materialNames.push_back(material.name);
|
materialNames.push_back(material.name);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -82,8 +82,6 @@ public:
|
||||||
|
|
||||||
camera.setRotation({ -7.75f, 150.25f, 0.0f });
|
camera.setRotation({ -7.75f, 150.25f, 0.0f });
|
||||||
camera.setPosition({ 0.7f, 0.1f, 1.7f });
|
camera.setPosition({ 0.7f, 0.1f, 1.7f });
|
||||||
|
|
||||||
settings.overlay = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
~VulkanExample()
|
~VulkanExample()
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,6 @@ public:
|
||||||
camera.setRotation(glm::vec3(-25.0f, 15.0f, 0.0f));
|
camera.setRotation(glm::vec3(-25.0f, 15.0f, 0.0f));
|
||||||
camera.setRotationSpeed(0.5f);
|
camera.setRotationSpeed(0.5f);
|
||||||
camera.setPerspective(60.0f, (float)(width / 3.0f) / (float)height, 0.1f, 256.0f);
|
camera.setPerspective(60.0f, (float)(width / 3.0f) / (float)height, 0.1f, 256.0f);
|
||||||
settings.overlay = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
~VulkanExample()
|
~VulkanExample()
|
||||||
|
|
|
||||||
|
|
@ -60,7 +60,6 @@ public:
|
||||||
camera.movementSpeed = 4.0f;
|
camera.movementSpeed = 4.0f;
|
||||||
camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 256.0f);
|
camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 256.0f);
|
||||||
camera.rotationSpeed = 0.25f;
|
camera.rotationSpeed = 0.25f;
|
||||||
settings.overlay = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
~VulkanExample()
|
~VulkanExample()
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,6 @@ public:
|
||||||
camera.setRotation(glm::vec3(0.0, 0.0f, 0.0f));
|
camera.setRotation(glm::vec3(0.0, 0.0f, 0.0f));
|
||||||
camera.setPerspective(60.0f, (float) width / (float) height, 0.1f, 256.0f);
|
camera.setPerspective(60.0f, (float) width / (float) height, 0.1f, 256.0f);
|
||||||
camera.setRotationSpeed(0.5f);
|
camera.setRotationSpeed(0.5f);
|
||||||
settings.overlay = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
~VulkanExample()
|
~VulkanExample()
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,6 @@ public:
|
||||||
VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION)
|
VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION)
|
||||||
{
|
{
|
||||||
title = "Push descriptors";
|
title = "Push descriptors";
|
||||||
settings.overlay = true;
|
|
||||||
camera.type = Camera::CameraType::lookat;
|
camera.type = Camera::CameraType::lookat;
|
||||||
camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 512.0f);
|
camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 512.0f);
|
||||||
camera.setRotation(glm::vec3(0.0f, 0.0f, 0.0f));
|
camera.setRotation(glm::vec3(0.0f, 0.0f, 0.0f));
|
||||||
|
|
|
||||||
|
|
@ -89,7 +89,6 @@ public:
|
||||||
camera.setRotation(glm::vec3(-16.25f, -28.75f, 0.0f));
|
camera.setRotation(glm::vec3(-16.25f, -28.75f, 0.0f));
|
||||||
camera.setPerspective(45.0f, (float)width / (float)height, 1.0f, 256.0f);
|
camera.setPerspective(45.0f, (float)width / (float)height, 1.0f, 256.0f);
|
||||||
timerSpeed *= 0.5f;
|
timerSpeed *= 0.5f;
|
||||||
settings.overlay = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
~VulkanExample()
|
~VulkanExample()
|
||||||
|
|
|
||||||
|
|
@ -46,8 +46,8 @@ public:
|
||||||
camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 512.0f);
|
camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 512.0f);
|
||||||
camera.setRotation(glm::vec3(0.0f, 0.0f, 0.0f));
|
camera.setRotation(glm::vec3(0.0f, 0.0f, 0.0f));
|
||||||
camera.setTranslation(glm::vec3(0.0f, 3.0f, -10.0f));
|
camera.setTranslation(glm::vec3(0.0f, 3.0f, -10.0f));
|
||||||
settings.overlay = true;
|
rayQueryOnly = true;
|
||||||
enableExtensions(true);
|
enableExtensions();
|
||||||
enabledDeviceExtensions.push_back(VK_KHR_RAY_QUERY_EXTENSION_NAME);
|
enabledDeviceExtensions.push_back(VK_KHR_RAY_QUERY_EXTENSION_NAME);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -271,7 +271,7 @@ public:
|
||||||
vkCmdBindPipeline(drawCmdBuffers[i], VK_PIPELINE_BIND_POINT_GRAPHICS, pipeline);
|
vkCmdBindPipeline(drawCmdBuffers[i], VK_PIPELINE_BIND_POINT_GRAPHICS, pipeline);
|
||||||
scene.draw(drawCmdBuffers[i]);
|
scene.draw(drawCmdBuffers[i]);
|
||||||
|
|
||||||
drawUI(drawCmdBuffers[i]);
|
VulkanExampleBase::drawUI(drawCmdBuffers[i]);
|
||||||
|
|
||||||
vkCmdEndRenderPass(drawCmdBuffers[i]);
|
vkCmdEndRenderPass(drawCmdBuffers[i]);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* Vulkan Example - Hardware accelerated ray tracing callable shaders example
|
* Vulkan Example - Hardware accelerated ray tracing callable shaders example
|
||||||
*
|
*
|
||||||
* Dynamically calls different shaders based on the geoemtry id in the closest hit shader
|
* Dynamically calls different shaders based on the geometry id in the closest hit shader
|
||||||
*
|
*
|
||||||
* Relevant code parts are marked with [POI]
|
* Relevant code parts are marked with [POI]
|
||||||
*
|
*
|
||||||
|
|
@ -47,7 +47,6 @@ public:
|
||||||
VulkanExample() : VulkanRaytracingSample()
|
VulkanExample() : VulkanRaytracingSample()
|
||||||
{
|
{
|
||||||
title = "Ray tracing callable shaders";
|
title = "Ray tracing callable shaders";
|
||||||
settings.overlay = false;
|
|
||||||
timerSpeed *= 0.25f;
|
timerSpeed *= 0.25f;
|
||||||
camera.type = Camera::CameraType::lookat;
|
camera.type = Camera::CameraType::lookat;
|
||||||
camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 512.0f);
|
camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 512.0f);
|
||||||
|
|
@ -581,6 +580,8 @@ public:
|
||||||
VK_IMAGE_LAYOUT_GENERAL,
|
VK_IMAGE_LAYOUT_GENERAL,
|
||||||
subresourceRange);
|
subresourceRange);
|
||||||
|
|
||||||
|
drawUI(drawCmdBuffers[i], frameBuffers[i]);
|
||||||
|
|
||||||
VK_CHECK_RESULT(vkEndCommandBuffer(drawCmdBuffers[i]));
|
VK_CHECK_RESULT(vkEndCommandBuffer(drawCmdBuffers[i]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,6 @@ public:
|
||||||
VulkanExample() : VulkanRaytracingSample()
|
VulkanExample() : VulkanRaytracingSample()
|
||||||
{
|
{
|
||||||
title = "Ray tracing reflections";
|
title = "Ray tracing reflections";
|
||||||
settings.overlay = false;
|
|
||||||
timerSpeed *= 0.5f;
|
timerSpeed *= 0.5f;
|
||||||
camera.rotationSpeed *= 0.25f;
|
camera.rotationSpeed *= 0.25f;
|
||||||
camera.type = Camera::CameraType::firstperson;
|
camera.type = Camera::CameraType::firstperson;
|
||||||
|
|
@ -519,10 +518,7 @@ public:
|
||||||
VK_IMAGE_LAYOUT_GENERAL,
|
VK_IMAGE_LAYOUT_GENERAL,
|
||||||
subresourceRange);
|
subresourceRange);
|
||||||
|
|
||||||
//@todo: Default render pass setup will overwrite contents
|
drawUI(drawCmdBuffers[i], frameBuffers[i]);
|
||||||
//vkCmdBeginRenderPass(drawCmdBuffers[i], &renderPassBeginInfo, VK_SUBPASS_CONTENTS_INLINE);
|
|
||||||
//drawUI(drawCmdBuffers[i]);
|
|
||||||
//vkCmdEndRenderPass(drawCmdBuffers[i]);
|
|
||||||
|
|
||||||
VK_CHECK_RESULT(vkEndCommandBuffer(drawCmdBuffers[i]));
|
VK_CHECK_RESULT(vkEndCommandBuffer(drawCmdBuffers[i]));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,6 @@ public:
|
||||||
VulkanExample() : VulkanRaytracingSample()
|
VulkanExample() : VulkanRaytracingSample()
|
||||||
{
|
{
|
||||||
title = "Ray traced shadows";
|
title = "Ray traced shadows";
|
||||||
settings.overlay = false;
|
|
||||||
timerSpeed *= 0.25f;
|
timerSpeed *= 0.25f;
|
||||||
camera.type = Camera::CameraType::lookat;
|
camera.type = Camera::CameraType::lookat;
|
||||||
camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 512.0f);
|
camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 512.0f);
|
||||||
|
|
@ -514,6 +513,8 @@ public:
|
||||||
VK_IMAGE_LAYOUT_GENERAL,
|
VK_IMAGE_LAYOUT_GENERAL,
|
||||||
subresourceRange);
|
subresourceRange);
|
||||||
|
|
||||||
|
drawUI(drawCmdBuffers[i], frameBuffers[i]);
|
||||||
|
|
||||||
VK_CHECK_RESULT(vkEndCommandBuffer(drawCmdBuffers[i]));
|
VK_CHECK_RESULT(vkEndCommandBuffer(drawCmdBuffers[i]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -34,8 +34,6 @@ public:
|
||||||
VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION)
|
VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION)
|
||||||
{
|
{
|
||||||
title = "Saving framebuffer to screenshot";
|
title = "Saving framebuffer to screenshot";
|
||||||
settings.overlay = true;
|
|
||||||
|
|
||||||
camera.type = Camera::CameraType::lookat;
|
camera.type = Camera::CameraType::lookat;
|
||||||
camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 512.0f);
|
camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 512.0f);
|
||||||
camera.setRotation(glm::vec3(-25.0f, 23.75f, 0.0f));
|
camera.setRotation(glm::vec3(-25.0f, 23.75f, 0.0f));
|
||||||
|
|
|
||||||
|
|
@ -102,7 +102,6 @@ public:
|
||||||
camera.setRotation(glm::vec3(-15.0f, -390.0f, 0.0f));
|
camera.setRotation(glm::vec3(-15.0f, -390.0f, 0.0f));
|
||||||
camera.setPerspective(60.0f, (float)width / (float)height, 1.0f, 256.0f);
|
camera.setPerspective(60.0f, (float)width / (float)height, 1.0f, 256.0f);
|
||||||
timerSpeed *= 0.5f;
|
timerSpeed *= 0.5f;
|
||||||
settings.overlay = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
~VulkanExample()
|
~VulkanExample()
|
||||||
|
|
|
||||||
|
|
@ -141,7 +141,6 @@ public:
|
||||||
camera.setPerspective(45.0f, (float)width / (float)height, zNear, zFar);
|
camera.setPerspective(45.0f, (float)width / (float)height, zNear, zFar);
|
||||||
camera.setPosition(glm::vec3(-0.12f, 1.14f, -2.25f));
|
camera.setPosition(glm::vec3(-0.12f, 1.14f, -2.25f));
|
||||||
camera.setRotation(glm::vec3(-17.0f, 7.0f, 0.0f));
|
camera.setRotation(glm::vec3(-17.0f, 7.0f, 0.0f));
|
||||||
settings.overlay = true;
|
|
||||||
timer = 0.2f;
|
timer = 0.2f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -93,7 +93,6 @@ public:
|
||||||
VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION)
|
VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION)
|
||||||
{
|
{
|
||||||
title = "Point light shadows (cubemap)";
|
title = "Point light shadows (cubemap)";
|
||||||
settings.overlay = true;
|
|
||||||
camera.type = Camera::CameraType::lookat;
|
camera.type = Camera::CameraType::lookat;
|
||||||
camera.setPerspective(45.0f, (float)width / (float)height, zNear, zFar);
|
camera.setPerspective(45.0f, (float)width / (float)height, zNear, zFar);
|
||||||
camera.setRotation(glm::vec3(-20.5f, -673.0f, 0.0f));
|
camera.setRotation(glm::vec3(-20.5f, -673.0f, 0.0f));
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,6 @@ public:
|
||||||
camera.setPerspective(60.0f, ((float)width / 3.0f) / (float)height, 0.1f, 512.0f);
|
camera.setPerspective(60.0f, ((float)width / 3.0f) / (float)height, 0.1f, 512.0f);
|
||||||
camera.setRotation(glm::vec3(-40.0f, -90.0f, 0.0f));
|
camera.setRotation(glm::vec3(-40.0f, -90.0f, 0.0f));
|
||||||
camera.setTranslation(glm::vec3(0.0f, 0.0f, -2.0f));
|
camera.setTranslation(glm::vec3(0.0f, 0.0f, -2.0f));
|
||||||
settings.overlay = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
~VulkanExample()
|
~VulkanExample()
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,6 @@ public:
|
||||||
camera.setRotation(glm::vec3(-25.0f, 23.75f, 0.0f));
|
camera.setRotation(glm::vec3(-25.0f, 23.75f, 0.0f));
|
||||||
camera.setRotationSpeed(0.75f);
|
camera.setRotationSpeed(0.75f);
|
||||||
camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 256.0f);
|
camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 256.0f);
|
||||||
settings.overlay = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
~VulkanExample()
|
~VulkanExample()
|
||||||
|
|
|
||||||
|
|
@ -124,7 +124,6 @@ public:
|
||||||
VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION)
|
VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION)
|
||||||
{
|
{
|
||||||
title = "Screen space ambient occlusion";
|
title = "Screen space ambient occlusion";
|
||||||
settings.overlay = true;
|
|
||||||
camera.type = Camera::CameraType::firstperson;
|
camera.type = Camera::CameraType::firstperson;
|
||||||
#ifndef __ANDROID__
|
#ifndef __ANDROID__
|
||||||
camera.rotationSpeed = 0.25f;
|
camera.rotationSpeed = 0.25f;
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,6 @@ public:
|
||||||
camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 512.0f);
|
camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 512.0f);
|
||||||
camera.setRotation(glm::vec3(2.5f, -35.0f, 0.0f));
|
camera.setRotation(glm::vec3(2.5f, -35.0f, 0.0f));
|
||||||
camera.setTranslation(glm::vec3(0.0f, 0.0f, -2.0f));
|
camera.setTranslation(glm::vec3(0.0f, 0.0f, -2.0f));
|
||||||
settings.overlay = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
~VulkanExample()
|
~VulkanExample()
|
||||||
|
|
|
||||||
|
|
@ -105,7 +105,6 @@ public:
|
||||||
camera.setPosition(glm::vec3(-3.2f, 1.0f, 5.9f));
|
camera.setPosition(glm::vec3(-3.2f, 1.0f, 5.9f));
|
||||||
camera.setRotation(glm::vec3(0.5f, 210.05f, 0.0f));
|
camera.setRotation(glm::vec3(0.5f, 210.05f, 0.0f));
|
||||||
camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 256.0f);
|
camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 256.0f);
|
||||||
settings.overlay = true;
|
|
||||||
UIOverlay.subpass = 2;
|
UIOverlay.subpass = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -106,7 +106,6 @@ public:
|
||||||
camera.setRotation(glm::vec3(-12.0f, 159.0f, 0.0f));
|
camera.setRotation(glm::vec3(-12.0f, 159.0f, 0.0f));
|
||||||
camera.setTranslation(glm::vec3(18.0f, 22.5f, 57.5f));
|
camera.setTranslation(glm::vec3(18.0f, 22.5f, 57.5f));
|
||||||
camera.movementSpeed = 7.5f;
|
camera.movementSpeed = 7.5f;
|
||||||
settings.overlay = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
~VulkanExample()
|
~VulkanExample()
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,6 @@ public:
|
||||||
camera.setPosition(glm::vec3(0.0f, 0.0f, -4.0f));
|
camera.setPosition(glm::vec3(0.0f, 0.0f, -4.0f));
|
||||||
camera.setRotation(glm::vec3(-350.0f, 60.0f, 0.0f));
|
camera.setRotation(glm::vec3(-350.0f, 60.0f, 0.0f));
|
||||||
camera.setPerspective(45.0f, (float)(width * ((splitScreen) ? 0.5f : 1.0f)) / (float)height, 0.1f, 256.0f);
|
camera.setPerspective(45.0f, (float)(width * ((splitScreen) ? 0.5f : 1.0f)) / (float)height, 0.1f, 256.0f);
|
||||||
settings.overlay = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
~VulkanExample()
|
~VulkanExample()
|
||||||
|
|
|
||||||
|
|
@ -69,7 +69,6 @@ public:
|
||||||
camera.setPosition(glm::vec3(0.0f, 0.0f, -2.5f));
|
camera.setPosition(glm::vec3(0.0f, 0.0f, -2.5f));
|
||||||
camera.setRotation(glm::vec3(0.0f, 15.0f, 0.0f));
|
camera.setRotation(glm::vec3(0.0f, 15.0f, 0.0f));
|
||||||
camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 256.0f);
|
camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 256.0f);
|
||||||
settings.overlay = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
~VulkanExample()
|
~VulkanExample()
|
||||||
|
|
|
||||||
|
|
@ -175,7 +175,6 @@ public:
|
||||||
camera.setPosition(glm::vec3(0.0f, 0.0f, -2.5f));
|
camera.setPosition(glm::vec3(0.0f, 0.0f, -2.5f));
|
||||||
camera.setRotation(glm::vec3(0.0f, 15.0f, 0.0f));
|
camera.setRotation(glm::vec3(0.0f, 15.0f, 0.0f));
|
||||||
camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 256.0f);
|
camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 256.0f);
|
||||||
settings.overlay = true;
|
|
||||||
srand((unsigned int)time(NULL));
|
srand((unsigned int)time(NULL));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,6 @@ public:
|
||||||
VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION)
|
VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION)
|
||||||
{
|
{
|
||||||
title = "Texture arrays";
|
title = "Texture arrays";
|
||||||
settings.overlay = true;
|
|
||||||
camera.type = Camera::CameraType::lookat;
|
camera.type = Camera::CameraType::lookat;
|
||||||
camera.setPosition(glm::vec3(0.0f, 0.0f, -7.5f));
|
camera.setPosition(glm::vec3(0.0f, 0.0f, -7.5f));
|
||||||
camera.setRotation(glm::vec3(-35.0f, 0.0f, 0.0f));
|
camera.setRotation(glm::vec3(-35.0f, 0.0f, 0.0f));
|
||||||
|
|
|
||||||
|
|
@ -61,7 +61,6 @@ public:
|
||||||
camera.setRotation(glm::vec3(0.0f));
|
camera.setRotation(glm::vec3(0.0f));
|
||||||
camera.setRotationSpeed(0.25f);
|
camera.setRotationSpeed(0.25f);
|
||||||
camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 256.0f);
|
camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 256.0f);
|
||||||
settings.overlay = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
~VulkanExample()
|
~VulkanExample()
|
||||||
|
|
|
||||||
|
|
@ -61,7 +61,6 @@ public:
|
||||||
camera.setPosition(glm::vec3(0.0f, 0.0f, -4.0f));
|
camera.setPosition(glm::vec3(0.0f, 0.0f, -4.0f));
|
||||||
camera.setRotationSpeed(0.25f);
|
camera.setRotationSpeed(0.25f);
|
||||||
camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 256.0f);
|
camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 256.0f);
|
||||||
settings.overlay = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
~VulkanExample()
|
~VulkanExample()
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,6 @@ public:
|
||||||
camera.setTranslation(glm::vec3(40.75f, 0.0f, 0.0f));
|
camera.setTranslation(glm::vec3(40.75f, 0.0f, 0.0f));
|
||||||
camera.movementSpeed = 2.5f;
|
camera.movementSpeed = 2.5f;
|
||||||
camera.rotationSpeed = 0.5f;
|
camera.rotationSpeed = 0.5f;
|
||||||
settings.overlay = true;
|
|
||||||
timerSpeed *= 0.05f;
|
timerSpeed *= 0.05f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -141,7 +141,6 @@ VulkanExample::VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION)
|
||||||
camera.setPosition(glm::vec3(0.0f, 0.0f, -12.0f));
|
camera.setPosition(glm::vec3(0.0f, 0.0f, -12.0f));
|
||||||
camera.setRotation(glm::vec3(-90.0f, 0.0f, 0.0f));
|
camera.setRotation(glm::vec3(-90.0f, 0.0f, 0.0f));
|
||||||
camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 256.0f);
|
camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 256.0f);
|
||||||
settings.overlay = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
VulkanExample::~VulkanExample()
|
VulkanExample::~VulkanExample()
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,6 @@ VulkanExample::VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION)
|
||||||
camera.setRotation(glm::vec3(0.0f, -90.0f, 0.0f));
|
camera.setRotation(glm::vec3(0.0f, -90.0f, 0.0f));
|
||||||
camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 256.0f);
|
camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 256.0f);
|
||||||
camera.setRotationSpeed(0.25f);
|
camera.setRotationSpeed(0.25f);
|
||||||
settings.overlay = true;
|
|
||||||
enabledInstanceExtensions.push_back(VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME);
|
enabledInstanceExtensions.push_back(VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME);
|
||||||
enabledDeviceExtensions.push_back(VK_NV_SHADING_RATE_IMAGE_EXTENSION_NAME);
|
enabledDeviceExtensions.push_back(VK_NV_SHADING_RATE_IMAGE_EXTENSION_NAME);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,6 @@ public:
|
||||||
camera.setRotation(glm::vec3(0.0f, 90.0f, 0.0f));
|
camera.setRotation(glm::vec3(0.0f, 90.0f, 0.0f));
|
||||||
camera.setTranslation(glm::vec3(7.0f, 3.2f, 0.0f));
|
camera.setTranslation(glm::vec3(7.0f, 3.2f, 0.0f));
|
||||||
camera.setMovementSpeed(5.0f);
|
camera.setMovementSpeed(5.0f);
|
||||||
settings.overlay = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
~VulkanExample()
|
~VulkanExample()
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,6 @@ public:
|
||||||
camera.setRotation(glm::vec3(15.0f, 0.0f, 0.0f));
|
camera.setRotation(glm::vec3(15.0f, 0.0f, 0.0f));
|
||||||
camera.setRotationSpeed(0.5f);
|
camera.setRotationSpeed(0.5f);
|
||||||
camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 256.0f);
|
camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 256.0f);
|
||||||
settings.overlay = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
~VulkanExample()
|
~VulkanExample()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue