Enumerationmigueldeicaza.swiftgodot 0.45.0SwiftGodot
CullMode
BaseMaterial3D.swift:289enum CullMode
Cases
case back
Default cull mode. The back of the object is culled when not visible. Back face triangles will be culled when facing the camera. This results in only the front side of triangles being drawn. For closed-surface meshes, this means that only the exterior of the mesh will be visible.
case front
Front face triangles will be culled when facing the camera. This results in only the back side of triangles being drawn. For closed-surface meshes, this means that the interior of the mesh will be drawn instead of the exterior.
case disabled
No face culling is performed; both the front face and back face will be visible.
Other members in extension
View members
Hide members
This section is hidden by default because it contains too many (134) members.
Types
enum AlphaAntiAliasing
enum BillboardMode
enum BlendMode
enum DepthDrawMode
enum DetailUV
enum DiffuseMode
enum DistanceFadeMode
enum EmissionOperator
enum Feature
enum Flags
enum ShadingMode
enum SpecularMode
enum TextureChannel
enum TextureFilter
enum TextureParam
enum Transparency
Type members
Instance members
var albedoColor: Color
The material’s base color.
var albedoTexture: Texture2D?
Texture to multiply by
albedoColor
. Used for basic texturing of objects.var albedoTextureForceSrgb: Bool
If
true
, forces a conversion of thealbedoTexture
from sRGB color space to linear color space. See alsovertexColorIsSrgb
.var albedoTextureMsdf: Bool
Enables multichannel signed distance field rendering shader. Use
msdfPixelRange
andmsdfOutlineSize
to configure MSDF parameters.var alphaAntialiasingEdge: Double
Threshold at which antialiasing will be applied on the alpha channel.
var alphaAntialiasingMode: BaseMaterial3D.AlphaAntiAliasing
The type of alpha antialiasing to apply. See
AlphaAntiAliasing
.var alphaHashScale: Double
The hashing scale for Alpha Hash. Recommended values between
0
and2
.var alphaScissorThreshold: Double
Threshold at which the alpha scissor will discard values. Higher values will result in more pixels being discarded. If the material becomes too opaque at a distance, try increasing
alphaScissorThreshold
. If the material disappears at a distance, try decreasingalphaScissorThreshold
.var anisotropy: Double
The strength of the anisotropy effect. This is multiplied by
anisotropyFlowmap
’s alpha channel if a texture is defined there and the texture contains an alpha channel.var anisotropyEnabled: Bool
If
true
, anisotropy is enabled. Anisotropy changes the shape of the specular blob and aligns it to tangent space. This is useful for brushed aluminium and hair reflections.var anisotropyFlowmap: Texture2D?
Texture that offsets the tangent map for anisotropy calculations and optionally controls the anisotropy effect (if an alpha channel is present). The flowmap texture is expected to be a derivative map, with the red channel representing distortion on the X axis and green channel representing distortion on the Y axis. Values below 0.5 will result in negative distortion, whereas values above 0.5 will result in positive distortion.
var aoEnabled: Bool
If
true
, ambient occlusion is enabled. Ambient occlusion darkens areas based on theaoTexture
.var aoLightAffect: Double
Amount that ambient occlusion affects lighting from lights. If
0
, ambient occlusion only affects ambient light. If1
, ambient occlusion affects lights just as much as it affects ambient light. This can be used to impact the strength of the ambient occlusion effect, but typically looks unrealistic.var aoOnUv2: Bool
If
true
, useUV2
coordinates to look up from theaoTexture
.var aoTexture: Texture2D?
Texture that defines the amount of ambient occlusion for a given point on the object.
var aoTextureChannel: BaseMaterial3D.TextureChannel
Specifies the channel of the
aoTexture
in which the ambient occlusion information is stored. This is useful when you store the information for multiple effects in a single texture. For example if you stored metallic in the red channel, roughness in the blue, and ambient occlusion in the green you could reduce the number of textures you use.var backlight: Color
The color used by the backlight effect. Represents the light passing through an object.
var backlightEnabled: Bool
If
true
, the backlight effect is enabled. See alsosubsurfScatterTransmittanceEnabled
.var backlightTexture: Texture2D?
Texture used to control the backlight effect per-pixel. Added to
backlight
.var billboardKeepScale: Bool
If
true
, the shader will keep the scale set for the mesh. Otherwise, the scale is lost when billboarding. Only applies whenbillboardMode
is not .billboardDisabled.var billboardMode: BaseMaterial3D.BillboardMode
Controls how the object faces the camera. See
BillboardMode
.var blendMode: BaseMaterial3D.BlendMode
The material’s blend mode.
var clearcoat: Double
Sets the strength of the clearcoat effect. Setting to
0
looks the same as disabling the clearcoat effect.var clearcoatEnabled: Bool
If
true
, clearcoat rendering is enabled. Adds a secondary transparent pass to the lighting calculation resulting in an added specular blob. This makes materials appear as if they have a clear layer on them that can be either glossy or rough.var clearcoatRoughness: Double
Sets the roughness of the clearcoat pass. A higher value results in a rougher clearcoat while a lower value results in a smoother clearcoat.
var clearcoatTexture: Texture2D?
Texture that defines the strength of the clearcoat effect and the glossiness of the clearcoat. Strength is specified in the red channel while glossiness is specified in the green channel.
var cullMode: BaseMaterial3D.CullMode
Determines which side of the triangle to cull depending on whether the triangle faces towards or away from the camera. See
CullMode
.var depthDrawMode: BaseMaterial3D.DepthDrawMode
Determines when depth rendering takes place. See
DepthDrawMode
. See alsotransparency
.var detailAlbedo: Texture2D?
Texture that specifies the color of the detail overlay.
detailAlbedo
’s alpha channel is used as a mask, even when the material is opaque. To use a dedicated texture as a mask, seedetailMask
.var detailBlendMode: BaseMaterial3D.BlendMode
Specifies how the
detailAlbedo
should blend with the currentALBEDO
. SeeBlendMode
for options.var detailEnabled: Bool
If
true
, enables the detail overlay. Detail is a second texture that gets mixed over the surface of the object based ondetailMask
anddetailAlbedo
’s alpha channel. This can be used to add variation to objects, or to blend between two different albedo/normal textures.var detailMask: Texture2D?
Texture used to specify how the detail textures get blended with the base textures.
detailMask
can be used together withdetailAlbedo
’s alpha channel (if any).var detailNormal: Texture2D?
Texture that specifies the per-pixel normal of the detail overlay. The
detailNormal
texture only uses the red and green channels; the blue and alpha channels are ignored. The normal read fromdetailNormal
is oriented around the surface normal provided by theMesh
.var detailUvLayer: BaseMaterial3D.DetailUV
Specifies whether to use
UV
orUV2
for the detail layer. SeeDetailUV
for options.var diffuseMode: BaseMaterial3D.DiffuseMode
The algorithm used for diffuse light scattering. See
DiffuseMode
.var disableAmbientLight: Bool
If
true
, the object receives no ambient light.var disableFog: Bool
If
true
, the object will not be affected by fog (neither volumetric nor depth fog). This is useful for unshaded or transparent materials (e.g. particles), which without this setting will be affected even if fully transparent.var disableReceiveShadows: Bool
If
true
, the object receives no shadow that would otherwise be cast onto it.var distanceFadeMaxDistance: Double
Distance at which the object appears fully opaque.
var distanceFadeMinDistance: Double
Distance at which the object starts to become visible. If the object is less than this distance away, it will be invisible.
var distanceFadeMode: BaseMaterial3D.DistanceFadeMode
Specifies which type of fade to use. Can be any of the
DistanceFadeMode
s.var emission: Color
The emitted light’s color. See
emissionEnabled
.var emissionEnabled: Bool
If
true
, the body emits light. Emitting light makes the object appear brighter. The object can also cast light on other objects if aVoxelGI
, SDFGI, orLightmapGI
is used and this object is used in baked lighting.var emissionEnergyMultiplier: Double
Multiplier for emitted light. See
emissionEnabled
.var emissionIntensity: Double
Luminance of emitted light, measured in nits (candela per square meter). Only available when
ProjectSettings/rendering/lightsAndShadows/usePhysicalLightUnits
is enabled. The default is roughly equivalent to an indoor lightbulb.var emissionOnUv2: Bool
Use
UV2
to read from theemissionTexture
.var emissionOperator: BaseMaterial3D.EmissionOperator
Sets how
emission
interacts withemissionTexture
. Can either add or multiply. SeeEmissionOperator
for options.var emissionTexture: Texture2D?
Texture that specifies how much surface emits light at a given point.
var fixedSize: Bool
If
true
, the object is rendered at the same size regardless of distance.var grow: Bool
If
true
, enables the vertex grow setting. This can be used to create mesh-based outlines using a second material pass and itscullMode
set to .cullFront. See alsogrowAmount
.var growAmount: Double
Grows object vertices in the direction of their normals. Only effective if
grow
istrue
.var heightmapDeepParallax: Bool
If
true
, uses parallax occlusion mapping to represent depth in the material instead of simple offset mapping (seeheightmapEnabled
). This results in a more convincing depth effect, but is much more expensive on the GPU. Only enable this on materials where it makes a significant visual difference.var heightmapEnabled: Bool
If
true
, height mapping is enabled (also called “parallax mapping” or “depth mapping”). See alsonormalEnabled
. Height mapping is a demanding feature on the GPU, so it should only be used on materials where it makes a significant visual difference.var heightmapFlipBinormal: Bool
If
true
, flips the mesh’s binormal vectors when interpreting the height map. If the heightmap effect looks strange when the camera moves (even with a reasonableheightmapScale
), try setting this totrue
.var heightmapFlipTangent: Bool
If
true
, flips the mesh’s tangent vectors when interpreting the height map. If the heightmap effect looks strange when the camera moves (even with a reasonableheightmapScale
), try setting this totrue
.var heightmapFlipTexture: Bool
If
true
, interprets the height map texture as a depth map, with brighter values appearing to be “lower” in altitude compared to darker values.var heightmapMaxLayers: Int32
The number of layers to use for parallax occlusion mapping when the camera is up close to the material. Higher values result in a more convincing depth effect, especially in materials that have steep height changes. Higher values have a significant cost on the GPU, so it should only be increased on materials where it makes a significant visual difference.
var heightmapMinLayers: Int32
The number of layers to use for parallax occlusion mapping when the camera is far away from the material. Higher values result in a more convincing depth effect, especially in materials that have steep height changes. Higher values have a significant cost on the GPU, so it should only be increased on materials where it makes a significant visual difference.
var heightmapScale: Double
The heightmap scale to use for the parallax effect (see
heightmapEnabled
). The default value is tuned so that the highest point (value = 255) appears to be 5 cm higher than the lowest point (value = 0). Higher values result in a deeper appearance, but may result in artifacts appearing when looking at the material from oblique angles, especially when the camera moves. Negative values can be used to invert the parallax effect, but this is different from inverting the texture usingheightmapFlipTexture
as the material will also appear to be “closer” to the camera. In most cases,heightmapScale
should be kept to a positive value.var heightmapTexture: Texture2D?
The texture to use as a height map. See also
heightmapEnabled
.var metallic: Double
A high value makes the material appear more like a metal. Non-metals use their albedo as the diffuse color and add diffuse to the specular reflection. With non-metals, the reflection appears on top of the albedo color. Metals use their albedo as a multiplier to the specular reflection and set the diffuse color to black resulting in a tinted reflection. Materials work better when fully metal or fully non-metal, values between
0
and1
should only be used for blending between metal and non-metal sections. To alter the amount of reflection useroughness
.var metallicSpecular: Double
Adjusts the strength of specular reflections. Specular reflections are composed of scene reflections and the specular lobe which is the bright spot that is reflected from light sources. When set to
0.0
, no specular reflections will be visible. This differs from the .specularDisabledSpecularMode
as .specularDisabled only applies to the specular lobe from the light source.var metallicTexture: Texture2D?
Texture used to specify metallic for an object. This is multiplied by
metallic
.var metallicTextureChannel: BaseMaterial3D.TextureChannel
Specifies the channel of the
metallicTexture
in which the metallic information is stored. This is useful when you store the information for multiple effects in a single texture. For example if you stored metallic in the red channel, roughness in the blue, and ambient occlusion in the green you could reduce the number of textures you use.var msdfOutlineSize: Double
The width of the shape outline.
var msdfPixelRange: Double
The width of the range around the shape between the minimum and maximum representable signed distance.
var noDepthTest: Bool
If
true
, depth testing is disabled and the object will be drawn in render order.var normalEnabled: Bool
If
true
, normal mapping is enabled. This has a slight performance cost, especially on mobile GPUs.var normalScale: Double
The strength of the normal map’s effect.
var normalTexture: Texture2D?
Texture used to specify the normal at a given pixel. The
normalTexture
only uses the red and green channels; the blue and alpha channels are ignored. The normal read fromnormalTexture
is oriented around the surface normal provided by theMesh
.var ormTexture: Texture2D?
The Occlusion/Roughness/Metallic texture to use. This is a more efficient replacement of
aoTexture
,roughnessTexture
andmetallicTexture
inORMMaterial3D
. Ambient occlusion is stored in the red channel. Roughness map is stored in the green channel. Metallic map is stored in the blue channel. The alpha channel is ignored.var particlesAnimHFrames: Int32
The number of horizontal frames in the particle sprite sheet. Only enabled when using .billboardParticles. See
billboardMode
.var particlesAnimLoop: Bool
If
true
, particle animations are looped. Only enabled when using .billboardParticles. SeebillboardMode
.var particlesAnimVFrames: Int32
The number of vertical frames in the particle sprite sheet. Only enabled when using .billboardParticles. See
billboardMode
.var pointSize: Double
The point size in pixels. See
usePointSize
.var proximityFadeDistance: Double
Distance over which the fade effect takes place. The larger the distance the longer it takes for an object to fade.
var proximityFadeEnabled: Bool
If
true
, the proximity fade effect is enabled. The proximity fade effect fades out each pixel based on its distance to another object.var refractionEnabled: Bool
If
true
, the refraction effect is enabled. Distorts transparency based on light from behind the object.var refractionScale: Double
The strength of the refraction effect.
var refractionTexture: Texture2D?
Texture that controls the strength of the refraction per-pixel. Multiplied by
refractionScale
.var refractionTextureChannel: BaseMaterial3D.TextureChannel
Specifies the channel of the
refractionTexture
in which the refraction information is stored. This is useful when you store the information for multiple effects in a single texture. For example if you stored refraction in the red channel, roughness in the blue, and ambient occlusion in the green you could reduce the number of textures you use.var rim: Double
Sets the strength of the rim lighting effect.
var rimEnabled: Bool
If
true
, rim effect is enabled. Rim lighting increases the brightness at glancing angles on an object.var rimTexture: Texture2D?
Texture used to set the strength of the rim lighting effect per-pixel. Multiplied by
rim
.var rimTint: Double
The amount of to blend light and albedo color when rendering rim effect. If
0
the light color is used, while1
means albedo color is used. An intermediate value generally works best.var roughness: Double
Surface reflection. A value of
0
represents a perfect mirror while a value of1
completely blurs the reflection. See alsometallic
.var roughnessTexture: Texture2D?
Texture used to control the roughness per-pixel. Multiplied by
roughness
.var roughnessTextureChannel: BaseMaterial3D.TextureChannel
Specifies the channel of the
roughnessTexture
in which the roughness information is stored. This is useful when you store the information for multiple effects in a single texture. For example if you stored metallic in the red channel, roughness in the blue, and ambient occlusion in the green you could reduce the number of textures you use.var shadingMode: BaseMaterial3D.ShadingMode
Sets whether the shading takes place, per-pixel, per-vertex or unshaded. Per-vertex lighting is faster, making it the best choice for mobile applications, however it looks considerably worse than per-pixel. Unshaded rendering is the fastest, but disables all interactions with lights.
var shadowToOpacity: Bool
If
true
, enables the “shadow to opacity” render mode where lighting modifies the alpha so shadowed areas are opaque and non-shadowed areas are transparent. Useful for overlaying shadows onto a camera feed in AR.var specularMode: BaseMaterial3D.SpecularMode
The method for rendering the specular blob. See
SpecularMode
.var subsurfScatterEnabled: Bool
If
true
, subsurface scattering is enabled. Emulates light that penetrates an object’s surface, is scattered, and then emerges. Subsurface scattering quality is controlled byProjectSettings/rendering/environment/subsurfaceScattering/subsurfaceScatteringQuality
.var subsurfScatterSkinMode: Bool
If
true
, subsurface scattering will use a special mode optimized for the color and density of human skin, such as boosting the intensity of the red channel in subsurface scattering.var subsurfScatterStrength: Double
The strength of the subsurface scattering effect. The depth of the effect is also controlled by
ProjectSettings/rendering/environment/subsurfaceScattering/subsurfaceScatteringScale
, which is set globally.var subsurfScatterTexture: Texture2D?
Texture used to control the subsurface scattering strength. Stored in the red texture channel. Multiplied by
subsurfScatterStrength
.var subsurfScatterTransmittanceBoost: Double
The intensity of the subsurface scattering transmittance effect.
var subsurfScatterTransmittanceColor: Color
The color to multiply the subsurface scattering transmittance effect with. Ignored if
subsurfScatterSkinMode
istrue
.var subsurfScatterTransmittanceDepth: Double
The depth of the subsurface scattering transmittance effect.
var subsurfScatterTransmittanceEnabled: Bool
If
true
, enables subsurface scattering transmittance. Only effective ifsubsurfScatterEnabled
istrue
. See alsobacklightEnabled
.var subsurfScatterTransmittanceTexture: Texture2D?
The texture to use for multiplying the intensity of the subsurface scattering transmitteance intensity. See also
subsurfScatterTexture
. Ignored ifsubsurfScatterSkinMode
istrue
.var textureFilter: BaseMaterial3D.TextureFilter
Filter flags for the texture. See
TextureFilter
for options.var textureRepeat: Bool
Repeat flags for the texture. See
TextureFilter
for options.var transparency: BaseMaterial3D.Transparency
The material’s transparency mode. Some transparency modes will disable shadow casting. Any transparency mode other than .disabled has a greater performance impact compared to opaque rendering. See also
blendMode
.var useParticleTrails: Bool
If
true
, enables parts of the shader required forGPUParticles3D
trails to function. This also requires using a mesh with appropriate skinning, such asRibbonTrailMesh
orTubeTrailMesh
. Enabling this feature outside of materials used inGPUParticles3D
meshes will break material rendering.var usePointSize: Bool
If
true
, render point size can be changed.var uv1Offset: Vector3
How much to offset the
UV
coordinates. This amount will be added toUV
in the vertex function. This can be used to offset a texture. The Z component is used whenuv1Triplanar
is enabled, but it is not used anywhere else.var uv1Scale: Vector3
How much to scale the
UV
coordinates. This is multiplied byUV
in the vertex function. The Z component is used whenuv1Triplanar
is enabled, but it is not used anywhere else.var uv1Triplanar: Bool
If
true
, instead of usingUV
textures will use a triplanar texture lookup to determine how to apply textures. Triplanar uses the orientation of the object’s surface to blend between texture coordinates. It reads from the source texture 3 times, once for each axis and then blends between the results based on how closely the pixel aligns with each axis. This is often used for natural features to get a realistic blend of materials. Because triplanar texturing requires many more texture reads per-pixel it is much slower than normal UV texturing. Additionally, because it is blending the texture between the three axes, it is unsuitable when you are trying to achieve crisp texturing.var uv1TriplanarSharpness: Double
A lower number blends the texture more softly while a higher number blends the texture more sharply.
var uv1WorldTriplanar: Bool
If
true
, triplanar mapping forUV
is calculated in world space rather than object local space. See alsouv1Triplanar
.var uv2Offset: Vector3
How much to offset the
UV2
coordinates. This amount will be added toUV2
in the vertex function. This can be used to offset a texture. The Z component is used whenuv2Triplanar
is enabled, but it is not used anywhere else.var uv2Scale: Vector3
How much to scale the
UV2
coordinates. This is multiplied byUV2
in the vertex function. The Z component is used whenuv2Triplanar
is enabled, but it is not used anywhere else.var uv2Triplanar: Bool
If
true
, instead of usingUV2
textures will use a triplanar texture lookup to determine how to apply textures. Triplanar uses the orientation of the object’s surface to blend between texture coordinates. It reads from the source texture 3 times, once for each axis and then blends between the results based on how closely the pixel aligns with each axis. This is often used for natural features to get a realistic blend of materials. Because triplanar texturing requires many more texture reads per-pixel it is much slower than normal UV texturing. Additionally, because it is blending the texture between the three axes, it is unsuitable when you are trying to achieve crisp texturing.var uv2TriplanarSharpness: Double
A lower number blends the texture more softly while a higher number blends the texture more sharply.
var uv2WorldTriplanar: Bool
If
true
, triplanar mapping forUV2
is calculated in world space rather than object local space. See alsouv2Triplanar
.var vertexColorIsSrgb: Bool
If
true
, vertex colors are considered to be stored in sRGB color space and are converted to linear color space during rendering. Iffalse
, vertex colors are considered to be stored in linear color space and are rendered as-is. See alsoalbedoTextureForceSrgb
.var vertexColorUseAsAlbedo: Bool
If
true
, the vertex color is used as albedo color.
Citizens in SwiftGodot
Conformances
protocol CaseIterable
A type that provides a collection of all of its values.
protocol CustomDebugStringConvertible
A type with a customized textual representation suitable for debugging purposes.
protocol Equatable
A type that can be compared for value equality.
protocol Hashable
A type that can be hashed into a
Hasher
to produce an integer hash value.protocol RawRepresentable<RawValue>
A type that can be converted to and from an associated raw value.
Type members
Instance members
var debugDescription: String
A textual representation of this instance, suitable for debugging
Type features
static func != (lhs: Self, rhs: Self
) -> Bool Returns a Boolean value indicating whether two values are not equal.