basic gui
This commit is contained in:
+2
-2
@@ -25,8 +25,8 @@ private:
|
|||||||
std::mutex queueLock;
|
std::mutex queueLock;
|
||||||
std::condition_variable queueCV;
|
std::condition_variable queueCV;
|
||||||
std::condition_variable completedCV;
|
std::condition_variable completedCV;
|
||||||
uint32_t numRemaining;
|
uint32_t numRemaining = 0;
|
||||||
uint32_t numRunning;
|
uint32_t numRunning = 0;
|
||||||
std::list<Batch> taskQueue;
|
std::list<Batch> taskQueue;
|
||||||
std::vector<std::thread> workers;
|
std::vector<std::thread> workers;
|
||||||
};
|
};
|
||||||
+18
-17
@@ -1,38 +1,39 @@
|
|||||||
#include "scene/Renderer.h"
|
#include "scene/Renderer.h"
|
||||||
#include "util/ModelLoader.h"
|
#include "util/ModelLoader.h"
|
||||||
#include "window/Window.h"
|
#include "window/Window.h"
|
||||||
#include <iostream>
|
|
||||||
#include <imgui.h>
|
#include <imgui.h>
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
Renderer scene;
|
Renderer scene;
|
||||||
Window window(1920, 1080);
|
Window window(1920, 1080);
|
||||||
scene.startRender(
|
Camera camera = Camera{
|
||||||
Camera{
|
.position = glm::vec3(20, 5, 5),
|
||||||
.position = glm::vec3(-2, 5, 5),
|
|
||||||
.target = glm::vec3(0, 0, 0),
|
.target = glm::vec3(0, 0, 0),
|
||||||
},
|
};
|
||||||
RenderParameter{
|
RenderParameter render = RenderParameter{
|
||||||
.width = 1920,
|
.width = 1920,
|
||||||
.height = 1080,
|
.height = 1080,
|
||||||
.numSamples = 10000,
|
.numSamples = 10000,
|
||||||
});
|
};
|
||||||
|
scene.startRender(camera, render);
|
||||||
|
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
window.beginFrame();
|
window.beginFrame();
|
||||||
|
ImGui::Text("Camera Parameters");
|
||||||
|
ImGui::InputFloat3("Position", &camera.position.x);
|
||||||
|
ImGui::InputFloat3("Target", &camera.target.x);
|
||||||
|
ImGui::InputFloat("Focal Length", &camera.f);
|
||||||
|
ImGui::InputFloat("Aperture", &camera.A);
|
||||||
|
ImGui::Text("Render Parameters");
|
||||||
|
ImGui::InputInt2("Dimensions", &render.width);
|
||||||
|
ImGui::InputInt("Samples", &render.numSamples);
|
||||||
|
|
||||||
if (ImGui::Button("Render"))
|
if (ImGui::Button("Render"))
|
||||||
{
|
{
|
||||||
scene.startRender(
|
scene.startRender(camera, render);
|
||||||
Camera{
|
|
||||||
.position = glm::vec3(5, 5, 5),
|
|
||||||
.target = glm::vec3(0, 0, 0),
|
|
||||||
},
|
|
||||||
RenderParameter{
|
|
||||||
.width = 1920,
|
|
||||||
.height = 1080,
|
|
||||||
.numSamples = 10000,
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
window.update(scene.getImage());
|
window.update(scene.getImage());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user