Feature
BaseMaterial3D.swift:183enum Featureenum Featureimport SwiftGodotFramework to write Godot Game Extensions using the Swift Programming Language.
class BaseMaterial3DAbstract base class for defining the 3D rendering properties of meshes.
case emissionConstant for setting emissionEnabled.
case normalMappingConstant for setting normalEnabled.
case rimConstant for setting rimEnabled.
case clearcoatConstant for setting clearcoatEnabled.
case anisotropyConstant for setting anisotropyEnabled.
case ambientOcclusionConstant for setting aoEnabled.
case heightMappingConstant for setting heightmapEnabled.
case subsurfaceScatteringConstant for setting subsurfScatterEnabled.
case subsurfaceTransmittanceConstant for setting subsurfScatterTransmittanceEnabled.
case backlightConstant for setting backlightEnabled.
case refractionConstant for setting refractionEnabled.
case detailConstant for setting detailEnabled.
case maxRepresents the size of the Feature enum.
final var emissionEnabled: Bool { get set }If true, the body emits light. Emitting light makes the object appear brighter. The object can also cast light on other objects if a VoxelGI, SDFGI, or LightmapGI is used and this object is used in baked lighting.
final var normalEnabled: Bool { get set }If true, normal mapping is enabled. This has a slight performance cost, especially on mobile GPUs.
final var rimEnabled: Bool { get set }If true, rim effect is enabled. Rim lighting increases the brightness at glancing angles on an object.
final var clearcoatEnabled: Bool { get set }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.
final var anisotropyEnabled: Bool { get set }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.
final var aoEnabled: Bool { get set }If true, ambient occlusion is enabled. Ambient occlusion darkens areas based on the aoTexture.
final var heightmapEnabled: Bool { get set }If true, height mapping is enabled (also called “parallax mapping” or “depth mapping”). See also normalEnabled. Height mapping is a demanding feature on the GPU, so it should only be used on materials where it makes a significant visual difference.
final var subsurfScatterEnabled: Bool { get set }If true, subsurface scattering is enabled. Emulates light that penetrates an object’s surface, is scattered, and then emerges. Subsurface scattering quality is controlled by ProjectSettings/rendering/environment/subsurfaceScattering/subsurfaceScatteringQuality.
final var subsurfScatterTransmittanceEnabled: Bool { get set }If true, enables subsurface scattering transmittance. Only effective if subsurfScatterEnabled is true. See also backlightEnabled.
final var backlightEnabled: Bool { get set }If true, the backlight effect is enabled. See also subsurfScatterTransmittanceEnabled.
final var refractionEnabled: Bool { get set }If true, the refraction effect is enabled. Distorts transparency based on light from behind the object.
final var detailEnabled: Bool { get set }If true, enables the detail overlay. Detail is a second texture that gets mixed over the surface of the object based on detailMask and detailAlbedo’s alpha channel. This can be used to add variation to objects, or to blend between two different albedo/normal textures.
override class var godotClassName: StringName { get }final var albedoColor: Color { get set }The material’s base color.
final var albedoTexture: Texture2D? { get set }Texture to multiply by albedoColor. Used for basic texturing of objects.
final var albedoTextureForceSrgb: Bool { get set }If true, forces a conversion of the albedoTexture from sRGB color space to linear color space. See also vertexColorIsSrgb.
final var albedoTextureMsdf: Bool { get set }Enables multichannel signed distance field rendering shader. Use msdfPixelRange and msdfOutlineSize to configure MSDF parameters.
final var alphaAntialiasingEdge: Double { get set }Threshold at which antialiasing will be applied on the alpha channel.
final var alphaAntialiasingMode: BaseMaterial3D.AlphaAntiAliasing { get set }The type of alpha antialiasing to apply. See AlphaAntiAliasing.
final var alphaHashScale: Double { get set }The hashing scale for Alpha Hash. Recommended values between 0 and 2.
final var alphaScissorThreshold: Double { get set }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 decreasing alphaScissorThreshold.
final var anisotropy: Double { get set }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.
final var anisotropyFlowmap: Texture2D? { get set }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.
final var aoLightAffect: Double { get set }Amount that ambient occlusion affects lighting from lights. If 0, ambient occlusion only affects ambient light. If 1, 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.
final var aoOnUv2: Bool { get set }If true, use UV2 coordinates to look up from the aoTexture.
final var aoTexture: Texture2D? { get set }Texture that defines the amount of ambient occlusion for a given point on the object.
final var aoTextureChannel: BaseMaterial3D.TextureChannel { get set }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.
final var backlight: Color { get set }The color used by the backlight effect. Represents the light passing through an object.
final var backlightTexture: Texture2D? { get set }Texture used to control the backlight effect per-pixel. Added to backlight.
final var billboardKeepScale: Bool { get set }If true, the shader will keep the scale set for the mesh. Otherwise, the scale is lost when billboarding. Only applies when billboardMode is not .billboardDisabled.
final var billboardMode: BaseMaterial3D.BillboardMode { get set }Controls how the object faces the camera. See BillboardMode.
final var blendMode: BaseMaterial3D.BlendMode { get set }The material’s blend mode.
final var clearcoat: Double { get set }Sets the strength of the clearcoat effect. Setting to 0 looks the same as disabling the clearcoat effect.
final var clearcoatRoughness: Double { get set }Sets the roughness of the clearcoat pass. A higher value results in a rougher clearcoat while a lower value results in a smoother clearcoat.
final var clearcoatTexture: Texture2D? { get set }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.
final var cullMode: BaseMaterial3D.CullMode { get set }Determines which side of the triangle to cull depending on whether the triangle faces towards or away from the camera. See CullMode.
final var depthDrawMode: BaseMaterial3D.DepthDrawMode { get set }Determines when depth rendering takes place. See DepthDrawMode. See also transparency.
final var detailAlbedo: Texture2D? { get set }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, see detailMask.
final var detailBlendMode: BaseMaterial3D.BlendMode { get set }Specifies how the detailAlbedo should blend with the current ALBEDO. See BlendMode for options.
final var detailMask: Texture2D? { get set }Texture used to specify how the detail textures get blended with the base textures. detailMask can be used together with detailAlbedo’s alpha channel (if any).
final var detailNormal: Texture2D? { get set }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 from detailNormal is oriented around the surface normal provided by the Mesh.
final var detailUvLayer: BaseMaterial3D.DetailUV { get set }Specifies whether to use UV or UV2 for the detail layer. See DetailUV for options.
final var diffuseMode: BaseMaterial3D.DiffuseMode { get set }The algorithm used for diffuse light scattering. See DiffuseMode.
final var disableAmbientLight: Bool { get set }If true, the object receives no ambient light.
final var disableFog: Bool { get set }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.
final var disableReceiveShadows: Bool { get set }If true, the object receives no shadow that would otherwise be cast onto it.
final var distanceFadeMaxDistance: Double { get set }Distance at which the object appears fully opaque.
final var distanceFadeMinDistance: Double { get set }Distance at which the object starts to become visible. If the object is less than this distance away, it will be invisible.
final var distanceFadeMode: BaseMaterial3D.DistanceFadeMode { get set }Specifies which type of fade to use. Can be any of the DistanceFadeModes.
final var emission: Color { get set }The emitted light’s color. See emissionEnabled.
final var emissionEnergyMultiplier: Double { get set }Multiplier for emitted light. See emissionEnabled.
final var emissionIntensity: Double { get set }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.
final var emissionOnUv2: Bool { get set }Use UV2 to read from the emissionTexture.
final var emissionOperator: BaseMaterial3D.EmissionOperator { get set }Sets how emission interacts with emissionTexture. Can either add or multiply. See EmissionOperator for options.
final var emissionTexture: Texture2D? { get set }Texture that specifies how much surface emits light at a given point.
final var fixedSize: Bool { get set }If true, the object is rendered at the same size regardless of distance.
final var grow: Bool { get set }If true, enables the vertex grow setting. This can be used to create mesh-based outlines using a second material pass and its cullMode set to .cullFront. See also growAmount.
final var growAmount: Double { get set }Grows object vertices in the direction of their normals. Only effective if grow is true.
final var heightmapDeepParallax: Bool { get set }If true, uses parallax occlusion mapping to represent depth in the material instead of simple offset mapping (see heightmapEnabled). 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.
final var heightmapFlipBinormal: Bool { get set }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 reasonable heightmapScale), try setting this to true.
final var heightmapFlipTangent: Bool { get set }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 reasonable heightmapScale), try setting this to true.
final var heightmapFlipTexture: Bool { get set }If true, interprets the height map texture as a depth map, with brighter values appearing to be “lower” in altitude compared to darker values.
final var heightmapMaxLayers: Int32 { get set }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.
final var heightmapMinLayers: Int32 { get set }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.
final var heightmapScale: Double { get set }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 using heightmapFlipTexture as the material will also appear to be “closer” to the camera. In most cases, heightmapScale should be kept to a positive value.
final var heightmapTexture: Texture2D? { get set }The texture to use as a height map. See also heightmapEnabled.
final var metallic: Double { get set }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 and 1 should only be used for blending between metal and non-metal sections. To alter the amount of reflection use roughness.
final var metallicSpecular: Double { get set }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 .specularDisabled SpecularMode as .specularDisabled only applies to the specular lobe from the light source.
final var metallicTexture: Texture2D? { get set }Texture used to specify metallic for an object. This is multiplied by metallic.
final var metallicTextureChannel: BaseMaterial3D.TextureChannel { get set }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.
final var msdfOutlineSize: Double { get set }The width of the shape outline.
final var msdfPixelRange: Double { get set }The width of the range around the shape between the minimum and maximum representable signed distance.
final var noDepthTest: Bool { get set }If true, depth testing is disabled and the object will be drawn in render order.
final var normalScale: Double { get set }The strength of the normal map’s effect.
final var normalTexture: Texture2D? { get set }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 from normalTexture is oriented around the surface normal provided by the Mesh.
final var ormTexture: Texture2D? { get set }The Occlusion/Roughness/Metallic texture to use. This is a more efficient replacement of aoTexture, roughnessTexture and metallicTexture in ORMMaterial3D. 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.
final var particlesAnimHFrames: Int32 { get set }The number of horizontal frames in the particle sprite sheet. Only enabled when using .billboardParticles. See billboardMode.
final var particlesAnimLoop: Bool { get set }If true, particle animations are looped. Only enabled when using .billboardParticles. See billboardMode.
final var particlesAnimVFrames: Int32 { get set }The number of vertical frames in the particle sprite sheet. Only enabled when using .billboardParticles. See billboardMode.
final var pointSize: Double { get set }The point size in pixels. See usePointSize.
final var proximityFadeDistance: Double { get set }Distance over which the fade effect takes place. The larger the distance the longer it takes for an object to fade.
final var proximityFadeEnabled: Bool { get set }If true, the proximity fade effect is enabled. The proximity fade effect fades out each pixel based on its distance to another object.
final var refractionScale: Double { get set }The strength of the refraction effect.
final var refractionTexture: Texture2D? { get set }Texture that controls the strength of the refraction per-pixel. Multiplied by refractionScale.
final var refractionTextureChannel: BaseMaterial3D.TextureChannel { get set }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.
final var rim: Double { get set }Sets the strength of the rim lighting effect.
final var rimTexture: Texture2D? { get set }Texture used to set the strength of the rim lighting effect per-pixel. Multiplied by rim.
final var rimTint: Double { get set }The amount of to blend light and albedo color when rendering rim effect. If 0 the light color is used, while 1 means albedo color is used. An intermediate value generally works best.
final var roughness: Double { get set }Surface reflection. A value of 0 represents a perfect mirror while a value of 1 completely blurs the reflection. See also metallic.
final var roughnessTexture: Texture2D? { get set }Texture used to control the roughness per-pixel. Multiplied by roughness.
final var roughnessTextureChannel: BaseMaterial3D.TextureChannel { get set }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.
final var shadingMode: BaseMaterial3D.ShadingMode { get set }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.
final var shadowToOpacity: Bool { get set }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.
final var specularMode: BaseMaterial3D.SpecularMode { get set }The method for rendering the specular blob. See SpecularMode.
final var subsurfScatterSkinMode: Bool { get set }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.
final var subsurfScatterStrength: Double { get set }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.
final var subsurfScatterTexture: Texture2D? { get set }Texture used to control the subsurface scattering strength. Stored in the red texture channel. Multiplied by subsurfScatterStrength.
final var subsurfScatterTransmittanceBoost: Double { get set }The intensity of the subsurface scattering transmittance effect.
final var subsurfScatterTransmittanceColor: Color { get set }The color to multiply the subsurface scattering transmittance effect with. Ignored if subsurfScatterSkinMode is true.
final var subsurfScatterTransmittanceDepth: Double { get set }The depth of the subsurface scattering transmittance effect.
final var subsurfScatterTransmittanceTexture: Texture2D? { get set }The texture to use for multiplying the intensity of the subsurface scattering transmittance intensity. See also subsurfScatterTexture. Ignored if subsurfScatterSkinMode is true.
final var textureFilter: BaseMaterial3D.TextureFilter { get set }Filter flags for the texture. See TextureFilter for options.
final var textureRepeat: Bool { get set }Repeat flags for the texture. See TextureFilter for options.
final var transparency: BaseMaterial3D.Transparency { get set }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.
final var useParticleTrails: Bool { get set }If true, enables parts of the shader required for GPUParticles3D trails to function. This also requires using a mesh with appropriate skinning, such as RibbonTrailMesh or TubeTrailMesh. Enabling this feature outside of materials used in GPUParticles3D meshes will break material rendering.
final var usePointSize: Bool { get set }If true, render point size can be changed.
final var uv1Offset: Vector3 { get set }How much to offset the UV coordinates. This amount will be added to UV in the vertex function. This can be used to offset a texture. The Z component is used when uv1Triplanar is enabled, but it is not used anywhere else.
final var uv1Scale: Vector3 { get set }How much to scale the UV coordinates. This is multiplied by UV in the vertex function. The Z component is used when uv1Triplanar is enabled, but it is not used anywhere else.
final var uv1Triplanar: Bool { get set }If true, instead of using UV 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.
final var uv1TriplanarSharpness: Double { get set }A lower number blends the texture more softly while a higher number blends the texture more sharply.
final var uv1WorldTriplanar: Bool { get set }If true, triplanar mapping for UV is calculated in world space rather than object local space. See also uv1Triplanar.
final var uv2Offset: Vector3 { get set }How much to offset the UV2 coordinates. This amount will be added to UV2 in the vertex function. This can be used to offset a texture. The Z component is used when uv2Triplanar is enabled, but it is not used anywhere else.
final var uv2Scale: Vector3 { get set }How much to scale the UV2 coordinates. This is multiplied by UV2 in the vertex function. The Z component is used when uv2Triplanar is enabled, but it is not used anywhere else.
final var uv2Triplanar: Bool { get set }If true, instead of using UV2 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.
final var uv2TriplanarSharpness: Double { get set }A lower number blends the texture more softly while a higher number blends the texture more sharply.
final var uv2WorldTriplanar: Bool { get set }If true, triplanar mapping for UV2 is calculated in world space rather than object local space. See also uv2Triplanar.
final var vertexColorIsSrgb: Bool { get set }If true, vertex colors are considered to be stored in sRGB color space and are converted to linear color space during rendering. If false, vertex colors are considered to be stored in linear color space and are rendered as-is. See also albedoTextureForceSrgb.
final var vertexColorUseAsAlbedo: Bool { get set }If true, the vertex color is used as albedo color.
enum AlphaAntiAliasingenum BillboardModeenum BlendModeenum CullModeenum DepthDrawModeenum DetailUVenum DiffuseModeenum DistanceFadeModeenum EmissionOperatorenum Flagsenum ShadingModeenum SpecularModeenum TextureChannelenum TextureFilterenum TextureParamenum Transparencyclass ORMMaterial3DA PBR (Physically Based Rendering) material to be used on 3D objects. Uses an ORM texture.
protocol CaseIterableA type that provides a collection of all of its values.
protocol CustomDebugStringConvertibleA type with a customized textual representation suitable for debugging purposes.
protocol EquatableA type that can be compared for value equality.
protocol Hashable : EquatableA 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.
init?(rawValue: Int64) var debugDescription: String { get }A textual representation of this instance, suitable for debugging
var hashValue: Int { get }static func != (lhs: Self, rhs: Self) -> Bool Returns a Boolean value indicating whether two values are not equal.
func hash(into hasher: inout Hasher)