I love the smell of UnrealEd crashing in the morning. – tarquin

Difference between revisions of "UE3:Material properties (UDK)"

From Unreal Wiki, The Unreal Engine Documentation Site
Jump to: navigation, search
(Talk)
 
m (1 revision: class descriptions for UDK January update (part 3))
 
(One intermediate revision by one other user not shown)
Line 27: Line 27:
 
'''Type:''' [[float]]
 
'''Type:''' [[float]]
  
If BlendMode is BLEND_Masked, the surface is not rendered where OpacityMask < OpacityMaskClipValue.
+
If BlendMode is BLEND_Masked or BLEND_SoftMasked, the surface is not rendered where OpacityMask < OpacityMaskClipValue.
  
 
'''Default value:''' 0.3333
 
'''Default value:''' 0.3333
Line 94: Line 94:
  
 
<!-- enter variable description -->
 
<!-- enter variable description -->
 
====bUsedAsSpecialEngineMaterial====
 
'''Type:''' [[bool]]
 
 
'''[[Variables#Modifiers|Modifiers]]:''' const
 
 
This is a special usage flag that allows a material to be assignable to any primitive type.
 
This is useful for materials used by code to implement certain viewmodes, for example the default material or lighting only material.
 
The cost is that nearly 20x more shaders will be compiled for the material than the average material, which will greatly increase shader compile time and memory usage.
 
This flag should only be set when absolutely necessary.
 
  
 
====bUsedWithBeamTrails====
 
====bUsedWithBeamTrails====
Line 117: Line 107:
 
'''[[Variables#Modifiers|Modifiers]]:''' const
 
'''[[Variables#Modifiers|Modifiers]]:''' const
  
<!-- enter variable description -->
+
WARNING: bUsedWithDecals is mutually exclusive with all other mesh type usage flags! A material with bUsedWithDecals=true will not work on any other mesh type.
  
 
====bUsedWithFluidSurfaces====
 
====bUsedWithFluidSurfaces====
Line 131: Line 121:
 
'''[[Variables#Modifiers|Modifiers]]:''' const
 
'''[[Variables#Modifiers|Modifiers]]:''' const
  
<!-- enter variable description -->
+
Indicates that the material is used on fog volumes.  This usage flag is mutually exclusive with all other mesh type usage flags!
  
 
====bUsedWithFoliage====
 
====bUsedWithFoliage====
Line 152: Line 142:
 
'''[[Variables#Modifiers|Modifiers]]:''' const
 
'''[[Variables#Modifiers|Modifiers]]:''' const
  
Adds an extra pow instruction to the shader using the current render target's gamma value
+
Gamma corrects the output of the base pass using the current render target's gamma value.
 +
This must be set on materials used with UIScenes to get correct results.
  
 
====bUsedWithInstancedMeshes====
 
====bUsedWithInstancedMeshes====
Line 166: Line 157:
 
'''[[Variables#Modifiers|Modifiers]]:''' const
 
'''[[Variables#Modifiers|Modifiers]]:''' const
  
<!-- enter variable description -->
+
Enables instancing for mesh particles.  Use the "Vertex Color" node when enabled, not "MeshEmit VertColor."
  
 
====bUsedWithLensFlare====
 
====bUsedWithLensFlare====
Line 215: Line 206:
 
'''[[Variables#Modifiers|Modifiers]]:''' const
 
'''[[Variables#Modifiers|Modifiers]]:''' const
  
<!-- enter variable description -->
+
Indicates that the material and its instances can be assigned to skeletal meshes.
 +
This will result in the shaders required to support skeletal meshes being compiled which will increase shader compile time and memory usage.
  
 
====bUsedWithSpeedTree====
 
====bUsedWithSpeedTree====
Line 263: Line 255:
 
TRUE if Material is the preview material used in the material editor.
 
TRUE if Material is the preview material used in the material editor.
  
====bSupportsSinglePassSHLight====
+
====bUsedAsSpecialEngineMaterial====
 
'''Type:''' [[bool]]
 
