Best way to render text with DirectX11

Started by
12 comments, last by satanir 9 years, 8 months ago

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!?!?)

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.

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

A sprite-batched text option is the DirectX Toolkit. The MakeFont utility supports creating font files from installed fonts.

Please don't PM me with questions. Post them in the forums for everyone's benefit, and I can embarrass myself publicly.

You don't forget how to play when you grow old; you grow old when you forget how to play.

Alternatively FW1FontWrapper by Erik Rufelt.

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.

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


(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/


(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).

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.

This topic is closed to new replies.

Advertisement