GraphicTemplate Interface
A reusable representation of a RenderGraphic.
You can use createGraphicFromTemplate to produce a RenderGraphic from a template.
The template contains all of the WebGL resources required to render the graphics, so no matter how many times you use the template,
no additional GPU resources will be allocated.
The primary use for a template is instanced rendering - efficiently
drawing many repetitions of the same graphic with different positions, scales, rotations, and symbology.
Using instancing to draw 1 template N times is far more efficient than drawing N RenderGraphics created from the same template.
You can instance a template by supplying a RenderInstances to createGraphicFromTemplate, unless isInstanceable is false
.
@see - finishTemplate to create a template from a GraphicBuilder.
- createTemplateFromDescription to create a template from a GraphicDescription.
- readGltfTemplate to create a template from a glTF model.
Properties
Name | Type | Description | |
---|---|---|---|
isInstanceable Readonly | boolean | Whether the graphics in this template can be instanced. |
Defined in
Last Updated: 17 December, 2024