Enumerationmigueldeicaza.swiftgodot 0.46.0SwiftGodot
CanvasItemTextureFilter
RenderingServer.swift:1898enum CanvasItemTextureFilter
Cases
case `default`
Uses the default filter mode for this
Viewport
.case nearest
The texture filter reads from the nearest pixel only. This makes the texture look pixelated from up close, and grainy from a distance (due to mipmaps not being sampled).
case linear
The texture filter blends between the nearest 4 pixels. This makes the texture look smooth from up close, and grainy from a distance (due to mipmaps not being sampled).
case nearestWithMipmaps
The texture filter reads from the nearest pixel and blends between the nearest 2 mipmaps (or uses the nearest mipmap if
ProjectSettings/rendering/textures/defaultFilters/useNearestMipmapFilter
istrue
). This makes the texture look pixelated from up close, and smooth from a distance.case linearWithMipmaps
The texture filter blends between the nearest 4 pixels and between the nearest 2 mipmaps (or uses the nearest mipmap if
ProjectSettings/rendering/textures/defaultFilters/useNearestMipmapFilter
istrue
). This makes the texture look smooth from up close, and smooth from a distance.case nearestWithMipmapsAnisotropic
The texture filter reads from the nearest pixel and blends between 2 mipmaps (or uses the nearest mipmap if
ProjectSettings/rendering/textures/defaultFilters/useNearestMipmapFilter
istrue
) based on the angle between the surface and the camera view. This makes the texture look pixelated from up close, and smooth from a distance. Anisotropic filtering improves texture quality on surfaces that are almost in line with the camera, but is slightly slower. The anisotropic filtering level can be changed by adjustingProjectSettings/rendering/textures/defaultFilters/anisotropicFilteringLevel
.case linearWithMipmapsAnisotropic
The texture filter blends between the nearest 4 pixels and blends between 2 mipmaps (or uses the nearest mipmap if
ProjectSettings/rendering/textures/defaultFilters/useNearestMipmapFilter
istrue
) based on the angle between the surface and the camera view. This makes the texture look smooth from up close, and smooth from a distance. Anisotropic filtering improves texture quality on surfaces that are almost in line with the camera, but is slightly slower. The anisotropic filtering level can be changed by adjustingProjectSettings/rendering/textures/defaultFilters/anisotropicFilteringLevel
.case max
Max value for
CanvasItemTextureFilter
enum.
Other members in extension
View members
Hide members
This section is hidden by default because it contains too many (590) members.
Types
enum ArrayCustomFormat
struct ArrayFormat
enum ArrayType
enum BakeChannels
enum BlendShapeMode
enum CanvasGroupMode
enum CanvasItemTextureRepeat
enum CanvasLightBlendMode
enum CanvasLightMode
enum CanvasLightShadowFilter
enum CanvasOccluderPolygonCullMode
enum CanvasTextureChannel
enum CompositorEffectCallbackType
enum CompositorEffectFlags
enum CubeMapLayer
enum DOFBlurQuality
enum DOFBokehShape
enum DecalFilter
enum DecalTexture
enum EnvironmentAmbientSource
enum EnvironmentBG
enum EnvironmentFogMode
enum EnvironmentGlowBlendMode
enum EnvironmentReflectionSource
enum EnvironmentSDFGIFramesToConverge
enum EnvironmentSDFGIFramesToUpdateLight
enum EnvironmentSDFGIRayCount
enum EnvironmentSDFGIYScale
enum EnvironmentSSAOQuality
enum EnvironmentSSILQuality
enum EnvironmentSSRRoughnessQuality
enum EnvironmentToneMapper
enum Features
enum FogVolumeShape
enum GlobalShaderParameterType
enum InstanceFlags
enum InstanceType
enum LightBakeMode
enum LightDirectionalShadowMode
enum LightDirectionalSkyMode
enum LightOmniShadowMode
enum LightParam
enum LightProjectorFilter
enum LightType
enum MultimeshTransformFormat
enum NinePatchAxisMode
enum ParticlesCollisionHeightfieldResolution
enum ParticlesCollisionType
enum ParticlesDrawOrder
enum ParticlesMode
enum ParticlesTransformAlign
enum PrimitiveType
enum ReflectionProbeAmbientMode
enum ReflectionProbeUpdateMode
enum RenderingInfo
enum ShaderMode
enum ShadowCastingSetting
enum ShadowQuality
enum SkyMode
enum SubSurfaceScatteringQuality
enum TextureLayeredType
enum ViewportClearMode
enum ViewportDebugDraw
enum ViewportEnvironmentMode
enum ViewportMSAA
enum ViewportOcclusionCullingBuildQuality
enum ViewportRenderInfo
enum ViewportRenderInfoType
enum ViewportSDFOversize
enum ViewportSDFScale
enum ViewportScaling3DMode
enum ViewportScreenSpaceAA
enum ViewportUpdateMode
enum ViewportVRSMode
enum ViewportVRSUpdateMode
enum VisibilityRangeFadeMode
enum VoxelGIQuality
Type members
static let arrayCustomCount: Int
The number of custom data arrays available (.arrayCustom0, .arrayCustom1, .arrayCustom2, .arrayCustom3).
static let arrayWeightsSize: Int
Number of weights/bones per vertex.
static let canvasItemZMax: Int
The maximum Z-layer for canvas items.
static let canvasItemZMin: Int
The minimum Z-layer for canvas items.
static let materialRenderPriorityMax: Int
The maximum renderpriority of all materials.
static let materialRenderPriorityMin: Int
The minimum renderpriority of all materials.
static let max2dDirectionalLights: Int
The maximum number of directional lights that can be rendered at a given time in 2D.
static let maxCursors: Int
static let maxGlowLevels: Int
The maximum number of glow levels that can be used with the glow post-processing effect.
static let maxMeshSurfaces: Int
The maximum number of surfaces a mesh can have.
static let noIndexArray: Int
Marks an error that shows that the index array is empty.
static let particlesEmitFlagColor: Int
static let particlesEmitFlagCustom: Int
static let particlesEmitFlagPosition: Int
static let particlesEmitFlagRotationScale: Int
static let particlesEmitFlagVelocity: Int
static var renderLoopEnabled: Bool
If
false
, disables rendering completely, but the engine logic is still being processed. You can callforceDraw(swapBuffers:frameStep:)
to draw a frame even with rendering disabled.static func bakeRenderUv2(base: RID, materialOverrides: VariantCollection<RID>, imageSize: Vector2i
) -> ObjectCollection<Image> Bakes the material data of the Mesh passed in the
base
parameter with optionalmaterialOverrides
to a set ofImage
s of sizeimageSize
. Returns an array ofImage
s containing material properties as specified inBakeChannels
.static func callOnRenderThread(callable: Callable
) As the RenderingServer actual logic may run on an separate thread, accessing its internals from the main (or any other) thread will result in errors. To make it easier to run code that can safely access the rendering internals (such as
RenderingDevice
and similar RD classes), push a callable via this function so it will be executed on the render thread.static func cameraAttributesCreate(
) -> RID Creates a camera attributes object and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all
camera_attributes_
RenderingServer functions.static func cameraAttributesSetAutoExposure(cameraAttributes: RID, enable: Bool, minSensitivity: Double, maxSensitivity: Double, speed: Double, scale: Double
) Sets the parameters to use with the auto-exposure effect. These parameters take on the same meaning as their counterparts in
CameraAttributes
andCameraAttributesPractical
.static func cameraAttributesSetDofBlur(cameraAttributes: RID, farEnable: Bool, farDistance: Double, farTransition: Double, nearEnable: Bool, nearDistance: Double, nearTransition: Double, amount: Double
) Sets the parameters to use with the DOF blur effect. These parameters take on the same meaning as their counterparts in
CameraAttributesPractical
.static func cameraAttributesSetDofBlurBokehShape(RenderingServer.DOFBokehShape
) Sets the shape of the DOF bokeh pattern. Different shapes may be used to achieve artistic effect, or to meet performance targets. For more detail on available options see
DOFBokehShape
.static func cameraAttributesSetDofBlurQuality(RenderingServer.DOFBlurQuality, useJitter: Bool
) Sets the quality level of the DOF blur effect to one of the options in
DOFBlurQuality
.useJitter
can be used to jitter samples taken during the blur pass to hide artifacts at the cost of looking more fuzzy.static func cameraAttributesSetExposure(cameraAttributes: RID, multiplier: Double, normalization: Double
) Sets the exposure values that will be used by the renderers. The normalization amount is used to bake a given Exposure Value (EV) into rendering calculations to reduce the dynamic range of the scene.
static func cameraCreate(
) -> RID Creates a 3D camera and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all
camera_*
RenderingServer functions.static func cameraSetCameraAttributes(camera: RID, effects: RID
) Sets the camera_attributes created with
cameraAttributesCreate
to the given camera.static func cameraSetCompositor(camera: RID, compositor: RID
) Sets the compositor used by this camera. Equivalent to
compositor
.static func cameraSetCullMask(camera: RID, layers: UInt32
) Sets the cull mask associated with this camera. The cull mask describes which 3D layers are rendered by this camera. Equivalent to
cullMask
.static func cameraSetEnvironment(camera: RID, env: RID
) Sets the environment used by this camera. Equivalent to
environment
.static func cameraSetFrustum(camera: RID, size: Double, offset: Vector2, zNear: Double, zFar: Double
) Sets camera to use frustum projection. This mode allows adjusting the
offset
argument to create “tilted frustum” effects.static func cameraSetOrthogonal(camera: RID, size: Double, zNear: Double, zFar: Double
) Sets camera to use orthogonal projection, also known as orthographic projection. Objects remain the same size on the screen no matter how far away they are.
static func cameraSetPerspective(camera: RID, fovyDegrees: Double, zNear: Double, zFar: Double
) Sets camera to use perspective projection. Objects on the screen becomes smaller when they are far away.
static func cameraSetTransform(camera: RID, transform: Transform3D
) Sets
Transform3D
of camera.static func cameraSetUseVerticalAspect(camera: RID, enable: Bool
) If
true
, preserves the horizontal aspect ratio which is equivalent toCamera3D/KeepAspect/keepWidth
. Iffalse
, preserves the vertical aspect ratio which is equivalent toCamera3D/KeepAspect/keepHeight
.static func canvasCreate(
) -> RID Creates a canvas and returns the assigned
RID
. It can be accessed with the RID that is returned. This RID will be used in allcanvas_*
RenderingServer functions.static func canvasItemAddAnimationSlice(item: RID, animationLength: Double, sliceBegin: Double, sliceEnd: Double, offset: Double
) Subsequent drawing commands will be ignored unless they fall within the specified animation slice. This is a faster way to implement animations that loop on background rather than redrawing constantly.
static func canvasItemAddCircle(item: RID, pos: Vector2, radius: Double, color: Color, antialiased: Bool
) Draws a circle on the
CanvasItem
pointed to by theitem
RID
. See alsodrawCircle(position:radius:color:filled:width:antialiased:)
.static func canvasItemAddClipIgnore(item: RID, ignore: Bool
) If
ignore
istrue
, ignore clipping on items drawn with this canvas item until this is called again withignore
set to false.static func canvasItemAddLcdTextureRectRegion(item: RID, rect: Rect2, texture: RID, srcRect: Rect2, modulate: Color
) See also
drawLcdTextureRectRegion(texture:rect:srcRect:modulate:)
.static func canvasItemAddLine(item: RID, from: Vector2, to: Vector2, color: Color, width: Double, antialiased: Bool
) Draws a line on the
CanvasItem
pointed to by theitem
RID
. See alsodrawLine(from:to:color:width:antialiased:)
.static func canvasItemAddMesh(item: RID, mesh: RID, transform: Transform2D, modulate: Color, texture: RID
) Draws a mesh created with
meshCreate
with giventransform
,modulate
color, andtexture
. This is used internally byMeshInstance2D
.static func canvasItemAddMsdfTextureRectRegion(item: RID, rect: Rect2, texture: RID, srcRect: Rect2, modulate: Color, outlineSize: Int32, pxRange: Double, scale: Double
) See also
drawMsdfTextureRectRegion(texture:rect:srcRect:modulate:outline:pixelRange:scale:)
.static func canvasItemAddMultiline(item: RID, points: PackedVector2Array, colors: PackedColorArray, width: Double, antialiased: Bool
) Draws a 2D multiline on the
CanvasItem
pointed to by theitem
RID
. See alsodrawMultiline(points:color:width:antialiased:)
anddrawMultilineColors(points:colors:width:antialiased:)
.static func canvasItemAddMultimesh(item: RID, mesh: RID, texture: RID
) Draws a 2D
MultiMesh
on theCanvasItem
pointed to by theitem
RID
. See alsodrawMultimesh(_:texture:)
.static func canvasItemAddNinePatch(item: RID, rect: Rect2, source: Rect2, texture: RID, topleft: Vector2, bottomright: Vector2, xAxisMode: RenderingServer.NinePatchAxisMode, yAxisMode: RenderingServer.NinePatchAxisMode, drawCenter: Bool, modulate: Color
) Draws a nine-patch rectangle on the
CanvasItem
pointed to by theitem
RID
.static func canvasItemAddParticles(item: RID, particles: RID, texture: RID
) Draws particles on the
CanvasItem
pointed to by theitem
RID
.static func canvasItemAddPolygon(item: RID, points: PackedVector2Array, colors: PackedColorArray, uvs: PackedVector2Array, texture: RID
) Draws a 2D polygon on the
CanvasItem
pointed to by theitem
RID
. If you need more flexibility (such as being able to use bones), usecanvasItemAddTriangleArray(item:indices:points:colors:uvs:bones:weights:texture:count:)
instead. See alsodrawPolygon(points:colors:uvs:texture:)
.static func canvasItemAddPolyline(item: RID, points: PackedVector2Array, colors: PackedColorArray, width: Double, antialiased: Bool
) Draws a 2D polyline on the
CanvasItem
pointed to by theitem
RID
. See alsodrawPolyline(points:color:width:antialiased:)
anddrawPolylineColors(points:colors:width:antialiased:)
.static func canvasItemAddPrimitive(item: RID, points: PackedVector2Array, colors: PackedColorArray, uvs: PackedVector2Array, texture: RID
) Draws a 2D primitive on the
CanvasItem
pointed to by theitem
RID
. See alsodrawPrimitive(points:colors:uvs:texture:)
.static func canvasItemAddRect(item: RID, rect: Rect2, color: Color, antialiased: Bool
) Draws a rectangle on the
CanvasItem
pointed to by theitem
RID
. See alsodrawRect(_:color:filled:width:antialiased:)
.static func canvasItemAddSetTransform(item: RID, transform: Transform2D
) Sets a
Transform2D
that will be used to transform subsequent canvas item commands.static func canvasItemAddTextureRect(item: RID, rect: Rect2, texture: RID, tile: Bool, modulate: Color, transpose: Bool
) Draws a 2D textured rectangle on the
CanvasItem
pointed to by theitem
RID
. See alsodrawTextureRect(texture:rect:tile:modulate:transpose:)
anddrawRect(canvasItem:rect:tile:modulate:transpose:)
.static func canvasItemAddTextureRectRegion(item: RID, rect: Rect2, texture: RID, srcRect: Rect2, modulate: Color, transpose: Bool, clipUv: Bool
) Draws the specified region of a 2D textured rectangle on the
CanvasItem
pointed to by theitem
RID
. See alsodrawTextureRectRegion(texture:rect:srcRect:modulate:transpose:clipUv:)
anddrawRectRegion(canvasItem:rect:srcRect:modulate:transpose:clipUv:)
.static func canvasItemAddTriangleArray(item: RID, indices: PackedInt32Array, points: PackedVector2Array, colors: PackedColorArray, uvs: PackedVector2Array, bones: PackedInt32Array, weights: PackedFloat32Array, texture: RID, count: Int32
) Draws a triangle array on the
CanvasItem
pointed to by theitem
RID
. This is internally used byLine2D
andStyleBoxFlat
for rendering.canvasItemAddTriangleArray(item:indices:points:colors:uvs:bones:weights:texture:count:)
is highly flexible, but more complex to use thancanvasItemAddPolygon(item:points:colors:uvs:texture:)
.static func canvasItemClear(item: RID
) Clears the
CanvasItem
and removes all commands in it.static func canvasItemCreate(
) -> RID Creates a new CanvasItem instance and returns its
RID
. It can be accessed with the RID that is returned. This RID will be used in allcanvas_item_*
RenderingServer functions.static func canvasItemResetPhysicsInterpolation(item: RID
) Prevents physics interpolation for the current physics tick.
static func canvasItemSetCanvasGroupMode(item: RID, mode: RenderingServer.CanvasGroupMode, clearMargin: Double, fitEmpty: Bool, fitMargin: Double, blurMipmaps: Bool
) Sets the canvas group mode used during 2D rendering for the canvas item specified by the
item
RID. For faster but more limited clipping, usecanvasItemSetClip(item:clip:)
instead.static func canvasItemSetClip(item: RID, clip: Bool
) If
clip
istrue
, makes the canvas item specified by theitem
RID not draw anything outside of its rect’s coordinates. This clipping is fast, but works only with axis-aligned rectangles. This means that rotation is ignored by the clipping rectangle. For more advanced clipping shapes, usecanvasItemSetCanvasGroupMode(item:mode:clearMargin:fitEmpty:fitMargin:blurMipmaps:)
instead.static func canvasItemSetCopyToBackbuffer(item: RID, enabled: Bool, rect: Rect2
) Sets the
CanvasItem
to copy a rect to the backbuffer.static func canvasItemSetCustomRect(item: RID, useCustomRect: Bool, rect: Rect2
) If
useCustomRect
istrue
, sets the custom visibility rectangle (used for culling) torect
for the canvas item specified byitem
. Setting a custom visibility rect can reduce CPU load when drawing lots of 2D instances. IfuseCustomRect
isfalse
, automatically computes a visibility rectangle based on the canvas item’s draw commands.static func canvasItemSetDefaultTextureFilter(item: RID, filter: RenderingServer.CanvasItemTextureFilter
) Sets the default texture filter mode for the canvas item specified by the
item
RID. Equivalent totextureFilter
.static func canvasItemSetDefaultTextureRepeat(item: RID, repeat: RenderingServer.CanvasItemTextureRepeat
) Sets the default texture repeat mode for the canvas item specified by the
item
RID. Equivalent totextureRepeat
.static func canvasItemSetDistanceFieldMode(item: RID, enabled: Bool
) If
enabled
istrue
, enables multichannel signed distance field rendering mode for the canvas item specified by theitem
RID. This is meant to be used for font rendering, or with specially generated images using msdfgen.static func canvasItemSetDrawBehindParent(item: RID, enabled: Bool
) If
enabled
istrue
, draws the canvas item specified by theitem
RID behind its parent. Equivalent toshowBehindParent
.static func canvasItemSetDrawIndex(item: RID, index: Int32
) Sets the index for the
CanvasItem
.static func canvasItemSetInterpolated(item: RID, interpolated: Bool
) If
interpolated
istrue
, turns on physics interpolation for the canvas item.static func canvasItemSetLightMask(item: RID, mask: Int32
) Sets the light
mask
for the canvas item specified by theitem
RID. Equivalent tolightMask
.static func canvasItemSetMaterial(item: RID, material: RID
) Sets a new
material
to the canvas item specified by theitem
RID. Equivalent tomaterial
.static func canvasItemSetModulate(item: RID, color: Color
) Multiplies the color of the canvas item specified by the
item
RID, while affecting its children. See alsocanvasItemSetSelfModulate(item:color:)
. Equivalent tomodulate
.static func canvasItemSetParent(item: RID, parent: RID
) Sets a parent
CanvasItem
to theCanvasItem
. The item will inherit transform, modulation and visibility from its parent, likeCanvasItem
nodes in the scene tree.static func canvasItemSetSelfModulate(item: RID, color: Color
) Multiplies the color of the canvas item specified by the
item
RID, without affecting its children. See alsocanvasItemSetModulate(item:color:)
. Equivalent toselfModulate
.static func canvasItemSetSortChildrenByY(item: RID, enabled: Bool
) If
enabled
istrue
, child nodes with the lowest Y position are drawn before those with a higher Y position. Y-sorting only affects children that inherit from the canvas item specified by theitem
RID, not the canvas item itself. Equivalent toySortEnabled
.static func canvasItemSetTransform(item: RID, transform: Transform2D
) Sets the
transform
of the canvas item specified by theitem
RID. This affects where and how the item will be drawn. Child canvas items’ transforms are multiplied by their parent’s transform. Equivalent totransform
.static func canvasItemSetUseParentMaterial(item: RID, enabled: Bool
) Sets if the
CanvasItem
uses its parent’s material.static func canvasItemSetVisibilityLayer(item: RID, visibilityLayer: UInt32
) Sets the rendering visibility layer associated with this
CanvasItem
. OnlyViewport
nodes with a matching rendering mask will render thisCanvasItem
.static func canvasItemSetVisibilityNotifier(item: RID, enable: Bool, area: Rect2, enterCallable: Callable, exitCallable: Callable
) Sets the given
CanvasItem
as visibility notifier.area
defines the area of detecting visibility.enterCallable
is called when theCanvasItem
enters the screen,exitCallable
is called when theCanvasItem
exits the screen. Ifenable
isfalse
, the item will no longer function as notifier.static func canvasItemSetVisible(item: RID, visible: Bool
) Sets the visibility of the
CanvasItem
.static func canvasItemSetZAsRelativeToParent(item: RID, enabled: Bool
) If this is enabled, the Z index of the parent will be added to the children’s Z index.
static func canvasItemSetZIndex(item: RID, zIndex: Int32
) Sets the
CanvasItem
’s Z index, i.e. its draw order (lower indexes are drawn first).static func canvasItemTransformPhysicsInterpolation(item: RID, transform: Transform2D
) Transforms both the current and previous stored transform for a canvas item.
static func canvasLightAttachToCanvas(light: RID, canvas: RID
) Attaches the canvas light to the canvas. Removes it from its previous canvas.
static func canvasLightCreate(
) -> RID Creates a canvas light and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all
canvas_light_*
RenderingServer functions.static func canvasLightOccluderAttachToCanvas(occluder: RID, canvas: RID
) Attaches a light occluder to the canvas. Removes it from its previous canvas.
static func canvasLightOccluderCreate(
) -> RID Creates a light occluder and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all
canvas_light_occluder_*
RenderingServer functions.static func canvasLightOccluderResetPhysicsInterpolation(occluder: RID
) Prevents physics interpolation for the current physics tick.
static func canvasLightOccluderSetAsSdfCollision(occluder: RID, enable: Bool
) static func canvasLightOccluderSetEnabled(occluder: RID, enabled: Bool
) Enables or disables light occluder.
static func canvasLightOccluderSetInterpolated(occluder: RID, interpolated: Bool
) If
interpolated
istrue
, turns on physics interpolation for the light occluder.static func canvasLightOccluderSetLightMask(occluder: RID, mask: Int32
) The light mask. See
LightOccluder2D
for more information on light masks.static func canvasLightOccluderSetPolygon(occluder: RID, polygon: RID
) Sets a light occluder’s polygon.
static func canvasLightOccluderSetTransform(occluder: RID, transform: Transform2D
) Sets a light occluder’s
Transform2D
.static func canvasLightOccluderTransformPhysicsInterpolation(occluder: RID, transform: Transform2D
) Transforms both the current and previous stored transform for a light occluder.
static func canvasLightResetPhysicsInterpolation(light: RID
) Prevents physics interpolation for the current physics tick.
static func canvasLightSetBlendMode(light: RID, mode: RenderingServer.CanvasLightBlendMode
) Sets the blend mode for the given canvas light. See
CanvasLightBlendMode
for options. Equivalent toblendMode
.static func canvasLightSetColor(light: RID, color: Color
) Sets the color for a light.
static func canvasLightSetEnabled(light: RID, enabled: Bool
) Enables or disables a canvas light.
static func canvasLightSetEnergy(light: RID, energy: Double
) Sets a canvas light’s energy.
static func canvasLightSetHeight(light: RID, height: Double
) Sets a canvas light’s height.
static func canvasLightSetInterpolated(light: RID, interpolated: Bool
) If
interpolated
istrue
, turns on physics interpolation for the canvas light.static func canvasLightSetItemCullMask(light: RID, mask: Int32
) The light mask. See
LightOccluder2D
for more information on light masks.static func canvasLightSetItemShadowCullMask(light: RID, mask: Int32
) The binary mask used to determine which layers this canvas light’s shadows affects. See
LightOccluder2D
for more information on light masks.static func canvasLightSetLayerRange(light: RID, minLayer: Int32, maxLayer: Int32
) The layer range that gets rendered with this light.
static func canvasLightSetMode(light: RID, mode: RenderingServer.CanvasLightMode
) The mode of the light, see
CanvasLightMode
constants.static func canvasLightSetShadowColor(light: RID, color: Color
) Sets the color of the canvas light’s shadow.
static func canvasLightSetShadowEnabled(light: RID, enabled: Bool
) Enables or disables the canvas light’s shadow.
static func canvasLightSetShadowFilter(light: RID, filter: RenderingServer.CanvasLightShadowFilter
) Sets the canvas light’s shadow’s filter, see
CanvasLightShadowFilter
constants.static func canvasLightSetShadowSmooth(light: RID, smooth: Double
) Smoothens the shadow. The lower, the smoother.
static func canvasLightSetTexture(light: RID, texture: RID
) Sets the texture to be used by a
PointLight2D
. Equivalent totexture
.static func canvasLightSetTextureOffset(light: RID, offset: Vector2
) Sets the offset of a
PointLight2D
’s texture. Equivalent tooffset
.static func canvasLightSetTextureScale(light: RID, scale: Double
) Sets the scale factor of a
PointLight2D
’s texture. Equivalent totextureScale
.static func canvasLightSetTransform(light: RID, transform: Transform2D
) Sets the canvas light’s
Transform2D
.static func canvasLightSetZRange(light: RID, minZ: Int32, maxZ: Int32
) Sets the Z range of objects that will be affected by this light. Equivalent to
rangeZMin
andrangeZMax
.static func canvasLightTransformPhysicsInterpolation(light: RID, transform: Transform2D
) Transforms both the current and previous stored transform for a canvas light.
static func canvasOccluderPolygonCreate(
) -> RID Creates a new light occluder polygon and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all
canvas_occluder_polygon_*
RenderingServer functions.static func canvasOccluderPolygonSetCullMode(occluderPolygon: RID, mode: RenderingServer.CanvasOccluderPolygonCullMode
) Sets an occluder polygons cull mode. See
CanvasOccluderPolygonCullMode
constants.static func canvasOccluderPolygonSetShape(occluderPolygon: RID, shape: PackedVector2Array, closed: Bool
) Sets the shape of the occluder polygon.
static func canvasSetDisableScale(disable: Bool
) static func canvasSetItemMirroring(canvas: RID, item: RID, mirroring: Vector2
) A copy of the canvas item will be drawn with a local offset of the mirroring
Vector2
.static func canvasSetItemRepeat(item: RID, repeatSize: Vector2, repeatTimes: Int32
) A copy of the canvas item will be drawn with a local offset of the
repeatSize
by the number of times of therepeatTimes
. As therepeatTimes
increases, the copies will spread away from the origin texture.static func canvasSetModulate(canvas: RID, color: Color
) Modulates all colors in the given canvas.
static func canvasSetShadowTextureSize(Int32
) Sets the
ProjectSettings/rendering/2d/shadowAtlas/size
to use forLight2D
shadow rendering (in pixels). The value is rounded up to the nearest power of 2.static func canvasTextureCreate(
) -> RID Creates a canvas texture and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all
canvas_texture_*
RenderingServer functions.static func canvasTextureSetChannel(canvasTexture: RID, channel: RenderingServer.CanvasTextureChannel, texture: RID
) Sets the
channel
’stexture
for the canvas texture specified by thecanvasTexture
RID. Equivalent todiffuseTexture
,normalTexture
andspecularTexture
.static func canvasTextureSetShadingParameters(canvasTexture: RID, baseColor: Color, shininess: Double
) Sets the
baseColor
andshininess
to use for the canvas texture specified by thecanvasTexture
RID. Equivalent tospecularColor
andspecularShininess
.static func canvasTextureSetTextureFilter(canvasTexture: RID, filter: RenderingServer.CanvasItemTextureFilter
) Sets the texture
filter
mode to use for the canvas texture specified by thecanvasTexture
RID.static func canvasTextureSetTextureRepeat(canvasTexture: RID, repeat: RenderingServer.CanvasItemTextureRepeat
) Sets the texture
repeat
mode to use for the canvas texture specified by thecanvasTexture
RID.static func compositorCreate(
) -> RID Creates a new compositor and adds it to the RenderingServer. It can be accessed with the RID that is returned.
static func compositorEffectCreate(
) -> RID Creates a new rendering effect and adds it to the RenderingServer. It can be accessed with the RID that is returned.
static func compositorEffectSetCallback(effect: RID, callbackType: RenderingServer.CompositorEffectCallbackType, callback: Callable
) Sets the callback type (
callbackType
) and callback method(callback
) for this rendering effect.static func compositorEffectSetEnabled(effect: RID, enabled: Bool
) Enables/disables this rendering effect.
static func compositorEffectSetFlag(effect: RID, flag: RenderingServer.CompositorEffectFlags, set: Bool
) Sets the flag (
flag
) for this rendering effect totrue
orfalse
(set
).static func compositorSetCompositorEffects(compositor: RID, effects: VariantCollection<RID>
) Sets the compositor effects for the specified compositor RID.
effects
should be an array containing RIDs created withcompositorEffectCreate
.static func createLocalRenderingDevice(
) -> RenderingDevice? Creates a RenderingDevice that can be used to do draw and compute operations on a separate thread. Cannot draw to the screen nor share data with the global RenderingDevice.
static func debugCanvasItemGetRect(item: RID
) -> Rect2 Returns the bounding rectangle for a canvas item in local space, as calculated by the renderer. This bound is used internally for culling.
static func decalCreate(
) -> RID Creates a decal and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all
decal_*
RenderingServer functions.static func decalSetAlbedoMix(decal: RID, albedoMix: Double
) Sets the
albedoMix
in the decal specified by thedecal
RID. Equivalent toalbedoMix
.static func decalSetCullMask(decal: RID, mask: UInt32
) Sets the cull
mask
in the decal specified by thedecal
RID. Equivalent tocullMask
.static func decalSetDistanceFade(decal: RID, enabled: Bool, begin: Double, length: Double
) Sets the distance fade parameters in the decal specified by the
decal
RID. Equivalent todistanceFadeEnabled
,distanceFadeBegin
anddistanceFadeLength
.static func decalSetEmissionEnergy(decal: RID, energy: Double
) Sets the emission
energy
in the decal specified by thedecal
RID. Equivalent toemissionEnergy
.static func decalSetFade(decal: RID, above: Double, below: Double
) Sets the upper fade (
above
) and lower fade (below
) in the decal specified by thedecal
RID. Equivalent toupperFade
andlowerFade
.static func decalSetModulate(decal: RID, color: Color
) Sets the color multiplier in the decal specified by the
decal
RID tocolor
. Equivalent tomodulate
.static func decalSetNormalFade(decal: RID, fade: Double
) Sets the normal
fade
in the decal specified by thedecal
RID. Equivalent tonormalFade
.static func decalSetSize(decal: RID, size: Vector3
) Sets the
size
of the decal specified by thedecal
RID. Equivalent tosize
.static func decalSetTexture(decal: RID, type: RenderingServer.DecalTexture, texture: RID
) Sets the
texture
in the given texturetype
slot for the specified decal. Equivalent toDecal/setTexture(type:texture:)
.static func decalsSetFilter(RenderingServer.DecalFilter
) Sets the texture
filter
mode to use when rendering decals. This parameter is global and cannot be set on a per-decal basis.static func directionalLightCreate(
) -> RID Creates a directional light and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID can be used in most
light_*
RenderingServer functions.static func directionalShadowAtlasSetSize(Int32, is16bits: Bool
) Sets the
size
of the directional light shadows in 3D. See alsoProjectSettings/rendering/lightsAndShadows/directionalShadow/size
. This parameter is global and cannot be set on a per-viewport basis.static func directionalSoftShadowFilterSetQuality(RenderingServer.ShadowQuality
) Sets the filter
quality
for directional light shadows in 3D. See alsoProjectSettings/rendering/lightsAndShadows/directionalShadow/softShadowFilterQuality
. This parameter is global and cannot be set on a per-viewport basis.static func environmentBakePanorama(environment: RID, bakeIrradiance: Bool, size: Vector2i
) -> Image? Generates and returns an
Image
containing the radiance map for the specifiedenvironment
RID’s sky. This supports built-in sky material and custom sky shaders. IfbakeIrradiance
istrue
, the irradiance map is saved instead of the radiance map. The radiance map is used to render reflected light, while the irradiance map is used to render ambient light. See alsoskyBakePanorama(sky:energy:bakeIrradiance:size:)
.static func environmentCreate(
) -> RID Creates an environment and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all
environment_*
RenderingServer functions.static func environmentGlowSetUseBicubicUpscale(enable: Bool
) If
enable
istrue
, enables bicubic upscaling for glow which improves quality at the cost of performance. Equivalent toProjectSettings/rendering/environment/glow/upscaleMode
.static func environmentSetAdjustment(env: RID, enable: Bool, brightness: Double, contrast: Double, saturation: Double, use1dColorCorrection: Bool, colorCorrection: RID
) Sets the values to be used with the “adjustments” post-process effect. See
Environment
for more details.static func environmentSetAmbientLight(env: RID, color: Color, ambient: RenderingServer.EnvironmentAmbientSource, energy: Double, skyContibution: Double, reflectionSource: RenderingServer.EnvironmentReflectionSource
) Sets the values to be used for ambient light rendering. See
Environment
for more details.static func environmentSetBackground(env: RID, bg: RenderingServer.EnvironmentBG
) Sets the environment’s background mode. Equivalent to
backgroundMode
.static func environmentSetBgColor(env: RID, color: Color
) Color displayed for clear areas of the scene. Only effective if using the .envBgColor background mode.
static func environmentSetBgEnergy(env: RID, multiplier: Double, exposureValue: Double
) Sets the intensity of the background color.
static func environmentSetCanvasMaxLayer(env: RID, maxLayer: Int32
) Sets the maximum layer to use if using Canvas background mode.
static func environmentSetFog(env: RID, enable: Bool, lightColor: Color, lightEnergy: Double, sunScatter: Double, density: Double, height: Double, heightDensity: Double, aerialPerspective: Double, skyAffect: Double, fogMode: RenderingServer.EnvironmentFogMode
) Configures fog for the specified environment RID. See
fog_*
properties inEnvironment
for more information.static func environmentSetGlow(env: RID, enable: Bool, levels: PackedFloat32Array, intensity: Double, strength: Double, mix: Double, bloomThreshold: Double, blendMode: RenderingServer.EnvironmentGlowBlendMode, hdrBleedThreshold: Double, hdrBleedScale: Double, hdrLuminanceCap: Double, glowMapStrength: Double, glowMap: RID
) Configures glow for the specified environment RID. See
glow_*
properties inEnvironment
for more information.static func environmentSetSdfgi(env: RID, enable: Bool, cascades: Int32, minCellSize: Double, yScale: RenderingServer.EnvironmentSDFGIYScale, useOcclusion: Bool, bounceFeedback: Double, readSky: Bool, energy: Double, normalBias: Double, probeBias: Double
) Configures signed distance field global illumination for the specified environment RID. See
sdfgi_*
properties inEnvironment
for more information.static func environmentSetSdfgiFramesToConverge(frames: RenderingServer.EnvironmentSDFGIFramesToConverge
) Sets the number of frames to use for converging signed distance field global illumination. Equivalent to
ProjectSettings/rendering/globalIllumination/sdfgi/framesToConverge
.static func environmentSetSdfgiFramesToUpdateLight(frames: RenderingServer.EnvironmentSDFGIFramesToUpdateLight
) Sets the update speed for dynamic lights’ indirect lighting when computing signed distance field global illumination. Equivalent to
ProjectSettings/rendering/globalIllumination/sdfgi/framesToUpdateLights
.static func environmentSetSdfgiRayCount(RenderingServer.EnvironmentSDFGIRayCount
) Sets the number of rays to throw per frame when computing signed distance field global illumination. Equivalent to
ProjectSettings/rendering/globalIllumination/sdfgi/probeRayCount
.static func environmentSetSky(env: RID, sky: RID
) Sets the
Sky
to be used as the environment’s background when using BGMode sky. Equivalent tosky
.static func environmentSetSkyCustomFov(env: RID, scale: Double
) Sets a custom field of view for the background
Sky
. Equivalent toskyCustomFov
.static func environmentSetSkyOrientation(env: RID, orientation: Basis
) Sets the rotation of the background
Sky
expressed as aBasis
. Equivalent toskyRotation
, where the rotation vector is used to construct theBasis
.static func environmentSetSsao(env: RID, enable: Bool, radius: Double, intensity: Double, power: Double, detail: Double, horizon: Double, sharpness: Double, lightAffect: Double, aoChannelAffect: Double
) Sets the variables to be used with the screen-space ambient occlusion (SSAO) post-process effect. See
Environment
for more details.static func environmentSetSsaoQuality(RenderingServer.EnvironmentSSAOQuality, halfSize: Bool, adaptiveTarget: Double, blurPasses: Int32, fadeoutFrom: Double, fadeoutTo: Double
) Sets the quality level of the screen-space ambient occlusion (SSAO) post-process effect. See
Environment
for more details.static func environmentSetSsilQuality(RenderingServer.EnvironmentSSILQuality, halfSize: Bool, adaptiveTarget: Double, blurPasses: Int32, fadeoutFrom: Double, fadeoutTo: Double
) Sets the quality level of the screen-space indirect lighting (SSIL) post-process effect. See
Environment
for more details.static func environmentSetSsr(env: RID, enable: Bool, maxSteps: Int32, fadeIn: Double, fadeOut: Double, depthTolerance: Double
) Sets the variables to be used with the screen-space reflections (SSR) post-process effect. See
Environment
for more details.static func environmentSetSsrRoughnessQuality(RenderingServer.EnvironmentSSRRoughnessQuality
) static func environmentSetTonemap(env: RID, toneMapper: RenderingServer.EnvironmentToneMapper, exposure: Double, white: Double
) Sets the variables to be used with the “tonemap” post-process effect. See
Environment
for more details.static func environmentSetVolumetricFog(env: RID, enable: Bool, density: Double, albedo: Color, emission: Color, emissionEnergy: Double, anisotropy: Double, length: Double, pDetailSpread: Double, giInject: Double, temporalReprojection: Bool, temporalReprojectionAmount: Double, ambientInject: Double, skyAffect: Double
) Sets the variables to be used with the volumetric fog post-process effect. See
Environment
for more details.static func environmentSetVolumetricFogFilterActive(Bool
) Enables filtering of the volumetric fog scattering buffer. This results in much smoother volumes with very few under-sampling artifacts.
static func environmentSetVolumetricFogVolumeSize(Int32, depth: Int32
) Sets the resolution of the volumetric fog’s froxel buffer.
size
is modified by the screen’s aspect ratio and then used to set the width and height of the buffer. Whiledepth
is directly used to set the depth of the buffer.static func fogVolumeCreate(
) -> RID Creates a new fog volume and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all
fog_volume_*
RenderingServer functions.static func fogVolumeSetMaterial(fogVolume: RID, material: RID
) Sets the
Material
of the fog volume. Can be either aFogMaterial
or a customShaderMaterial
.static func fogVolumeSetShape(fogVolume: RID, shape: RenderingServer.FogVolumeShape
) Sets the shape of the fog volume to either
ellipsoid
,cone
,cylinder
,box
orworld
.static func fogVolumeSetSize(fogVolume: RID, size: Vector3
) Sets the size of the fog volume when shape is
ellipsoid
,cone
,cylinder
orbox
.static func forceDraw(swapBuffers: Bool, frameStep: Double
) Forces redrawing of all viewports at once. Must be called from the main thread.
static func forceSync(
) Forces a synchronization between the CPU and GPU, which may be required in certain cases. Only call this when needed, as CPU-GPU synchronization has a performance cost.
static func freeRid(RID
) Tries to free an object in the RenderingServer. To avoid memory leaks, this should be called after using an object as memory management does not occur automatically when using RenderingServer directly.
static func getDefaultClearColor(
) -> Color Returns the default clear color which is used when a specific clear color has not been selected. See also
setDefaultClearColor(_:)
.static func getFrameSetupTimeCpu(
) -> Double Returns the time taken to setup rendering on the CPU in milliseconds. This value is shared across all viewports and does not require
viewportSetMeasureRenderTime(viewport:enable:)
to be enabled on a viewport to be queried. See alsoviewportGetMeasuredRenderTimeCpu(viewport:)
.static func getRenderingDevice(
) -> RenderingDevice Returns the global RenderingDevice.
static func getRenderingInfo(RenderingServer.RenderingInfo
) -> UInt Returns a statistic about the rendering engine which can be used for performance profiling. See
RenderingServer.RenderingInfo
for a list of values that can be queried. See alsoviewportGetRenderInfo(viewport:type:info:)
, which returns information specific to a viewport.static func getShaderParameterList(shader: RID
) -> VariantCollection<GDictionary> Returns the parameters of a shader.
static func getTestCube(
) -> RID Returns the RID of the test cube. This mesh will be created and returned on the first call to
getTestCube
, then it will be cached for subsequent calls. See alsomakeSphereMesh(latitudes:longitudes:radius:)
.static func getTestTexture(
) -> RID Returns the RID of a 256×256 texture with a testing pattern on it (in
rgb8
format). This texture will be created and returned on the first call togetTestTexture
, then it will be cached for subsequent calls. See alsogetWhiteTexture
.static func getVideoAdapterApiVersion(
) -> String Returns the version of the graphics video adapter currently in use (e.g. “1.2.189” for Vulkan, “3.3.0 NVIDIA 510.60.02” for OpenGL). This version may be different from the actual latest version supported by the hardware, as Godot may not always request the latest version. See also
getVideoAdapterDriverInfo
.static func getVideoAdapterName(
) -> String Returns the name of the video adapter (e.g. “GeForce GTX 1080/PCIe/SSE2”).
static func getVideoAdapterType(
) -> RenderingDevice.DeviceType Returns the type of the video adapter. Since dedicated graphics cards from a given generation will usually be significantly faster than integrated graphics made in the same generation, the device type can be used as a basis for automatic graphics settings adjustment. However, this is not always true, so make sure to provide users with a way to manually override graphics settings.
static func getVideoAdapterVendor(
) -> String Returns the vendor of the video adapter (e.g. “NVIDIA Corporation”).
static func getWhiteTexture(
) -> RID Returns the ID of a 4×4 white texture (in
rgb8
format). This texture will be created and returned on the first call togetWhiteTexture
, then it will be cached for subsequent calls. See alsogetTestTexture
.static func giSetUseHalfResolution(Bool
) If
halfResolution
istrue
, rendersVoxelGI
and SDFGI (sdfgiEnabled
) buffers at halved resolution on each axis (e.g. 960×540 when the viewport size is 1920×1080). This improves performance significantly when VoxelGI or SDFGI is enabled, at the cost of artifacts that may be visible on polygon edges. The loss in quality becomes less noticeable as the viewport resolution increases.LightmapGI
rendering is not affected by this setting. Equivalent toProjectSettings/rendering/globalIllumination/gi/useHalfResolution
.static func globalShaderParameterAdd(name: StringName, type: RenderingServer.GlobalShaderParameterType, defaultValue: Variant
) Creates a new global shader uniform.
static func globalShaderParameterGet(name: StringName
) -> Variant Returns the value of the global shader uniform specified by
name
.static func globalShaderParameterGetList(
) -> VariantCollection<StringName> Returns the list of global shader uniform names.
static func globalShaderParameterGetType(name: StringName
) -> RenderingServer.GlobalShaderParameterType Returns the type associated to the global shader uniform specified by
name
.static func globalShaderParameterRemove(name: StringName
) Removes the global shader uniform specified by
name
.static func globalShaderParameterSet(name: StringName, value: Variant
) Sets the global shader uniform
name
tovalue
.static func globalShaderParameterSetOverride(name: StringName, value: Variant
) Overrides the global shader uniform
name
withvalue
. Equivalent to theShaderGlobalsOverride
node.static func hasChanged(
) -> Bool Returns
true
if changes have been made to the RenderingServer’s data.forceDraw(swapBuffers:frameStep:)
is usually called if this happens.static func hasFeature(RenderingServer.Features
) -> Bool This method does nothing and always returns
false
.static func hasOsFeature(String
) -> Bool Returns
true
if the OS supports a certainfeature
. Features might bes3tc
,etc
, andetc2
.static func instanceAttachObjectInstanceId(instance: RID, id: UInt
) Attaches a unique Object ID to instance. Object ID must be attached to instance for proper culling with
instancesCullAabb(_:scenario:)
,instancesCullConvex(_:scenario:)
, andinstancesCullRay(from:to:scenario:)
.static func instanceAttachSkeleton(instance: RID, skeleton: RID
) Attaches a skeleton to an instance. Removes the previous skeleton from the instance.
static func instanceCreate(
) -> RID Creates a visual instance and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all
instance_*
RenderingServer functions.static func instanceCreate2(base: RID, scenario: RID
) -> RID Creates a visual instance, adds it to the RenderingServer, and sets both base and scenario. It can be accessed with the RID that is returned. This RID will be used in all
instance_*
RenderingServer functions.static func instanceGeometryGetShaderParameter(instance: RID, parameter: StringName
) -> Variant Returns the value of the per-instance shader uniform from the specified 3D geometry instance. Equivalent to
getInstanceShaderParameter(name:)
.static func instanceGeometryGetShaderParameterDefaultValue(instance: RID, parameter: StringName
) -> Variant Returns the default value of the per-instance shader uniform from the specified 3D geometry instance. Equivalent to
getInstanceShaderParameter(name:)
.static func instanceGeometryGetShaderParameterList(instance: RID
) -> VariantCollection<GDictionary> Returns a dictionary of per-instance shader uniform names of the per-instance shader uniform from the specified 3D geometry instance. The returned dictionary is in PropertyInfo format, with the keys
name
,class_name
,type
,hint
,hint_string
andusage
. Equivalent togetInstanceShaderParameter(name:)
.static func instanceGeometrySetCastShadowsSetting(instance: RID, shadowCastingSetting: RenderingServer.ShadowCastingSetting
) Sets the shadow casting setting to one of
ShadowCastingSetting
. Equivalent tocastShadow
.static func instanceGeometrySetFlag(instance: RID, flag: RenderingServer.InstanceFlags, enabled: Bool
) Sets the flag for a given
InstanceFlags
. SeeInstanceFlags
for more details.static func instanceGeometrySetLightmap(instance: RID, lightmap: RID, lightmapUvScale: Rect2, lightmapSlice: Int32
) Sets the lightmap GI instance to use for the specified 3D geometry instance. The lightmap UV scale for the specified instance (equivalent to
giLightmapScale
) and lightmap atlas slice must also be specified.static func instanceGeometrySetLodBias(instance: RID, lodBias: Double
) Sets the level of detail bias to use when rendering the specified 3D geometry instance. Higher values result in higher detail from further away. Equivalent to
lodBias
.static func instanceGeometrySetMaterialOverlay(instance: RID, material: RID
) Sets a material that will be rendered for all surfaces on top of active materials for the mesh associated with this instance. Equivalent to
materialOverlay
.static func instanceGeometrySetMaterialOverride(instance: RID, material: RID
) Sets a material that will override the material for all surfaces on the mesh associated with this instance. Equivalent to
materialOverride
.static func instanceGeometrySetShaderParameter(instance: RID, parameter: StringName, value: Variant
) Sets the per-instance shader uniform on the specified 3D geometry instance. Equivalent to
setInstanceShaderParameter(name:value:)
.static func instanceGeometrySetTransparency(instance: RID, transparency: Double
) Sets the transparency for the given geometry instance. Equivalent to
transparency
.static func instanceGeometrySetVisibilityRange(instance: RID, min: Double, max: Double, minMargin: Double, maxMargin: Double, fadeMode: RenderingServer.VisibilityRangeFadeMode
) Sets the visibility range values for the given geometry instance. Equivalent to
visibilityRangeBegin
and related properties.static func instanceSetBase(instance: RID, base: RID
) Sets the base of the instance. A base can be any of the 3D objects that are created in the RenderingServer that can be displayed. For example, any of the light types, mesh, multimesh, particle system, reflection probe, decal, lightmap, voxel GI and visibility notifiers are all types that can be set as the base of an instance in order to be displayed in the scenario.
static func instanceSetBlendShapeWeight(instance: RID, shape: Int32, weight: Double
) Sets the weight for a given blend shape associated with this instance.
static func instanceSetCustomAabb(instance: RID, aabb: AABB
) Sets a custom AABB to use when culling objects from the view frustum. Equivalent to setting
customAabb
.static func instanceSetExtraVisibilityMargin(instance: RID, margin: Double
) Sets a margin to increase the size of the AABB when culling objects from the view frustum. This allows you to avoid culling objects that fall outside the view frustum. Equivalent to
extraCullMargin
.static func instanceSetIgnoreCulling(instance: RID, enabled: Bool
) If
true
, ignores both frustum and occlusion culling on the specified 3D geometry instance. This is not the same asignoreOcclusionCulling
, which only ignores occlusion culling and leaves frustum culling intact.static func instanceSetLayerMask(instance: RID, mask: UInt32
) Sets the render layers that this instance will be drawn to. Equivalent to
layers
.static func instanceSetPivotData(instance: RID, sortingOffset: Double, useAabbCenter: Bool
) Sets the sorting offset and switches between using the bounding box or instance origin for depth sorting.
static func instanceSetScenario(instance: RID, scenario: RID
) Sets the scenario that the instance is in. The scenario is the 3D world that the objects will be displayed in.
static func instanceSetSurfaceOverrideMaterial(instance: RID, surface: Int32, material: RID
) Sets the override material of a specific surface. Equivalent to
setSurfaceOverrideMaterial(surface:material:)
.static func instanceSetTransform(instance: RID, transform: Transform3D
) Sets the world space transform of the instance. Equivalent to
globalTransform
.static func instanceSetVisibilityParent(instance: RID, parent: RID
) Sets the visibility parent for the given instance. Equivalent to
visibilityParent
.static func instanceSetVisible(instance: RID, visible: Bool
) Sets whether an instance is drawn or not. Equivalent to
visible
.static func instancesCullAabb(AABB, scenario: RID
) -> PackedInt64Array Returns an array of object IDs intersecting with the provided AABB. Only 3D nodes that inherit from
VisualInstance3D
are considered, such asMeshInstance3D
orDirectionalLight3D
. Use@GlobalScope.instance_from_id
to obtain the actual nodes. A scenario RID must be provided, which is available in theWorld3D
you want to query. This forces an update for all resources queued to update.static func instancesCullConvex(VariantCollection<Plane>, scenario: RID
) -> PackedInt64Array Returns an array of object IDs intersecting with the provided convex shape. Only 3D nodes that inherit from
VisualInstance3D
are considered, such asMeshInstance3D
orDirectionalLight3D
. Use@GlobalScope.instance_from_id
to obtain the actual nodes. A scenario RID must be provided, which is available in theWorld3D
you want to query. This forces an update for all resources queued to update.static func instancesCullRay(from: Vector3, to: Vector3, scenario: RID
) -> PackedInt64Array Returns an array of object IDs intersecting with the provided 3D ray. Only 3D nodes that inherit from
VisualInstance3D
are considered, such asMeshInstance3D
orDirectionalLight3D
. Use@GlobalScope.instance_from_id
to obtain the actual nodes. A scenario RID must be provided, which is available in theWorld3D
you want to query. This forces an update for all resources queued to update.static func isOnRenderThread(
) -> Bool Returns
true
if our code is currently executing on the rendering thread.static func lightDirectionalSetBlendSplits(light: RID, enable: Bool
) If
true
, this directional light will blend between shadow map splits resulting in a smoother transition between them. Equivalent todirectionalShadowBlendSplits
.static func lightDirectionalSetShadowMode(light: RID, mode: RenderingServer.LightDirectionalShadowMode
) Sets the shadow mode for this directional light. Equivalent to
directionalShadowMode
. SeeLightDirectionalShadowMode
for options.static func lightDirectionalSetSkyMode(light: RID, mode: RenderingServer.LightDirectionalSkyMode
) If
true
, this light will not be used for anything except sky shaders. Use this for lights that impact your sky shader that you may want to hide from affecting the rest of the scene. For example, you may want to enable this when the sun in your sky shader falls below the horizon.static func lightOmniSetShadowMode(light: RID, mode: RenderingServer.LightOmniShadowMode
) Sets whether to use a dual paraboloid or a cubemap for the shadow map. Dual paraboloid is faster but may suffer from artifacts. Equivalent to
omniShadowMode
.static func lightProjectorsSetFilter(RenderingServer.LightProjectorFilter
) Sets the texture filter mode to use when rendering light projectors. This parameter is global and cannot be set on a per-light basis.
static func lightSetBakeMode(light: RID, bakeMode: RenderingServer.LightBakeMode
) Sets the bake mode to use for the specified 3D light. Equivalent to
lightBakeMode
.static func lightSetColor(light: RID, color: Color
) Sets the color of the light. Equivalent to
lightColor
.static func lightSetCullMask(light: RID, mask: UInt32
) Sets the cull mask for this 3D light. Lights only affect objects in the selected layers. Equivalent to
lightCullMask
.static func lightSetDistanceFade(decal: RID, enabled: Bool, begin: Double, shadow: Double, length: Double
) Sets the distance fade for this 3D light. This acts as a form of level of detail (LOD) and can be used to improve performance. Equivalent to
distanceFadeEnabled
,distanceFadeBegin
,distanceFadeShadow
, anddistanceFadeLength
.static func lightSetMaxSdfgiCascade(light: RID, cascade: UInt32
) Sets the maximum SDFGI cascade in which the 3D light’s indirect lighting is rendered. Higher values allow the light to be rendered in SDFGI further away from the camera.
static func lightSetNegative(light: RID, enable: Bool
) If
true
, the 3D light will subtract light instead of adding light. Equivalent tolightNegative
.static func lightSetParam(light: RID, param: RenderingServer.LightParam, value: Double
) Sets the specified 3D light parameter. See
LightParam
for options. Equivalent toLight3D/setParam(_:value:)
.static func lightSetProjector(light: RID, texture: RID
) Sets the projector texture to use for the specified 3D light. Equivalent to
lightProjector
.static func lightSetReverseCullFaceMode(light: RID, enabled: Bool
) If
true
, reverses the backface culling of the mesh. This can be useful when you have a flat mesh that has a light behind it. If you need to cast a shadow on both sides of the mesh, set the mesh to use double-sided shadows withinstanceGeometrySetCastShadowsSetting(instance:shadowCastingSetting:)
. Equivalent toshadowReverseCullFace
.static func lightSetShadow(light: RID, enabled: Bool
) If
true
, light will cast shadows. Equivalent toshadowEnabled
.static func lightmapCreate(
) -> RID Creates a new lightmap global illumination instance and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all
lightmap_*
RenderingServer functions.static func lightmapGetProbeCaptureBspTree(lightmap: RID
) -> PackedInt32Array static func lightmapGetProbeCapturePoints(lightmap: RID
) -> PackedVector3Array static func lightmapGetProbeCaptureSh(lightmap: RID
) -> PackedColorArray static func lightmapGetProbeCaptureTetrahedra(lightmap: RID
) -> PackedInt32Array static func lightmapSetBakedExposureNormalization(lightmap: RID, bakedExposure: Double
) Used to inform the renderer what exposure normalization value was used while baking the lightmap. This value will be used and modulated at run time to ensure that the lightmap maintains a consistent level of exposure even if the scene-wide exposure normalization is changed at run time. For more information see
cameraAttributesSetExposure(cameraAttributes:multiplier:normalization:)
.static func lightmapSetProbeBounds(lightmap: RID, bounds: AABB
) static func lightmapSetProbeCaptureData(lightmap: RID, points: PackedVector3Array, pointSh: PackedColorArray, tetrahedra: PackedInt32Array, bspTree: PackedInt32Array
) static func lightmapSetProbeCaptureUpdateSpeed(Double
) static func lightmapSetProbeInterior(lightmap: RID, interior: Bool
) static func lightmapSetTextures(lightmap: RID, light: RID, usesSh: Bool
) Set the textures on the given
lightmap
GI instance to the texture array pointed to by thelight
RID. If the lightmap texture was baked withdirectional
set totrue
, thenusesSh
must also betrue
.static func makeSphereMesh(latitudes: Int32, longitudes: Int32, radius: Double
) -> RID Returns a mesh of a sphere with the given number of horizontal subdivisions, vertical subdivisions and radius. See also
getTestCube
.static func materialCreate(
) -> RID Creates an empty material and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all
material_*
RenderingServer functions.static func materialGetParam(material: RID, parameter: StringName
) -> Variant Returns the value of a certain material’s parameter.
static func materialSetNextPass(material: RID, nextMaterial: RID
) Sets an object’s next material.
static func materialSetParam(material: RID, parameter: StringName, value: Variant
) Sets a material’s parameter.
static func materialSetRenderPriority(material: RID, priority: Int32
) Sets a material’s render priority.
static func materialSetShader(shaderMaterial: RID, shader: RID
) Sets a shader material’s shader.
static func meshAddSurface(mesh: RID, surface: GDictionary
) static func meshAddSurfaceFromArrays(mesh: RID, primitive: RenderingServer.PrimitiveType, arrays: GArray, blendShapes: GArray, lods: GDictionary, compressFormat: RenderingServer.ArrayFormat
) static func meshClear(mesh: RID
) Removes all surfaces from a mesh.
static func meshCreate(
) -> RID Creates a new mesh and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all
mesh_*
RenderingServer functions.static func meshCreateFromSurfaces(VariantCollection<GDictionary>, blendShapeCount: Int32
) -> RID static func meshGetBlendShapeCount(mesh: RID
) -> Int32 Returns a mesh’s blend shape count.
static func meshGetBlendShapeMode(mesh: RID
) -> RenderingServer.BlendShapeMode Returns a mesh’s blend shape mode.
static func meshGetCustomAabb(mesh: RID
) -> AABB Returns a mesh’s custom aabb.
static func meshGetSurface(mesh: RID, surface: Int32
) -> GDictionary static func meshGetSurfaceCount(mesh: RID
) -> Int32 Returns a mesh’s number of surfaces.
static func meshSetBlendShapeMode(mesh: RID, mode: RenderingServer.BlendShapeMode
) Sets a mesh’s blend shape mode.
static func meshSetCustomAabb(mesh: RID, aabb: AABB
) Sets a mesh’s custom aabb.
static func meshSetShadowMesh(RID, shadowMesh: RID
) static func meshSurfaceGetArrays(mesh: RID, surface: Int32
) -> GArray Returns a mesh’s surface’s buffer arrays.
static func meshSurfaceGetBlendShapeArrays(mesh: RID, surface: Int32
) -> VariantCollection<GArray> Returns a mesh’s surface’s arrays for blend shapes.
static func meshSurfaceGetFormatAttributeStride(format: RenderingServer.ArrayFormat, vertexCount: Int32
) -> UInt32 Returns the stride of the attribute buffer for a mesh with given
format
.static func meshSurfaceGetFormatNormalTangentStride(format: RenderingServer.ArrayFormat, vertexCount: Int32
) -> UInt32 Returns the stride of the combined normals and tangents for a mesh with given
format
. Note importantly that, while normals and tangents are in the vertex buffer with vertices, they are only interleaved with each other and so have a different stride than vertex positions.static func meshSurfaceGetFormatOffset(format: RenderingServer.ArrayFormat, vertexCount: Int32, arrayIndex: Int32
) -> UInt32 Returns the offset of a given attribute by
arrayIndex
in the start of its respective buffer.static func meshSurfaceGetFormatSkinStride(format: RenderingServer.ArrayFormat, vertexCount: Int32
) -> UInt32 Returns the stride of the skin buffer for a mesh with given
format
.static func meshSurfaceGetFormatVertexStride(format: RenderingServer.ArrayFormat, vertexCount: Int32
) -> UInt32 Returns the stride of the vertex positions for a mesh with given
format
. Note importantly that vertex positions are stored consecutively and are not interleaved with the other attributes in the vertex buffer (normals and tangents).static func meshSurfaceGetMaterial(mesh: RID, surface: Int32
) -> RID Returns a mesh’s surface’s material.
static func meshSurfaceSetMaterial(mesh: RID, surface: Int32, material: RID
) Sets a mesh’s surface’s material.
static func meshSurfaceUpdateAttributeRegion(mesh: RID, surface: Int32, offset: Int32, data: PackedByteArray
) static func meshSurfaceUpdateSkinRegion(mesh: RID, surface: Int32, offset: Int32, data: PackedByteArray
) static func meshSurfaceUpdateVertexRegion(mesh: RID, surface: Int32, offset: Int32, data: PackedByteArray
) static func multimeshAllocateData(multimesh: RID, instances: Int32, transformFormat: RenderingServer.MultimeshTransformFormat, colorFormat: Bool, customDataFormat: Bool
) static func multimeshCreate(
) -> RID Creates a new multimesh on the RenderingServer and returns an
RID
handle. This RID will be used in allmultimesh_*
RenderingServer functions.static func multimeshGetAabb(multimesh: RID
) -> AABB Calculates and returns the axis-aligned bounding box that encloses all instances within the multimesh.
static func multimeshGetBuffer(multimesh: RID
) -> PackedFloat32Array Returns the MultiMesh data (such as instance transforms, colors, etc.). See
multimeshSetBuffer(multimesh:buffer:)
for details on the returned data.static func multimeshGetCustomAabb(multimesh: RID
) -> AABB Returns the custom AABB defined for this MultiMesh resource.
static func multimeshGetInstanceCount(multimesh: RID
) -> Int32 Returns the number of instances allocated for this multimesh.
static func multimeshGetMesh(multimesh: RID
) -> RID Returns the RID of the mesh that will be used in drawing this multimesh.
static func multimeshGetVisibleInstances(multimesh: RID
) -> Int32 Returns the number of visible instances for this multimesh.
static func multimeshInstanceGetColor(multimesh: RID, index: Int32
) -> Color Returns the color by which the specified instance will be modulated.
static func multimeshInstanceGetCustomData(multimesh: RID, index: Int32
) -> Color Returns the custom data associated with the specified instance.
static func multimeshInstanceGetTransform(multimesh: RID, index: Int32
) -> Transform3D Returns the
Transform3D
of the specified instance.static func multimeshInstanceGetTransform2d(multimesh: RID, index: Int32
) -> Transform2D Returns the
Transform2D
of the specified instance. For use when the multimesh is set to use 2D transforms.static func multimeshInstanceSetColor(multimesh: RID, index: Int32, color: Color
) Sets the color by which this instance will be modulated. Equivalent to
setInstanceColor(instance:color:)
.static func multimeshInstanceSetCustomData(multimesh: RID, index: Int32, customData: Color
) Sets the custom data for this instance. Custom data is passed as a
Color
, but is interpreted as avec4
in the shader. Equivalent tosetInstanceCustomData(instance:customData:)
.static func multimeshInstanceSetTransform(multimesh: RID, index: Int32, transform: Transform3D
) Sets the
Transform3D
for this instance. Equivalent tosetInstanceTransform(instance:transform:)
.static func multimeshInstanceSetTransform2d(multimesh: RID, index: Int32, transform: Transform2D
) Sets the
Transform2D
for this instance. For use when multimesh is used in 2D. Equivalent tosetInstanceTransform2d(instance:transform:)
.static func multimeshSetBuffer(multimesh: RID, buffer: PackedFloat32Array
) Set the entire data to use for drawing the
multimesh
at once tobuffer
(such as instance transforms and colors).buffer
’s size must match the number of instances multiplied by the per-instance data size (which depends on the enabled MultiMesh fields). Otherwise, an error message is printed and nothing is rendered. See alsomultimeshGetBuffer(multimesh:)
.static func multimeshSetCustomAabb(multimesh: RID, aabb: AABB
) Sets the custom AABB for this MultiMesh resource.
static func multimeshSetMesh(multimesh: RID, mesh: RID
) Sets the mesh to be drawn by the multimesh. Equivalent to
mesh
.static func multimeshSetVisibleInstances(multimesh: RID, visible: Int32
) Sets the number of instances visible at a given time. If -1, all instances that have been allocated are drawn. Equivalent to
visibleInstanceCount
.static func occluderCreate(
) -> RID Creates an occluder instance and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all
occluder_*
RenderingServer functions.static func occluderSetMesh(occluder: RID, vertices: PackedVector3Array, indices: PackedInt32Array
) Sets the mesh data for the given occluder RID, which controls the shape of the occlusion culling that will be performed.
static func omniLightCreate(
) -> RID Creates a new omni light and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID can be used in most
light_*
RenderingServer functions.static func particlesCollisionCreate(
) -> RID Creates a new 3D GPU particle collision or attractor and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID can be used in most
particles_collision_*
RenderingServer functions.static func particlesCollisionHeightFieldUpdate(particlesCollision: RID
) Requests an update for the 3D GPU particle collision heightfield. This may be automatically called by the 3D GPU particle collision heightfield depending on its
updateMode
.static func particlesCollisionSetAttractorAttenuation(particlesCollision: RID, curve: Double
) Sets the attenuation
curve
for the 3D GPU particles attractor specified by theparticlesCollision
RID. Only used for attractors, not colliders. Equivalent toattenuation
.static func particlesCollisionSetAttractorDirectionality(particlesCollision: RID, amount: Double
) Sets the directionality
amount
for the 3D GPU particles attractor specified by theparticlesCollision
RID. Only used for attractors, not colliders. Equivalent todirectionality
.static func particlesCollisionSetAttractorStrength(particlesCollision: RID, strength: Double
) Sets the
strength
for the 3D GPU particles attractor specified by theparticlesCollision
RID. Only used for attractors, not colliders. Equivalent tostrength
.static func particlesCollisionSetBoxExtents(particlesCollision: RID, extents: Vector3
) Sets the
extents
for the 3D GPU particles collision by theparticlesCollision
RID. Equivalent tosize
,size
,size
,size
orsize
depending on theparticlesCollision
type.static func particlesCollisionSetCollisionType(particlesCollision: RID, type: RenderingServer.ParticlesCollisionType
) Sets the collision or attractor shape
type
for the 3D GPU particles collision or attractor specified by theparticlesCollision
RID.static func particlesCollisionSetCullMask(particlesCollision: RID, mask: UInt32
) Sets the cull
mask
for the 3D GPU particles collision or attractor specified by theparticlesCollision
RID. Equivalent tocullMask
orcullMask
depending on theparticlesCollision
type.static func particlesCollisionSetFieldTexture(particlesCollision: RID, texture: RID
) Sets the signed distance field
texture
for the 3D GPU particles collision specified by theparticlesCollision
RID. Equivalent totexture
ortexture
depending on theparticlesCollision
type.static func particlesCollisionSetHeightFieldResolution(particlesCollision: RID, resolution: RenderingServer.ParticlesCollisionHeightfieldResolution
) Sets the heightmap
resolution
for the 3D GPU particles heightfield collision specified by theparticlesCollision
RID. Equivalent toresolution
.static func particlesCollisionSetSphereRadius(particlesCollision: RID, radius: Double
) Sets the
radius
for the 3D GPU particles sphere collision or attractor specified by theparticlesCollision
RID. Equivalent toradius
orradius
depending on theparticlesCollision
type.static func particlesCreate(
) -> RID Creates a GPU-based particle system and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all
particles_*
RenderingServer functions.static func particlesEmit(particles: RID, transform: Transform3D, velocity: Vector3, color: Color, custom: Color, emitFlags: UInt32
) Manually emits particles from the
particles
instance.static func particlesGetCurrentAabb(particles: RID
) -> AABB Calculates and returns the axis-aligned bounding box that contains all the particles. Equivalent to
captureAabb
.static func particlesGetEmitting(particles: RID
) -> Bool Returns
true
if particles are currently set to emitting.static func particlesIsInactive(particles: RID
) -> Bool Returns
true
if particles are not emitting and particles are set to inactive.static func particlesRequestProcess(particles: RID
) Add particle system to list of particle systems that need to be updated. Update will take place on the next frame, or on the next call to
instancesCullAabb(_:scenario:)
,instancesCullConvex(_:scenario:)
, orinstancesCullRay(from:to:scenario:)
.static func particlesRestart(particles: RID
) Reset the particles on the next update. Equivalent to
restart
.static func particlesSetAmount(particles: RID, amount: Int32
) Sets the number of particles to be drawn and allocates the memory for them. Equivalent to
amount
.static func particlesSetAmountRatio(particles: RID, ratio: Double
) Sets the amount ratio for particles to be emitted. Equivalent to
amountRatio
.static func particlesSetCollisionBaseSize(particles: RID, size: Double
) static func particlesSetCustomAabb(particles: RID, aabb: AABB
) Sets a custom axis-aligned bounding box for the particle system. Equivalent to
visibilityAabb
.static func particlesSetDrawOrder(particles: RID, order: RenderingServer.ParticlesDrawOrder
) Sets the draw order of the particles to one of the named enums from
ParticlesDrawOrder
. SeeParticlesDrawOrder
for options. Equivalent todrawOrder
.static func particlesSetDrawPassMesh(particles: RID, pass: Int32, mesh: RID
) Sets the mesh to be used for the specified draw pass. Equivalent to
drawPass1
,drawPass2
,drawPass3
, anddrawPass4
.static func particlesSetDrawPasses(particles: RID, count: Int32
) Sets the number of draw passes to use. Equivalent to
drawPasses
.static func particlesSetEmissionTransform(particles: RID, transform: Transform3D
) Sets the
Transform3D
that will be used by the particles when they first emit.static func particlesSetEmitterVelocity(particles: RID, velocity: Vector3
) Sets the velocity of a particle node, that will be used by
inheritVelocityRatio
.static func particlesSetEmitting(particles: RID, emitting: Bool
) If
true
, particles will emit over time. Setting to false does not reset the particles, but only stops their emission. Equivalent toemitting
.static func particlesSetExplosivenessRatio(particles: RID, ratio: Double
) Sets the explosiveness ratio. Equivalent to
explosiveness
.static func particlesSetFixedFps(particles: RID, fps: Int32
) Sets the frame rate that the particle system rendering will be fixed to. Equivalent to
fixedFps
.static func particlesSetFractionalDelta(particles: RID, enable: Bool
) If
true
, uses fractional delta which smooths the movement of the particles. Equivalent tofractDelta
.static func particlesSetInterpToEnd(particles: RID, factor: Double
) Sets the value that informs a
ParticleProcessMaterial
to rush all particles towards the end of their lifetime.static func particlesSetInterpolate(particles: RID, enable: Bool
) static func particlesSetLifetime(particles: RID, lifetime: Double
) Sets the lifetime of each particle in the system. Equivalent to
lifetime
.static func particlesSetMode(particles: RID, mode: RenderingServer.ParticlesMode
) Sets whether the GPU particles specified by the
particles
RID should be rendered in 2D or 3D according tomode
.static func particlesSetOneShot(particles: RID, oneShot: Bool
) If
true
, particles will emit once and then stop. Equivalent tooneShot
.static func particlesSetPreProcessTime(particles: RID, time: Double
) Sets the preprocess time for the particles’ animation. This lets you delay starting an animation until after the particles have begun emitting. Equivalent to
preprocess
.static func particlesSetProcessMaterial(particles: RID, material: RID
) Sets the material for processing the particles.
static func particlesSetRandomnessRatio(particles: RID, ratio: Double
) Sets the emission randomness ratio. This randomizes the emission of particles within their phase. Equivalent to
randomness
.static func particlesSetSpeedScale(particles: RID, scale: Double
) Sets the speed scale of the particle system. Equivalent to
speedScale
.static func particlesSetSubemitter(particles: RID, subemitterParticles: RID
) static func particlesSetTrailBindPoses(particles: RID, bindPoses: VariantCollection<Transform3D>
) static func particlesSetTrails(particles: RID, enable: Bool, lengthSec: Double
) If
enable
istrue
, enables trails for theparticles
with the specifiedlengthSec
in seconds. Equivalent totrailEnabled
andtrailLifetime
.static func particlesSetTransformAlign(particles: RID, align: RenderingServer.ParticlesTransformAlign
) static func particlesSetUseLocalCoordinates(particles: RID, enable: Bool
) If
true
, particles use local coordinates. Iffalse
they use global coordinates. Equivalent tolocalCoords
.static func positionalSoftShadowFilterSetQuality(RenderingServer.ShadowQuality
) Sets the filter quality for omni and spot light shadows in 3D. See also
ProjectSettings/rendering/lightsAndShadows/positionalShadow/softShadowFilterQuality
. This parameter is global and cannot be set on a per-viewport basis.static func reflectionProbeCreate(
) -> RID Creates a reflection probe and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all
reflection_probe_*
RenderingServer functions.static func reflectionProbeSetAmbientColor(probe: RID, color: Color
) Sets the reflection probe’s custom ambient light color. Equivalent to
ambientColor
.static func reflectionProbeSetAmbientEnergy(probe: RID, energy: Double
) Sets the reflection probe’s custom ambient light energy. Equivalent to
ambientColorEnergy
.static func reflectionProbeSetAmbientMode(probe: RID, mode: RenderingServer.ReflectionProbeAmbientMode
) Sets the reflection probe’s ambient light mode. Equivalent to
ambientMode
.static func reflectionProbeSetAsInterior(probe: RID, enable: Bool
) If
true
, reflections will ignore sky contribution. Equivalent tointerior
.static func reflectionProbeSetCullMask(probe: RID, layers: UInt32
) Sets the render cull mask for this reflection probe. Only instances with a matching layer will be reflected by this probe. Equivalent to
cullMask
.static func reflectionProbeSetEnableBoxProjection(probe: RID, enable: Bool
) If
true
, uses box projection. This can make reflections look more correct in certain situations. Equivalent toboxProjection
.static func reflectionProbeSetEnableShadows(probe: RID, enable: Bool
) If
true
, computes shadows in the reflection probe. This makes the reflection much slower to compute. Equivalent toenableShadows
.static func reflectionProbeSetIntensity(probe: RID, intensity: Double
) Sets the intensity of the reflection probe. Intensity modulates the strength of the reflection. Equivalent to
intensity
.static func reflectionProbeSetMaxDistance(probe: RID, distance: Double
) Sets the max distance away from the probe an object can be before it is culled. Equivalent to
maxDistance
.static func reflectionProbeSetMeshLodThreshold(probe: RID, pixels: Double
) Sets the mesh level of detail to use in the reflection probe rendering. Higher values will use less detailed versions of meshes that have LOD variations generated, which can improve performance. Equivalent to
meshLodThreshold
.static func reflectionProbeSetOriginOffset(probe: RID, offset: Vector3
) Sets the origin offset to be used when this reflection probe is in box project mode. Equivalent to
originOffset
.static func reflectionProbeSetReflectionMask(probe: RID, layers: UInt32
) Sets the render reflection mask for this reflection probe. Only instances with a matching layer will have reflections applied from this probe. Equivalent to
reflectionMask
.static func reflectionProbeSetResolution(probe: RID, resolution: Int32
) Sets the resolution to use when rendering the specified reflection probe. The
resolution
is specified for each cubemap face: for instance, specifying512
will allocate 6 faces of 512×512 each (plus mipmaps for roughness levels).static func reflectionProbeSetSize(probe: RID, size: Vector3
) Sets the size of the area that the reflection probe will capture. Equivalent to
size
.static func reflectionProbeSetUpdateMode(probe: RID, mode: RenderingServer.ReflectionProbeUpdateMode
) Sets how often the reflection probe updates. Can either be once or every frame. See
ReflectionProbeUpdateMode
for options.static func requestFrameDrawnCallback(callable: Callable
) Schedules a callback to the given callable after a frame has been drawn.
static func scenarioCreate(
) -> RID Creates a scenario and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all
scenario_*
RenderingServer functions.static func scenarioSetCameraAttributes(scenario: RID, effects: RID
) Sets the camera attributes (
effects
) that will be used with this scenario. See alsoCameraAttributes
.static func scenarioSetCompositor(scenario: RID, compositor: RID
) Sets the compositor (
compositor
) that will be used with this scenario. See alsoCompositor
.static func scenarioSetEnvironment(scenario: RID, environment: RID
) Sets the environment that will be used with this scenario. See also
Environment
.static func scenarioSetFallbackEnvironment(scenario: RID, environment: RID
) Sets the fallback environment to be used by this scenario. The fallback environment is used if no environment is set. Internally, this is used by the editor to provide a default environment.
static func screenSpaceRoughnessLimiterSetActive(enable: Bool, amount: Double, limit: Double
) Sets the screen-space roughness limiter parameters, such as whether it should be enabled and its thresholds. Equivalent to
ProjectSettings/rendering/antiAliasing/screenSpaceRoughnessLimiter/enabled
,ProjectSettings/rendering/antiAliasing/screenSpaceRoughnessLimiter/amount
andProjectSettings/rendering/antiAliasing/screenSpaceRoughnessLimiter/limit
.static func setBootImage(Image?, color: Color, scale: Bool, useFilter: Bool
) Sets a boot image. The color defines the background color. If
scale
istrue
, the image will be scaled to fit the screen size. IfuseFilter
istrue
, the image will be scaled with linear interpolation. IfuseFilter
isfalse
, the image will be scaled with nearest-neighbor interpolation.static func setDebugGenerateWireframes(generate: Bool
) This method is currently unimplemented and does nothing if called with
generate
set totrue
.static func setDefaultClearColor(Color
) Sets the default clear color which is used when a specific clear color has not been selected. See also
getDefaultClearColor
.static func shaderCreate(
) -> RID Creates an empty shader and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all
shader_*
RenderingServer functions.static func shaderGetCode(shader: RID
) -> String Returns a shader’s source code as a string.
static func shaderGetDefaultTextureParameter(shader: RID, name: StringName, index: Int32
) -> RID Returns a default texture from a shader searched by name.
static func shaderGetParameterDefault(shader: RID, name: StringName
) -> Variant Returns the default value for the specified shader uniform. This is usually the value written in the shader source code.
static func shaderSetCode(shader: RID, code: String
) Sets the shader’s source code (which triggers recompilation after being changed).
static func shaderSetDefaultTextureParameter(shader: RID, name: StringName, texture: RID, index: Int32
) Sets a shader’s default texture. Overwrites the texture given by name.
static func shaderSetPathHint(shader: RID, path: String
) Sets the path hint for the specified shader. This should generally match the
Shader
resource’sresourcePath
.static func skeletonAllocateData(skeleton: RID, bones: Int32, is2dSkeleton: Bool
) static func skeletonBoneGetTransform(skeleton: RID, bone: Int32
) -> Transform3D Returns the
Transform3D
set for a specific bone of this skeleton.static func skeletonBoneGetTransform2d(skeleton: RID, bone: Int32
) -> Transform2D Returns the
Transform2D
set for a specific bone of this skeleton.static func skeletonBoneSetTransform(skeleton: RID, bone: Int32, transform: Transform3D
) Sets the
Transform3D
for a specific bone of this skeleton.static func skeletonBoneSetTransform2d(skeleton: RID, bone: Int32, transform: Transform2D
) Sets the
Transform2D
for a specific bone of this skeleton.static func skeletonCreate(
) -> RID Creates a skeleton and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all
skeleton_*
RenderingServer functions.static func skeletonGetBoneCount(skeleton: RID
) -> Int32 Returns the number of bones allocated for this skeleton.
static func skeletonSetBaseTransform2d(skeleton: RID, baseTransform: Transform2D
) static func skyBakePanorama(sky: RID, energy: Double, bakeIrradiance: Bool, size: Vector2i
) -> Image? Generates and returns an
Image
containing the radiance map for the specifiedsky
RID. This supports built-in sky material and custom sky shaders. IfbakeIrradiance
istrue
, the irradiance map is saved instead of the radiance map. The radiance map is used to render reflected light, while the irradiance map is used to render ambient light. See alsoenvironmentBakePanorama(environment:bakeIrradiance:size:)
.static func skyCreate(
) -> RID Creates an empty sky and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all
sky_*
RenderingServer functions.static func skySetMaterial(sky: RID, material: RID
) Sets the material that the sky uses to render the background, ambient and reflection maps.
static func skySetMode(sky: RID, mode: RenderingServer.SkyMode
) Sets the process
mode
of the sky specified by thesky
RID. Equivalent toprocessMode
.static func skySetRadianceSize(sky: RID, radianceSize: Int32
) Sets the
radianceSize
of the sky specified by thesky
RID (in pixels). Equivalent toradianceSize
.static func spotLightCreate(
) -> RID Creates a spot light and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID can be used in most
light_*
RenderingServer functions.static func subSurfaceScatteringSetQuality(RenderingServer.SubSurfaceScatteringQuality
) Sets
ProjectSettings/rendering/environment/subsurfaceScattering/subsurfaceScatteringQuality
to use when rendering materials that have subsurface scattering enabled.static func subSurfaceScatteringSetScale(Double, depthScale: Double
) Sets the
ProjectSettings/rendering/environment/subsurfaceScattering/subsurfaceScatteringScale
andProjectSettings/rendering/environment/subsurfaceScattering/subsurfaceScatteringDepthScale
to use when rendering materials that have subsurface scattering enabled.static func texture2dCreate(image: Image?
) -> RID Creates a 2-dimensional texture and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all
texture_2d_*
RenderingServer functions.static func texture2dGet(texture: RID
) -> Image? Returns an
Image
instance from the giventexture
RID
.static func texture2dLayerGet(texture: RID, layer: Int32
) -> Image? Returns an
Image
instance from the giventexture
RID
andlayer
.static func texture2dLayeredCreate(layers: ObjectCollection<Image>, layeredType: RenderingServer.TextureLayeredType
) -> RID Creates a 2-dimensional layered texture and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all
texture_2d_layered_*
RenderingServer functions.static func texture2dLayeredPlaceholderCreate(layeredType: RenderingServer.TextureLayeredType
) -> RID Creates a placeholder for a 2-dimensional layered texture and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all
texture_2d_layered_*
RenderingServer functions, although it does nothing when used. See alsotexture2dPlaceholderCreate
.static func texture2dPlaceholderCreate(
) -> RID Creates a placeholder for a 2-dimensional layered texture and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all
texture_2d_layered_*
RenderingServer functions, although it does nothing when used. See alsotexture2dLayeredPlaceholderCreate(layeredType:)
static func texture2dUpdate(texture: RID, image: Image?, layer: Int32
) Updates the texture specified by the
texture
RID
with the data inimage
. Alayer
must also be specified, which should be0
when updating a single-layer texture (Texture2D
).static func texture3dCreate(format: Image.Format, width: Int32, height: Int32, depth: Int32, mipmaps: Bool, data: ObjectCollection<Image>
) -> RID static func texture3dGet(texture: RID
) -> ObjectCollection<Image> Returns 3D texture data as an array of
Image
s for the specified textureRID
.static func texture3dPlaceholderCreate(
) -> RID Creates a placeholder for a 3-dimensional texture and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all
texture_3d_*
RenderingServer functions, although it does nothing when used.static func texture3dUpdate(texture: RID, data: ObjectCollection<Image>
) Updates the texture specified by the
texture
RID
‘s data with the data indata
. All the texture’s layers must be replaced at once.static func textureGetFormat(texture: RID
) -> Image.Format Returns the format for the texture.
static func textureGetNativeHandle(texture: RID, srgb: Bool
) -> UInt Returns the internal graphics handle for this texture object. For use when communicating with third-party APIs mostly with GDExtension.
static func textureGetPath(texture: RID
) -> String static func textureGetRdTexture(RID, srgb: Bool
) -> RID Returns a texture
RID
that can be used withRenderingDevice
.static func textureProxyCreate(base: RID
) -> RID This method does nothing and always returns an invalid
RID
.static func textureProxyUpdate(texture: RID, proxyTo: RID
) This method does nothing.
static func textureRdCreate(rdTexture: RID, layerType: RenderingServer.TextureLayeredType
) -> RID Creates a new texture object based on a texture created directly on the
RenderingDevice
. If the texture contains layers,layerType
is used to define the layer type.static func textureReplace(texture: RID, byTexture: RID
) Replaces
texture
’s texture data by the texture specified by thebyTexture
RID, without changingtexture
’s RID.static func textureSetForceRedrawIfVisible(texture: RID, enable: Bool
) static func textureSetPath(texture: RID, path: String
) static func textureSetSizeOverride(texture: RID, width: Int32, height: Int32
) static func viewportAttachCamera(viewport: RID, camera: RID
) Sets a viewport’s camera.
static func viewportAttachCanvas(viewport: RID, canvas: RID
) Sets a viewport’s canvas.
static func viewportAttachToScreen(viewport: RID, rect: Rect2, screen: Int32
) Copies the viewport to a region of the screen specified by
rect
. IfviewportSetRenderDirectToScreen(viewport:enabled:)
istrue
, then the viewport does not use a framebuffer and the contents of the viewport are rendered directly to screen. However, note that the root viewport is drawn last, therefore it will draw over the screen. Accordingly, you must set the root viewport to an area that does not cover the area that you have attached this viewport to.static func viewportCreate(
) -> RID Creates an empty viewport and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all
viewport_*
RenderingServer functions.static func viewportGetMeasuredRenderTimeCpu(viewport: RID
) -> Double Returns the CPU time taken to render the last frame in milliseconds. This only includes time spent in rendering-related operations; scripts’
_process
functions and other engine subsystems are not included in this readout. To get a complete readout of CPU time spent to render the scene, sum the render times of all viewports that are drawn every frame plusgetFrameSetupTimeCpu
. UnlikegetFramesPerSecond
, this method will accurately reflect CPU utilization even if framerate is capped via V-Sync ormaxFps
. See alsoviewportGetMeasuredRenderTimeGpu(viewport:)
.static func viewportGetMeasuredRenderTimeGpu(viewport: RID
) -> Double Returns the GPU time taken to render the last frame in milliseconds. To get a complete readout of GPU time spent to render the scene, sum the render times of all viewports that are drawn every frame. Unlike
getFramesPerSecond
, this method accurately reflects GPU utilization even if framerate is capped via V-Sync ormaxFps
. See alsoviewportGetMeasuredRenderTimeGpu(viewport:)
.static func viewportGetRenderInfo(viewport: RID, type: RenderingServer.ViewportRenderInfoType, info: RenderingServer.ViewportRenderInfo
) -> Int32 Returns a statistic about the rendering engine which can be used for performance profiling. This is separated into render pass
type
s, each of them having the sameinfo
s you can query (different passes will return different values). SeeRenderingServer.ViewportRenderInfoType
for a list of render pass types andRenderingServer.ViewportRenderInfo
for a list of information that can be queried.static func viewportGetRenderTarget(viewport: RID
) -> RID Returns the render target for the viewport.
static func viewportGetTexture(viewport: RID
) -> RID Returns the viewport’s last rendered frame.
static func viewportGetUpdateMode(viewport: RID
) -> RenderingServer.ViewportUpdateMode Returns the viewport’s update mode. See
ViewportUpdateMode
constants for options.static func viewportRemoveCanvas(viewport: RID, canvas: RID
) Detaches a viewport from a canvas.
static func viewportSetActive(viewport: RID, active: Bool
) If
true
, sets the viewport active, else sets it inactive.static func viewportSetCanvasCullMask(viewport: RID, canvasCullMask: UInt32
) Sets the rendering mask associated with this
Viewport
. OnlyCanvasItem
nodes with a matching rendering visibility layer will be rendered by thisViewport
.static func viewportSetCanvasStacking(viewport: RID, canvas: RID, layer: Int32, sublayer: Int32
) Sets the stacking order for a viewport’s canvas.
static func viewportSetCanvasTransform(viewport: RID, canvas: RID, offset: Transform2D
) Sets the transformation of a viewport’s canvas.
static func viewportSetClearMode(viewport: RID, clearMode: RenderingServer.ViewportClearMode
) Sets the clear mode of a viewport. See
ViewportClearMode
for options.static func viewportSetDebugDraw(viewport: RID, draw: RenderingServer.ViewportDebugDraw
) Sets the debug draw mode of a viewport. See
ViewportDebugDraw
for options.static func viewportSetDefaultCanvasItemTextureFilter(viewport: RID, filter: RenderingServer.CanvasItemTextureFilter
) Sets the default texture filtering mode for the specified
viewport
RID. SeeCanvasItemTextureFilter
for options.static func viewportSetDefaultCanvasItemTextureRepeat(viewport: RID, repeat: RenderingServer.CanvasItemTextureRepeat
) Sets the default texture repeat mode for the specified
viewport
RID. SeeCanvasItemTextureRepeat
for options.static func viewportSetDisable2d(viewport: RID, disable: Bool
) If
true
, the viewport’s canvas (i.e. 2D and GUI elements) is not rendered.static func viewportSetDisable3d(viewport: RID, disable: Bool
) If
true
, the viewport’s 3D elements are not rendered.static func viewportSetEnvironmentMode(viewport: RID, mode: RenderingServer.ViewportEnvironmentMode
) Sets the viewport’s environment mode which allows enabling or disabling rendering of 3D environment over 2D canvas. When disabled, 2D will not be affected by the environment. When enabled, 2D will be affected by the environment if the environment background mode is .envBgCanvas. The default behavior is to inherit the setting from the viewport’s parent. If the topmost parent is also set to .viewportEnvironmentInherit, then the behavior will be the same as if it was set to .viewportEnvironmentEnabled.
static func viewportSetFsrSharpness(viewport: RID, sharpness: Double
) Determines how sharp the upscaled image will be when using the FSR upscaling mode. Sharpness halves with every whole number. Values go from 0.0 (sharpest) to 2.0. Values above 2.0 won’t make a visible difference.
static func viewportSetGlobalCanvasTransform(viewport: RID, transform: Transform2D
) Sets the viewport’s global transformation matrix.
static func viewportSetMeasureRenderTime(viewport: RID, enable: Bool
) Sets the measurement for the given
viewport
RID (obtained usinggetViewportRid
). Once enabled,viewportGetMeasuredRenderTimeCpu(viewport:)
andviewportGetMeasuredRenderTimeGpu(viewport:)
will return values greater than0.0
when queried with the givenviewport
.static func viewportSetMsaa2d(viewport: RID, msaa: RenderingServer.ViewportMSAA
) Sets the multisample anti-aliasing mode for 2D/Canvas on the specified
viewport
RID. SeeViewportMSAA
for options.static func viewportSetMsaa3d(viewport: RID, msaa: RenderingServer.ViewportMSAA
) Sets the multisample anti-aliasing mode for 3D on the specified
viewport
RID. SeeViewportMSAA
for options.static func viewportSetOcclusionCullingBuildQuality(RenderingServer.ViewportOcclusionCullingBuildQuality
) Sets the
ProjectSettings/rendering/occlusionCulling/bvhBuildQuality
to use for occlusion culling. This parameter is global and cannot be set on a per-viewport basis.static func viewportSetOcclusionRaysPerThread(Int32
) Sets the
ProjectSettings/rendering/occlusionCulling/occlusionRaysPerThread
to use for occlusion culling. This parameter is global and cannot be set on a per-viewport basis.static func viewportSetParentViewport(RID, parentViewport: RID
) Sets the viewport’s parent to the viewport specified by the
parentViewport
RID.static func viewportSetPositionalShadowAtlasQuadrantSubdivision(viewport: RID, quadrant: Int32, subdivision: Int32
) Sets the number of subdivisions to use in the specified shadow atlas
quadrant
for omni and spot shadows. See alsoViewport/setPositionalShadowAtlasQuadrantSubdiv(quadrant:subdiv:)
.static func viewportSetPositionalShadowAtlasSize(viewport: RID, size: Int32, use16Bits: Bool
) Sets the
size
of the shadow atlas’s images (used for omni and spot lights) on the viewport specified by theviewport
RID. The value is rounded up to the nearest power of 2. Ifuse16Bits
istrue
, use 16 bits for the omni/spot shadow depth map. Enabling this results in shadows having less precision and may result in shadow acne, but can lead to performance improvements on some devices.static func viewportSetRenderDirectToScreen(viewport: RID, enabled: Bool
) If
true
, render the contents of the viewport directly to screen. This allows a low-level optimization where you can skip drawing a viewport to the root viewport. While this optimization can result in a significant increase in speed (especially on older devices), it comes at a cost of usability. When this is enabled, you cannot read from the viewport or from the screen_texture. You also lose the benefit of certain window settings, such as the various stretch modes. Another consequence to be aware of is that in 2D the rendering happens in window coordinates, so if you have a viewport that is double the size of the window, and you set this, then only the portion that fits within the window will be drawn, no automatic scaling is possible, even if your game scene is significantly larger than the window size.static func viewportSetScaling3dMode(viewport: RID, scaling3dMode: RenderingServer.ViewportScaling3DMode
) Sets the 3D resolution scaling mode. Bilinear scaling renders at different resolution to either undersample or supersample the viewport. FidelityFX Super Resolution 1.0, abbreviated to FSR, is an upscaling technology that produces high quality images at fast framerates by using a spatially aware upscaling algorithm. FSR is slightly more expensive than bilinear, but it produces significantly higher image quality. FSR should be used where possible.
static func viewportSetScaling3dScale(viewport: RID, scale: Double
) Scales the 3D render buffer based on the viewport size uses an image filter specified in
ViewportScaling3DMode
to scale the output image to the full viewport size. Values lower than1.0
can be used to speed up 3D rendering at the cost of quality (undersampling). Values greater than1.0
are only valid for bilinear mode and can be used to improve 3D rendering quality at a high performance cost (supersampling). See alsoViewportMSAA
for multi-sample antialiasing, which is significantly cheaper but only smoothens the edges of polygons.static func viewportSetScenario(viewport: RID, scenario: RID
) Sets a viewport’s scenario. The scenario contains information about environment information, reflection atlas, etc.
static func viewportSetScreenSpaceAa(viewport: RID, mode: RenderingServer.ViewportScreenSpaceAA
) Sets the viewport’s screen-space antialiasing mode.
static func viewportSetSdfOversizeAndScale(viewport: RID, oversize: RenderingServer.ViewportSDFOversize, scale: RenderingServer.ViewportSDFScale
) Sets the viewport’s 2D signed distance field
ProjectSettings/rendering/2d/sdf/oversize
andProjectSettings/rendering/2d/sdf/scale
. This is used when sampling the signed distance field inCanvasItem
shaders as well asGPUParticles2D
collision. This is not used by SDFGI in 3D rendering.static func viewportSetSize(viewport: RID, width: Int32, height: Int32
) Sets the viewport’s width and height in pixels.
static func viewportSetSnap2dTransformsToPixel(viewport: RID, enabled: Bool
) If
true
, canvas item transforms (i.e. origin position) are snapped to the nearest pixel when rendering. This can lead to a crisper appearance at the cost of less smooth movement, especially whenCamera2D
smoothing is enabled. Equivalent toProjectSettings/rendering/2d/snap/snap2dTransformsToPixel
.static func viewportSetSnap2dVerticesToPixel(viewport: RID, enabled: Bool
) If
true
, canvas item vertices (i.e. polygon points) are snapped to the nearest pixel when rendering. This can lead to a crisper appearance at the cost of less smooth movement, especially whenCamera2D
smoothing is enabled. Equivalent toProjectSettings/rendering/2d/snap/snap2dVerticesToPixel
.static func viewportSetTextureMipmapBias(viewport: RID, mipmapBias: Double
) Affects the final texture sharpness by reading from a lower or higher mipmap (also called “texture LOD bias”). Negative values make mipmapped textures sharper but grainier when viewed at a distance, while positive values make mipmapped textures blurrier (even when up close). To get sharper textures at a distance without introducing too much graininess, set this between
-0.75
and0.0
. Enabling temporal antialiasing (ProjectSettings/rendering/antiAliasing/quality/useTaa
) can help reduce the graininess visible when using negative mipmap bias.static func viewportSetTransparentBackground(viewport: RID, enabled: Bool
) If
true
, the viewport renders its background as transparent.static func viewportSetUpdateMode(viewport: RID, updateMode: RenderingServer.ViewportUpdateMode
) Sets when the viewport should be updated. See
ViewportUpdateMode
constants for options.static func viewportSetUseDebanding(viewport: RID, enable: Bool
) If
true
, enables debanding on the specified viewport. Equivalent toProjectSettings/rendering/antiAliasing/quality/useDebanding
.static func viewportSetUseHdr2d(viewport: RID, enabled: Bool
) If
true
, 2D rendering will use a high dynamic range (HDR) format framebuffer matching the bit depth of the 3D framebuffer. When using the Forward+ renderer this will be anRGBA16
framebuffer, while when using the Mobile renderer it will be anRGB10_A2
framebuffer. Additionally, 2D rendering will take place in linear color space and will be converted to sRGB space immediately before blitting to the screen (if the Viewport is attached to the screen). Practically speaking, this means that the end result of the Viewport will not be clamped into the0-1
range and can be used in 3D rendering without color space adjustments. This allows 2D rendering to take advantage of effects requiring high dynamic range (e.g. 2D glow) as well as substantially improves the appearance of effects requiring highly detailed gradients. This setting has the same effect asuseHdr2d
.static func viewportSetUseOcclusionCulling(viewport: RID, enable: Bool
) If
true
, enables occlusion culling on the specified viewport. Equivalent toProjectSettings/rendering/occlusionCulling/useOcclusionCulling
.static func viewportSetUseTaa(viewport: RID, enable: Bool
) If
true
, use Temporal Anti-Aliasing. Equivalent toProjectSettings/rendering/antiAliasing/quality/useTaa
.static func viewportSetUseXr(viewport: RID, useXr: Bool
) If
true
, the viewport uses augmented or virtual reality technologies. SeeXRInterface
.static func viewportSetVrsMode(viewport: RID, mode: RenderingServer.ViewportVRSMode
) Sets the Variable Rate Shading (VRS) mode for the viewport. If the GPU does not support VRS, this property is ignored. Equivalent to
ProjectSettings/rendering/vrs/mode
.static func viewportSetVrsTexture(viewport: RID, texture: RID
) The texture to use when the VRS mode is set to
RenderingServer/ViewportVRSMode/viewportVrsTexture
. Equivalent toProjectSettings/rendering/vrs/texture
.static func viewportSetVrsUpdateMode(viewport: RID, mode: RenderingServer.ViewportVRSUpdateMode
) Sets the update mode for Variable Rate Shading (VRS) for the viewport. VRS requires the input texture to be converted to the format usable by the VRS method supported by the hardware. The update mode defines how often this happens. If the GPU does not support VRS, or VRS is not enabled, this property is ignored.
static func visibilityNotifierCreate(
) -> RID Creates a new 3D visibility notifier object and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all
visibility_notifier_*
RenderingServer functions.static func visibilityNotifierSetAabb(notifier: RID, aabb: AABB
) static func visibilityNotifierSetCallbacks(notifier: RID, enterCallable: Callable, exitCallable: Callable
) static func voxelGiAllocateData(voxelGi: RID, toCellXform: Transform3D, aabb: AABB, octreeSize: Vector3i, octreeCells: PackedByteArray, dataCells: PackedByteArray, distanceField: PackedByteArray, levelCounts: PackedInt32Array
) static func voxelGiCreate(
) -> RID Creates a new voxel-based global illumination object and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all
voxel_gi_*
RenderingServer functions.static func voxelGiGetDataCells(voxelGi: RID
) -> PackedByteArray static func voxelGiGetDistanceField(voxelGi: RID
) -> PackedByteArray static func voxelGiGetLevelCounts(voxelGi: RID
) -> PackedInt32Array static func voxelGiGetOctreeCells(voxelGi: RID
) -> PackedByteArray static func voxelGiGetOctreeSize(voxelGi: RID
) -> Vector3i static func voxelGiGetToCellXform(voxelGi: RID
) -> Transform3D static func voxelGiSetBakedExposureNormalization(voxelGi: RID, bakedExposure: Double
) Used to inform the renderer what exposure normalization value was used while baking the voxel gi. This value will be used and modulated at run time to ensure that the voxel gi maintains a consistent level of exposure even if the scene-wide exposure normalization is changed at run time. For more information see
cameraAttributesSetExposure(cameraAttributes:multiplier:normalization:)
.static func voxelGiSetBias(voxelGi: RID, bias: Double
) Sets the
bias
value to use on the specifiedvoxelGi
’sRID
.static func voxelGiSetDynamicRange(voxelGi: RID, range: Double
) Sets the
dynamicRange
value to use on the specifiedvoxelGi
’sRID
.static func voxelGiSetEnergy(voxelGi: RID, energy: Double
) Sets the
energy
value to use on the specifiedvoxelGi
’sRID
.static func voxelGiSetInterior(voxelGi: RID, enable: Bool
) Sets the
interior
value to use on the specifiedvoxelGi
’sRID
.static func voxelGiSetNormalBias(voxelGi: RID, bias: Double
) Sets the
normalBias
value to use on the specifiedvoxelGi
’sRID
.static func voxelGiSetPropagation(voxelGi: RID, amount: Double
) Sets the
propagation
value to use on the specifiedvoxelGi
’sRID
.static func voxelGiSetQuality(RenderingServer.VoxelGIQuality
) Sets the
ProjectSettings/rendering/globalIllumination/voxelGi/quality
value to use when rendering. This parameter is global and cannot be set on a per-VoxelGI basis.static func voxelGiSetUseTwoBounces(voxelGi: RID, enable: Bool
) Sets the
useTwoBounces
value to use on the specifiedvoxelGi
’sRID
.class var godotClassName: StringName
Instance members
var framePostDraw: SimpleSignal
Emitted at the end of the frame, after the RenderingServer has finished updating all the Viewports.
var framePreDraw: SimpleSignal
Emitted at the beginning of the frame, before the RenderingServer updates all the Viewports.
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.