mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 11:01:49 +00:00
fix text 3d position and culling
This commit is contained in:
parent
303346f5e5
commit
2e17c74f91
2 changed files with 15 additions and 3 deletions
|
|
@ -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(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue