Implement texture atlas for fonts

This commit is contained in:
Dynamitos committed 2026-10-21 21:21:49 +02:00
1 parent 17dc1e4d88
commit 22a90fe07c
14 files changed
+388 -50

No files matched your search

@@ -59,6 +59,8 @@ void UIPass::beginFrame(const Component::Camera& cam, const Component::Transform
.color = render.backgroundColor,
.z = render.level / 100.f,
.textureIndex = textureIndex,
.uvOffset = render.uvOffset,
.uvSize = render.uvSize,
});
}
elementBuffer->rotateBuffer(sizeof(RenderElementStyle) * elements.size());
+4 -2
View File
@@ -36,8 +36,10 @@ class UIPass : public RenderPass {
float opacity = 1;
float z = 0;
uint32 textureIndex = std::numeric_limits<uint32>::max();
uint32 pad0;
uint32 pad1;
// UV rect for textured quads (glyphs: their rect in the font atlas); unused for untextured quads
Vector2 uvOffset = Vector2(0);
Vector2 uvSize = Vector2(1);
Vector2 pad;
};
Gfx::RenderTargetAttachment colorAttachment;