RenderableManager
Factory and manager for Renderables, which are entities that can be drawn.
Renderables are bundles of primitives, each with its own geometry and material. All primitives in a renderable share rendering attributes such as shadow casting, skinning, morphing, layer masks, and priority.
Creating renderables:
val entity = entityManager.create()
RenderableManager.Builder(1) // 1 primitive
.boundingBox(Box(floatArrayOf(0f, 0f, 0f), floatArrayOf(1f, 1f, 1f)))
.material(0, materialInstance)
.geometry(0, PrimitiveType.TRIANGLES, vertexBuffer, indexBuffer, 0, 6)
.receiveShadows(true)
.castShadows(true)
.build(engine, entity)
scene.addEntity(entity)Modifying renderables: To modify an existing renderable, use RenderableManager to get a temporary handle called an Instance. The instance is used to get/set rendering state. Instances are ephemeral; store Entity IDs, not instances.
Related components:
Use TransformManager to associate a 4x4 transform with an entity
Use LightManager to add lights
Use RenderableManager to add geometry and materials
See also
Properties
Functions
Clears the material instance for a primitive (revert to default).
Gets the bounding box used for frustum culling.
Gets the drawing order for blended primitives.
Get the channel a renderable is associated to.
Retrieves the set of enabled attribute slots in the given primitive's VertexBuffer.
Returns the Entity of the component from its Instance.
Returns whether large-scale fog is enabled for this renderable.
Gets a temporary handle that can be used to access the renderable state.
Get the number of instances in the given entity.
Get the visibility bits.
Returns whether a light channel is enabled on this renderable.
Gets a material instance on a primitive.
Get the MorphTargetBuffer of the given renderable, or null if it has none.
Get the number of morph targets in the given entity.
Get the number of primitives in the given entity.
Get the coarse-level draw ordering.
Checks if the given entity already has a renderable component.
Get whether or not frustum culling is on.
Gets whether the blend order is global or local to this Renderable.
Checks if the renderable can use screen-space contact shadows.
Checks if the renderable can cast shadows.
Checks if the renderable can receive shadows.
Changes the bounding box used for frustum culling. The renderable must not have staticGeometry enabled.
Sets the drawing order for blended primitives.
Updates the bone transforms in the range [offset, offset + boneCount). The bones must be pre-allocated using Builder.skinning().
Changes whether or not the renderable casts shadows.
Changes the channel a renderable is associated to.
Changes whether or not frustum culling is on.
Changes whether or not the large-scale fog is applied to this renderable.
Changes the geometry for a non-indexed primitive.
Changes the geometry for a primitive.
Sets whether the blend order is global or local to this Renderable.
Changes the visibility bits.
Enables or disables a light channel for this renderable.
Changes a material instance on a primitive.
Associates a MorphTargetBuffer offset to the given primitive.
Updates the vertex morphing weights on a renderable, all zeroes by default.
Changes the coarse-level draw ordering.
Changes whether or not the renderable can receive shadows.
Changes whether or not the renderable can use screen-space contact shadows.
Associates a region of a SkinningBuffer to a renderable instance.