CompositorEffectFlags
RenderingServer.swift:1279enum CompositorEffectFlags
enum CompositorEffectFlags
s10SwiftGodot15RenderingServerC21CompositorEffectFlagsO
What are these?56KXA
import SwiftGodot
Framework to write Godot Game Extensions using the Swift Programming Language.
class RenderingServer
Server for anything visible.
case accessResolvedColor
The rendering effect requires the color buffer to be resolved if MSAA is enabled.
case accessResolvedDepth
The rendering effect requires the depth buffer to be resolved if MSAA is enabled.
case needsMotionVectors
The rendering effect requires motion vectors to be produced.
case needsRoughness
The rendering effect requires normals and roughness g-buffer to be produced (Forward+ only).
case needsSeparateSpecular
The rendering effect requires specular data to be separated out (Forward+ only).
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 { get set }
If false
, disables rendering completely, but the engine logic is still being processed. You can call forceDraw(swapBuffers:frameStep:)
to draw a frame even with rendering disabled.
static var shared: RenderingServer
The shared instance of this class
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 optional materialOverrides
to a set of Image
s of size imageSize
. Returns an array of Image
s containing material properties as specified in BakeChannels
.
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
and CameraAttributesPractical
.
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(_ shape: 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(_ quality: 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 to Camera3D/KeepAspect/keepWidth
. If false
, preserves the vertical aspect ratio which is equivalent to Camera3D/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 all canvas_*
RenderingServer functions.
static func canvasItemAddAnimationSlice(item: RID, animationLength: Double, sliceBegin: Double, sliceEnd: Double, offset: Double = 0.0)
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 = false)
Draws a circle on the CanvasItem
pointed to by the item
RID
. See also drawCircle(position:radius:color:filled:width:antialiased:)
.
static func canvasItemAddClipIgnore(item: RID, ignore: Bool)
If ignore
is true
, ignore clipping on items drawn with this canvas item until this is called again with ignore
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 = -1.0, antialiased: Bool = false)
Draws a line on the CanvasItem
pointed to by the item
RID
. See also drawLine(from:to:color:width:antialiased:)
.
static func canvasItemAddMesh(item: RID, mesh: RID, transform: Transform2D = Transform2D (xAxis: Vector2 (x: 1, y: 0), yAxis: Vector2 (x: 0, y: 1), origin: Vector2 (x: 0, y: 0)), modulate: Color = Color (r: 1, g: 1, b: 1, a: 1), texture: RID = RID())
Draws a mesh created with meshCreate
with given transform
, modulate
color, and texture
. This is used internally by MeshInstance2D
.
static func canvasItemAddMsdfTextureRectRegion(item: RID, rect: Rect2, texture: RID, srcRect: Rect2, modulate: Color = Color (r: 1, g: 1, b: 1, a: 1), outlineSize: Int32 = 0, pxRange: Double = 1.0, scale: Double = 1.0)
See also drawMsdfTextureRectRegion(texture:rect:srcRect:modulate:outline:pixelRange:scale:)
.
static func canvasItemAddMultiline(item: RID, points: PackedVector2Array, colors: PackedColorArray, width: Double = -1.0, antialiased: Bool = false)
Draws a 2D multiline on the CanvasItem
pointed to by the item
RID
. See also drawMultiline(points:color:width:antialiased:)
and drawMultilineColors(points:colors:width:antialiased:)
.
static func canvasItemAddMultimesh(item: RID, mesh: RID, texture: RID = RID())
Draws a 2D MultiMesh
on the CanvasItem
pointed to by the item
RID
. See also drawMultimesh(_:texture:)
.
static func canvasItemAddNinePatch(item: RID, rect: Rect2, source: Rect2, texture: RID, topleft: Vector2, bottomright: Vector2, xAxisMode: RenderingServer.NinePatchAxisMode = .stretch, yAxisMode: RenderingServer.NinePatchAxisMode = .stretch, drawCenter: Bool = true, modulate: Color = Color (r: 1, g: 1, b: 1, a: 1))
Draws a nine-patch rectangle on the CanvasItem
pointed to by the item
RID
.
static func canvasItemAddParticles(item: RID, particles: RID, texture: RID)
Draws particles on the CanvasItem
pointed to by the item
RID
.
static func canvasItemAddPolygon(item: RID, points: PackedVector2Array, colors: PackedColorArray, uvs: PackedVector2Array = PackedVector2Array(), texture: RID = RID())
Draws a 2D polygon on the CanvasItem
pointed to by the item
RID
. If you need more flexibility (such as being able to use bones), use canvasItemAddTriangleArray(item:indices:points:colors:uvs:bones:weights:texture:count:)
instead. See also drawPolygon(points:colors:uvs:texture:)
.
static func canvasItemAddPolyline(item: RID, points: PackedVector2Array, colors: PackedColorArray, width: Double = -1.0, antialiased: Bool = false)
Draws a 2D polyline on the CanvasItem
pointed to by the item
RID
. See also drawPolyline(points:color:width:antialiased:)
and drawPolylineColors(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 the item
RID
. See also drawPrimitive(points:colors:uvs:texture:)
.
static func canvasItemAddRect(item: RID, rect: Rect2, color: Color, antialiased: Bool = false)
Draws a rectangle on the CanvasItem
pointed to by the item
RID
. See also drawRect(_: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 = false, modulate: Color = Color (r: 1, g: 1, b: 1, a: 1), transpose: Bool = false)
Draws a 2D textured rectangle on the CanvasItem
pointed to by the item
RID
. See also drawTextureRect(texture:rect:tile:modulate:transpose:)
and drawRect(canvasItem:rect:tile:modulate:transpose:)
.
static func canvasItemAddTextureRectRegion(item: RID, rect: Rect2, texture: RID, srcRect: Rect2, modulate: Color = Color (r: 1, g: 1, b: 1, a: 1), transpose: Bool = false, clipUv: Bool = true)
Draws the specified region of a 2D textured rectangle on the CanvasItem
pointed to by the item
RID
. See also drawTextureRectRegion(texture:rect:srcRect:modulate:transpose:clipUv:)
and drawRectRegion(canvasItem:rect:srcRect:modulate:transpose:clipUv:)
.
static func canvasItemAddTriangleArray(item: RID, indices: PackedInt32Array, points: PackedVector2Array, colors: PackedColorArray, uvs: PackedVector2Array = PackedVector2Array(), bones: PackedInt32Array = PackedInt32Array(), weights: PackedFloat32Array = PackedFloat32Array(), texture: RID = RID(), count: Int32 = -1)
Draws a triangle array on the CanvasItem
pointed to by the item
RID
. This is internally used by Line2D
and StyleBoxFlat
for rendering. canvasItemAddTriangleArray(item:indices:points:colors:uvs:bones:weights:texture:count:)
is highly flexible, but more complex to use than canvasItemAddPolygon(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 all canvas_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 = 5.0, fitEmpty: Bool = false, fitMargin: Double = 0.0, blurMipmaps: Bool = false)
Sets the canvas group mode used during 2D rendering for the canvas item specified by the item
RID. For faster but more limited clipping, use canvasItemSetClip(item:clip:)
instead.
static func canvasItemSetClip(item: RID, clip: Bool)
If clip
is true
, makes the canvas item specified by the item
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, use canvasItemSetCanvasGroupMode(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 = Rect2 (x: 0, y: 0, width: 0, height: 0))
If useCustomRect
is true
, sets the custom visibility rectangle (used for culling) to rect
for the canvas item specified by item
. Setting a custom visibility rect can reduce CPU load when drawing lots of 2D instances. If useCustomRect
is false
, 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 to textureFilter
.
static func canvasItemSetDefaultTextureRepeat(item: RID, repeat: RenderingServer.CanvasItemTextureRepeat)
Sets the default texture repeat mode for the canvas item specified by the item
RID. Equivalent to textureRepeat
.
static func canvasItemSetDistanceFieldMode(item: RID, enabled: Bool)
If enabled
is true
, enables multichannel signed distance field rendering mode for the canvas item specified by the item
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
is true
, draws the canvas item specified by the item
RID behind its parent. Equivalent to showBehindParent
.
static func canvasItemSetDrawIndex(item: RID, index: Int32)
Sets the index for the CanvasItem
.
static func canvasItemSetInterpolated(item: RID, interpolated: Bool)
If interpolated
is true
, 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 the item
RID. Equivalent to lightMask
.
static func canvasItemSetMaterial(item: RID, material: RID)
Sets a new material
to the canvas item specified by the item
RID. Equivalent to material
.
static func canvasItemSetModulate(item: RID, color: Color)
Multiplies the color of the canvas item specified by the item
RID, while affecting its children. See also canvasItemSetSelfModulate(item:color:)
. Equivalent to modulate
.
static func canvasItemSetParent(item: RID, parent: RID)
Sets a parent CanvasItem
to the CanvasItem
. The item will inherit transform, modulation and visibility from its parent, like CanvasItem
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 also canvasItemSetModulate(item:color:)
. Equivalent to selfModulate
.
static func canvasItemSetSortChildrenByY(item: RID, enabled: Bool)
If enabled
is true
, 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 the item
RID, not the canvas item itself. Equivalent to ySortEnabled
.
static func canvasItemSetTransform(item: RID, transform: Transform2D)
Sets the transform
of the canvas item specified by the item
RID. This affects where and how the item will be drawn. Child canvas items’ transforms are multiplied by their parent’s transform. Equivalent to transform
.
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
. Only Viewport
nodes with a matching rendering mask will render this CanvasItem
.
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 the CanvasItem
enters the screen, exitCallable
is called when the CanvasItem
exits the screen. If enable
is false
, 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
is true
, 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 to blendMode
.
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
is true
, 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 to texture
.
static func canvasLightSetTextureOffset(light: RID, offset: Vector2)
Sets the offset of a PointLight2D
’s texture. Equivalent to offset
.
static func canvasLightSetTextureScale(light: RID, scale: Double)
Sets the scale factor of a PointLight2D
’s texture. Equivalent to textureScale
.
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
and rangeZMax
.
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 the repeatTimes
. As the repeatTimes
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(_ size: Int32)
Sets the ProjectSettings/rendering/2d/shadowAtlas/size
to use for Light2D
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
’s texture
for the canvas texture specified by the canvasTexture
RID. Equivalent to diffuseTexture
, normalTexture
and specularTexture
.
static func canvasTextureSetShadingParameters(canvasTexture: RID, baseColor: Color, shininess: Double)
Sets the baseColor
and shininess
to use for the canvas texture specified by the canvasTexture
RID. Equivalent to specularColor
and specularShininess
.
static func canvasTextureSetTextureFilter(canvasTexture: RID, filter: RenderingServer.CanvasItemTextureFilter)
Sets the texture filter
mode to use for the canvas texture specified by the canvasTexture
RID.
static func canvasTextureSetTextureRepeat(canvasTexture: RID, repeat: RenderingServer.CanvasItemTextureRepeat)
Sets the texture repeat
mode to use for the canvas texture specified by the canvasTexture
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 to true
or false
(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 with compositorEffectCreate
.
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 the decal
RID. Equivalent to albedoMix
.
static func decalSetCullMask(decal: RID, mask: UInt32)
Sets the cull mask
in the decal specified by the decal
RID. Equivalent to cullMask
.
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 to distanceFadeEnabled
, distanceFadeBegin
and distanceFadeLength
.
static func decalSetEmissionEnergy(decal: RID, energy: Double)
Sets the emission energy
in the decal specified by the decal
RID. Equivalent to emissionEnergy
.
static func decalSetFade(decal: RID, above: Double, below: Double)
Sets the upper fade (above
) and lower fade (below
) in the decal specified by the decal
RID. Equivalent to upperFade
and lowerFade
.
static func decalSetModulate(decal: RID, color: Color)
Sets the color multiplier in the decal specified by the decal
RID to color
. Equivalent to modulate
.
static func decalSetNormalFade(decal: RID, fade: Double)
Sets the normal fade
in the decal specified by the decal
RID. Equivalent to normalFade
.
static func decalSetSize(decal: RID, size: Vector3)
Sets the size
of the decal specified by the decal
RID. Equivalent to size
.
static func decalSetTexture(decal: RID, type: RenderingServer.DecalTexture, texture: RID)
Sets the texture
in the given texture type
slot for the specified decal. Equivalent to Decal/setTexture(type:texture:)
.
static func decalsSetFilter(_ filter: 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(_ size: Int32, is16bits: Bool)
Sets the size
of the directional light shadows in 3D. See also ProjectSettings/rendering/lightsAndShadows/directionalShadow/size
. This parameter is global and cannot be set on a per-viewport basis.
static func directionalSoftShadowFilterSetQuality(_ quality: RenderingServer.ShadowQuality)
Sets the filter quality
for directional light shadows in 3D. See also ProjectSettings/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 specified environment
RID’s sky. This supports built-in sky material and custom sky shaders. If bakeIrradiance
is true
, 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 also skyBakePanorama(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
is true
, enables bicubic upscaling for glow which improves quality at the cost of performance. Equivalent to ProjectSettings/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 = .bg, energy: Double = 1.0, skyContibution: Double = 0.0, reflectionSource: RenderingServer.EnvironmentReflectionSource = .bg)
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 = .exponential)
Configures fog for the specified environment RID. See fog_*
properties in Environment
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 in Environment
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 in Environment
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(_ rayCount: 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 to sky
.
static func environmentSetSkyCustomFov(env: RID, scale: Double)
Sets a custom field of view for the background Sky
. Equivalent to skyCustomFov
.
static func environmentSetSkyOrientation(env: RID, orientation: Basis)
Sets the rotation of the background Sky
expressed as a Basis
. Equivalent to skyRotation
, where the rotation vector is used to construct the Basis
.
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(_ quality: 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(_ quality: 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(_ quality: 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(_ active: Bool)
Enables filtering of the volumetric fog scattering buffer. This results in much smoother volumes with very few under-sampling artifacts.
static func environmentSetVolumetricFogVolumeSize(_ size: 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. While depth
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 a FogMaterial
or a custom ShaderMaterial
.
static func fogVolumeSetShape(fogVolume: RID, shape: RenderingServer.FogVolumeShape)
Sets the shape of the fog volume to either ellipsoid
, cone
, cylinder
, box
or world
.
static func fogVolumeSetSize(fogVolume: RID, size: Vector3)
Sets the size of the fog volume when shape is ellipsoid
, cone
, cylinder
or box
.
static func forceDraw(swapBuffers: Bool = true, frameStep: Double = 0.0)
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: 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 also viewportGetMeasuredRenderTimeCpu(viewport:)
.
static func getRenderingDevice() -> RenderingDevice
Returns the global RenderingDevice.
static func getRenderingInfo(_ info: 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 also viewportGetRenderInfo(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 also makeSphereMesh(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 to getTestTexture
, then it will be cached for subsequent calls. See also getWhiteTexture
.
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 to getWhiteTexture
, then it will be cached for subsequent calls. See also getTestTexture
.
static func giSetUseHalfResolution(_ halfResolution: Bool)
If halfResolution
is true
, renders VoxelGI
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 to ProjectSettings/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
to value
.
static func globalShaderParameterSetOverride(name: StringName, value: Variant)
Overrides the global shader uniform name
with value
. Equivalent to the ShaderGlobalsOverride
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(_ feature: RenderingServer.Features) -> Bool
This method does nothing and always returns false
.
static func hasOsFeature(_ feature: String) -> Bool
Returns true
if the OS supports a certain feature
. Features might be s3tc
, etc
, and etc2
.
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:)
, and instancesCullRay(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
and usage
. Equivalent to getInstanceShaderParameter(name:)
.
static func instanceGeometrySetCastShadowsSetting(instance: RID, shadowCastingSetting: RenderingServer.ShadowCastingSetting)
Sets the shadow casting setting to one of ShadowCastingSetting
. Equivalent to castShadow
.
static func instanceGeometrySetFlag(instance: RID, flag: RenderingServer.InstanceFlags, enabled: Bool)
Sets the flag for a given InstanceFlags
. See InstanceFlags
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 as ignoreOcclusionCulling
, 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: AABB, scenario: RID = RID()) -> PackedInt64Array
Returns an array of object IDs intersecting with the provided AABB. Only 3D nodes that inherit from VisualInstance3D
are considered, such as MeshInstance3D
or DirectionalLight3D
. Use @GlobalScope.instance_from_id
to obtain the actual nodes. A scenario RID must be provided, which is available in the World3D
you want to query. This forces an update for all resources queued to update.
static func instancesCullConvex(_ convex: VariantCollection<Plane>, scenario: RID = RID()) -> PackedInt64Array
Returns an array of object IDs intersecting with the provided convex shape. Only 3D nodes that inherit from VisualInstance3D
are considered, such as MeshInstance3D
or DirectionalLight3D
. Use @GlobalScope.instance_from_id
to obtain the actual nodes. A scenario RID must be provided, which is available in the World3D
you want to query. This forces an update for all resources queued to update.
static func instancesCullRay(from: Vector3, to: Vector3, scenario: RID = RID()) -> PackedInt64Array
Returns an array of object IDs intersecting with the provided 3D ray. Only 3D nodes that inherit from VisualInstance3D
are considered, such as MeshInstance3D
or DirectionalLight3D
. Use @GlobalScope.instance_from_id
to obtain the actual nodes. A scenario RID must be provided, which is available in the World3D
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 to directionalShadowBlendSplits
.
static func lightDirectionalSetShadowMode(light: RID, mode: RenderingServer.LightDirectionalShadowMode)
Sets the shadow mode for this directional light. Equivalent to directionalShadowMode
. See LightDirectionalShadowMode
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(_ filter: 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
, and distanceFadeLength
.
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 to lightNegative
.
static func lightSetParam(light: RID, param: RenderingServer.LightParam, value: Double)
Sets the specified 3D light parameter. See LightParam
for options. Equivalent to Light3D/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 with instanceGeometrySetCastShadowsSetting(instance:shadowCastingSetting:)
. Equivalent to shadowReverseCullFace
.
static func lightSetShadow(light: RID, enabled: Bool)
If true
, light will cast shadows. Equivalent to shadowEnabled
.
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(_ speed: 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 the light
RID. If the lightmap texture was baked with directional
set to true
, then usesSh
must also be true
.
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 = GArray (), lods: GDictionary = 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(_ surfaces: VariantCollection<GDictionary>, blendShapeCount: Int32 = 0) -> 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(_ mesh: 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 = false, customDataFormat: Bool = false)
static func multimeshCreate() -> RID
Creates a new multimesh on the RenderingServer and returns an RID
handle. This RID will be used in all multimesh_*
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 a vec4
in the shader. Equivalent to setInstanceCustomData(instance:customData:)
.
static func multimeshInstanceSetTransform(multimesh: RID, index: Int32, transform: Transform3D)
Sets the Transform3D
for this instance. Equivalent to setInstanceTransform(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 to setInstanceTransform2d(instance:transform:)
.
static func multimeshSetBuffer(multimesh: RID, buffer: PackedFloat32Array)
Set the entire data to use for drawing the multimesh
at once to buffer
(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 also multimeshGetBuffer(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 the particlesCollision
RID. Only used for attractors, not colliders. Equivalent to attenuation
.
static func particlesCollisionSetAttractorDirectionality(particlesCollision: RID, amount: Double)
Sets the directionality amount
for the 3D GPU particles attractor specified by the particlesCollision
RID. Only used for attractors, not colliders. Equivalent to directionality
.
static func particlesCollisionSetAttractorStrength(particlesCollision: RID, strength: Double)
Sets the strength
for the 3D GPU particles attractor specified by the particlesCollision
RID. Only used for attractors, not colliders. Equivalent to strength
.
static func particlesCollisionSetBoxExtents(particlesCollision: RID, extents: Vector3)
Sets the extents
for the 3D GPU particles collision by the particlesCollision
RID. Equivalent to size
, size
, size
, size
or size
depending on the particlesCollision
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 the particlesCollision
RID.
static func particlesCollisionSetCullMask(particlesCollision: RID, mask: UInt32)
Sets the cull mask
for the 3D GPU particles collision or attractor specified by the particlesCollision
RID. Equivalent to cullMask
or cullMask
depending on the particlesCollision
type.
static func particlesCollisionSetFieldTexture(particlesCollision: RID, texture: RID)
Sets the signed distance field texture
for the 3D GPU particles collision specified by the particlesCollision
RID. Equivalent to texture
or texture
depending on the particlesCollision
type.
static func particlesCollisionSetHeightFieldResolution(particlesCollision: RID, resolution: RenderingServer.ParticlesCollisionHeightfieldResolution)
Sets the heightmap resolution
for the 3D GPU particles heightfield collision specified by the particlesCollision
RID. Equivalent to resolution
.
static func particlesCollisionSetSphereRadius(particlesCollision: RID, radius: Double)
Sets the radius
for the 3D GPU particles sphere collision or attractor specified by the particlesCollision
RID. Equivalent to radius
or radius
depending on the particlesCollision
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:)
, or instancesCullRay(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
. See ParticlesDrawOrder
for options. Equivalent to drawOrder
.
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
, and drawPass4
.
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 to emitting
.
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 to fractDelta
.
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 to mode
.
static func particlesSetOneShot(particles: RID, oneShot: Bool)
If true
, particles will emit once and then stop. Equivalent to oneShot
.
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
is true
, enables trails for the particles
with the specified lengthSec
in seconds. Equivalent to trailEnabled
and trailLifetime
.
static func particlesSetTransformAlign(particles: RID, align: RenderingServer.ParticlesTransformAlign)
static func particlesSetUseLocalCoordinates(particles: RID, enable: Bool)
If true
, particles use local coordinates. If false
they use global coordinates. Equivalent to localCoords
.
static func positionalSoftShadowFilterSetQuality(_ quality: 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 to interior
.
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 to boxProjection
.
static func reflectionProbeSetEnableShadows(probe: RID, enable: Bool)
If true
, computes shadows in the reflection probe. This makes the reflection much slower to compute. Equivalent to enableShadows
.
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, specifying 512
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 also CameraAttributes
.
static func scenarioSetCompositor(scenario: RID, compositor: RID)
Sets the compositor (compositor
) that will be used with this scenario. See also Compositor
.
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
and ProjectSettings/rendering/antiAliasing/screenSpaceRoughnessLimiter/limit
.
static func setBootImage(_ image: Image?, color: Color, scale: Bool, useFilter: Bool = true)
Sets a boot image. The color defines the background color. If scale
is true
, the image will be scaled to fit the screen size. If useFilter
is true
, the image will be scaled with linear interpolation. If useFilter
is false
, 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 to true
.
static func setDefaultClearColor(_ color: 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 = 0) -> 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 = 0)
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’s resourcePath
.
static func skeletonAllocateData(skeleton: RID, bones: Int32, is2dSkeleton: Bool = false)
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 specified sky
RID. This supports built-in sky material and custom sky shaders. If bakeIrradiance
is true
, 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 also environmentBakePanorama(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 the sky
RID. Equivalent to processMode
.
static func skySetRadianceSize(sky: RID, radianceSize: Int32)
Sets the radianceSize
of the sky specified by the sky
RID (in pixels). Equivalent to radianceSize
.
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(_ quality: RenderingServer.SubSurfaceScatteringQuality)
Sets ProjectSettings/rendering/environment/subsurfaceScattering/subsurfaceScatteringQuality
to use when rendering materials that have subsurface scattering enabled.
static func subSurfaceScatteringSetScale(_ scale: Double, depthScale: Double)
Sets the ProjectSettings/rendering/environment/subsurfaceScattering/subsurfaceScatteringScale
and ProjectSettings/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 given texture
RID
.
static func texture2dLayerGet(texture: RID, layer: Int32) -> Image?
Returns an Image
instance from the given texture
RID
and layer
.
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 also texture2dPlaceholderCreate
.
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 also texture2dLayeredPlaceholderCreate(layeredType:)
static func texture2dUpdate(texture: RID, image: Image?, layer: Int32)
Updates the texture specified by the texture
RID
with the data in image
. A layer
must also be specified, which should be 0
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 texture RID
.
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 in data
. 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 = false) -> 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(_ texture: RID, srgb: Bool = false) -> RID
Returns a texture RID
that can be used with RenderingDevice
.
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 = .textureLayered2dArray) -> 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 the byTexture
RID, without changing texture
’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 = Rect2 (x: 0, y: 0, width: 0, height: 0), screen: Int32 = 0)
Copies the viewport to a region of the screen specified by rect
. If viewportSetRenderDirectToScreen(viewport:enabled:)
is true
, 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 plus getFrameSetupTimeCpu
. Unlike getFramesPerSecond
, this method will accurately reflect CPU utilization even if framerate is capped via V-Sync or maxFps
. See also viewportGetMeasuredRenderTimeGpu(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 or maxFps
. See also viewportGetMeasuredRenderTimeGpu(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 same info
s you can query (different passes will return different values). See RenderingServer.ViewportRenderInfoType
for a list of render pass types and RenderingServer.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
. Only CanvasItem
nodes with a matching rendering visibility layer will be rendered by this Viewport
.
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. See CanvasItemTextureFilter
for options.
static func viewportSetDefaultCanvasItemTextureRepeat(viewport: RID, repeat: RenderingServer.CanvasItemTextureRepeat)
Sets the default texture repeat mode for the specified viewport
RID. See CanvasItemTextureRepeat
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 using getViewportRid
). Once enabled, viewportGetMeasuredRenderTimeCpu(viewport:)
and viewportGetMeasuredRenderTimeGpu(viewport:)
will return values greater than 0.0
when queried with the given viewport
.
static func viewportSetMsaa2d(viewport: RID, msaa: RenderingServer.ViewportMSAA)
Sets the multisample anti-aliasing mode for 2D/Canvas on the specified viewport
RID. See ViewportMSAA
for options.
static func viewportSetMsaa3d(viewport: RID, msaa: RenderingServer.ViewportMSAA)
Sets the multisample anti-aliasing mode for 3D on the specified viewport
RID. See ViewportMSAA
for options.
static func viewportSetOcclusionCullingBuildQuality(_ quality: 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(_ raysPerThread: 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(_ viewport: 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 also Viewport/setPositionalShadowAtlasQuadrantSubdiv(quadrant:subdiv:)
.
static func viewportSetPositionalShadowAtlasSize(viewport: RID, size: Int32, use16Bits: Bool = false)
Sets the size
of the shadow atlas’s images (used for omni and spot lights) on the viewport specified by the viewport
RID. The value is rounded up to the nearest power of 2. If use16Bits
is true
, 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 than 1.0
can be used to speed up 3D rendering at the cost of quality (undersampling). Values greater than 1.0
are only valid for bilinear mode and can be used to improve 3D rendering quality at a high performance cost (supersampling). See also ViewportMSAA
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
and ProjectSettings/rendering/2d/sdf/scale
. This is used when sampling the signed distance field in CanvasItem
shaders as well as GPUParticles2D
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 when Camera2D
smoothing is enabled. Equivalent to ProjectSettings/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 when Camera2D
smoothing is enabled. Equivalent to ProjectSettings/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
and 0.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 to ProjectSettings/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 an RGBA16
framebuffer, while when using the Mobile renderer it will be an RGB10_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 the 0-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 as useHdr2d
.
static func viewportSetUseOcclusionCulling(viewport: RID, enable: Bool)
If true
, enables occlusion culling on the specified viewport. Equivalent to ProjectSettings/rendering/occlusionCulling/useOcclusionCulling
.
static func viewportSetUseTaa(viewport: RID, enable: Bool)
If true
, use Temporal Anti-Aliasing. Equivalent to ProjectSettings/rendering/antiAliasing/quality/useTaa
.
static func viewportSetUseXr(viewport: RID, useXr: Bool)
If true
, the viewport uses augmented or virtual reality technologies. See XRInterface
.
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 to ProjectSettings/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 specified voxelGi
’s RID
.
static func voxelGiSetDynamicRange(voxelGi: RID, range: Double)
Sets the dynamicRange
value to use on the specified voxelGi
’s RID
.
static func voxelGiSetEnergy(voxelGi: RID, energy: Double)
Sets the energy
value to use on the specified voxelGi
’s RID
.
static func voxelGiSetInterior(voxelGi: RID, enable: Bool)
Sets the interior
value to use on the specified voxelGi
’s RID
.
static func voxelGiSetNormalBias(voxelGi: RID, bias: Double)
Sets the normalBias
value to use on the specified voxelGi
’s RID
.
static func voxelGiSetPropagation(voxelGi: RID, amount: Double)
Sets the propagation
value to use on the specified voxelGi
’s RID
.
static func voxelGiSetQuality(_ quality: 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 specified voxelGi
’s RID
.
override class var godotClassName: StringName { get }
var framePostDraw: SimpleSignal { get }
Emitted at the end of the frame, after the RenderingServer has finished updating all the Viewports.
var framePreDraw: SimpleSignal { get }
Emitted at the beginning of the frame, before the RenderingServer updates all the Viewports.
enum ArrayCustomFormat
struct ArrayFormat
enum ArrayType
enum BakeChannels
enum BlendShapeMode
enum CanvasGroupMode
enum CanvasItemTextureFilter
enum CanvasItemTextureRepeat
enum CanvasLightBlendMode
enum CanvasLightMode
enum CanvasLightShadowFilter
enum CanvasOccluderPolygonCullMode
enum CanvasTextureChannel
enum CompositorEffectCallbackType
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
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 : Equatable
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.
init?(rawValue: Int64)
var debugDescription: String { get }
A textual representation of this instance, suitable for debugging
var hashValue: Int { get }
static func != (lhs: Self, rhs: Self) -> Bool
Returns a Boolean value indicating whether two values are not equal.
func hash(into hasher: inout Hasher)