'''Type:''' [[bool]]
  
'''[[Variables#Modifiers|Modifiers]]:''' private
+
'''[[Variables#Modifiers|Modifiers]]:''' duplicatetransient, const
  
TRUE if Material can support an SH light in the base pass
+
This is a special usage flag that allows a material to be assignable to any primitive type.
 
+
This is useful for materials used by code to implement certain viewmodes, for example the default material or lighting only material.
'''Default value:''' True
+
The cost is that nearly 20x more shaders will be compiled for the material than the average material, which will greatly increase shader compile time and memory usage.
 +
This flag should only be set when absolutely necessary, and is purposefully not exposed to the UI to prevent abuse.
  
 
====bUsedWithParticleSystem====
 
====bUsedWithParticleSystem====
Line 290: Line 283:
  
 
Use a custom light transfer equation to be factored with light color, attenuation and shadowing.
 
Use a custom light transfer equation to be factored with light color, attenuation and shadowing.
 +
This is currently only used for Movable, Toggleable and Dominant light contribution.
 +
LightVector can be used in this material input and will be set to the tangent space light direction of the current light being rendered.
  
 
====CustomSkylightDiffuse====
 
====CustomSkylightDiffuse====
Line 295: Line 290:
  
 
Use a custom diffuse factor for attenuation with lights that only support a diffuse term.
 
Use a custom diffuse factor for attenuation with lights that only support a diffuse term.
This is currently used with skylights and SH lights.
+
This should only be the diffuse color coefficient, and must not depend on LightVector.
 +
This is currently used with skylights, SH lights, materials exported to lightmass and directional lightmap contribution.
  
 
====DefaultMaterialInstances====
 
====DefaultMaterialInstances====
Line 470: Line 466:
 
'''Type:''' [[array]]<{{cl|Texture}}>
 
'''Type:''' [[array]]<{{cl|Texture}}>
  
'''[[Variables#Modifiers|Modifiers]]:''' private, const
+
'''[[Variables#Modifiers|Modifiers]]:''' deprecated, private, const
  
Array of textures referenced, updated in PostLoad.  These are needed to keep the textures used by material resources
+
Legacy texture references, now handled by FMaterial.
from getting destroyed by realtime GC.
+
  
 
====SpecularColor====
 
====SpecularColor====

Latest revision as of 05:41, 17 January 2010

UDK Object >> Surface >> MaterialInterface >> Material (properties)

Contents

Properties[edit]

Property group 'Material'[edit]

BlendMode[edit]

Type: EBlendMode

Determines how the material's color is blended with background colors.

bPerPixelCameraVector[edit]

Type: bool

When enabled, the camera vector will be computed in the pixel shader instead of the vertex shader which may improve the quality of the reflection. Enabling this setting also allows VertexColor expressions to be used alongside Transform expressions.

LightingModel[edit]

Type: EMaterialLightingModel

Determines how inputs are combined to create the material's final color.

OpacityMaskClipValue[edit]

Type: float

If BlendMode is BLEND_Masked or BLEND_SoftMasked, the surface is not rendered where OpacityMask < OpacityMaskClipValue.

Default value: 0.3333

PhysMaterial[edit]

Type: PhysicalMaterial

Physical material to use for this graphics material. Used for sounds, effects etc.

TwoSided[edit]

Type: bool

Indicates that the material should be rendered without backface culling and the normal should be flipped for backfaces.

TwoSidedSeparatePass[edit]

Type: bool

Indicates that the material should be rendered in its own pass. Used for hair renderering

Wireframe[edit]

Type: bool


Property group 'Translucency'[edit]

bAllowFog[edit]

Type: bool

Whether the material should allow fog or be unaffected by fog. This only has meaning for materials with translucent blend modes.

Default value: True

bCastLitTranslucencyShadowAsMasked[edit]

Type: bool

If this is set, lit translucent objects will cast shadow as if they were masked

bDisableDepthTest[edit]

Type: bool

