This documentation is for a prerelease version of O3DE. Click here to switch to the latest release, or select a version from the dropdown.

Version:

Mesh Component

The Mesh component specifies a model to render in the scene. Model assets are supported and processed using AssImp .

Provider

Atom Gem

Mesh Component properties

mesh-component-base-properties

PropertyDescriptionValuesDefault
Model AssetSets the model asset for this component.Model AssetNone
Sort KeyTransparent models are first drawn by sort key, then depth. Use this to force certain transparent models to draw before or after others.-2,147,483,648 to 2,147,483,6470
Exclude from reflection cubemapsIf enabled, the model will not be visible in baked reflection probe cubemaps.BooleanDisabled
Use Forward Pass IBL SpecularRenders image-based lighting (IBL) specular reflections in the forward pass, by using only the most influential probe (based on the position of the entity) and the global IBL cubemap. It can reduce rendering costs, but is only recommended for static objects that are affected by at most one reflection probe.BooleanDisabled
Use ray tracingIncludes this model in ray tracing calculations.BooleanEnabled
LOD TypeRefer to LOD Type below.Default, Screen Coverage, Specific LODDefault
Add Material ComponentButton to add a Material Component to the entity.
Model StatsDisplays mesh count, vertex count, and triangle count for each LOD in the model.

LOD Type

LOD Type determines how the level of detail (LOD) is selected during rendering.

lod-type-default

LOD Type: Default uses the configured default method for automatically selecting the LOD. O3DE ships using the Screen Coverage method as the default method. If the default method is changed in the future, the component automatically uses the new default.

lod-type-screen-coverage

LOD Type: Screen Coverage determines which LOD to render based on the approximate proportion of the screen that the LOD covers.

PropertyDescriptionValuesDefault
LOD Configuration - Minimum Screen CoverageMinimum proportion of screen area that the entity will cover. If the entity is smaller than the minimum coverage, it is culled.0.0 to 1.01.0f / 1080.0f
LOD Configuration - Quality Decay RateRate at which the mesh quality decays.

0 - Always stays at highest quality LOD.

1 - Immediately falls off to lowest quality LOD.
0.0 to 1.00.5

lod-type-specific-lod

LOD Type: Specific LOD specifies the LOD to render, overriding the automatic LOD calculations.

PropertyDescriptionValuesDefault
LOD Configuration - LOD OverrideSets the specific LOD to render. The number of LODs depends on how many LODs the asset has.LOD 0 (Highest Detail) to LOD n, where n is the lowest detail LODLOD 0 (Highest Detail)

MeshComponentRequestBus

Method NameDescriptionParameterReturnScriptable
SetModelAssetSets the model asset used by the component.Model Asset: AssetNoneNo
GetModelAssetReturns the model asset used by the component.NoneModel Asset: AssetNo
SetModelAssetIdSets the model used by the component via its AssetId.Model AssetId: AssetIdNoneYes
GetModelAssetIdReturns the AssetId for the model used by the component.NoneModel AssetId: AssetIdYes
SetModelAssetPathSets the model used by the component via its path.Asset Path: StringNoneYes
GetModelAssetPathReturns the path for the model used by the component.NoneAsset Path: StringYes
GetModelReturns the model instance used by the component.NoneModel: InstanceNo
SetSortKeySee Sort KeyDraw Item Sort Key: IntegerNoneYes
GetSortKeySee Sort KeyNoneDraw Item Sort Key: IntegerYes
SetLodTypeSee LOD TypeLOD Type: EnumNoneYes
GetLodTypeSee LOD TypeNoneLOD Type: EnumYes
SetLodOverrideSee LOD Type: Specific LOD TabLOD Override: IntegerNoneYes
GetLodOverrideSee LOD Type: Specific LOD TabNoneLOD Override: IntegerYes
SetMinimumScreenCoverageSee LOD Type: Screen Coverage TabMinimum Screen Coverage: FloatNoneYes
GetMinimumScreenCoverageSee LOD Type: Screen Coverage TabNoneMinimum Screen Coverage: FloatYes
SetQualityDecayRateSee LOD Type: Screen Coverage TabQuality Decay Rate: FloatNoneYes
GetQualityDecayRateSee LOD Type: Screen Coverage TabNoneQuality Decay Rate: FloatYes
SetVisibilitySets if the model should be visible (true) or hidden (false).Visibility: BooleanNoneNo
GetVisibilityReturns the visibility. If the model is visible (true), that only means that it has not been explicitly hidden. The model may still not be visible by any views being rendered. If it is not visible (false), it will not be rendered by any views, regardless of whether or not the model is in the view frustum.NoneVisibility: BooleanNo
SetRayTracingEnabledSee Use Ray TracingIs Ray Tracing Enabled: BooleanNoneYes
GetRayTracingEnabledSee Use Ray TracingNoneIs Ray Tracing Enabled: BooleanYes
GetWorldBoundsReturns the axis-aligned bounding box for the model at its world position.NoneWorld Bounds: AabbNo
GetLocalBoundsReturns the axis-aligned bounding box in model space.NoneLocal Bounds: AabbNo

MeshComponentNotificationBus

Method NameDescriptionParameterReturnScriptable
OnModelReadyNotifies listeners when a model has been loaded. If the model is already loaded when first connecting to the MeshComponentNotificationBus, the OnModelReady event will occur when connecting.Model Asset: Asset<T>, Model: Instance<T>NoneYes
OnModelPreDestroyNotifies listeners when the instance of the model for this component is about to be released.NoneNoneNo