Original Post
🔒 Locked
Fast font rendering
Advertisement
Fast font:
Create a texture
draw a font set on the texture
store the font coordinates in a list
draw using the texture and using uv values.
If you don''t need to redraw everything you can:
draw the text on a new texture
subsequently only draw the new texture instead of writing text.
____________________________________________________________
Try RealityRift at www.planetrift.com
Feel free to comment, object, laugh at or agree to this. I won''t engage in flaming because of what I have said.
I could be wrong or right but the ideas are mine.
Create a texture
draw a font set on the texture
store the font coordinates in a list
draw using the texture and using uv values.
If you don''t need to redraw everything you can:
draw the text on a new texture
subsequently only draw the new texture instead of writing text.
____________________________________________________________
Try RealityRift at www.planetrift.com
Feel free to comment, object, laugh at or agree to this. I won''t engage in flaming because of what I have said.
I could be wrong or right but the ideas are mine.
There''s a nice font class in the D3DUtil directory in the SDK. I eventually rolled my own, but I used the method used in that class (I think it''s in D3DFont.cpp, but don''t quote me on that).
It''s pretty much what MichaelT said, but that''s code that''s already written that you can use (or at the least check out).
Josh
It''s pretty much what MichaelT said, but that''s code that''s already written that you can use (or at the least check out).
Josh
As mentioned, theres a GREAT piece of code in the DXUtils folder (I also believe it''s called d3dfont.*, but *shrug*). Anyway, if you decide to roll your own, I recommend copying the basic structure of this class. Not only does it get the idea of writing texture coords to polys and having the graphics card do the hard work (not like direct draw way back when...), but it also incorporates hardware efficiency speedups which I only recently learned about! If you look carefully, the DrawText() functions write to a single LARGE vertex buffer, and when it''s full, Unlock() it, render it, and Lock() it again! This saves CPU time and is real awesome frame rate wise.
Chris Pergrossi
< ctoan >
My Realm
Chris Pergrossi
< ctoan >
My Realm
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement