hadronized / quaazar

Realtime 3D engine
BSD 3-Clause "New" or "Revised" License
6 stars 2 forks source link

Text rendering via signed distance fields #106

Closed hadronized closed 9 years ago

hadronized commented 9 years ago

quaazar should offer some ways to render text. We should have a way to turn a String into something that we could pass to quaazar so that it renders it.

The solution I’ve found is called signed distance fields (SDF). The idea is pretty simple:

Each pixel stores the distance the closest glyph edge. We can then use that information to render arbitrarily sized texts! How cool is that!

hadronized commented 9 years ago

Nope. We’ll just use a TTF library to load glyph on the fly at the wished resolution.