Billboard Types and Usage

Lunci edited this page Oct 12, 2018 · 7 revisions

Each billboard geometry3D require a texture and a list of texture coordinates for each billboard to render with. Below are detail explanation on different billboard geometry3D.

  1. BillboardText3D

BillboardText3D uses a predefined character texture and character map to generate a set of texture coordinates for each character in each text string from BillboardText3D.TextInfo collection. BillboardText3D provides simple way to render a set of texts without updating the texture. However it limits the font style/sizes and languages since the character texture is predefined.

More info on how to generate and use custom character texture can be found on Custom Bitmap Font for BillboardText3D.

  1. BillboardSingleText3D

BillboardSingleText3D creates text texture on the fly by using Direct2D. Each time user set a new TextInfo, the texture is rebuilt automatically. BillboardSingleText3D only supports single TextInfo, but it has much more flexibility on creating different font styles and text languages. And it also creates much higher quality text texture based on text size.

  1. BillboardSingleImage3D

BillboardSingleImage3D is used to render a single image texture.

  1. BillboardImage3D

BillboardImage3D is used to render sub images/sprites from a merged single large texture. User defines each sub image texture coordinates by ImageInfo and adds them into BillboardImage3D.ImageInfos.

  1. TextInfoExt and text batching.

Due to drawbacks on BillboardSingleText3D and BillboardText3D. Image Packer and TextInfoExt has been integrated into HelixToolkit v2.5.0.

Image Packer is used to merge a set of small textures into a single big texture. We can create a set of TextInfoExt with variety of font styles and text languages. Then Image Packer processes these TextInfoExts and generate a merged texture. This merged texture contains all sub textures required to render this set of 'TextInfoExts'. Then we can use BillboardImage3D to render all sub billboard textures.

ToBillboardImage3D extension method has been implemented to conveniently generate a BillboardImage3D from IEnumerable<TextInfoExt>. And user generally don't need to worry about the Image Packer implementation details.

Default maximum size of the merged texture is 2048 x 2048. User needs to separate text infos into subsets and create multiple BillboardImage3D if the size is not enough to hold all of the TextInfoExt user needs to render.

All billboard examples can be found in BillboardDemo;

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.