Fixed rendering issues!
Turns out it was all just fustrum shit
This commit is contained in:
parent
346038a8f7
commit
f95c48bac6
@ -364,7 +364,7 @@ void Renderer::draw() {
|
|||||||
|
|
||||||
auto sz = win.getDimensions();
|
auto sz = win.getDimensions();
|
||||||
|
|
||||||
const auto p = glm::perspective(glm::radians(90.0f), static_cast<float>(sz.width) / static_cast<float>(sz.height), 0.01f, 10000.0f);
|
const auto p = glm::perspective(glm::radians(90.0f), static_cast<float>(sz.width) / static_cast<float>(sz.height), near_plane, far_plane);
|
||||||
|
|
||||||
auto uni = UniformData{
|
auto uni = UniformData{
|
||||||
.view = cam.view(),
|
.view = cam.view(),
|
||||||
|
|||||||
@ -80,6 +80,9 @@ struct Renderer {
|
|||||||
size_t n_indices;
|
size_t n_indices;
|
||||||
bool visibility_testing;
|
bool visibility_testing;
|
||||||
|
|
||||||
|
float near_plane = 2.0f;
|
||||||
|
float far_plane = 10000.0f;
|
||||||
|
|
||||||
float tess_factor = 1.8f;
|
float tess_factor = 1.8f;
|
||||||
float tess_edge_size = 20.0f;
|
float tess_edge_size = 20.0f;
|
||||||
};
|
};
|
||||||
|
|||||||
@ -59,7 +59,7 @@ void BSP::load_indices(const glm::vec3& cam_pos, bool visibility_test) {
|
|||||||
case Face::ePATCH:
|
case Face::ePATCH:
|
||||||
break;
|
break;
|
||||||
case Face::ePOLYGON:
|
case Face::ePOLYGON:
|
||||||
// case Face::eMESH:
|
case Face::eMESH:
|
||||||
for (size_t i = 0; i < face.n_mesh_vertices; i++)
|
for (size_t i = 0; i < face.n_mesh_vertices; i++)
|
||||||
indices.push_back(face.first_vertex_idx + mesh_vertices[face.first_mesh_vertex_idx+i].idx);
|
indices.push_back(face.first_vertex_idx + mesh_vertices[face.first_mesh_vertex_idx+i].idx);
|
||||||
break;
|
break;
|
||||||
|
|||||||
10
UI/UI.cpp
10
UI/UI.cpp
@ -11,7 +11,13 @@
|
|||||||
|
|
||||||
#include <Scene/Camera.hpp>
|
#include <Scene/Camera.hpp>
|
||||||
|
|
||||||
UI::UI(Renderer* ren) : info{ .flycam = ren->flycam, .visibility_testing = ren->visibility_testing, .time = ren->time, .cam = ren->cam, .tess_factor = ren->tess_factor, .tess_edge_size = ren->tess_edge_size, .n_indices = ren->n_indices }, dev(ren->dev) {
|
UI::UI(Renderer* ren) :
|
||||||
|
info {
|
||||||
|
.flycam = ren->flycam, .visibility_testing = ren->visibility_testing,
|
||||||
|
.time = ren->time, .cam = ren->cam, .tess_factor = ren->tess_factor,
|
||||||
|
.tess_edge_size = ren->tess_edge_size, .n_indices = ren->n_indices,
|
||||||
|
.near_plane = ren->near_plane, .far_plane = ren->far_plane
|
||||||
|
}, dev(ren->dev) {
|
||||||
IMGUI_CHECKVERSION();
|
IMGUI_CHECKVERSION();
|
||||||
ImGui::CreateContext();
|
ImGui::CreateContext();
|
||||||
|
|
||||||
@ -94,6 +100,8 @@ void UI::newFrame() {
|
|||||||
ImGui::Text("Time: %f", info.time);
|
ImGui::Text("Time: %f", info.time);
|
||||||
ImGui::Checkbox("Fly Camera", &info.flycam);
|
ImGui::Checkbox("Fly Camera", &info.flycam);
|
||||||
ImGui::Checkbox("Visibility Testing", &info.visibility_testing);
|
ImGui::Checkbox("Visibility Testing", &info.visibility_testing);
|
||||||
|
ImGui::SliderFloat("Near Plane", &info.near_plane, 0.00, 0.20);
|
||||||
|
ImGui::SliderFloat("Far Plane", &info.far_plane, 1000.0, 10000.0);
|
||||||
ImGui::SliderFloat("Tessellation Factor", &info.tess_factor, 0.1, 10.0);
|
ImGui::SliderFloat("Tessellation Factor", &info.tess_factor, 0.1, 10.0);
|
||||||
ImGui::SliderFloat("Edge Size", &info.tess_edge_size, 0.0, 40.0);
|
ImGui::SliderFloat("Edge Size", &info.tess_edge_size, 0.0, 40.0);
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user