Back to Filament

RenderableManager

docs/android/dokka/filament-android/com.google.android.filament/-renderable-manager/index.md

1.75.019.0 KB
Original Source

//filament-android/com.google.android.filament/RenderableManager

RenderableManager

[main]
open class RenderableManager

Factory and manager for renderables, which are entities that can be drawn.

Renderables are bundles of primitives, each of which has its own geometry and material. All primitives in a particular renderable share a set of rendering attributes, such as whether they cast shadows or use vertex skinning. Kotlin usage example:

kotlin
val entity = EntityManager.get().create()

RenderableManager.Builder(1)
        .boundingBox(Box(0.0f, 0.0f, 0.0f, 9000.0f, 9000.0f, 9000.0f))
        .geometry(0, RenderableManager.PrimitiveType.TRIANGLES, vb, ib)
        .material(0, material)
        .build(engine, entity)

scene.addEntity(renderable)

To modify the state of an existing renderable, clients should first use RenderableManager to get a temporary handle called an instance. The instance can then be used to get or set the renderable's state. Please note that instances are ephemeral; clients should store entities, not instances.

Types

NameSummary
Builder[main]
open class Builder
Adds renderable components to entities using a builder pattern.
PrimitiveType[main]
enum PrimitiveType
Primitive types used in geometry.

Functions

NameSummary
clearMaterialInstanceAt[main]
open fun clearMaterialInstanceAt(i: Int, primitiveIndex: Int)
Clears the material instance for the given primitive.
destroy[main]
open fun destroy(entity: Int)
Destroys the renderable component in the given entity.
getAxisAlignedBoundingBox[main]
open fun getAxisAlignedBoundingBox(i: Int, out: Box): Box
Gets the bounding box used for frustum culling.
getBlendOrderAt[main]
open fun getBlendOrderAt(instance: Int, primitiveIndex: Int): Int
getChannel[main]
open fun getChannel(i: Int): Int
getEnabledAttributesAt[main]
open fun getEnabledAttributesAt(i: Int, primitiveIndex: Int): Set<VertexBuffer.VertexAttribute>
Retrieves the set of enabled attribute slots in the given primitive's VertexBuffer.
getFogEnabled[main]
open fun getFogEnabled(i: Int): Boolean
Returns whether large-scale fog is enabled for this renderable.
getInstance[main]
open fun getInstance(entity: Int): Int
Gets a temporary handle that can be used to access the renderable state.
getInstanceCount[main]
open fun getInstanceCount(i: Int): Int
Gets the immutable number of instances in the given renderable.
getLightChannel[main]
open fun getLightChannel(i: Int, channel: Int): Boolean
Returns whether a light channel is enabled on a specified renderable.
getMaterialInstanceAt[main]
open fun getMaterialInstanceAt(i: Int, primitiveIndex: Int): MaterialInstance
Creates a MaterialInstance Java wrapper object for a particular material instance.
getMorphTargetCount[main]
open fun getMorphTargetCount(i: Int): Int
Gets the morph target count on a renderable.
getNativeObject[main]
open fun getNativeObject(): Long
getPrimitiveCount[main]
open fun getPrimitiveCount(i: Int): Int
Gets the immutable number of primitives in the given renderable.
getPriority[main]
open fun getPriority(i: Int): Int
hasComponent[main]
open fun hasComponent(entity: Int): Boolean
Checks if the given entity already has a renderable component.
isCullingEnabled[main]
open fun isCullingEnabled(i: Int): Boolean
isGlobalBlendOrderEnabledAt[main]
open fun isGlobalBlendOrderEnabledAt(instance: Int, primitiveIndex: Int): Boolean
isScreenSpaceContactShadowsEnabled[main]
open fun isScreenSpaceContactShadowsEnabled(i: Int): Boolean
isShadowCaster[main]
open fun isShadowCaster(i: Int): Boolean
Checks if the renderable can cast shadows.
isShadowReceiver[main]
open fun isShadowReceiver(i: Int): Boolean
Checks if the renderable can receive shadows.
setAxisAlignedBoundingBox[main]
open fun setAxisAlignedBoundingBox(i: Int, aabb: Box)
Changes the bounding box used for frustum culling.
setBlendOrderAt[main]
open fun setBlendOrderAt(instance: Int, primitiveIndex: Int, blendOrder: Int)
Changes the drawing order for blended primitives.
setBonesAsMatrices[main]
open fun setBonesAsMatrices(i: Int, matrices: Buffer, boneCount: Int, offset: Int)
Sets the transforms associated with each bone of a Renderable.
setBonesAsQuaternions[main]
open fun setBonesAsQuaternions(i: Int, quaternions: Buffer, boneCount: Int, offset: Int)
Sets the transforms associated with each bone of a Renderable.
setCastShadows[main]
open fun setCastShadows(i: Int, enabled: Boolean)
Changes whether or not the renderable casts shadows.
setChannel[main]
open fun setChannel(i: Int, channel: Int)
Changes the channel of a renderable
setCulling[main]
open fun setCulling(i: Int, enabled: Boolean)
Changes whether or not frustum culling is on.
setFogEnabled[main]
open fun setFogEnabled(i: Int, enabled: Boolean)
Changes whether or not the large-scale fog is applied to this renderable
setGeometryAt[main]
open fun setGeometryAt(i: Int, primitiveIndex: Int, type: RenderableManager.PrimitiveType, vertices: VertexBuffer)
open fun setGeometryAt(i: Int, primitiveIndex: Int, type: RenderableManager.PrimitiveType, vertices: VertexBuffer, indices: IndexBuffer)
open fun setGeometryAt(i: Int, primitiveIndex: Int, type: RenderableManager.PrimitiveType, vertices: VertexBuffer, offset: Int, count: Int)
open fun setGeometryAt(i: Int, primitiveIndex: Int, type: RenderableManager.PrimitiveType, vertices: VertexBuffer, indices: IndexBuffer, offset: Int, count: Int)
Changes the geometry for the given primitive.
setGlobalBlendOrderEnabledAt[main]
open fun setGlobalBlendOrderEnabledAt(instance: Int, primitiveIndex: Int, enabled: Boolean)
Changes whether the blend order is global or local to this Renderable (by default).
setLayerMask[main]
open fun setLayerMask(i: Int, select: Int, value: Int)
Changes the visibility bits.
setLightChannel[main]
open fun setLightChannel(i: Int, channel: Int, enable: Boolean)
Enables or disables a light channel.
setMaterialInstanceAt[main]
open fun setMaterialInstanceAt(i: Int, primitiveIndex: Int, materialInstance: MaterialInstance)
Changes the material instance binding for the given primitive.
setMorphTargetBufferOffsetAt[main]
open fun setMorphTargetBufferOffsetAt(i: Int, level: Int, primitiveIndex: Int, offset: Int)
Changes the morph target buffer for the given primitive.
setMorphWeights[main]
open fun setMorphWeights(i: Int, weights: Array<Float>, offset: Int)
Updates the vertex morphing weights on a renderable, all zeroes by default.
setPriority[main]
open fun setPriority(i: Int, priority: Int)
Changes the coarse-level draw ordering.
setReceiveShadows[main]
open fun setReceiveShadows(i: Int, enabled: Boolean)
Changes whether or not the renderable can receive shadows.
setScreenSpaceContactShadows[main]
open fun setScreenSpaceContactShadows(i: Int, enabled: Boolean)
Changes whether or not the renderable can use screen-space contact shadows.
setSkinningBuffer[main]
open fun setSkinningBuffer(i: Int, skinningBuffer: SkinningBuffer, count: Int, offset: Int)
Associates a SkinningBuffer to a renderable instance