Allows the material to disable depth tests, which is only meaningful with translucent blend modes. Disabling depth tests will make rendering significantly slower since no occluded pixels can get zculled.

bUseLitTranslucencyDepthPass[edit]

Type: bool

If this is set, a depth-only pass for will be rendered for solid (A=255) areas of dynamic lit translucency primitives. This improves hair sorting at the extra render cost.

bUseLitTranslucencyPostRenderDepthPass[edit]

Type: bool

If this is set, a depth-only pass for will be rendered for any visible (A>0) areas of dynamic lit translucency primitives. This is necessary for correct fog and DoF of hair

bUseOneLayerDistortion[edit]

Type: bool

Whether the material should use one-layer distortion, which can be cheaper than normal distortion for some primitive types (mainly fluid surfaces). One layer distortion won't handle overlapping one layer distortion primitives correctly. This causes an extra scene color resolve for the first primitive that uses one layer distortion and so should only be used in very specific circumstances.

Property group 'Usage'[edit]

bUsedAsLightFunction[edit]

Type: bool

Modifiers: const


bUsedWithBeamTrails[edit]

Type: bool

Modifiers: const


bUsedWithDecals[edit]

Type: bool

Modifiers: const

WARNING: bUsedWithDecals is mutually exclusive with all other mesh type usage flags! A material with bUsedWithDecals=true will not work on any other mesh type.

bUsedWithFluidSurfaces[edit]

Type: bool

Modifiers: const


bUsedWithFogVolumes[edit]

Type: bool

Modifiers: const

Indicates that the material is used on fog volumes. This usage flag is mutually exclusive with all other mesh type usage flags!

bUsedWithFoliage[edit]

Type: bool

Modifiers: const


bUsedWithFracturedMeshes[edit]

Type: bool

Modifiers: const


bUsedWithGammaCorrection[edit]

Type: bool

Modifiers: const

Gamma corrects the output of the base pass using the current render target's gamma value. This must be set on materials used with UIScenes to get correct results.

bUsedWithInstancedMeshes[edit]

Type: bool

Modifiers: const


bUsedWithInstancedMeshParticles[edit]

Type: bool

Modifiers: const

Enables instancing for mesh particles. Use the "Vertex Color" node when enabled, not "MeshEmit VertColor."

bUsedWithLensFlare[edit]

Type: bool

Modifiers: const


bUsedWithMaterialEffect[edit]

Type: bool

Modifiers: const


bUsedWithMorphTargets[edit]

Type: bool

Modifiers: const


bUsedWithParticleSprites[edit]

Type: bool

Modifiers: const


bUsedWithParticleSubUV[edit]

Type: bool

Modifiers: const


bUsedWithRadialBlur[edit]

Type: bool

Modifiers: const


bUsedWithSkeletalMesh[edit]

Type: bool

Modifiers: const

Indicates that the material and its instances can be assigned to skeletal meshes. This will result in the shaders required to support skeletal meshes being compiled which will increase shader compile time and memory usage.

bUsedWithSpeedTree[edit]

Type: bool

Modifiers: const


bUsedWithSplineMeshes[edit]

Type: bool

Modifiers: const


bUsedWithStaticLighting[edit]

Type: bool

Modifiers: const


Internal variables[edit]

AnisotropicDirection[edit]

Type: VectorMaterialInput

Specify a vector to use as anisotropic direction

bIsFallbackMaterial[edit]

Type: bool

Indicates that the material will be used as a fallback on sm2 platforms

bIsMasked[edit]

Type: bool

Modifiers: private

TRUE if Material is masked and uses custom opacity

bIsPreviewMaterial[edit]

Type: bool

Modifiers: transient, duplicatetransient, private

TRUE if Material is the preview material used in the material editor.

bUsedAsSpecialEngineMaterial[edit]

Type: bool

Modifiers: duplicatetransient, const

This is a special usage flag that allows a material to be assignable to any primitive type. This is useful for materials used by code to implement certain viewmodes, for example the default material or lighting only material. The cost is that nearly 20x more shaders will be compiled for the material than the average material, which will greatly increase shader compile time and memory usage. This flag should only be set when absolutely necessary, and is purposefully not exposed to the UI to prevent abuse.

