Example setup
This commit is contained in:
parent
7fee0ddb05
commit
228572c063
2 changed files with 3 additions and 4 deletions
|
|
@ -142,7 +142,9 @@ public:
|
||||||
title = "Vulkan Example - Deferred shading (2016 by Sascha Willems)";
|
title = "Vulkan Example - Deferred shading (2016 by Sascha Willems)";
|
||||||
camera.type = Camera::CameraType::firstperson;
|
camera.type = Camera::CameraType::firstperson;
|
||||||
camera.movementSpeed = 5.0f;
|
camera.movementSpeed = 5.0f;
|
||||||
|
#ifndef __ANDROID__
|
||||||
camera.rotationSpeed = 0.25f;
|
camera.rotationSpeed = 0.25f;
|
||||||
|
#endif
|
||||||
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);
|
||||||
|
|
|
||||||
|
|
@ -95,8 +95,7 @@ public:
|
||||||
title = "Vulkan Example - Compute shader ray tracing";
|
title = "Vulkan Example - Compute shader ray tracing";
|
||||||
enableTextOverlay = true;
|
enableTextOverlay = true;
|
||||||
compute.ubo.aspectRatio = (float)width / (float)height;
|
compute.ubo.aspectRatio = (float)width / (float)height;
|
||||||
paused = true;
|
timerSpeed *= 0.25f;
|
||||||
timerSpeed *= 0.5f;
|
|
||||||
|
|
||||||
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);
|
||||||
|
|
@ -676,9 +675,7 @@ public:
|
||||||
compute.ubo.lightPos.x = 0.0f + sin(glm::radians(timer * 360.0f)) * cos(glm::radians(timer * 360.0f)) * 2.0f;
|
compute.ubo.lightPos.x = 0.0f + sin(glm::radians(timer * 360.0f)) * cos(glm::radians(timer * 360.0f)) * 2.0f;
|
||||||
compute.ubo.lightPos.y = 0.0f + sin(glm::radians(timer * 360.0f)) * 2.0f;
|
compute.ubo.lightPos.y = 0.0f + sin(glm::radians(timer * 360.0f)) * 2.0f;
|
||||||
compute.ubo.lightPos.z = 0.0f + cos(glm::radians(timer * 360.0f)) * 2.0f;
|
compute.ubo.lightPos.z = 0.0f + cos(glm::radians(timer * 360.0f)) * 2.0f;
|
||||||
|
|
||||||
compute.ubo.camera.pos = camera.position * -1.0f;
|
compute.ubo.camera.pos = camera.position * -1.0f;
|
||||||
|
|
||||||
VK_CHECK_RESULT(compute.uniformBuffer.map());
|
VK_CHECK_RESULT(compute.uniformBuffer.map());
|
||||||
memcpy(compute.uniformBuffer.mapped, &compute.ubo, sizeof(compute.ubo));
|
memcpy(compute.uniformBuffer.mapped, &compute.ubo, sizeof(compute.ubo));
|
||||||
compute.uniformBuffer.unmap();
|
compute.uniformBuffer.unmap();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue