Join GitHub today
Billboard Types and Usage
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.
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 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.
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.
BillboardSingleImage3D is used to render a single image texture.
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
TextInfoExtand text batching.
Due to drawbacks on
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
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;