fix text 3d position and culling

This commit is contained in:
MihailRis
2025-08-12 20:35:46 +03:00
parent 303346f5e5
commit 2e17c74f91
2 changed files with 15 additions and 3 deletions
+9 -1
View File
@@ -126,7 +126,15 @@ void Batch3D::sprite(
float scale = 1.0f / static_cast<float>(atlasRes);
float u = (index % atlasRes) * scale;
float v = 1.0f - ((index / atlasRes) * scale) - scale;
sprite(pos, up, right, w, h, UVRegion(u, v, u+scale, v+scale), tint);
sprite(
pos + right * w + up * h, // revert centering
up,
right,
w,
h,
UVRegion(u, v, u + scale, v + scale),
tint
);
}
void Batch3D::sprite(