Terrain Macro Material Component

The Terrain Terrain Macro Material component provides a method of defining a macro-level appearance of a region of terrain.

Usage

You assign a color and a normal texture by dragging texture assets to the Color Texture or Normal Texture fields, or by clicking . Once the textures are assigned, you can adjust the appearance by using the Normal Flip X and Normal Flip Y toggles, and adjust the strength of the normals by using the Normal Factor slider. You can configure the dimensions of the region by adjusting the Axis Aligned Box Shape .

Provider

Terrain Gem

Dependencies

Axis Aligned Box Shape

Properties

PropertyDescriptionValuesDefault
Color TextureThe image that will be rendered on the terrain.TextureNone
Normal TextureThe texture that will be used as the normal map.TextureNone
Normal Flip XSet to true to flip the normals about X.BooleanFalse
Normal Flip YSet to true to flip the normals about Y.BooleanFalse
Normal FactorAdjusts the strength of the normal values.Float1.0

MacroMaterialData

This structure is used when sending out information about the macro material settings.

FieldDescriptionType
m_entityIdThe EntityId of the owning entity.AZ::EntityId
m_boundsThe bounds of the region that this macro-material component affects.AZ::Aabb
m_colorImageThe image that should be applied to the terrain.AZ::Data::Instance<AZ::RPI::Image>
m_normalImageThe normal map to be used in this region.AZ::Data::Instance<AZ::RPI::Image>
m_normalFlipXWhether or not the normal map should be flipped about the X axis.bool
m_normalFlipYWhether or not the normal map should be flipped about the Y axis.bool
m_normalFactorThe strength of the normal map.float

TerrainMacroMaterialRequestBus

Use the following request functions with the TerrainMacroMaterialRequestBus EBus interface to communicate with other components of your game.

GetTerrainMacroMaterialData

Retrieves the information assigned to the macro material.

Parameters

None

Returns

Type: MacroMaterialData
The settings of this Macro Material.

TerrainMacroMaterialNotificationBus

The TerrainMacroMaterialNotificationBus EBus interface provides the following notifications.

OnTerrainMacroMaterialCreated

Called when a new macro material has been created.

Parameters

MacroMaterialEntity

Type: AZ::EntityId
The id of the entity that owns the macro material.

MacroMaterial

Type: MacroMaterialData
Information about the macro material

OnTerrainMacroMaterialChanged

Called when a macro material has been changed.

Parameters

MacroMaterialEntity

Type: AZ::EntityId
The id of the entity that owns the macro material.

MacroMaterial

Type: MacroMaterialData
Information about the updated macro material.

OnTerrainMacroMaterialRegionChanged

Called when the bounding area of the macro material changes.

Parameters

MacroMaterialEntity

Type: AZ::EntityId
The id of the entity that owns the macro material.

oldRegion

Type: AZ::Aabb
The previous region bounding area.

newRegion

Type: AZ::Aabb
The new region bounding area.

OnTerrainMacroMaterialDestroyed

Called when a Macro Material is destroyed.

Parameters

MacroMaterialEntity

Type: AZ::EntityId
The id of the entity that owned the destroyed macro material.


Copyright © 2022 Open 3D Engine Contributors

Documentation Distributed under CC BY 4.0.
For our trademark, privacy and antitrust policies, code of conduct, and terms of use, please click the applicable link below or see https://www.lfprojects.org.


The Linux Foundation has registered trademarks and uses trademarks. For a list of trademarks of The Linux Foundation, please see our Trademark Policy page.