Testing the limits of the Canvas renderer

This commit is contained in:
2023-12-14 11:25:36 -06:00
parent f180e81bc4
commit 9eee482883
3 changed files with 13 additions and 6 deletions

View File

@ -57,6 +57,7 @@ struct RenderPassContext &ctx
} }
flushPass(); flushPass();
std::cout << "Passes: " << passes.size() << "\n";
return passes; return passes;
} }

View File

@ -30,7 +30,8 @@ void Dawn::helloWorldScene(Scene &s) {
auto cameraItem = s.createSceneItem(); auto cameraItem = s.createSceneItem();
auto camera = cameraItem->addComponent<Camera>(); auto camera = cameraItem->addComponent<Camera>();
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 quad = s.createSceneItem();
// auto quadMesh = std::make_shared<Mesh>(); // auto quadMesh = std::make_shared<Mesh>();
@ -62,7 +63,12 @@ void Dawn::helloWorldScene(Scene &s) {
// rect2->color = COLOR_BLUE; // rect2->color = COLOR_BLUE;
// uiCanvas->components.push_back(rect2); // uiCanvas->components.push_back(rect2);
for(float_t x = -20; x <= 20; x++) {
for(float_t y = -20; y <= 20; y++) {
auto label = std::make_shared<UILabel>(); auto label = std::make_shared<UILabel>();
label->setFont(texture); label->setFont(texture);
label->position = { x * 64, y * 32 };
uiCanvas->components.push_back(label); uiCanvas->components.push_back(label);
}
}
} }

View File

@ -7,8 +7,8 @@
#include "display/shader/Shader.hpp" #include "display/shader/Shader.hpp"
namespace Dawn { namespace Dawn {
#define UI_SHADER_QUAD_COUNT 32 #define UI_SHADER_QUAD_COUNT 1024
#define UI_SHADER_TEXTURE_COUNT 6 #define UI_SHADER_TEXTURE_COUNT 16
struct UIShaderQuad { struct UIShaderQuad {
glm::vec4 quad; glm::vec4 quad;