From 9eee48288345373a66094217a4125dd13e6b2cf2 Mon Sep 17 00:00:00 2001 From: Dominic Masters Date: Thu, 14 Dec 2023 11:25:36 -0600 Subject: [PATCH] Testing the limits of the Canvas renderer --- src/dawn/component/ui/UICanvas.cpp | 1 + src/dawnhelloworld/scene/HelloWorldScene.cpp | 14 ++++++++++---- src/dawnopengl/display/shader/UIShader.hpp | 4 ++-- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/dawn/component/ui/UICanvas.cpp b/src/dawn/component/ui/UICanvas.cpp index 2d324dd8..529c3c86 100644 --- a/src/dawn/component/ui/UICanvas.cpp +++ b/src/dawn/component/ui/UICanvas.cpp @@ -57,6 +57,7 @@ struct RenderPassContext &ctx } flushPass(); + std::cout << "Passes: " << passes.size() << "\n"; return passes; } diff --git a/src/dawnhelloworld/scene/HelloWorldScene.cpp b/src/dawnhelloworld/scene/HelloWorldScene.cpp index 22fb6cfc..7f7625dd 100644 --- a/src/dawnhelloworld/scene/HelloWorldScene.cpp +++ b/src/dawnhelloworld/scene/HelloWorldScene.cpp @@ -30,7 +30,8 @@ void Dawn::helloWorldScene(Scene &s) { auto cameraItem = s.createSceneItem(); auto camera = cameraItem->addComponent(); - cameraItem->lookAt({ 120, 120, 120 }, { 0, 0, 0 }, { 0, 1, 0 }); + cameraItem->lookAt({ 1200, 1200, 1200 }, { 0, 0, 0 }, { 0, 1, 0 }); + camera->clipFar = 99999.99f; // auto quad = s.createSceneItem(); // auto quadMesh = std::make_shared(); @@ -62,7 +63,12 @@ void Dawn::helloWorldScene(Scene &s) { // rect2->color = COLOR_BLUE; // uiCanvas->components.push_back(rect2); - auto label = std::make_shared(); - label->setFont(texture); - uiCanvas->components.push_back(label); + for(float_t x = -20; x <= 20; x++) { + for(float_t y = -20; y <= 20; y++) { + auto label = std::make_shared(); + label->setFont(texture); + label->position = { x * 64, y * 32 }; + uiCanvas->components.push_back(label); + } + } } \ No newline at end of file diff --git a/src/dawnopengl/display/shader/UIShader.hpp b/src/dawnopengl/display/shader/UIShader.hpp index 29ad39b7..c960bbdf 100644 --- a/src/dawnopengl/display/shader/UIShader.hpp +++ b/src/dawnopengl/display/shader/UIShader.hpp @@ -7,8 +7,8 @@ #include "display/shader/Shader.hpp" namespace Dawn { - #define UI_SHADER_QUAD_COUNT 32 - #define UI_SHADER_TEXTURE_COUNT 6 + #define UI_SHADER_QUAD_COUNT 1024 + #define UI_SHADER_TEXTURE_COUNT 16 struct UIShaderQuad { glm::vec4 quad;