Search
Setup for Free
S
Silk.NET
•
4y ago
Mkp
Whats a good strat to render bitmap text?
Whats a good strat to render bitmap text
?
Silk.NET
Join
A Discord server for the Silk.NET - your one-stop-shop for high-speed .NET multimedia, graphics, and compute. FOSS.
1,788
Members
View on Discord
Resources
ModelContextProtocol
ModelContextProtocol
MCP Server
Similar Threads
Was this page helpful?
Yes
No
© 2026 Hedgehog Software, LLC
Twitter
GitHub
Discord
System
Light
Dark
More
Communities
Docs
About
Terms
Privacy
M
Mkp
OP
•
7/26/22, 10:52 PM
As in setting up the vao and vbos
M
Mkp
Whats a good strat to render bitmap text?
L
Lyris the Kitori
•
7/26/22, 10:53 PM
render the chars to a texture atlas
, then pick them out using texcoords
M
Mkp
OP
•
7/26/22, 10:54 PM
I already have the atlas
, so you recommend generating texture coordinates and geometry instead of say keeping a atlas index instanced vbo and bind it per text render
?
F
Furball
•
7/26/22, 11:07 PM
just draw instanced quads with tex coords
M
Mkp
OP
•
7/26/22, 11:11 PM
Problem with that method is your need to switch the vbo when you need to render more than a single bit of text
M
Mkp
OP
•
7/26/22, 11:12 PM
Definitely want to do that just asking for opinions before implementing
L
Lyris the Kitori
•
7/26/22, 11:12 PM
are you rendering your game geometry as 2d quads or 3d
M
Mkp
OP
•
7/26/22, 11:12 PM
2d
M
Mkp
OP
•
7/26/22, 11:13 PM
240x160
L
Lyris the Kitori
•
7/26/22, 11:13 PM
then why do you need to change vbo
M
Mkp
OP
•
7/26/22, 11:13 PM
8x8 font
M
Mkp
OP
•
7/26/22, 11:13 PM
Because if you have two different lines of text you dont want to
\n
\n
\n
\n
\n
\n
\n
\n down to where you need to be for example
M
Mkp
OP
•
7/26/22, 11:14 PM
you
'd simply specify a new location and have a new dataset
L
Lyris the Kitori
•
7/26/22, 11:14 PM
what
L
Lyris the Kitori
•
7/26/22, 11:14 PM
just do normal instanced quad rendering and use that to draw the text
M
Mkp
OP
•
7/26/22, 11:14 PM
Yes
M
Mkp
OP
•
7/26/22, 11:15 PM
that allows you to draw a continuous line of text
M
Mkp
OP
•
7/26/22, 11:15 PM
Now what about two separate lines of text
?
M
Mkp
OP
•
7/26/22, 11:15 PM
call glDrawElementsInstanced again sure
M
Mkp
OP
•
7/26/22, 11:15 PM
But it will emit the same thing
M
Mkp
OP
•
7/26/22, 11:15 PM
Reupload to the vbo or switch vbo
(which contains the ids into the texture atlas
)
L
Lyris the Kitori
•
7/26/22, 11:16 PM
what
L
Lyris the Kitori
•
7/26/22, 11:17 PM
i
'm able to draw my whole scene with many lines of text in one call
M
Mkp
OP
•
7/26/22, 11:18 PM
How does it work then
? You just have one large buffer of all the text
?
F
Furball
•
7/26/22, 11:19 PM
just draw quads
L
Lyris the Kitori
•
7/26/22, 11:19 PM
no
L
Lyris the Kitori
•
7/26/22, 11:19 PM
i just draw quads
L
Lyris the Kitori
•
7/26/22, 11:19 PM
my drawing doesn
't distinguish text and game objects
L
Lyris the Kitori
•
7/26/22, 11:19 PM
it
's just
L
Lyris the Kitori
•
7/26/22, 11:19 PM
quads
F
Furball
•
7/26/22, 11:20 PM
quads with a texture and a specific tex coord
L
Lyris the Kitori
•
7/26/22, 11:20 PM
yup
F
Furball
•
7/26/22, 11:20 PM
we dont do any lines of text shenanigans
F
Furball
•
7/26/22, 11:20 PM
we quite literally just draw quads
L
Lyris the Kitori
•
7/26/22, 11:20 PM
characters are just quads
M
Mkp
OP
•
7/26/22, 11:20 PM
So you generate the positions of the quads and the texture coords
?
L
Lyris the Kitori
•
7/26/22, 11:21 PM
no
L
Lyris the Kitori
•
7/26/22, 11:21 PM
it
's instanced
L
Lyris the Kitori
•
7/26/22, 11:21 PM
we know the positions and the tex coords of each char
M
Mkp
OP
•
7/26/22, 11:21 PM
Okay then how do you render two different bits of text at two different locations
?
M
Mkp
OP
•
7/26/22, 11:21 PM
Another draw call surely
F
Furball
•
7/26/22, 11:21 PM
no
F
Furball
•
7/26/22, 11:21 PM
just draw quads
L
Lyris the Kitori
•
7/26/22, 11:21 PM
no
?
F
Furball
•
7/26/22, 11:22 PM
somewhere else
L
Lyris the Kitori
•
7/26/22, 11:22 PM
^
L
Lyris the Kitori
•
7/26/22, 11:22 PM
our renderer just takes in a list of quads
F
Furball
•
7/26/22, 11:22 PM
do you make a draw call everytime you need to draw something at a different location
L
Lyris the Kitori
•
7/26/22, 11:22 PM
then poops them out on screen
M
Mkp
OP
•
7/26/22, 11:22 PM
No I have an instanced buffer of the locations
Next page