bUsedWithParticleSystem[edit]

Type: bool

Modifiers: const


bUsesDistortion[edit]

Type: bool

Modifiers: private

TRUE if Material uses distortion

CustomLighting[edit]

Type: ColorMaterialInput

Use a custom light transfer equation to be factored with light color, attenuation and shadowing. This is currently only used for Movable, Toggleable and Dominant light contribution. LightVector can be used in this material input and will be set to the tangent space light direction of the current light being rendered.

CustomSkylightDiffuse[edit]

Type: ColorMaterialInput

Use a custom diffuse factor for attenuation with lights that only support a diffuse term. This should only be the diffuse color coefficient, and must not depend on LightVector. This is currently used with skylights, SH lights, materials exported to lightmass and directional lightmap contribution.

DefaultMaterialInstances[edit]

Type: pointer{class FDefaultMaterialInstance}

Array size: 2

Modifiers: const, native, duplicatetransient


DiffuseColor[edit]

Type: ColorMaterialInput


Default value:

Member Value
Constant
Member Value
A 0
B 128
G 128
R 128

DiffusePower[edit]

Type: ScalarMaterialInput


Default value:

Member Value
Constant 1.0

Distortion[edit]

Type: Vector2MaterialInput

Allows the material to distort background color by offsetting each background pixel by the amount of the distortion input for that pixel.

EditorComments[edit]

Type: array<MaterialExpressionComment>

Modifiers: editoronly

Array of comments associated with this material; viewed in the material editor.

EditorCompounds[edit]

Type: array<MaterialExpressionCompound>

Modifiers: editoronly

Array of material expression compounds associated with this material; viewed in the material editor.

EditorParameters[edit]

Type: Map{FName, TArray<UMaterialExpression*>}

Modifiers: native


EditorPitch[edit]

Type: int


EditorX[edit]

Type: int


EditorY[edit]

Type: int


EditorYaw[edit]

Type: int


EmissiveColor[edit]

Type: ColorMaterialInput


Expressions[edit]

Type: array<MaterialExpression>

Array of material expressions, excluding Comments and Compounds. Used by the material editor.

FallbackMaterial[edit]

Type: Material

Modifiers: duplicatetransient

The fallback material, which will be used on sm2 platforms

MaterialResources[edit]

Type: pointer{FMaterialResource}

Array size: 2

Modifiers: const, native, duplicatetransient


Normal[edit]

Type: VectorMaterialInput


Opacity[edit]

Type: ScalarMaterialInput


Default value:

Member Value
Constant 1.0

OpacityMask[edit]

Type: ScalarMaterialInput


Default value:

Member Value
Constant 1.0

PhysicalMaterial[edit]

Type: class<PhysicalMaterial>

For backwards compatibility only.

ReferencedTextureGuids[edit]

Type: array<Object.Guid>

Modifiers: private, const, editoronly


ReferencedTextures[edit]

Type: array<Texture>

Modifiers: deprecated, private, const

Legacy texture references, now handled by FMaterial.

SpecularColor[edit]

Type: ColorMaterialInput


Default value:

Member Value
Constant
Member Value
A 0
B 128
G 128
R 128

SpecularPower[edit]

Type: ScalarMaterialInput


Default value:

Member Value
Constant 15.0

TwoSidedLightingColor[edit]

Type: ColorMaterialInput

Modulates the lighting without the Lambertian term in two sided lighting.

Default value:

Member Value
Constant
Member Value
A 0
B 255
G 255
R 255

TwoSidedLightingMask[edit]

Type: ScalarMaterialInput

Lerps between lighting color (diffuse * attenuation * Lambertian) and lighting without the Lambertian term color (diffuse * attenuation * TwoSidedLightingColor).

WorldPositionOffset[edit]

Type: VectorMaterialInput

Adds to world position in the vertex shader.