I search for solutions in this order: Past Code, Unreal Source, Wiki, BUF, groups.yahoo, google, screaming at monitor. – RegularX
UE3:Terrain (UDK)
Contents
- 1 Properties
- 1.1 Property group 'Collision'
- 1.2 Property group 'Lighting'
- 1.3 Property group 'Lightmass'
- 1.4 Property group 'Physics'
- 1.5 Property group 'Terrain'
- 1.5.1 bMorphingEnabled
- 1.5.2 bMorphingGradientsEnabled
- 1.5.3 bShowWireframe
- 1.5.4 DecoLayers
- 1.5.5 EditorTessellationLevel
- 1.5.6 Layers
- 1.5.7 MaxComponentSize
- 1.5.8 MaxTesselationLevel
- 1.5.9 MinTessellationLevel
- 1.5.10 NormalMapLayer
- 1.5.11 NumPatchesX
- 1.5.12 NumPatchesY
- 1.5.13 TesselationDistanceScale
- 1.5.14 TessellationCheckDistance
- 1.5.15 WireframeColor
- 1.6 Internal variables
- 1.6.1 AlphaMaps
- 1.6.2 bHeightmapLocked
- 1.6.3 bLocked
- 1.6.4 bShowingCollision
- 1.6.5 CachedDisplacements
- 1.6.6 CachedTerrainMaterials
- 1.6.7 Heights
- 1.6.8 InfoData
- 1.6.9 LightingGuid
- 1.6.10 MaxCollisionDisplacement
- 1.6.11 NumSectionsX
- 1.6.12 NumSectionsY
- 1.6.13 NumVerticesX
- 1.6.14 NumVerticesY
- 1.6.15 ReleaseResourcesFence
- 1.6.16 SectionSize
- 1.6.17 SelectedVertices
- 1.6.18 TerrainComponents
- 1.6.19 WeightedMaterials
- 1.6.20 WeightedTextureMaps
- 1.7 Default values
- 1.8 Subobjects
- 2 Structs
- 3 Functions
This is an auto-generated page and may need human attention. Please remove the {{autogenerated}} tag if the page seems reasonably complete or replace it with the {{expand}} tag if the page is not yet complete. |
Properties[edit]
Property group 'Collision'[edit]
bAllowRigidBodyUnderneath[edit]
Type: bool
Modifiers: const
If true, this allows rigid bodies to go underneath visible areas of the terrain. This adds some physics cost.
bBlockRigidBody[edit]
Type: bool
Modifiers: const
If false, primitive does not block rigid body physics.
Property is propagated to terrain components.
Default value: True
CollisionTesselationLevel[edit]
Type: int
The tessellation level to utilize when performing collision checks with non-zero extents.
Default value: 1
Property group 'Lighting'[edit]
bAcceptsDynamicLights[edit]
Type: bool
Modifiers: const
If false, primitive does not accept dynamic lights, aka lights with HasStaticShadowing() == FALSE
Property is propagated to terrain components.
Default value: True
bBilinearFilterLightmapGeneration[edit]
Type: bool
If true, the lightmap generation will be performed using the bilinear filtering that all other lightmap generation in the engine uses.
Default value: True
bCastDynamicShadow[edit]
Type: bool
Modifiers: const
If false, primitive does not cast dynamic shadows.
Property is propagated to terrain components .
Default value: True
bCastShadow[edit]
Type: bool
Whether terrain should cast shadows.
Property is propagated to terrain components
Default value: True
bEnableSpecular[edit]
Type: bool
If TRUE, enable specular on this terrain.
bForceDirectLightMap[edit]
Type: bool
Modifiers: const
If true, forces all static lights to use light-maps for direct lighting on the terrain, regardless of the light's UseDirectLightMap property.
Property is propagated to terrain components .
Default value: True
bIsOverridingLightResolution[edit]
Type: bool
If true, the light/shadow map size is no longer restricted... The size of the light map will be (per component): INT LightMapSizeX = Component->SectionSizeX * StaticLightingResolution + 1; INT LightMapSizeY = Component->SectionSizeY * StaticLightingResolution + 1;
So, the maximum size of a light/shadow map for a component will be: MaxMapSizeX = MaxComponentSize * StaticLightingResolution + 1 MaxMapSizeY = MaxComponentSize * StaticLightingResolution + 1
Be careful with the setting of StaticLightingResolution when this mode is enabled. It will be quite easy to run up a massive texture requirement on terrain!
LightingChannels[edit]
Type: LightComponent.LightingChannelContainer
Modifiers: const
Lighting channels controlling light/ primitive interaction. Only allows interaction if at least one channel is shared
Default value:
Member | Value |
---|---|
bInitialized | True |
Static | True |
StaticLightingResolution[edit]
Type: int
The resolution to cache lighting at, in texels/patch. A separate shadow-map is used for each terrain component, which is up to (MaxComponentSize * StaticLightingResolution + 1) pixels on a side. Must be a power of two, 1 <= StaticLightingResolution <= MaxTesselationLevel.
Default value: 4
Property group 'Lightmass'[edit]
LightmassSettings[edit]
Type: EngineTypes.LightmassPrimitiveSettings
Lightmass settings for the terrain
Default value:
Member | Value |
---|---|
DiffuseBoost | 1.0 |
EmissiveBoost | 1.0 |
EmissiveLightFalloffExponent | 2.0 |
FullyOccludedSamplesFraction | 1.0 |
SpecularBoost | 1.0 |
Property group 'Physics'[edit]
TerrainPhysMaterialOverride[edit]
Type: PhysicalMaterial
Modifiers: const
PhysicalMaterial to use for entire terrain
Property group 'Terrain'[edit]
bMorphingEnabled[edit]
Type: bool
Whether to utilize morping terrain or not
bMorphingGradientsEnabled[edit]
Type: bool
Whether to utilize morping gradients or not (bMorphingEnabled must be true for this to matter)
bShowWireframe[edit]
Type: bool
Tells the terrain to render in wireframe.
DecoLayers[edit]
Type: array<TerrainDecoLayer>
Modifiers: const
Array of the decoration layers applied
EditorTessellationLevel[edit]
Type: int
Modifiers: transient
Editor-viewing tessellation level
Layers[edit]
Type: array<TerrainLayer>
Modifiers: const
Array of the terrain layers applied to the terrain
MaxComponentSize[edit]
Type: int
For rendering and collision, split the terrain into components with a maximum size of (MaxComponentSize,MaxComponentSize) patches. The terrain is split up into rectangular groups of patches called terrain components for rendering. MaxComponentSize is the maximum number of patches in a single row/column of a terrain component. Generally, all components will be MaxComponentSize patches square, but on terrains with a patch resolution which isn't a multiple of MaxComponentSize, there will be some components along the edges which are smaller.
This is limited by the MaxTesselationLevel, to prevent the vertex buffer for a fully tessellated component from being > 65536 vertices. For a MaxTesselationLevel of 16, MaxComponentSize is limited to <= 15. For a MaxTesselationLevel of 8, MaxComponentSize is limited to <= 31.
PostEditChange clamps this to be >= 1.
Default value: 16
MaxTesselationLevel[edit]
Type: int
The maximum number of quads in a single row/column of a tessellated patch.
Must be a power of two, 1 <= MaxTesselationLevel <= 16
Default value: 4
MinTessellationLevel[edit]
Type: int
The minimum number of quads in a tessellated patch. Must be a power of two, 1 <= MaxTesselationLevel
Default value: 1
NormalMapLayer[edit]
Type: int
The index of the layer that supplies the normal map for the whole terrain. If this is -1, the terrain will compile the normal property the old way (all normal maps blended together). If this is a valid index into the layer array, it will compile the normal property only for the material(s) contained in said layer.
Default value: -1
NumPatchesX[edit]
Type: int
The number of patches in a single row of the terrain's patch grid.
PostEditChange clamps this to be >= 1.
Note that if you make this and/or NumPatchesY smaller, it will destroy the height-map/alpha-map data which is no longer used by the patches.If you make the dimensions larger, it simply fills in the new height-map/alpha-map data with zero.
Default value: 1
NumPatchesY[edit]
Type: int
The number of patches in a single column of the terrain's patch grid.
PostEditChange clamps this to be >= 1.
Default value: 1
TesselationDistanceScale[edit]
Type: float
The scale factor to apply to the distance used in determining the tessellation level to utilize when rendering a patch. TessellationLevel = SomeFunction((Patch distance to camera) * TesselationDistanceScale)
Default value: 1.0
TessellationCheckDistance[edit]
Type: float
The radius from the view origin that terrain tessellation checks should be performed. If less than 0, the general setting from the engine configuration will be used. If 0.0, every component will be checked for tessellation changes each frame.
Default value: -1.0
WireframeColor[edit]
Type: Object.Color
The color to use when rendering the wireframe of the terrain.
Default value:
Member | Value |
---|---|
A | 0 |
B | 255 |
G | 255 |
R | 0 |
Internal variables[edit]
AlphaMaps[edit]
Modifiers: native, const
Array of the alpha maps between layers
bHeightmapLocked[edit]
Type: bool
The terrain heightmap is locked - no editing can take place on it
bLocked[edit]
Type: bool
The terrain is locked - no editing can take place on it
bShowingCollision[edit]
Type: bool
Viewing collision tessellation level
CachedDisplacements[edit]
Modifiers: native, const
INTERNAL - Displacement related values
CachedTerrainMaterials[edit]
Type: CachedTerrainMaterialArray
Array size: 2
Modifiers: native, const
array of cached terrain materials for SM2,SM3
Heights[edit]
Type: array<TerrainHeight>
Modifiers: private, const, native
Array of the terrain heights
InfoData[edit]
Type: array<TerrainInfoData>
Modifiers: private, const, native
Array of the terrain information data (visible, etc.)
LightingGuid[edit]
Type: Object.Guid
Modifiers: private, const
Unique ID for this terrain, used for caching during distributed lighting
MaxCollisionDisplacement[edit]
Type: float
Modifiers: native, const
NumSectionsX[edit]
Type: int
Modifiers: const
Internal values used to setup components
The number of sections is the number of terrain components along the X and Y of the 'grid'.
NumSectionsY[edit]
Type: int
Modifiers: const
NumVerticesX[edit]
Type: int
Modifiers: const
The number of vertices currently stored in a single row of height and alpha data. Updated from NumPatchesX when Allocate is called(usually from PostEditChange).
NumVerticesY[edit]
Type: int
Modifiers: const
The number of vertices currently stored in a single column of height and alpha data. Updated from NumPatchesY when Allocate is called(usually from PostEditChange).
ReleaseResourcesFence[edit]
Type: pointer{FRenderCommandFence}
Modifiers: native, const
Command fence used to shut down properly
SectionSize[edit]
Type: int
Modifiers: const
Legacy!
SelectedVertices[edit]
Type: array<SelectedTerrainVertex>
Modifiers: transient
TerrainComponents[edit]
Type: array<TerrainComponent>
Modifiers: const, nontransactional
The array of terrain components that are used by the terrain
WeightedMaterials[edit]
Type: array<TerrainWeightedMaterial>
Modifiers: private, native, const
INTERNAL - The weighted materials and blend maps
WeightedTextureMaps[edit]
Type: array<TerrainWeightMapTexture>
Modifiers: private, const, native
Default values[edit]
Property | Value | ||||||||
---|---|---|---|---|---|---|---|---|---|
bBlockActors | True | ||||||||
bCollideActors | True | ||||||||
bEdShouldSnap | True | ||||||||
bHidden | False | ||||||||
bNoDelete | True | ||||||||
bStatic | True | ||||||||
bWorldGeometry | True | ||||||||
CollisionType | COLLIDE_CustomDefault | ||||||||
DrawScale3D |
|
Subobjects[edit]
Sprite[edit]
Class: Engine.SpriteComponent
Inherits from: Info.Sprite
Property | Value |
---|---|
ReplacementPrimitive | None |
Sprite | Texture2D'EditorResources.S_Terrain' |
Structs[edit]
AlphaMap[edit]
A mapping used to apply a layer to the terrain. Full structure can be found in UnTerrain.h, FAlphaMap.
(No member variables.)
CachedTerrainMaterialArray[edit]
Modifiers: native
SelectedTerrainVertex[edit]
Selected vertex structure - used for vertex editing
- int X
- The position of the vertex.
- int Y
- The position of the vertex.
- int Weight
- The weight of the selection.
TerrainDecoLayer[edit]
A decoration layer - used to easily apply static meshes to the terrain
- string Name
- The name of the DecoLayer, for UI display purposes.
- array<TerrainDecoration> Decorations
- The decoration(s) to apply for this layer.
- int AlphaMapIndex
- INTERNAL: The index of the alpha map that represents the application of this layer.
Default values:
Property | Value |
---|---|
AlphaMapIndex | -1 |
TerrainDecoration[edit]
A decoration source for terrain DecoLayers.
- PrimitiveComponentFactory Factory
- The factory used to generate the decoration mesh.
- float MinScale
- The min scale to apply to the source mesh.
- float MaxScale
- The max scale to apply to the source mesh.
- float Density
- The density to use when applying the mesh to the terrain.
- float SlopeRotationBlend
- The amount to rotate the mesh to match the slope of the terrain
where it is being placed. If 1.0, the mesh will match the slope exactly.
- int RandSeed
- The value to use to seed the random number generator.
- array<TerrainDecorationInstance> Instances
- INTERNAL: An array of instances of the decoration applied to the
terrain.
Default values:
Property | Value |
---|---|
Density | 0.01 |
MaxScale | 1.0 |
MinScale | 1.0 |
TerrainDecorationInstance[edit]
A decoration instance applied to the terrain. Used internally to apply DecoLayers.
- PrimitiveComponent Component
- No UObject references.
- float X
- float Y
- float Scale
- int Yaw
TerrainHeight[edit]
A height data entry that is stored in an array for the terrain. Full structure can be found in UnTerrain.h, FTerrainHeight.
(No member variables.)
TerrainInfoData[edit]
InfoData entries for each patch in the terrain. This includes information such as whether the patch is visible or not (holes). Full structure can be found in UnTerrain.h, FTerrainInfoData.
(No member variables.)
TerrainLayer[edit]
A layer that can be painted onto the terrain.
- string Name
- The name of the layer, for UI display purposes.
- TerrainLayerSetup Setup
- The TerrainLayerSetup, which declares the material(s) used in the layer.
- int AlphaMapIndex
- INTERNAL: The index of the alpha map that represents the application of this layer.
- bool Highlighted
- Whether the layer should be highlighted when rendered.
- bool WireframeHighlighted
- Whether the layer should be wireframe highlighted when rendered.
CURRENTLY NOT IMPLEMENTED
- bool Hidden
- Whether the layer is hidden (not rendered).
- Object.Color HighlightColor
- The color to highlight the layer with.
- Object.Color WireframeColor
- The color to wireframe highlight the layer with.
- int MinX
- Rectangle encompassing all the vertices this layer affects.
TerrainLayerSetup::SetMaterial() uses this to avoid rebuilding terrain that has not changed
- int MinY
- Rectangle encompassing all the vertices this layer affects.
TerrainLayerSetup::SetMaterial() uses this to avoid rebuilding terrain that has not changed
- int MaxX
- Rectangle encompassing all the vertices this layer affects.
TerrainLayerSetup::SetMaterial() uses this to avoid rebuilding terrain that has not changed
- int MaxY
- Rectangle encompassing all the vertices this layer affects.
TerrainLayerSetup::SetMaterial() uses this to avoid rebuilding terrain that has not changed
Default values:
Property | Value | ||||||||
---|---|---|---|---|---|---|---|---|---|
AlphaMapIndex | -1 | ||||||||
HighlightColor |
|
TerrainMaterialResource[edit]
Terrain material resource - compiled terrain material used to render the terrain. Full structure can be found in UnTerrain.h, FTerrainMaterialResource.
(No member variables.)
TerrainWeightedMaterial[edit]
A weighted material used on the terrain. Full structure can be found in UnTerrain.h, FTerrainWeightedMaterial.
(No member variables.)
Functions[edit]
Native functions[edit]
CalcLayerBounds[edit]
for each layer, calculate the rectangle encompassing all the vertices affected by it and store the result in the layer's MinX, MinY, MaxX, and MaxY properties
Events[edit]
PostBeginPlay[edit]
Overrides: Actor.PostBeginPlay