Jump to content
  • Advertisement
Sign in to follow this  
satanir

DX11 Best way to render text with DirectX11

This topic is 1424 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

So, there's a bunch of methods for text rendering with DX11. The ones I know of are:

  1. Sprite rendering. Pretty straightforward and well-known. Only con I see is the dynamic VB calculation each draw.
  2. Use D2D. You get a simple, HW accelerated API, but on Win7 means another DX10.1 device, sharing the BB, synchronizing, which basically takes the simple API and wraps it with not so nice looking code. Not sure if it has real performance gain over sprites.
  3. Use GDI+ to render text directly to the back-buffer. I assume performance will be bad, though I haven't tried it.

 

In terms of performance and code complexity, which one is better?

Is there another option I'm unaware of?

 

(And MS, why did you leave D2D/D3D11 interop out of Win7!?!?)

Share this post


Link to post
Share on other sites
Advertisement


In terms of performance and code complexity, which one is better?

Is there another option I'm unaware of?


Sprite rendering. Pretty straightforward and well-known. Only con I see is the dynamic VB calculation each draw.


(And MS, why did you leave D2D/D3D11 interop out of Win7!?!?)

Because Windows 8.

Share this post


Link to post
Share on other sites

Calculation of VB each draw is probably not really neccessary. Because you can add something like "dirty" flag, and calculate buffer only if text was changed

Share this post


Link to post
Share on other sites

Thanks for the answers guys. I already know about all those stuff, and my framework implements the sprite-batch approach.

 

I was just wondering if someone got the chance to try other approaches and share his experience with - in regards to performance and code complexity.

Share this post


Link to post
Share on other sites

 

 

I was just wondering if someone got the chance to try other approaches and share his experience with - in regards to performance and code complexity.

I render every glyph as a quad of 2 triangles, sampling glyph texture with no filtering, calibrating perfect fit as per pixel. If you happen to have a resolution of 8000x4000, you will see outputed glyph very small, needing binocular scaler. But- in a good quality. I cannot help myself in this manner. Vertex glyphs are off of me, nor vertex font definitions fractals

Share this post


Link to post
Share on other sites

(And MS, why did you leave D2D/D3D11 interop out of Win7!?!?)

 

Didn't they fix this in the platform update a year ago?

I'm reasonably sure... but Google doesn't give me any clear answer right now... 11.1 device (at any feature level).

 

 

You can combine sprite-sheets with signed distance fields for pretty good quality in magnified and 3D transformed text.

 

There was a thread recently which links to a pretty cool method: http://www.gamedev.net/topic/659230-font-rendering/

Share this post


Link to post
Share on other sites

 


(And MS, why did you leave D2D/D3D11 interop out of Win7!?!?)

 

Didn't they fix this in the platform update a year ago?

I'm reasonably sure... but Google doesn't give me any clear answer right now... 11.1 device (at any feature level).

 

 

You can combine sprite-sheets with signed distance fields for pretty good quality in magnified and 3D transformed text.

 

There was a thread recently which links to a pretty cool method: http://www.gamedev.net/topic/659230-font-rendering/

 

 

Yes, I'm pretty sure that the Win7 platform update added D3D11 support for D2D and DirectWrite (although I haven't personally tried doing the interop).

Share this post


Link to post
Share on other sites

Yes, I'm pretty sure that the Win7 platform update added D3D11 support for D2D and DirectWrite (although I haven't personally tried doing the interop).


Great, I'll give it a try.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!