Skip to content
Snippets Groups Projects
Commit f9649fbe authored by Alexander Gauggel's avatar Alexander Gauggel
Browse files

[#106] Add more option to control movement of test object

parent 0bc597bb
No related branches found
No related tags found
1 merge request!89Resolve "Indirect Dispatch"
...@@ -92,6 +92,8 @@ void App::run() { ...@@ -92,6 +92,8 @@ void App::run() {
eMotionVectorMode motionBlurMotionMode = eMotionVectorMode::MaxTileNeighbourhood; eMotionVectorMode motionBlurMotionMode = eMotionVectorMode::MaxTileNeighbourhood;
float objectVerticalSpeed = 5; float objectVerticalSpeed = 5;
float objectAmplitude = 1;
float objectMeanHeight = 1;
float motionBlurMinVelocity = 0.001; float motionBlurMinVelocity = 0.001;
int cameraShutterSpeedInverse = 24; int cameraShutterSpeedInverse = 24;
float motionVectorVisualisationRange = 0.008; float motionVectorVisualisationRange = 0.008;
...@@ -113,8 +115,8 @@ void App::run() { ...@@ -113,8 +115,8 @@ void App::run() {
Object sphere; Object sphere;
sphere.meshResources = m_sphereMesh; sphere.meshResources = m_sphereMesh;
sphere.modelMatrixUpdate = [&objectVerticalSpeed](float time, Object& obj) { sphere.modelMatrixUpdate = [&](float time, Object& obj) {
const float currentHeight = glm::sin(time * objectVerticalSpeed); const float currentHeight = objectMeanHeight + objectAmplitude * glm::sin(time * objectVerticalSpeed);
obj.modelMatrix = glm::translate(glm::mat4(1), glm::vec3(0, currentHeight, 0)); obj.modelMatrix = glm::translate(glm::mat4(1), glm::vec3(0, currentHeight, 0));
}; };
sceneObjects.push_back(sphere); sceneObjects.push_back(sphere);
...@@ -317,10 +319,13 @@ void App::run() { ...@@ -317,10 +319,13 @@ void App::run() {
MotionVectorModeLabels, MotionVectorModeLabels,
static_cast<int>(eMotionVectorMode::OptionCount)); static_cast<int>(eMotionVectorMode::OptionCount));
ImGui::InputFloat("Object movement speed", &objectVerticalSpeed);
ImGui::InputInt("Camera shutter speed inverse", &cameraShutterSpeedInverse); ImGui::InputInt("Camera shutter speed inverse", &cameraShutterSpeedInverse);
ImGui::DragFloat("Motion blur min velocity", &motionBlurMinVelocity, 0.01, 0, 1); ImGui::DragFloat("Motion blur min velocity", &motionBlurMinVelocity, 0.01, 0, 1);
ImGui::InputFloat("Object movement speed", &objectVerticalSpeed);
ImGui::InputFloat("Object movement amplitude", &objectAmplitude);
ImGui::InputFloat("Object mean height", &objectMeanHeight);
ImGui::End(); ImGui::End();
gui.endGUI(); gui.endGUI();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment