RenderingServer
A low-level API for rendering resources and instances.
An ordinary MeshInstance3D already manages mesh placement and tree integration. Direct RenderingServer use lets you create an instance through a RID but requires managing its world scenario, transform, visibility and lifetime.
InstanceCreate creates an owned RID. Assign its Mesh RID and World3D.Scenario, retain strong resource references, and release the owned instance with FreeRid. A borrowed world RID does not belong to this code. The guide verifies a rendering instance; it does not implement ECS, physics or streaming.
Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.
Properties2
RenderLoopEnabledProperty
public static bool RenderLoopEnabled { get; set; }If false, disables rendering completely, but the engine logic is still being processed. You can call RenderingServer.ForceDraw to draw a frame even with rendering disabled.
SingletonProperty
public static RenderingServerInstance Singleton { get; }Methods568
AreaLightCreateRid
public static Rid AreaLightCreate();Creates a new area 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.
Once finished with your RID, you will want to free the RID using the RenderingServer's RenderingServer.FreeRid method.
To place in a scene, attach this area light to an instance using RenderingServer.InstanceSetBase using the returned RID.
Note: The equivalent node is AreaLight3D.
RidBakeRenderUV2Reckfell.Collections.Array<Image>
public static Reckfell.Collections.Array<Image> BakeRenderUV2(Rid @base, Reckfell.Collections.Array<Rid> materialOverrides, Vector2I imageSize);Bakes the material data of the Mesh passed in the base parameter with optional material_overrides to a set of Images of size image_size. Returns an array of Images containing material properties as specified in RenderingServer.BakeChannels.
| Name | Type | Default |
|---|---|---|
base | Rid | — |
materialOverrides | Reckfell.Collections.Array<Rid> | — |
imageSize | Vector2I | — |
Reckfell.Collections.Array<Image>CallOnRenderThreadvoid
public static void CallOnRenderThread(Callable callable);As the RenderingServer actual logic may run on a 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.
| Name | Type | Default |
|---|---|---|
callable | Callable | — |
CameraAttributesCreateRid
public static Rid CameraAttributesCreate();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.
Once finished with your RID, you will want to free the RID using the RenderingServer's RenderingServer.FreeRid method.
Note: The equivalent resource is CameraAttributes.
RidCameraAttributesSetAutoExposurevoid
public static void CameraAttributesSetAutoExposure(Rid cameraAttributes, bool enable, float minSensitivity, float maxSensitivity, float speed, float scale);Sets the parameters to use with the auto-exposure effect. These parameters take on the same meaning as their counterparts in CameraAttributes and CameraAttributesPractical.
| Name | Type | Default |
|---|---|---|
cameraAttributes | Rid | — |
enable | bool | — |
minSensitivity | float | — |
maxSensitivity | float | — |
speed | float | — |
scale | float | — |
CameraAttributesSetDofBlurvoid
public static void CameraAttributesSetDofBlur(Rid cameraAttributes, bool farEnable, float farDistance, float farTransition, bool nearEnable, float nearDistance, float nearTransition, float amount);Sets the parameters to use with the DOF blur effect. These parameters take on the same meaning as their counterparts in CameraAttributesPractical.
| Name | Type | Default |
|---|---|---|
cameraAttributes | Rid | — |
farEnable | bool | — |
farDistance | float | — |
farTransition | float | — |
nearEnable | bool | — |
nearDistance | float | — |
nearTransition | float | — |
amount | float | — |
CameraAttributesSetDofBlurBokehShapevoid
public static void CameraAttributesSetDofBlurBokehShape(RenderingServer.DofBokehShape shape);Sets the shape of the DOF bokeh pattern to shape. Different shapes may be used to achieve artistic effect, or to meet performance targets.
| Name | Type | Default |
|---|---|---|
shape | RenderingServer.DofBokehShape | — |
CameraAttributesSetDofBlurQualityvoid
public static void CameraAttributesSetDofBlurQuality(RenderingServer.DofBlurQuality quality, bool useJitter);Sets the quality level of the DOF blur effect to quality. use_jitter can be used to jitter samples taken during the blur pass to hide artifacts at the cost of looking more fuzzy.
| Name | Type | Default |
|---|---|---|
quality | RenderingServer.DofBlurQuality | — |
useJitter | bool | — |
CameraAttributesSetExposurevoid
public static void CameraAttributesSetExposure(Rid cameraAttributes, float multiplier, float normalization);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. The normalization factor can be calculated from exposure value (EV100) as follows:
The exposure value can be calculated from aperture (in f-stops), shutter speed (in seconds), and sensitivity (in ISO) as follows:
| Name | Type | Default |
|---|---|---|
cameraAttributes | Rid | — |
multiplier | float | — |
normalization | float | — |
CameraCreateRid
public static Rid CameraCreate();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.
Once finished with your RID, you will want to free the RID using the RenderingServer's RenderingServer.FreeRid method.
Note: The equivalent node is Camera3D.
RidCameraSetCameraAttributesvoid
public static void CameraSetCameraAttributes(Rid camera, Rid effects);Sets the camera_attributes created with RenderingServer.CameraAttributesCreate to the given camera.
| Name | Type | Default |
|---|---|---|
camera | Rid | — |
effects | Rid | — |
CameraSetCompositorvoid
public static void CameraSetCompositor(Rid camera, Rid compositor);Sets the compositor used by this camera. Equivalent to Camera3D.Compositor.
| Name | Type | Default |
|---|---|---|
camera | Rid | — |
compositor | Rid | — |
CameraSetCullMaskvoid
public static void CameraSetCullMask(Rid camera, uint layers);Sets the cull mask associated with this camera. The cull mask describes which 3D layers are rendered by this camera. Equivalent to Camera3D.CullMask.
| Name | Type | Default |
|---|---|---|
camera | Rid | — |
layers | uint | — |
CameraSetEnvironmentvoid
public static void CameraSetEnvironment(Rid camera, Rid env);Sets the environment used by this camera. Equivalent to Camera3D.Environment.
| Name | Type | Default |
|---|---|---|
camera | Rid | — |
env | Rid | — |
CameraSetFrustumvoid
public static void CameraSetFrustum(Rid camera, float size, Vector2 offset, float zNear, float zFar);Sets camera to use frustum projection. This mode allows adjusting the offset argument to create "tilted frustum" effects.
| Name | Type | Default |
|---|---|---|
camera | Rid | — |
size | float | — |
offset | Vector2 | — |
zNear | float | — |
zFar | float | — |
CameraSetOrthogonalvoid
public static void CameraSetOrthogonal(Rid camera, float size, float zNear, float zFar);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.
| Name | Type | Default |
|---|---|---|
camera | Rid | — |
size | float | — |
zNear | float | — |
zFar | float | — |
CameraSetPerspectivevoid
public static void CameraSetPerspective(Rid camera, float fovyDegrees, float zNear, float zFar);Sets camera to use perspective projection. Objects on the screen becomes smaller when they are far away.
| Name | Type | Default |
|---|---|---|
camera | Rid | — |
fovyDegrees | float | — |
zNear | float | — |
zFar | float | — |
CameraSetTransformvoid
public static void CameraSetTransform(Rid camera, Transform3D transform);Sets Transform3D of camera.
| Name | Type | Default |
|---|---|---|
camera | Rid | — |
transform | Transform3D | — |
CameraSetUseVerticalAspectvoid
public static void CameraSetUseVerticalAspect(Rid camera, bool enable);If true, preserves the horizontal aspect ratio which is equivalent to Camera3D.KeepAspectEnum.Width. If false, preserves the vertical aspect ratio which is equivalent to Camera3D.KeepAspectEnum.Height.
| Name | Type | Default |
|---|---|---|
camera | Rid | — |
enable | bool | — |
CameraSetXRProjectionsvoid
public static void CameraSetXRProjections(Rid camera, Reckfell.Collections.Array<Projection> projections, Reckfell.Collections.Array<Transform3D> offsets = null);Sets camera to use any set of projections. You can specify one projection for each view set on the viewport. If the views are offset (e.g. ocular distance) and/or skewed, this data can be provided through offsets.
| Name | Type | Default |
|---|---|---|
camera | Rid | — |
projections | Reckfell.Collections.Array<Projection> | — |
offsets | Reckfell.Collections.Array<Transform3D> | null |
CanvasCreateRid
public static Rid CanvasCreate();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.
Once finished with your RID, you will want to free the RID using the RenderingServer's RenderingServer.FreeRid method.
Canvas has no Resource or Entity equivalent.
RidCanvasItemAddAnimationSlicevoid
public static void CanvasItemAddAnimationSlice(Rid item, double animationLength, double sliceBegin, double sliceEnd, double offset = 0d);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.
| Name | Type | Default |
|---|---|---|
item | Rid | — |
animationLength | double | — |
sliceBegin | double | — |
sliceEnd | double | — |
offset | double | 0d |
CanvasItemAddCircle2 overloads
public static void CanvasItemAddCircle(Rid item, Vector2 pos, float radius, Color color);Draws a circle on the CanvasItem pointed to by the item Rid. See also CanvasItem.DrawCircle.
| Name | Type | Default |
|---|---|---|
item | Rid | — |
pos | Vector2 | — |
radius | float | — |
color | Color | — |
public static void CanvasItemAddCircle(Rid item, Vector2 pos, float radius, Color color, bool antialiased = false);Draws a circle on the CanvasItem pointed to by the item Rid. See also CanvasItem.DrawCircle.
| Name | Type | Default |
|---|---|---|
item | Rid | — |
pos | Vector2 | — |
radius | float | — |
color | Color | — |
antialiased | bool | false |
CanvasItemAddClipIgnorevoid
public static void CanvasItemAddClipIgnore(Rid item, bool ignore);If ignore is true, ignore clipping on items drawn with this canvas item until this is called again with ignore set to false.
| Name | Type | Default |
|---|---|---|
item | Rid | — |
ignore | bool | — |
CanvasItemAddEllipsevoid
public static void CanvasItemAddEllipse(Rid item, Vector2 pos, float major, float minor, Color color, bool antialiased = false);Draws an ellipse with semi-major axis major and semi-minor axis minor on the CanvasItem pointed to by the item Rid. See also CanvasItem.DrawEllipse.
| Name | Type | Default |
|---|---|---|
item | Rid | — |
pos | Vector2 | — |
major | float | — |
minor | float | — |
color | Color | — |
antialiased | bool | false |
CanvasItemAddLcdTextureRectRegionvoid
public static void CanvasItemAddLcdTextureRectRegion(Rid item, Rect2 rect, Rid texture, Rect2 srcRect, Color modulate);See also CanvasItem.DrawLcdTextureRectRegion.
| Name | Type | Default |
|---|---|---|
item | Rid | — |
rect | Rect2 | — |
texture | Rid | — |
srcRect | Rect2 | — |
modulate | Color | — |
CanvasItemAddLinevoid
public static void CanvasItemAddLine(Rid item, Vector2 from, Vector2 to, Color color, float width = -1f, bool antialiased = false);Draws a line on the CanvasItem pointed to by the item Rid. See also CanvasItem.DrawLine.
| Name | Type | Default |
|---|---|---|
item | Rid | — |
from | Vector2 | — |
to | Vector2 | — |
color | Color | — |
width | float | -1f |
antialiased | bool | false |
CanvasItemAddMeshvoid
public static void CanvasItemAddMesh(Rid item, Rid mesh, Transform2D? transform = default, Color? modulate = default, Rid texture = default);Draws a mesh created with RenderingServer.MeshCreate with given transform, modulate color, and texture. This is used internally by MeshInstance2D.
| Name | Type | Default |
|---|---|---|
item | Rid | — |
mesh | Rid | — |
transform | Transform2D? | default |
modulate | Color? | default |
texture | Rid | default |
transformIf the parameter is null, then the default value is Transform2D.Identity.
modulateIf the parameter is null, then the default value is new Color(1.0f, 1.0f, 1.0f, 1.0f).
CanvasItemAddMsdfTextureRectRegionvoid
public static void CanvasItemAddMsdfTextureRectRegion(Rid item, Rect2 rect, Rid texture, Rect2 srcRect, Color? modulate = default, int outlineSize = 0, float pxRange = 1f, float scale = 1f);See also CanvasItem.DrawMsdfTextureRectRegion.
| Name | Type | Default |
|---|---|---|
item | Rid | — |
rect | Rect2 | — |
texture | Rid | — |
srcRect | Rect2 | — |
modulate | Color? | default |
outlineSize | int | 0 |
pxRange | float | 1f |
scale | float | 1f |
modulateIf the parameter is null, then the default value is new Color(1.0f, 1.0f, 1.0f, 1.0f).
CanvasItemAddMultiline4 overloads
public static void CanvasItemAddMultiline(Rid item, Vector2[] points, Color[] colors, float width);Draws a 2D multiline on the CanvasItem pointed to by the item Rid. See also CanvasItem.DrawMultiline and CanvasItem.DrawMultilineColors.
| Name | Type | Default |
|---|---|---|
item | Rid | — |
points | Vector2[] | — |
colors | Color[] | — |
width | float | — |
public static void CanvasItemAddMultiline(Rid item, Vector2[] points, Color[] colors, float width = -1f, bool antialiased = false);Draws a 2D multiline on the CanvasItem pointed to by the item Rid. See also CanvasItem.DrawMultiline and CanvasItem.DrawMultilineColors.
| Name | Type | Default |
|---|---|---|
item | Rid | — |
points | Vector2[] | — |
colors | Color[] | — |
width | float | -1f |
antialiased | bool | false |
public static void CanvasItemAddMultiline(Rid item, ReadOnlySpan<Vector2> points, ReadOnlySpan<Color> colors, float width);Draws a 2D multiline on the CanvasItem pointed to by the item Rid. See also CanvasItem.DrawMultiline and CanvasItem.DrawMultilineColors.
| Name | Type | Default |
|---|---|---|
item | Rid | — |
points | ReadOnlySpan<Vector2> | — |
colors | ReadOnlySpan<Color> | — |
width | float | — |
public static void CanvasItemAddMultiline(Rid item, ReadOnlySpan<Vector2> points, ReadOnlySpan<Color> colors, float width, bool antialiased);Draws a 2D multiline on the CanvasItem pointed to by the item Rid. See also CanvasItem.DrawMultiline and CanvasItem.DrawMultilineColors.
| Name | Type | Default |
|---|---|---|
item | Rid | — |
points | ReadOnlySpan<Vector2> | — |
colors | ReadOnlySpan<Color> | — |
width | float | — |
antialiased | bool | — |
CanvasItemAddMultimeshvoid
public static void CanvasItemAddMultimesh(Rid item, Rid mesh, Rid texture = default);Draws a 2D MultiMesh on the CanvasItem pointed to by the item Rid. See also CanvasItem.DrawMultimesh.
| Name | Type | Default |
|---|---|---|
item | Rid | — |
mesh | Rid | — |
texture | Rid | default |
CanvasItemAddNinePatchvoid
public static void CanvasItemAddNinePatch(Rid item, Rect2 rect, Rect2 source, Rid texture, Vector2 topleft, Vector2 bottomright, RenderingServer.NinePatchAxisMode xAxisMode = RenderingServer.NinePatchAxisMode.Stretch, RenderingServer.NinePatchAxisMode yAxisMode = RenderingServer.NinePatchAxisMode.Stretch, bool drawCenter = true, Color? modulate = default);Draws a nine-patch rectangle on the CanvasItem pointed to by the item Rid.
| Name | Type | Default |
|---|---|---|
item | Rid | — |
rect | Rect2 | — |
source | Rect2 | — |
texture | Rid | — |
topleft | Vector2 | — |
bottomright | Vector2 | — |
xAxisMode | RenderingServer.NinePatchAxisMode | RenderingServer.NinePatchAxisMode.Stretch |
yAxisMode | RenderingServer.NinePatchAxisMode | RenderingServer.NinePatchAxisMode.Stretch |
drawCenter | bool | true |
modulate | Color? | default |
modulateIf the parameter is null, then the default value is new Color(1.0f, 1.0f, 1.0f, 1.0f).
CanvasItemAddParticlesvoid
public static void CanvasItemAddParticles(Rid item, Rid particles, Rid texture);Draws particles on the CanvasItem pointed to by the item Rid.
| Name | Type | Default |
|---|---|---|
item | Rid | — |
particles | Rid | — |
texture | Rid | — |
CanvasItemAddPolygon2 overloads
public static void CanvasItemAddPolygon(Rid item, Vector2[] points, Color[] colors, Vector2[] uvs = null, Rid texture = default);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 RenderingServer.CanvasItemAddTriangleArray instead. See also CanvasItem.DrawPolygon.
Note: If you frequently redraw the same polygon with a large number of vertices, consider pre-calculating the triangulation with Geometry2D.TriangulatePolygon and using CanvasItem.DrawMesh, CanvasItem.DrawMultimesh, or RenderingServer.CanvasItemAddTriangleArray.
| Name | Type | Default |
|---|---|---|
item | Rid | — |
points | Vector2[] | — |
colors | Color[] | — |
uvs | Vector2[] | null |
texture | Rid | default |
uvsIf the parameter is null, then the default value is Array.Empty<Vector2>().
public static void CanvasItemAddPolygon(Rid item, ReadOnlySpan<Vector2> points, ReadOnlySpan<Color> colors, ReadOnlySpan<Vector2> uvs, Rid texture);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 RenderingServer.CanvasItemAddTriangleArray instead. See also CanvasItem.DrawPolygon.
Note: If you frequently redraw the same polygon with a large number of vertices, consider pre-calculating the triangulation with Geometry2D.TriangulatePolygon and using CanvasItem.DrawMesh, CanvasItem.DrawMultimesh, or RenderingServer.CanvasItemAddTriangleArray.
| Name | Type | Default |
|---|---|---|
item | Rid | — |
points | ReadOnlySpan<Vector2> | — |
colors | ReadOnlySpan<Color> | — |
uvs | ReadOnlySpan<Vector2> | — |
texture | Rid | — |
CanvasItemAddPolyline2 overloads
public static void CanvasItemAddPolyline(Rid item, Vector2[] points, Color[] colors, float width = -1f, bool antialiased = false);Draws a 2D polyline on the CanvasItem pointed to by the item Rid. See also CanvasItem.DrawPolyline and CanvasItem.DrawPolylineColors.
| Name | Type | Default |
|---|---|---|
item | Rid | — |
points | Vector2[] | — |
colors | Color[] | — |
width | float | -1f |
antialiased | bool | false |
public static void CanvasItemAddPolyline(Rid item, ReadOnlySpan<Vector2> points, ReadOnlySpan<Color> colors, float width, bool antialiased);Draws a 2D polyline on the CanvasItem pointed to by the item Rid. See also CanvasItem.DrawPolyline and CanvasItem.DrawPolylineColors.
| Name | Type | Default |
|---|---|---|
item | Rid | — |
points | ReadOnlySpan<Vector2> | — |
colors | ReadOnlySpan<Color> | — |
width | float | — |
antialiased | bool | — |
CanvasItemAddPrimitive2 overloads
public static void CanvasItemAddPrimitive(Rid item, Vector2[] points, Color[] colors, Vector2[] uvs, Rid texture);Draws a 2D primitive on the CanvasItem pointed to by the item Rid. See also CanvasItem.DrawPrimitive.
| Name | Type | Default |
|---|---|---|
item | Rid | — |
points | Vector2[] | — |
colors | Color[] | — |
uvs | Vector2[] | — |
texture | Rid | — |
public static void CanvasItemAddPrimitive(Rid item, ReadOnlySpan<Vector2> points, ReadOnlySpan<Color> colors, ReadOnlySpan<Vector2> uvs, Rid texture);Draws a 2D primitive on the CanvasItem pointed to by the item Rid. See also CanvasItem.DrawPrimitive.
| Name | Type | Default |
|---|---|---|
item | Rid | — |
points | ReadOnlySpan<Vector2> | — |
colors | ReadOnlySpan<Color> | — |
uvs | ReadOnlySpan<Vector2> | — |
texture | Rid | — |
CanvasItemAddRect2 overloads
public static void CanvasItemAddRect(Rid item, Rect2 rect, Color color);Draws a rectangle on the CanvasItem pointed to by the item Rid. See also CanvasItem.DrawRect.
| Name | Type | Default |
|---|---|---|
item | Rid | — |
rect | Rect2 | — |
color | Color | — |
public static void CanvasItemAddRect(Rid item, Rect2 rect, Color color, bool antialiased = false);Draws a rectangle on the CanvasItem pointed to by the item Rid. See also CanvasItem.DrawRect.
| Name | Type | Default |
|---|---|---|
item | Rid | — |
rect | Rect2 | — |
color | Color | — |
antialiased | bool | false |
CanvasItemAddSetTransformvoid
public static void CanvasItemAddSetTransform(Rid item, Transform2D transform);Sets a Transform2D that will be used to transform subsequent canvas item commands.
| Name | Type | Default |
|---|---|---|
item | Rid | — |
transform | Transform2D | — |
CanvasItemAddTextureRectvoid
public static void CanvasItemAddTextureRect(Rid item, Rect2 rect, Rid texture, bool tile = false, Color? modulate = default, bool transpose = false);Draws a 2D textured rectangle on the CanvasItem pointed to by the item Rid. See also CanvasItem.DrawTextureRect and Texture2D.DrawRect.
| Name | Type | Default |
|---|---|---|
item | Rid | — |
rect | Rect2 | — |
texture | Rid | — |
tile | bool | false |
modulate | Color? | default |
transpose | bool | false |
modulateIf the parameter is null, then the default value is new Color(1.0f, 1.0f, 1.0f, 1.0f).
CanvasItemAddTextureRectRegionvoid
public static void CanvasItemAddTextureRectRegion(Rid item, Rect2 rect, Rid texture, Rect2 srcRect, Color? modulate = default, bool transpose = false, bool clipUV = true);Draws the specified region of a 2D textured rectangle on the CanvasItem pointed to by the item Rid. See also CanvasItem.DrawTextureRectRegion and Texture2D.DrawRectRegion.
| Name | Type | Default |
|---|---|---|
item | Rid | — |
rect | Rect2 | — |
texture | Rid | — |
srcRect | Rect2 | — |
modulate | Color? | default |
transpose | bool | false |
clipUV | bool | true |
modulateIf the parameter is null, then the default value is new Color(1.0f, 1.0f, 1.0f, 1.0f).
CanvasItemAddTriangleArray2 overloads
public static void CanvasItemAddTriangleArray(Rid item, int[] indices, Vector2[] points, Color[] colors, Vector2[] uvs = null, int[] bones = null, float[] weights = null, Rid texture = default, int count = -1);Draws a triangle array on the CanvasItem pointed to by the item Rid. This is internally used by Line2D and StyleBoxFlat for rendering. RenderingServer.CanvasItemAddTriangleArray is highly flexible, but more complex to use than RenderingServer.CanvasItemAddPolygon.
Note: If count is set to a non-negative value, only the first count * 3 indices (corresponding to [code skip-lint]count` triangles) will be drawn. Otherwise, all indices are drawn.
| Name | Type | Default |
|---|---|---|
item | Rid | — |
indices | int[] | — |
points | Vector2[] | — |
colors | Color[] | — |
uvs | Vector2[] | null |
bones | int[] | null |
weights | float[] | null |
texture | Rid | default |
count | int | -1 |
uvsIf the parameter is null, then the default value is Array.Empty<Vector2>().
bonesIf the parameter is null, then the default value is Array.Empty<int>().
weightsIf the parameter is null, then the default value is Array.Empty<float>().
public static void CanvasItemAddTriangleArray(Rid item, ReadOnlySpan<int> indices, ReadOnlySpan<Vector2> points, ReadOnlySpan<Color> colors, ReadOnlySpan<Vector2> uvs, ReadOnlySpan<int> bones, ReadOnlySpan<float> weights, Rid texture, int count);Draws a triangle array on the CanvasItem pointed to by the item Rid. This is internally used by Line2D and StyleBoxFlat for rendering. RenderingServer.CanvasItemAddTriangleArray is highly flexible, but more complex to use than RenderingServer.CanvasItemAddPolygon.
Note: If count is set to a non-negative value, only the first count * 3 indices (corresponding to [code skip-lint]count` triangles) will be drawn. Otherwise, all indices are drawn.
| Name | Type | Default |
|---|---|---|
item | Rid | — |
indices | ReadOnlySpan<int> | — |
points | ReadOnlySpan<Vector2> | — |
colors | ReadOnlySpan<Color> | — |
uvs | ReadOnlySpan<Vector2> | — |
bones | ReadOnlySpan<int> | — |
weights | ReadOnlySpan<float> | — |
texture | Rid | — |
count | int | — |
CanvasItemAttachSkeletonvoid
public static void CanvasItemAttachSkeleton(Rid item, Rid skeleton);Attaches a skeleton to the CanvasItem. Removes the previous skeleton.
| Name | Type | Default |
|---|---|---|
item | Rid | — |
skeleton | Rid | — |
CanvasItemClearvoid
public static void CanvasItemClear(Rid item);Clears the CanvasItem and removes all commands in it.
| Name | Type | Default |
|---|---|---|
item | Rid | — |
CanvasItemCreateRid
public static Rid CanvasItemCreate();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.
Once finished with your RID, you will want to free the RID using the RenderingServer's RenderingServer.FreeRid method.
Note: The equivalent node is CanvasItem.
RidCanvasItemGetInstanceShaderParameterVariant
public static Variant CanvasItemGetInstanceShaderParameter(Rid instance, StringName parameter);Reads a parameter value from the canvas-item instance registry. An absent entry yields Nil; a returned value alone does not prove the name is declared by the current shader.
| Name | Type | Default |
|---|---|---|
instance | Rid | — |
parameter | StringName | — |
instanceCanvas-item RID, such as CanvasItem.GetCanvasItem().
parameterExact case-sensitive instance uniform name.
VariantInstance entry value, or Nil.
CanvasItemGetInstanceShaderParameterDefaultValueVariant
public static Variant CanvasItemGetInstanceShaderParameterDefaultValue(Rid instance, StringName parameter);Returns the declared default known to the instance registry. Can return Nil before material preparation or for an absent name; this is not the current override.
| Name | Type | Default |
|---|---|---|
instance | Rid | — |
parameter | StringName | — |
instanceCanvas-item RID, such as CanvasItem.GetCanvasItem().
parameterExact case-sensitive instance uniform name.
VariantDeclared default known to the registry, or Nil.
CanvasItemGetInstanceShaderParameterListReckfell.Collections.Array<Reckfell.Collections.Dictionary>
public static Reckfell.Collections.Array<Reckfell.Collections.Dictionary> CanvasItemGetInstanceShaderParameterList(Rid instance);Updates dirty canvas items and returns available instance-parameter descriptions. This is metadata, not a global-parameter list or ShaderMaterial values.
| Name | Type | Default |
|---|---|---|
instance | Rid | — |
instanceCanvas-item RID, such as CanvasItem.GetCanvasItem().
Reckfell.Collections.Array<Reckfell.Collections.Dictionary>Collection of instance-parameter metadata dictionaries.
CanvasItemResetPhysicsInterpolationvoid
public static void CanvasItemResetPhysicsInterpolation(Rid item);Prevents physics interpolation for the current physics tick. This is useful when moving a canvas item to a new location, to give an instantaneous change rather than interpolation from the previous location.
| Name | Type | Default |
|---|---|---|
item | Rid | — |
CanvasItemSetCanvasGroupModevoid
public static void CanvasItemSetCanvasGroupMode(Rid item, RenderingServer.CanvasGroupMode mode, float clearMargin = 5f, bool fitEmpty = false, float fitMargin = 0f, bool blurMipmaps = 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 RenderingServer.CanvasItemSetClip instead.
Note: The equivalent node functionality is found in CanvasGroup and CanvasItem.ClipChildren.
| Name | Type | Default |
|---|---|---|
item | Rid | — |
mode | RenderingServer.CanvasGroupMode | — |
clearMargin | float | 5f |
fitEmpty | bool | false |
fitMargin | float | 0f |
blurMipmaps | bool | false |
CanvasItemSetClipvoid
public static void CanvasItemSetClip(Rid item, bool clip);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 RenderingServer.CanvasItemSetCanvasGroupMode instead.
Note: The equivalent node functionality is found in Label.ClipText, RichTextLabel (always enabled) and more.
| Name | Type | Default |
|---|---|---|
item | Rid | — |
clip | bool | — |
CanvasItemSetCopyToBackbuffervoid
public static void CanvasItemSetCopyToBackbuffer(Rid item, bool enabled, Rect2 rect);Sets the CanvasItem to copy a rect to the backbuffer.
| Name | Type | Default |
|---|---|---|
item | Rid | — |
enabled | bool | — |
rect | Rect2 | — |
CanvasItemSetCustomRectvoid
public static void CanvasItemSetCustomRect(Rid item, bool useCustomRect, Rect2? rect = default);If use_custom_rect 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 use_custom_rect is false, automatically computes a visibility rectangle based on the canvas item's draw commands.
| Name | Type | Default |
|---|---|---|
item | Rid | — |
useCustomRect | bool | — |
rect | Rect2? | default |
rectIf the parameter is null, then the default value is new Rect2(new Vector2(0.0f, 0.0f), new Vector2(0.0f, 0.0f)).
CanvasItemSetDefaultTextureFiltervoid
public static void CanvasItemSetDefaultTextureFilter(Rid item, RenderingServer.CanvasItemTextureFilter filter);Sets the default texture filter mode for the canvas item specified by the item RID. Equivalent to CanvasItem.TextureFilter.
| Name | Type | Default |
|---|---|---|
item | Rid | — |
filter | RenderingServer.CanvasItemTextureFilter | — |
CanvasItemSetDefaultTextureRepeatvoid
public static void CanvasItemSetDefaultTextureRepeat(Rid item, RenderingServer.CanvasItemTextureRepeat repeat);Sets the default texture repeat mode for the canvas item specified by the item RID. Equivalent to CanvasItem.TextureRepeat.
| Name | Type | Default |
|---|---|---|
item | Rid | — |
repeat | RenderingServer.CanvasItemTextureRepeat | — |
CanvasItemSetDistanceFieldModevoid
public static void CanvasItemSetDistanceFieldMode(Rid item, bool enabled);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.
| Name | Type | Default |
|---|---|---|
item | Rid | — |
enabled | bool | — |
CanvasItemSetDrawBehindParentvoid
public static void CanvasItemSetDrawBehindParent(Rid item, bool enabled);If enabled is true, draws the canvas item specified by the item RID behind its parent. Equivalent to CanvasItem.ShowBehindParent.
| Name | Type | Default |
|---|---|---|
item | Rid | — |
enabled | bool | — |
CanvasItemSetDrawIndexvoid
public static void CanvasItemSetDrawIndex(Rid item, int index);Sets the index for the CanvasItem.
| Name | Type | Default |
|---|---|---|
item | Rid | — |
index | int | — |
CanvasItemSetInstanceShaderParametervoid
public static void CanvasItemSetInstanceShaderParameter(Rid instance, StringName parameter, Variant value);Writes a low-level canvas-item instance parameter value. For normal reset to the declared default use scene-level CanvasItem.SetInstanceShaderParameter with Nil: that method resolves the default first. The registry does not support Object values.
| Name | Type | Default |
|---|---|---|
instance | Rid | — |
parameter | StringName | — |
value | Variant | — |
instanceCanvas-item RID, such as CanvasItem.GetCanvasItem().
parameterExact case-sensitive instance uniform name.
valueCompatible value. Nil clears a global override; the low-level instance setter does not replace scene-level CanvasItem reset.
CanvasItemSetInterpolatedvoid
public static void CanvasItemSetInterpolated(Rid item, bool interpolated);If interpolated is true, turns on physics interpolation for the canvas item.
| Name | Type | Default |
|---|---|---|
item | Rid | — |
interpolated | bool | — |
CanvasItemSetLightMaskvoid
public static void CanvasItemSetLightMask(Rid item, int mask);Sets the light mask for the canvas item specified by the item RID. Equivalent to CanvasItem.LightMask.
| Name | Type | Default |
|---|---|---|
item | Rid | — |
mask | int | — |
CanvasItemSetMaterialvoid
public static void CanvasItemSetMaterial(Rid item, Rid material);Sets a new material to the canvas item specified by the item RID. Equivalent to CanvasItem.Material.
| Name | Type | Default |
|---|---|---|
item | Rid | — |
material | Rid | — |
CanvasItemSetModulatevoid
public static void CanvasItemSetModulate(Rid item, Color color);Multiplies the color of the canvas item specified by the item RID, while affecting its children. See also RenderingServer.CanvasItemSetSelfModulate. Equivalent to CanvasItem.Modulate.
| Name | Type | Default |
|---|---|---|
item | Rid | — |
color | Color | — |
CanvasItemSetParentvoid
public static void CanvasItemSetParent(Rid item, Rid parent);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.
| Name | Type | Default |
|---|---|---|
item | Rid | — |
parent | Rid | — |
CanvasItemSetSelfModulatevoid
public static void CanvasItemSetSelfModulate(Rid item, Color color);Multiplies the color of the canvas item specified by the item RID, without affecting its children. See also RenderingServer.CanvasItemSetModulate. Equivalent to CanvasItem.SelfModulate.
| Name | Type | Default |
|---|---|---|
item | Rid | — |
color | Color | — |
CanvasItemSetSortChildrenByYvoid
public static void CanvasItemSetSortChildrenByY(Rid item, bool enabled);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 CanvasItem.YSortEnabled.
| Name | Type | Default |
|---|---|---|
item | Rid | — |
enabled | bool | — |
CanvasItemSetTransformvoid
public static void CanvasItemSetTransform(Rid item, Transform2D transform);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 Entity2D.Transform.
| Name | Type | Default |
|---|---|---|
item | Rid | — |
transform | Transform2D | — |
CanvasItemSetUseParentMaterialvoid
public static void CanvasItemSetUseParentMaterial(Rid item, bool enabled);Sets if the CanvasItem uses its parent's material.
| Name | Type | Default |
|---|---|---|
item | Rid | — |
enabled | bool | — |
CanvasItemSetVisibilityLayervoid
public static void CanvasItemSetVisibilityLayer(Rid item, uint visibilityLayer);Sets the rendering visibility layer associated with this CanvasItem. Only Viewport nodes with a matching rendering mask will render this CanvasItem.
| Name | Type | Default |
|---|---|---|
item | Rid | — |
visibilityLayer | uint | — |
CanvasItemSetVisibilityNotifiervoid
public static void CanvasItemSetVisibilityNotifier(Rid item, bool enable, Rect2 area, Callable enterCallable, Callable exitCallable);Sets the given CanvasItem as visibility notifier. area defines the area of detecting visibility. enter_callable is called when the CanvasItem enters the screen, exit_callable is called when the CanvasItem exits the screen. If enable is false, the item will no longer function as notifier.
This method can be used to manually mimic VisibleOnScreenNotifier2D.
| Name | Type | Default |
|---|---|---|
item | Rid | — |
enable | bool | — |
area | Rect2 | — |
enterCallable | Callable | — |
exitCallable | Callable | — |
CanvasItemSetVisiblevoid
public static void CanvasItemSetVisible(Rid item, bool visible);Sets the visibility of the CanvasItem.
| Name | Type | Default |
|---|---|---|
item | Rid | — |
visible | bool | — |
CanvasItemSetZAsRelativeToParentvoid
public static void CanvasItemSetZAsRelativeToParent(Rid item, bool enabled);If this is enabled, the Z index of the parent will be added to the children's Z index.
| Name | Type | Default |
|---|---|---|
item | Rid | — |
enabled | bool | — |
CanvasItemSetZIndexvoid
public static void CanvasItemSetZIndex(Rid item, int zIndex);Sets the CanvasItem's Z index, i.e. its draw order (lower indexes are drawn first).
| Name | Type | Default |
|---|---|---|
item | Rid | — |
zIndex | int | — |
CanvasItemTransformPhysicsInterpolationvoid
public static void CanvasItemTransformPhysicsInterpolation(Rid item, Transform2D transform);Transforms both the current and previous stored transform for a canvas item. This allows transforming a canvas item without creating a "glitch" in the interpolation, which is particularly useful for large worlds utilizing a shifting origin.
| Name | Type | Default |
|---|---|---|
item | Rid | — |
transform | Transform2D | — |
CanvasLightAttachToCanvasvoid
public static void CanvasLightAttachToCanvas(Rid light, Rid canvas);Attaches the canvas light to the canvas. Removes it from its previous canvas.
| Name | Type | Default |
|---|---|---|
light | Rid | — |
canvas | Rid | — |
CanvasLightCreateRid
public static Rid CanvasLightCreate();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.
Once finished with your RID, you will want to free the RID using the RenderingServer's RenderingServer.FreeRid method.
Note: The equivalent node is Light2D.
RidCanvasLightOccluderAttachToCanvasvoid
public static void CanvasLightOccluderAttachToCanvas(Rid occluder, Rid canvas);Attaches a light occluder to the canvas. Removes it from its previous canvas.
| Name | Type | Default |
|---|---|---|
occluder | Rid | — |
canvas | Rid | — |
CanvasLightOccluderCreateRid
public static Rid CanvasLightOccluderCreate();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.
Once finished with your RID, you will want to free the RID using the RenderingServer's RenderingServer.FreeRid method.
Note: The equivalent node is LightOccluder2D.
RidCanvasLightOccluderResetPhysicsInterpolationvoid
public static void CanvasLightOccluderResetPhysicsInterpolation(Rid occluder);Prevents physics interpolation for the current physics tick. This is useful when moving an occluder to a new location, to give an instantaneous change rather than interpolation from the previous location.
| Name | Type | Default |
|---|---|---|
occluder | Rid | — |
CanvasLightOccluderSetAsSdfCollisionvoid
public static void CanvasLightOccluderSetAsSdfCollision(Rid occluder, bool enable);Enables or disables using the light occluder as a signed distance field for 2D particle collision.
| Name | Type | Default |
|---|---|---|
occluder | Rid | — |
enable | bool | — |
CanvasLightOccluderSetEnabledvoid
public static void CanvasLightOccluderSetEnabled(Rid occluder, bool enabled);Enables or disables light occluder.
| Name | Type | Default |
|---|---|---|
occluder | Rid | — |
enabled | bool | — |
CanvasLightOccluderSetInterpolatedvoid
public static void CanvasLightOccluderSetInterpolated(Rid occluder, bool interpolated);If interpolated is true, turns on physics interpolation for the light occluder.
| Name | Type | Default |
|---|---|---|
occluder | Rid | — |
interpolated | bool | — |
CanvasLightOccluderSetLightMaskvoid
public static void CanvasLightOccluderSetLightMask(Rid occluder, int mask);The light mask. See LightOccluder2D for more information on light masks.
| Name | Type | Default |
|---|---|---|
occluder | Rid | — |
mask | int | — |
CanvasLightOccluderSetPolygonvoid
public static void CanvasLightOccluderSetPolygon(Rid occluder, Rid polygon);Sets a light occluder's polygon.
| Name | Type | Default |
|---|---|---|
occluder | Rid | — |
polygon | Rid | — |
CanvasLightOccluderSetTransformvoid
public static void CanvasLightOccluderSetTransform(Rid occluder, Transform2D transform);Sets a light occluder's Transform2D.
| Name | Type | Default |
|---|---|---|
occluder | Rid | — |
transform | Transform2D | — |
CanvasLightOccluderTransformPhysicsInterpolationvoid
public static void CanvasLightOccluderTransformPhysicsInterpolation(Rid occluder, Transform2D transform);Transforms both the current and previous stored transform for a light occluder. This allows transforming an occluder without creating a "glitch" in the interpolation, which is particularly useful for large worlds utilizing a shifting origin.
| Name | Type | Default |
|---|---|---|
occluder | Rid | — |
transform | Transform2D | — |
CanvasLightResetPhysicsInterpolationvoid
public static void CanvasLightResetPhysicsInterpolation(Rid light);Prevents physics interpolation for the current physics tick. This is useful when moving a canvas item to a new location, to give an instantaneous change rather than interpolation from the previous location.
| Name | Type | Default |
|---|---|---|
light | Rid | — |
CanvasLightSetBlendModevoid
public static void CanvasLightSetBlendMode(Rid light, RenderingServer.CanvasLightBlendMode mode);Sets the blend mode for the given canvas light to mode. Equivalent to Light2D.BlendMode.
| Name | Type | Default |
|---|---|---|
light | Rid | — |
mode | RenderingServer.CanvasLightBlendMode | — |
CanvasLightSetColorvoid
public static void CanvasLightSetColor(Rid light, Color color);Sets the color for a light.
| Name | Type | Default |
|---|---|---|
light | Rid | — |
color | Color | — |
CanvasLightSetEnabledvoid
public static void CanvasLightSetEnabled(Rid light, bool enabled);Enables or disables a canvas light.
| Name | Type | Default |
|---|---|---|
light | Rid | — |
enabled | bool | — |
CanvasLightSetEnergyvoid
public static void CanvasLightSetEnergy(Rid light, float energy);Sets a canvas light's energy.
| Name | Type | Default |
|---|---|---|
light | Rid | — |
energy | float | — |
CanvasLightSetHeightvoid
public static void CanvasLightSetHeight(Rid light, float height);Sets a canvas light's height.
| Name | Type | Default |
|---|---|---|
light | Rid | — |
height | float | — |
CanvasLightSetInterpolatedvoid
public static void CanvasLightSetInterpolated(Rid light, bool interpolated);If interpolated is true, turns on physics interpolation for the canvas light.
| Name | Type | Default |
|---|---|---|
light | Rid | — |
interpolated | bool | — |
CanvasLightSetItemCullMaskvoid
public static void CanvasLightSetItemCullMask(Rid light, int mask);The light mask. See LightOccluder2D for more information on light masks.
| Name | Type | Default |
|---|---|---|
light | Rid | — |
mask | int | — |
CanvasLightSetItemShadowCullMaskvoid
public static void CanvasLightSetItemShadowCullMask(Rid light, int mask);The binary mask used to determine which layers this canvas light's shadows affects. See LightOccluder2D for more information on light masks.
| Name | Type | Default |
|---|---|---|
light | Rid | — |
mask | int | — |
CanvasLightSetLayerRangevoid
public static void CanvasLightSetLayerRange(Rid light, int minLayer, int maxLayer);The layer range that gets rendered with this light.
| Name | Type | Default |
|---|---|---|
light | Rid | — |
minLayer | int | — |
maxLayer | int | — |
CanvasLightSetModevoid
public static void CanvasLightSetMode(Rid light, RenderingServer.CanvasLightMode mode);Sets the mode of the canvas light.
| Name | Type | Default |
|---|---|---|
light | Rid | — |
mode | RenderingServer.CanvasLightMode | — |
CanvasLightSetShadowColorvoid
public static void CanvasLightSetShadowColor(Rid light, Color color);Sets the color of the canvas light's shadow.
| Name | Type | Default |
|---|---|---|
light | Rid | — |
color | Color | — |
CanvasLightSetShadowEnabledvoid
public static void CanvasLightSetShadowEnabled(Rid light, bool enabled);Enables or disables the canvas light's shadow.
| Name | Type | Default |
|---|---|---|
light | Rid | — |
enabled | bool | — |
CanvasLightSetShadowFiltervoid
public static void CanvasLightSetShadowFilter(Rid light, RenderingServer.CanvasLightShadowFilter filter);Sets the canvas light's shadow's filter.
| Name | Type | Default |
|---|---|---|
light | Rid | — |
filter | RenderingServer.CanvasLightShadowFilter | — |
CanvasLightSetShadowSmoothvoid
public static void CanvasLightSetShadowSmooth(Rid light, float smooth);Smoothens the shadow. The lower, the smoother.
| Name | Type | Default |
|---|---|---|
light | Rid | — |
smooth | float | — |
CanvasLightSetTexturevoid
public static void CanvasLightSetTexture(Rid light, Rid texture);Sets the texture to be used by a PointLight2D. Equivalent to PointLight2D.Texture.
| Name | Type | Default |
|---|---|---|
light | Rid | — |
texture | Rid | — |
CanvasLightSetTextureOffsetvoid
public static void CanvasLightSetTextureOffset(Rid light, Vector2 offset);Sets the offset of a PointLight2D's texture. Equivalent to PointLight2D.Offset.
| Name | Type | Default |
|---|---|---|
light | Rid | — |
offset | Vector2 | — |
CanvasLightSetTextureScalevoid
public static void CanvasLightSetTextureScale(Rid light, float scale);Sets the scale factor of a PointLight2D's texture. Equivalent to PointLight2D.TextureScale.
| Name | Type | Default |
|---|---|---|
light | Rid | — |
scale | float | — |
CanvasLightSetTransformvoid
public static void CanvasLightSetTransform(Rid light, Transform2D transform);Sets the canvas light's Transform2D.
| Name | Type | Default |
|---|---|---|
light | Rid | — |
transform | Transform2D | — |
CanvasLightSetZRangevoid
public static void CanvasLightSetZRange(Rid light, int minZ, int maxZ);Sets the Z range of objects that will be affected by this light. Equivalent to Light2D.RangeZMin and Light2D.RangeZMax.
| Name | Type | Default |
|---|---|---|
light | Rid | — |
minZ | int | — |
maxZ | int | — |
CanvasLightTransformPhysicsInterpolationvoid
public static void CanvasLightTransformPhysicsInterpolation(Rid light, Transform2D transform);Transforms both the current and previous stored transform for a canvas light. This allows transforming a light without creating a "glitch" in the interpolation, which is particularly useful for large worlds utilizing a shifting origin.
| Name | Type | Default |
|---|---|---|
light | Rid | — |
transform | Transform2D | — |
CanvasOccluderPolygonCreateRid
public static Rid CanvasOccluderPolygonCreate();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.
Once finished with your RID, you will want to free the RID using the RenderingServer's RenderingServer.FreeRid method.
Note: The equivalent resource is OccluderPolygon2D.
RidCanvasOccluderPolygonSetCullModevoid
public static void CanvasOccluderPolygonSetCullMode(Rid occluderPolygon, RenderingServer.CanvasOccluderPolygonCullMode mode);Sets an occluder polygon's cull mode.
| Name | Type | Default |
|---|---|---|
occluderPolygon | Rid | — |
mode | RenderingServer.CanvasOccluderPolygonCullMode | — |
CanvasOccluderPolygonSetShape2 overloads
public static void CanvasOccluderPolygonSetShape(Rid occluderPolygon, Vector2[] shape, bool closed);Sets the shape of the occluder polygon.
| Name | Type | Default |
|---|---|---|
occluderPolygon | Rid | — |
shape | Vector2[] | — |
closed | bool | — |
public static void CanvasOccluderPolygonSetShape(Rid occluderPolygon, ReadOnlySpan<Vector2> shape, bool closed);Sets the shape of the occluder polygon.
| Name | Type | Default |
|---|---|---|
occluderPolygon | Rid | — |
shape | ReadOnlySpan<Vector2> | — |
closed | bool | — |
CanvasSetDisableScalevoid
public static void CanvasSetDisableScale(bool disable);If disable is true, makes 2D rendering ignore the canvas scale defined for each canvas layer. This affects CanvasLayers with the CanvasLayer.FollowViewportEnabled property set to true.
In the editor, this is set to true by default, and set to false when View > Preview Canvas Scale is enabled at the top of the 2D editor viewport.
Note: Setting this to true does not impact the behavior of CanvasLayer.Scale, Entity2D.Scale, or Control.Scale.
| Name | Type | Default |
|---|---|---|
disable | bool | — |
CanvasSetItemMirroringvoid
public static void CanvasSetItemMirroring(Rid canvas, Rid item, Vector2 mirroring);A copy of the canvas item will be drawn with a local offset of the mirroring.
Note: This is equivalent to calling RenderingServer.CanvasSetItemRepeat like canvas_set_item_repeat(item, mirroring, 1), with an additional check ensuring canvas is a parent of item.
| Name | Type | Default |
|---|---|---|
canvas | Rid | — |
item | Rid | — |
mirroring | Vector2 | — |
CanvasSetItemRepeatvoid
public static void CanvasSetItemRepeat(Rid item, Vector2 repeatSize, int repeatTimes);A copy of the canvas item will be drawn with a local offset of the repeat_size by the number of times of the repeat_times. As the repeat_times increases, the copies will spread away from the origin texture.
| Name | Type | Default |
|---|---|---|
item | Rid | — |
repeatSize | Vector2 | — |
repeatTimes | int | — |
CanvasSetModulatevoid
public static void CanvasSetModulate(Rid canvas, Color color);Modulates all colors in the given canvas.
| Name | Type | Default |
|---|---|---|
canvas | Rid | — |
color | Color | — |
CanvasSetShadowTextureSizevoid
public static void CanvasSetShadowTextureSize(int size);Sets the ProjectSettings.rendering/2d/shadow_atlas/size to use for Light2D shadow rendering (in pixels). The value is rounded up to the nearest power of 2.
| Name | Type | Default |
|---|---|---|
size | int | — |
CanvasTextureCreateRid
public static Rid CanvasTextureCreate();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.
Once finished with your RID, you will want to free the RID using the RenderingServer's RenderingServer.FreeRid method. See also RenderingServer.Texture2DCreate.
Note: The equivalent resource is CanvasTexture and is only meant to be used in 2D rendering, not 3D.
RidCanvasTextureSetChannelvoid
public static void CanvasTextureSetChannel(Rid canvasTexture, RenderingServer.CanvasTextureChannel channel, Rid texture);Sets the channel's texture for the canvas texture specified by the canvas_texture RID. Equivalent to CanvasTexture.DiffuseTexture, CanvasTexture.NormalTexture and CanvasTexture.SpecularTexture.
| Name | Type | Default |
|---|---|---|
canvasTexture | Rid | — |
channel | RenderingServer.CanvasTextureChannel | — |
texture | Rid | — |
CanvasTextureSetShadingParametersvoid
public static void CanvasTextureSetShadingParameters(Rid canvasTexture, Color baseColor, float shininess);Sets the base_color and shininess to use for the canvas texture specified by the canvas_texture RID. Equivalent to CanvasTexture.SpecularColor and CanvasTexture.SpecularShininess.
| Name | Type | Default |
|---|---|---|
canvasTexture | Rid | — |
baseColor | Color | — |
shininess | float | — |
CanvasTextureSetTextureFiltervoid
public static void CanvasTextureSetTextureFilter(Rid canvasTexture, RenderingServer.CanvasItemTextureFilter filter);Sets the texture filter mode to use for the canvas texture specified by the canvas_texture RID.
| Name | Type | Default |
|---|---|---|
canvasTexture | Rid | — |
filter | RenderingServer.CanvasItemTextureFilter | — |
CanvasTextureSetTextureRepeatvoid
public static void CanvasTextureSetTextureRepeat(Rid canvasTexture, RenderingServer.CanvasItemTextureRepeat repeat);Sets the texture repeat mode to use for the canvas texture specified by the canvas_texture RID.
| Name | Type | Default |
|---|---|---|
canvasTexture | Rid | — |
repeat | RenderingServer.CanvasItemTextureRepeat | — |
CompositorCreateRid
public static Rid CompositorCreate();Creates a new compositor and adds it to the RenderingServer. It can be accessed with the RID that is returned.
Once finished with your RID, you will want to free the RID using the RenderingServer's RenderingServer.FreeRid method.
RidCompositorEffectCreateRid
public static Rid CompositorEffectCreate();Creates a new rendering effect and adds it to the RenderingServer. It can be accessed with the RID that is returned.
Once finished with your RID, you will want to free the RID using the RenderingServer's RenderingServer.FreeRid method.
RidCompositorEffectSetCallbackvoid
public static void CompositorEffectSetCallback(Rid effect, RenderingServer.CompositorEffectCallbackType callbackType, Callable callback);Sets the callback type (callback_type) and callback method(callback) for this rendering effect.
| Name | Type | Default |
|---|---|---|
effect | Rid | — |
callbackType | RenderingServer.CompositorEffectCallbackType | — |
callback | Callable | — |
CompositorEffectSetEnabledvoid
public static void CompositorEffectSetEnabled(Rid effect, bool enabled);Enables/disables this rendering effect.
| Name | Type | Default |
|---|---|---|
effect | Rid | — |
enabled | bool | — |
CompositorEffectSetFlagvoid
public static void CompositorEffectSetFlag(Rid effect, RenderingServer.CompositorEffectFlags flag, bool set);Sets the flag (flag) for this rendering effect to true or false (set).
| Name | Type | Default |
|---|---|---|
effect | Rid | — |
flag | RenderingServer.CompositorEffectFlags | — |
set | bool | — |
CompositorSetCompositorEffectsvoid
public static void CompositorSetCompositorEffects(Rid compositor, Reckfell.Collections.Array<Rid> effects);Sets the compositor effects for the specified compositor RID. effects should be an array containing RIDs created with RenderingServer.CompositorEffectCreate.
| Name | Type | Default |
|---|---|---|
compositor | Rid | — |
effects | Reckfell.Collections.Array<Rid> | — |
CreateLocalRenderingDeviceRenderingDevice
public static RenderingDevice CreateLocalRenderingDevice();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.
Note: When using the OpenGL rendering driver or when running in headless mode, this function always returns null.
RenderingDeviceDebugCanvasItemGetRectRect2
public static Rect2 DebugCanvasItemGetRect(Rid item);Returns the bounding rectangle for a canvas item in local space, as calculated by the renderer. This bound is used internally for culling.
Warning: This function is intended for debugging in the editor, and will pass through and return a zero Rect2 in exported projects.
| Name | Type | Default |
|---|---|---|
item | Rid | — |
Rect2DecalCreateRid
public static Rid DecalCreate();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.
Once finished with your RID, you will want to free the RID using the RenderingServer's RenderingServer.FreeRid method.
To place in a scene, attach this decal to an instance using RenderingServer.InstanceSetBase using the returned RID.
Note: The equivalent node is Decal.
RidDecalSetAlbedoMixvoid
public static void DecalSetAlbedoMix(Rid decal, float albedoMix);Sets the albedo_mix in the decal specified by the decal RID. Equivalent to Decal.AlbedoMix.
| Name | Type | Default |
|---|---|---|
decal | Rid | — |
albedoMix | float | — |
DecalSetCullMaskvoid
public static void DecalSetCullMask(Rid decal, uint mask);Sets the cull mask in the decal specified by the decal RID. Equivalent to Decal.CullMask.
| Name | Type | Default |
|---|---|---|
decal | Rid | — |
mask | uint | — |
DecalSetDistanceFadevoid
public static void DecalSetDistanceFade(Rid decal, bool enabled, float begin, float length);Sets the distance fade parameters in the decal specified by the decal RID. Equivalent to Decal.DistanceFadeEnabled, Decal.DistanceFadeBegin and Decal.DistanceFadeLength.
| Name | Type | Default |
|---|---|---|
decal | Rid | — |
enabled | bool | — |
begin | float | — |
length | float | — |
DecalSetEmissionEnergyvoid
public static void DecalSetEmissionEnergy(Rid decal, float energy);Sets the emission energy in the decal specified by the decal RID. Equivalent to Decal.EmissionEnergy.
| Name | Type | Default |
|---|---|---|
decal | Rid | — |
energy | float | — |
DecalSetFadevoid
public static void DecalSetFade(Rid decal, float above, float below);Sets the upper fade (above) and lower fade (below) in the decal specified by the decal RID. Equivalent to Decal.UpperFade and Decal.LowerFade.
| Name | Type | Default |
|---|---|---|
decal | Rid | — |
above | float | — |
below | float | — |
DecalSetModulatevoid
public static void DecalSetModulate(Rid decal, Color color);Sets the color multiplier in the decal specified by the decal RID to color. Equivalent to Decal.Modulate.
| Name | Type | Default |
|---|---|---|
decal | Rid | — |
color | Color | — |
DecalSetNormalFadevoid
public static void DecalSetNormalFade(Rid decal, float fade);Sets the normal fade in the decal specified by the decal RID. Equivalent to Decal.NormalFade.
| Name | Type | Default |
|---|---|---|
decal | Rid | — |
fade | float | — |
DecalSetSizevoid
public static void DecalSetSize(Rid decal, Vector3 size);Sets the size of the decal specified by the decal RID. Equivalent to Decal.Size.
| Name | Type | Default |
|---|---|---|
decal | Rid | — |
size | Vector3 | — |
DecalSetTexturevoid
public static void DecalSetTexture(Rid decal, RenderingServer.DecalTexture type, Rid texture);Sets the texture in the given texture type slot for the specified decal. Equivalent to Decal.SetTexture.
| Name | Type | Default |
|---|---|---|
decal | Rid | — |
type | RenderingServer.DecalTexture | — |
texture | Rid | — |
DecalsSetFiltervoid
public static void DecalsSetFilter(RenderingServer.DecalFilter filter);Sets the texture filter mode to use when rendering decals. This parameter is global and cannot be set on a per-decal basis.
| Name | Type | Default |
|---|---|---|
filter | RenderingServer.DecalFilter | — |
DirectionalLightCreateRid
public static Rid DirectionalLightCreate();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.
Once finished with your RID, you will want to free the RID using the RenderingServer's RenderingServer.FreeRid method.
To place in a scene, attach this directional light to an instance using RenderingServer.InstanceSetBase using the returned RID.
Note: The equivalent node is DirectionalLight3D.
RidDirectionalShadowAtlasSetSizevoid
public static void DirectionalShadowAtlasSetSize(int size, bool is16Bits);Sets the size of the directional light shadows in 3D. See also ProjectSettings.rendering/lights_and_shadows/directional_shadow/size. This parameter is global and cannot be set on a per-viewport basis.
| Name | Type | Default |
|---|---|---|
size | int | — |
is16Bits | bool | — |
DirectionalSoftShadowFilterSetQualityvoid
public static void DirectionalSoftShadowFilterSetQuality(RenderingServer.ShadowQuality quality);Sets the filter quality for directional light shadows in 3D. See also ProjectSettings.rendering/lights_and_shadows/directional_shadow/soft_shadow_filter_quality. This parameter is global and cannot be set on a per-viewport basis.
| Name | Type | Default |
|---|---|---|
quality | RenderingServer.ShadowQuality | — |
EnvironmentBakePanoramaImage
public static Image EnvironmentBakePanorama(Rid environment, bool bakeIrradiance, Vector2I size);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 bake_irradiance 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 RenderingServer.SkyBakePanorama.
Note: The image is saved using linear encoding without any tonemapping performed, which means it will look too dark if viewed directly in an image editor.
Note: size should be a 2:1 aspect ratio for the generated panorama to have square pixels. For radiance maps, there is no point in using a height greater than Sky.RadianceSize, as it won't increase detail. Irradiance maps only contain low-frequency data, so there is usually no point in going past a size of 128×64 pixels when saving an irradiance map.
| Name | Type | Default |
|---|---|---|
environment | Rid | — |
bakeIrradiance | bool | — |
size | Vector2I | — |
ImageEnvironmentCreateRid
public static Rid EnvironmentCreate();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.
Once finished with your RID, you will want to free the RID using the RenderingServer's RenderingServer.FreeRid method.
Note: The equivalent resource is Environment.
RidEnvironmentGlowSetUseBicubicUpscalevoid
public static void EnvironmentGlowSetUseBicubicUpscale(bool enable);If enable is true, enables bicubic upscaling for glow which improves quality at the cost of performance. Equivalent to ProjectSettings.rendering/environment/glow/upscale_mode.
Note: This setting is only effective when using the Forward+ or Mobile rendering methods, as Compatibility uses a different glow implementation.
| Name | Type | Default |
|---|---|---|
enable | bool | — |
EnvironmentSetAdjustmentvoid
public static void EnvironmentSetAdjustment(Rid env, bool enable, float brightness, float contrast, float saturation, bool use1DColorCorrection, Rid colorCorrection);Sets the values to be used with the "adjustments" post-process effect. See Environment for more details.
| Name | Type | Default |
|---|---|---|
env | Rid | — |
enable | bool | — |
brightness | float | — |
contrast | float | — |
saturation | float | — |
use1DColorCorrection | bool | — |
colorCorrection | Rid | — |
EnvironmentSetAmbientLightvoid
public static void EnvironmentSetAmbientLight(Rid env, Color color, RenderingServer.EnvironmentAmbientSource ambient = RenderingServer.EnvironmentAmbientSource.Bg, float energy = 1f, float skyContribution = 0f, RenderingServer.EnvironmentReflectionSource reflectionSource = RenderingServer.EnvironmentReflectionSource.Bg);Sets the values to be used for ambient light rendering. See Environment for more details.
| Name | Type | Default |
|---|---|---|
env | Rid | — |
color | Color | — |
ambient | RenderingServer.EnvironmentAmbientSource | RenderingServer.EnvironmentAmbientSource.Bg |
energy | float | 1f |
skyContribution | float | 0f |
reflectionSource | RenderingServer.EnvironmentReflectionSource | RenderingServer.EnvironmentReflectionSource.Bg |
EnvironmentSetBackgroundvoid
public static void EnvironmentSetBackground(Rid env, RenderingServer.EnvironmentBG bg);Sets the environment's background mode. Equivalent to Environment.BackgroundMode.
| Name | Type | Default |
|---|---|---|
env | Rid | — |
bg | RenderingServer.EnvironmentBG | — |
EnvironmentSetBgColorvoid
public static void EnvironmentSetBgColor(Rid env, Color color);Color displayed for clear areas of the scene. Only effective if using the RenderingServer.EnvironmentBG.Color background mode.
| Name | Type | Default |
|---|---|---|
env | Rid | — |
color | Color | — |
EnvironmentSetBgEnergyvoid
public static void EnvironmentSetBgEnergy(Rid env, float multiplier, float exposureValue);Sets the intensity of the background color.
| Name | Type | Default |
|---|---|---|
env | Rid | — |
multiplier | float | — |
exposureValue | float | — |
EnvironmentSetCameraIdvoid
public static void EnvironmentSetCameraId(Rid env, int id);Sets the camera ID to be used as environment background.
| Name | Type | Default |
|---|---|---|
env | Rid | — |
id | int | — |
EnvironmentSetCanvasMaxLayervoid
public static void EnvironmentSetCanvasMaxLayer(Rid env, int maxLayer);Sets the maximum layer to use if using Canvas background mode.
| Name | Type | Default |
|---|---|---|
env | Rid | — |
maxLayer | int | — |
EnvironmentSetFog2 overloads
public static void EnvironmentSetFog(Rid env, bool enable, Color lightColor, float lightEnergy, float sunScatter, float density, float height, float heightDensity, float aerialPerspective, float skyAffect);Configures fog for the specified environment RID. See fog_* properties in Environment for more information.
| Name | Type | Default |
|---|---|---|
env | Rid | — |
enable | bool | — |
lightColor | Color | — |
lightEnergy | float | — |
sunScatter | float | — |
density | float | — |
height | float | — |
heightDensity | float | — |
aerialPerspective | float | — |
skyAffect | float | — |
public static void EnvironmentSetFog(Rid env, bool enable, Color lightColor, float lightEnergy, float sunScatter, float density, float height, float heightDensity, float aerialPerspective, float skyAffect, RenderingServer.EnvironmentFogMode fogMode = RenderingServer.EnvironmentFogMode.Exponential);Configures fog for the specified environment RID. See fog_* properties in Environment for more information.
| Name | Type | Default |
|---|---|---|
env | Rid | — |
enable | bool | — |
lightColor | Color | — |
lightEnergy | float | — |
sunScatter | float | — |
density | float | — |
height | float | — |
heightDensity | float | — |
aerialPerspective | float | — |
skyAffect | float | — |
fogMode | RenderingServer.EnvironmentFogMode | RenderingServer.EnvironmentFogMode.Exponential |
EnvironmentSetFogDepthvoid
public static void EnvironmentSetFogDepth(Rid env, float curve, float begin, float end);Configures fog depth for the specified environment RID. Only has an effect when the fog mode of the environment is RenderingServer.EnvironmentFogMode.Depth. See fog_depth_* properties in Environment for more information.
| Name | Type | Default |
|---|---|---|
env | Rid | — |
curve | float | — |
begin | float | — |
end | float | — |
EnvironmentSetGlow2 overloads
public static void EnvironmentSetGlow(Rid env, bool enable, ReadOnlySpan<float> levels, float intensity, float strength, float mix, float bloomThreshold, RenderingServer.EnvironmentGlowBlendMode blendMode, float hdrBleedThreshold, float hdrBleedScale, float hdrLuminanceCap, float glowMapStrength, Rid glowMap);Configures glow for the specified environment RID. See glow_* properties in Environment for more information.
| Name | Type | Default |
|---|---|---|
env | Rid | — |
enable | bool | — |
levels | ReadOnlySpan<float> | — |
intensity | float | — |
strength | float | — |
mix | float | — |
bloomThreshold | float | — |
blendMode | RenderingServer.EnvironmentGlowBlendMode | — |
hdrBleedThreshold | float | — |
hdrBleedScale | float | — |
hdrLuminanceCap | float | — |
glowMapStrength | float | — |
glowMap | Rid | — |
public static void EnvironmentSetGlow(Rid env, bool enable, float[] levels, float intensity, float strength, float mix, float bloomThreshold, RenderingServer.EnvironmentGlowBlendMode blendMode, float hdrBleedThreshold, float hdrBleedScale, float hdrLuminanceCap, float glowMapStrength, Rid glowMap);Configures glow for the specified environment RID. See glow_* properties in Environment for more information.
| Name | Type | Default |
|---|---|---|
env | Rid | — |
enable | bool | — |
levels | float[] | — |
intensity | float | — |
strength | float | — |
mix | float | — |
bloomThreshold | float | — |
blendMode | RenderingServer.EnvironmentGlowBlendMode | — |
hdrBleedThreshold | float | — |
hdrBleedScale | float | — |
hdrLuminanceCap | float | — |
glowMapStrength | float | — |
glowMap | Rid | — |
EnvironmentSetSdfgivoid
public static void EnvironmentSetSdfgi(Rid env, bool enable, int cascades, float minCellSize, RenderingServer.EnvironmentSdfgiyScale yScale, bool useOcclusion, float bounceFeedback, bool readSky, float energy, float normalBias, float probeBias);Configures signed distance field global illumination for the specified environment RID. See sdfgi_* properties in Environment for more information.
| Name | Type | Default |
|---|---|---|
env | Rid | — |
enable | bool | — |
cascades | int | — |
minCellSize | float | — |
yScale | RenderingServer.EnvironmentSdfgiyScale | — |
useOcclusion | bool | — |
bounceFeedback | float | — |
readSky | bool | — |
energy | float | — |
normalBias | float | — |
probeBias | float | — |
EnvironmentSetSdfgiFramesToConvergevoid
public static void EnvironmentSetSdfgiFramesToConverge(RenderingServer.EnvironmentSdfgiFramesToConverge frames);Sets the number of frames to use for converging signed distance field global illumination. Equivalent to ProjectSettings.rendering/global_illumination/sdfgi/frames_to_converge.
| Name | Type | Default |
|---|---|---|
frames | RenderingServer.EnvironmentSdfgiFramesToConverge | — |
EnvironmentSetSdfgiFramesToUpdateLightvoid
public static void EnvironmentSetSdfgiFramesToUpdateLight(RenderingServer.EnvironmentSdfgiFramesToUpdateLight frames);Sets the update speed for dynamic lights' indirect lighting when computing signed distance field global illumination. Equivalent to ProjectSettings.rendering/global_illumination/sdfgi/frames_to_update_lights.
| Name | Type | Default |
|---|---|---|
frames | RenderingServer.EnvironmentSdfgiFramesToUpdateLight | — |
EnvironmentSetSdfgiRayCountvoid
public static void EnvironmentSetSdfgiRayCount(RenderingServer.EnvironmentSdfgiRayCount rayCount);Sets the number of rays to throw per frame when computing signed distance field global illumination. Equivalent to ProjectSettings.rendering/global_illumination/sdfgi/probe_ray_count.
| Name | Type | Default |
|---|---|---|
rayCount | RenderingServer.EnvironmentSdfgiRayCount | — |
EnvironmentSetSkyvoid
public static void EnvironmentSetSky(Rid env, Rid sky);Sets the Sky to be used as the environment's background when using BGMode sky. Equivalent to Environment.Sky.
| Name | Type | Default |
|---|---|---|
env | Rid | — |
sky | Rid | — |
EnvironmentSetSkyCustomFovvoid
public static void EnvironmentSetSkyCustomFov(Rid env, float scale);Sets a custom field of view for the background Sky. Equivalent to Environment.SkyCustomFov.
| Name | Type | Default |
|---|---|---|
env | Rid | — |
scale | float | — |
EnvironmentSetSkyOrientationvoid
public static void EnvironmentSetSkyOrientation(Rid env, Basis orientation);Sets the rotation of the background Sky expressed as a Basis. Equivalent to Environment.SkyRotation, where the rotation vector is used to construct the Basis.
| Name | Type | Default |
|---|---|---|
env | Rid | — |
orientation | Basis | — |
EnvironmentSetSsaovoid
public static void EnvironmentSetSsao(Rid env, bool enable, float radius, float intensity, float power, float detail, float horizon, float sharpness, float lightAffect, float aOChannelAffect);Sets the variables to be used with the screen-space ambient occlusion (SSAO) post-process effect. See Environment for more details.
| Name | Type | Default |
|---|---|---|
env | Rid | — |
enable | bool | — |
radius | float | — |
intensity | float | — |
power | float | — |
detail | float | — |
horizon | float | — |
sharpness | float | — |
lightAffect | float | — |
aOChannelAffect | float | — |
EnvironmentSetSsaoQualityvoid
public static void EnvironmentSetSsaoQuality(RenderingServer.EnvironmentSsaoQuality quality, bool halfSize, float adaptiveTarget, int blurPasses, float fadeOutFrom, float fadeOutTo);Sets the quality level of the screen-space ambient occlusion (SSAO) post-process effect. See Environment for more details.
| Name | Type | Default |
|---|---|---|
quality | RenderingServer.EnvironmentSsaoQuality | — |
halfSize | bool | — |
adaptiveTarget | float | — |
blurPasses | int | — |
fadeOutFrom | float | — |
fadeOutTo | float | — |
EnvironmentSetSsilQualityvoid
public static void EnvironmentSetSsilQuality(RenderingServer.EnvironmentSsilQuality quality, bool halfSize, float adaptiveTarget, int blurPasses, float fadeOutFrom, float fadeOutTo);Sets the quality level of the screen-space indirect lighting (SSIL) post-process effect. See Environment for more details.
| Name | Type | Default |
|---|---|---|
quality | RenderingServer.EnvironmentSsilQuality | — |
halfSize | bool | — |
adaptiveTarget | float | — |
blurPasses | int | — |
fadeOutFrom | float | — |
fadeOutTo | float | — |
EnvironmentSetSsrvoid
public static void EnvironmentSetSsr(Rid env, bool enable, int maxSteps, float fadeIn, float fadeOut, float depthTolerance);Sets the variables to be used with the screen-space reflections (SSR) post-process effect. See Environment for more details.
| Name | Type | Default |
|---|---|---|
env | Rid | — |
enable | bool | — |
maxSteps | int | — |
fadeIn | float | — |
fadeOut | float | — |
depthTolerance | float | — |
EnvironmentSetSsrHalfSizevoid
public static void EnvironmentSetSsrHalfSize(bool halfSize);Sets whether screen-space reflections will be rendered at full or half size. Half size is faster, but may look pixelated or cause flickering.
| Name | Type | Default |
|---|---|---|
halfSize | bool | — |
EnvironmentSetSsrRoughnessQualityvoid · Deprecated
public static void EnvironmentSetSsrRoughnessQuality(RenderingServer.EnvironmentSsrRoughnessQuality quality);| Name | Type | Default |
|---|---|---|
quality | RenderingServer.EnvironmentSsrRoughnessQuality | — |
EnvironmentSetTonemapvoid
public static void EnvironmentSetTonemap(Rid env, RenderingServer.EnvironmentToneMapper toneMapper, float exposure, float white);Sets the variables to be used with the "tonemap" post-process effect. See Environment for more details.
| Name | Type | Default |
|---|---|---|
env | Rid | — |
toneMapper | RenderingServer.EnvironmentToneMapper | — |
exposure | float | — |
white | float | — |
EnvironmentSetTonemapAgxContrastvoid
public static void EnvironmentSetTonemapAgxContrast(Rid env, float agxContrast);See Environment.TonemapAgxContrast for more details.
| Name | Type | Default |
|---|---|---|
env | Rid | — |
agxContrast | float | — |
EnvironmentSetVolumetricFogvoid
public static void EnvironmentSetVolumetricFog(Rid env, bool enable, float density, Color albedo, Color emission, float emissionEnergy, float anisotropy, float length, float detailSpread, float gIInject, bool temporalReprojection, float temporalReprojectionAmount, float ambientInject, float skyAffect);Sets the variables to be used with the volumetric fog post-process effect. See Environment for more details.
| Name | Type | Default |
|---|---|---|
env | Rid | — |
enable | bool | — |
density | float | — |
albedo | Color | — |
emission | Color | — |
emissionEnergy | float | — |
anisotropy | float | — |
length | float | — |
detailSpread | float | — |
gIInject | float | — |
temporalReprojection | bool | — |
temporalReprojectionAmount | float | — |
ambientInject | float | — |
skyAffect | float | — |
EnvironmentSetVolumetricFogFilterActivevoid
public static void EnvironmentSetVolumetricFogFilterActive(bool active);Enables filtering of the volumetric fog scattering buffer. This results in much smoother volumes with very few under-sampling artifacts.
| Name | Type | Default |
|---|---|---|
active | bool | — |
EnvironmentSetVolumetricFogVolumeSizevoid
public static void EnvironmentSetVolumetricFogVolumeSize(int size, int depth);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.
| Name | Type | Default |
|---|---|---|
size | int | — |
depth | int | — |
FogVolumeCreateRid
public static Rid FogVolumeCreate();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.
Once finished with your RID, you will want to free the RID using the RenderingServer's RenderingServer.FreeRid method.
Note: The equivalent node is FogVolume.
RidFogVolumeSetMaterialvoid
public static void FogVolumeSetMaterial(Rid fogVolume, Rid material);Sets the Material of the fog volume. Can be either a FogMaterial or a custom ShaderMaterial.
| Name | Type | Default |
|---|---|---|
fogVolume | Rid | — |
material | Rid | — |
FogVolumeSetShapevoid
public static void FogVolumeSetShape(Rid fogVolume, RenderingServer.FogVolumeShape shape);Sets the shape of the fog volume to either RenderingServer.FogVolumeShape.Ellipsoid, RenderingServer.FogVolumeShape.Cone, RenderingServer.FogVolumeShape.Cylinder, RenderingServer.FogVolumeShape.Box or RenderingServer.FogVolumeShape.World.
| Name | Type | Default |
|---|---|---|
fogVolume | Rid | — |
shape | RenderingServer.FogVolumeShape | — |
FogVolumeSetSizevoid
public static void FogVolumeSetSize(Rid fogVolume, Vector3 size);Sets the size of the fog volume when shape is RenderingServer.FogVolumeShape.Ellipsoid, RenderingServer.FogVolumeShape.Cone, RenderingServer.FogVolumeShape.Cylinder or RenderingServer.FogVolumeShape.Box.
| Name | Type | Default |
|---|---|---|
fogVolume | Rid | — |
size | Vector3 | — |
ForceDrawvoid
public static void ForceDraw(bool swapBuffers = true, double frameStep = 0d);Forces redrawing of all viewports at once. Must be called from the main thread.
| Name | Type | Default |
|---|---|---|
swapBuffers | bool | true |
frameStep | double | 0d |
ForceSyncvoid
public static void 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.
FreeRidvoid
public static void FreeRid(Rid rid);Releases a server object owned by the caller. RID copies are not reset automatically; do not call again with a stale value.
| Name | Type | Default |
|---|---|---|
rid | Rid | — |
GISetUseHalfResolutionvoid
public static void GISetUseHalfResolution(bool halfResolution);If half_resolution is true, renders VoxelGI and SDFGI (Environment.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/global_illumination/gi/use_half_resolution.
| Name | Type | Default |
|---|---|---|
halfResolution | bool | — |
GetCurrentRenderingDriverNamestring
public static string GetCurrentRenderingDriverName();Returns the actually active graphics driver name, not the rendering method. For diagnosis, record it together with GetCurrentRenderingMethod: a method name alone does not identify the API. This Windows runtime was tested with opengl3 and vulkan; other platform drivers were not tested.
stringActive driver name, such as opengl3 or vulkan. Not a performance rating or a list of all available drivers.
GetCurrentRenderingMethodstring
public static string GetCurrentRenderingMethod();Returns the current rendering method for selecting valid settings. Does not replace device capability or rendered-output checks.
stringName such as gl_compatibility, forward_plus or mobile. The example verifies the first two on this PC, not Mobile/MetalFX/XR.
GetDefaultClearColorColor
public static Color GetDefaultClearColor();Returns the default clear color which is used when a specific clear color has not been selected. See also RenderingServer.SetDefaultClearColor.
ColorGetFrameSetupTimeCpudouble
public static double GetFrameSetupTimeCpu();Returns the time taken to setup rendering on the CPU in milliseconds. This value is shared across all viewports and does not require RenderingServer.ViewportSetMeasureRenderTime to be enabled on a viewport to be queried. See also RenderingServer.ViewportGetMeasuredRenderTimeCpu.
doubleGetRenderingDeviceRenderingDevice
public static RenderingDevice GetRenderingDevice();Returns the shared RenderingDevice used by the engine. Available in the tested Mobile/Vulkan and Forward+/Vulkan runs; absent in Compatibility/OpenGL. The headless path likewise does not provide a global graphics device. Do not free or dispose this borrowed object; it is not a local device you created.
RenderingDeviceShared device, or null when the rendering path does not provide one. Check for null before querying it; no RenderingDevice does not mean no graphics capabilities.
GetRenderingInfoulong
public static ulong GetRenderingInfo(RenderingServer.RenderingInfo info);Returns a statistic about the rendering engine which can be used for performance profiling. See also RenderingServer.ViewportGetRenderInfo, which returns information specific to a viewport.
Note: Only 3D rendering is currently taken into account by some of these values, such as the number of draw calls.
Note: Rendering information is not available until at least 2 frames have been rendered by the engine. If rendering information is not available, RenderingServer.GetRenderingInfo returns 0. To print rendering information in _ready() successfully, use the following:
| Name | Type | Default |
|---|---|---|
info | RenderingServer.RenderingInfo | — |
ulongGetShaderParameterListReckfell.Collections.Array<Reckfell.Collections.Dictionary>
public static Reckfell.Collections.Array<Reckfell.Collections.Dictionary> GetShaderParameterList(Rid shader);Returns the parameters of a shader.
| Name | Type | Default |
|---|---|---|
shader | Rid | — |
Reckfell.Collections.Array<Reckfell.Collections.Dictionary>GetTestCubeRid
public static Rid GetTestCube();Returns the RID of the test cube. This mesh will be created and returned on the first call to RenderingServer.GetTestCube, then it will be cached for subsequent calls. See also RenderingServer.MakeSphereMesh.
RidGetTestTextureRid
public static Rid GetTestTexture();Returns the RID of a 256×256 texture with a testing pattern on it (in Image.Format.Rgb8 format). This texture will be created and returned on the first call to RenderingServer.GetTestTexture, then it will be cached for subsequent calls. See also RenderingServer.GetWhiteTexture.
Example: Get the test texture and apply it to a Sprite2D node:
RidGetVideoAdapterApiVersionstring
public static string GetVideoAdapterApiVersion();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 Reckfell may not always request the latest version. See also OS.GetVideoAdapterDriverInfo.
Note: When running a headless or server binary, this function returns an empty string.
stringGetVideoAdapterNamestring
public static string GetVideoAdapterName();Returns the name of the video adapter (e.g. "GeForce GTX 1080/PCIe/SSE2"). Note: When running a headless or server binary, this function returns an empty string. Note: On the web platform, some browsers such as Firefox may report a different, fixed GPU name such as "GeForce GTX 980" (regardless of the user's actual GPU model). This is done to make fingerprinting more difficult.
stringGetVideoAdapterTypeRenderingDevice.DeviceType
public static RenderingDevice.DeviceType GetVideoAdapterType();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.
Note: When using the OpenGL rendering driver or when running in headless mode, this function always returns RenderingDevice.DeviceType.Other.
RenderingDevice.DeviceTypeGetVideoAdapterVendorstring
public static string GetVideoAdapterVendor();Returns the vendor of the video adapter (e.g. "NVIDIA Corporation"). Note: When running a headless or server binary, this function returns an empty string.
stringGetWhiteTextureRid
public static Rid GetWhiteTexture();Returns the ID of a 4×4 white texture (in Image.Format.Rgb8 format). This texture will be created and returned on the first call to RenderingServer.GetWhiteTexture, then it will be cached for subsequent calls. See also RenderingServer.GetTestTexture.
Example: Get the white texture and apply it to a Sprite2D node:
RidGlobalShaderParameterAddvoid
public static void GlobalShaderParameterAdd(StringName name, RenderingServer.GlobalShaderParameterType type, Variant defaultValue);Registers a global shader parameter with a name, type and base value. The name must not already exist; a project shader_globals definition also registers it. Create the parameter before loading a shader that uses it.
| Name | Type | Default |
|---|---|---|
name | StringName | — |
type | RenderingServer.GlobalShaderParameterType | — |
defaultValue | Variant | — |
nameExact case-sensitive parameter name.
typeGlobal parameter type matching the shader declaration.
defaultValueBase value for the registered type.
GlobalShaderParameterGetVariant
public static Variant GlobalShaderParameterGet(StringName name);Reads the base value, not the effective override, in the editor context. During gameplay this version reports an error and returns Nil; it is not a supported runtime getter. Keep current values in C#.
| Name | Type | Default |
|---|---|---|
name | StringName | — |
nameExact case-sensitive parameter name.
VariantBase value in the editor; Nil when missing or when a gameplay call is rejected.
GlobalShaderParameterGetListReckfell.Collections.Array<StringName>
public static Reckfell.Collections.Array<StringName> GlobalShaderParameterGetList();Returns sorted global parameter names in the editor context; gameplay calls are rejected with an error and an empty result. GLES3 also permits the Project Manager context. Do not use it for a runtime pre-Add existence check.
Reckfell.Collections.Array<StringName>Sorted StringName collection for the editor context.
GlobalShaderParameterGetTypeRenderingServer.GlobalShaderParameterType
public static RenderingServer.GlobalShaderParameterType GlobalShaderParameterGetType(StringName name);Reads a registered global parameter type in the editor context. A missing name returns Max; gameplay calls are rejected with an error and also return Max.
| Name | Type | Default |
|---|---|---|
name | StringName | — |
nameExact case-sensitive parameter name.
RenderingServer.GlobalShaderParameterTypeRegistered type, or Max when missing/the call is rejected.
GlobalShaderParameterRemovevoid
public static void GlobalShaderParameterRemove(StringName name);Removes a global registration; a missing name is ignored. Stop dependent material/shader use first: removing a parameter that is still used can invalidate their output.
| Name | Type | Default |
|---|---|---|
name | StringName | — |
nameExact case-sensitive parameter name.
GlobalShaderParameterSetvoid
public static void GlobalShaderParameterSet(StringName name, Variant value);Changes a registered global parameter base value. With an active override, updates the base while the visible override remains until cleared. Keep needed values in application state instead of runtime Get.
| Name | Type | Default |
|---|---|---|
name | StringName | — |
value | Variant | — |
nameExact case-sensitive parameter name.
valueNew base value of the declared type; does not disable an active override.
GlobalShaderParameterSetOverridevoid
public static void GlobalShaderParameterSetOverride(StringName name, Variant value);Sets a priority override for a registered parameter. Nil clears it and restores the current base value; Object values are rejected. This call does not create a missing parameter.
| Name | Type | Default |
|---|---|---|
name | StringName | — |
value | Variant | — |
nameExact case-sensitive parameter name.
valueCompatible value. Nil clears a global override; the low-level instance setter does not replace scene-level CanvasItem reset.
HasChangedbool
public static bool HasChanged();Returns true if changes have been made to the RenderingServer's data. RenderingServer.ForceDraw is usually called if this happens.
boolHasFeaturebool · Deprecated
public static bool HasFeature(RenderingServer.Features feature);This method does nothing and always returns false.
| Name | Type | Default |
|---|---|---|
feature | RenderingServer.Features | — |
boolHasOsFeaturebool
public static bool HasOsFeature(string feature);Returns true if the OS supports a certain feature. Features might be s3tc, rgtc, bptc, etc, etc2, astc, and astc_hdr.
| Name | Type | Default |
|---|---|---|
feature | string | — |
boolInstanceAttachObjectInstanceIdvoid
public static void InstanceAttachObjectInstanceId(Rid instance, ulong id);Attaches a unique Object ID to instance. Object ID must be attached to instance for proper culling with RenderingServer.InstancesCullAabb, RenderingServer.InstancesCullConvex, and RenderingServer.InstancesCullRay.
| Name | Type | Default |
|---|---|---|
instance | Rid | — |
id | ulong | — |
InstanceAttachSkeletonvoid
public static void InstanceAttachSkeleton(Rid instance, Rid skeleton);Attaches a skeleton to an instance. Removes the previous skeleton from the instance.
| Name | Type | Default |
|---|---|---|
instance | Rid | — |
skeleton | Rid | — |
InstanceCreateRid
public static Rid InstanceCreate();Creates an owned rendering-instance RID. Assign base, scenario and transform for display; call FreeRid when finished.
RidInstanceCreate2Rid
public static Rid InstanceCreate2(Rid @base, Rid scenario);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.
Once finished with your RID, you will want to free the RID using the RenderingServer's RenderingServer.FreeRid method. This is a shorthand for using RenderingServer.InstanceCreate and setting the base and scenario manually.
| Name | Type | Default |
|---|---|---|
base | Rid | — |
scenario | Rid | — |
RidInstanceGeometryGetShaderParameterVariant
public static Variant InstanceGeometryGetShaderParameter(Rid instance, StringName parameter);Returns the value of the per-instance shader uniform from the specified 3D geometry instance. Equivalent to GeometryInstance3D.GetInstanceShaderParameter.
Note: Per-instance shader parameter names are case-sensitive.
| Name | Type | Default |
|---|---|---|
instance | Rid | — |
parameter | StringName | — |
VariantInstanceGeometryGetShaderParameterDefaultValueVariant
public static Variant InstanceGeometryGetShaderParameterDefaultValue(Rid instance, StringName parameter);Returns the default value of the per-instance shader uniform from the specified 3D geometry instance. Equivalent to GeometryInstance3D.GetInstanceShaderParameter.
| Name | Type | Default |
|---|---|---|
instance | Rid | — |
parameter | StringName | — |
VariantInstanceGeometryGetShaderParameterListReckfell.Collections.Array<Reckfell.Collections.Dictionary>
public static Reckfell.Collections.Array<Reckfell.Collections.Dictionary> InstanceGeometryGetShaderParameterList(Rid instance);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 GeometryInstance3D.GetInstanceShaderParameter.
| Name | Type | Default |
|---|---|---|
instance | Rid | — |
Reckfell.Collections.Array<Reckfell.Collections.Dictionary>InstanceGeometrySetCastShadowsSettingvoid
public static void InstanceGeometrySetCastShadowsSetting(Rid instance, RenderingServer.ShadowCastingSetting shadowCastingSetting);Sets the shadow casting setting. Equivalent to GeometryInstance3D.CastShadow.
| Name | Type | Default |
|---|---|---|
instance | Rid | — |
shadowCastingSetting | RenderingServer.ShadowCastingSetting | — |
InstanceGeometrySetFlagvoid
public static void InstanceGeometrySetFlag(Rid instance, RenderingServer.InstanceFlags flag, bool enabled);Sets the flag for a given instance to enabled.
| Name | Type | Default |
|---|---|---|
instance | Rid | — |
flag | RenderingServer.InstanceFlags | — |
enabled | bool | — |
InstanceGeometrySetLightmapvoid
public static void InstanceGeometrySetLightmap(Rid instance, Rid lightmap, Rect2 lightmapUVScale, int lightmapSlice);Sets the lightmap GI instance to use for the specified 3D geometry instance. The lightmap UV scale for the specified instance (equivalent to GeometryInstance3D.GILightmapScale) and lightmap atlas slice must also be specified.
| Name | Type | Default |
|---|---|---|
instance | Rid | — |
lightmap | Rid | — |
lightmapUVScale | Rect2 | — |
lightmapSlice | int | — |
InstanceGeometrySetLodBiasvoid
public static void InstanceGeometrySetLodBias(Rid instance, float lodBias);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 GeometryInstance3D.LodBias.
| Name | Type | Default |
|---|---|---|
instance | Rid | — |
lodBias | float | — |
InstanceGeometrySetMaterialOverlayvoid
public static void InstanceGeometrySetMaterialOverlay(Rid instance, Rid material);Low-level additional material overlay for a RenderingServer instance. It is another pass with its own depth/blending, not an unconditional top layer. Pass a Material RID, not a Shader or local RenderingDevice RID. An empty RID clears the assignment. This call does not replace resource ownership.
| Name | Type | Default |
|---|---|---|
instance | Rid | — |
material | Rid | — |
instanceRID of an existing RenderingServer geometry instance.
materialLive Material RID, or an empty RID to clear.
InstanceGeometrySetMaterialOverridevoid
public static void InstanceGeometrySetMaterialOverride(Rid instance, Rid material);Low-level base material override for a RenderingServer instance, replacing surface-material selection. Pass a Material RID, not a Shader or local RenderingDevice RID. An empty RID clears the assignment. This call does not replace resource ownership.
| Name | Type | Default |
|---|---|---|
instance | Rid | — |
material | Rid | — |
instanceRID of an existing RenderingServer geometry instance.
materialLive Material RID, or an empty RID to clear.
InstanceGeometrySetShaderParametervoid
public static void InstanceGeometrySetShaderParameter(Rid instance, StringName parameter, Variant value);Sets the per-instance shader uniform on the specified 3D geometry instance. Equivalent to GeometryInstance3D.SetInstanceShaderParameter.
| Name | Type | Default |
|---|---|---|
instance | Rid | — |
parameter | StringName | — |
value | Variant | — |
InstanceGeometrySetTransparencyvoid
public static void InstanceGeometrySetTransparency(Rid instance, float transparency);Sets the transparency for the given geometry instance. Equivalent to GeometryInstance3D.Transparency.
A transparency of 0.0 is fully opaque, while 1.0 is fully transparent. Values greater than 0.0 (exclusive) will force the geometry's materials to go through the transparent pipeline, which is slower to render and can exhibit rendering issues due to incorrect transparency sorting. However, unlike using a transparent material, setting transparency to a value greater than 0.0 (exclusive) will not disable shadow rendering.
In spatial shaders, 1.0 - transparency is set as the default value of the ALPHA built-in.
Note: transparency is clamped between 0.0 and 1.0, so this property cannot be used to make transparent materials more opaque than they originally are.
| Name | Type | Default |
|---|---|---|
instance | Rid | — |
transparency | float | — |
InstanceGeometrySetVisibilityRangevoid
public static void InstanceGeometrySetVisibilityRange(Rid instance, float min, float max, float minMargin, float maxMargin, RenderingServer.VisibilityRangeFadeMode fadeMode);Sets the visibility range values for the given geometry instance. Equivalent to GeometryInstance3D.VisibilityRangeBegin and related properties.
| Name | Type | Default |
|---|---|---|
instance | Rid | — |
min | float | — |
max | float | — |
minMargin | float | — |
maxMargin | float | — |
fadeMode | RenderingServer.VisibilityRangeFadeMode | — |
InstanceResetPhysicsInterpolationvoid
public static void InstanceResetPhysicsInterpolation(Rid instance);| Name | Type | Default |
|---|---|---|
instance | Rid | — |
InstanceSetBasevoid
public static void InstanceSetBase(Rid instance, Rid @base);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.
| Name | Type | Default |
|---|---|---|
instance | Rid | — |
base | Rid | — |
InstanceSetBlendShapeWeightvoid
public static void InstanceSetBlendShapeWeight(Rid instance, int shape, float weight);Sets the weight for a given blend shape associated with this instance.
| Name | Type | Default |
|---|---|---|
instance | Rid | — |
shape | int | — |
weight | float | — |
InstanceSetCustomAabbvoid
public static void InstanceSetCustomAabb(Rid instance, Aabb aabb);Sets custom local bounds on a rendering instance; default(Aabb) removes the override. The extra visibility margin is applied after selecting these bounds and before the world transform. A direct call does not update stored GeometryInstance3D.CustomAabb or change Mesh.GetAabb(). For an ordinary Entity, prefer the wrapper property to keep its state consistent.
| Name | Type | Default |
|---|---|---|
instance | Rid | — |
aabb | Aabb | — |
instanceA RenderingServer instance RID, not a Mesh resource RID. Passing a borrowed RID does not transfer ownership.
aabbReplacement local Aabb; default(Aabb) restores bounds selected from the geometry source.
InstanceSetExtraVisibilityMarginvoid
public static void InstanceSetExtraVisibilityMargin(Rid instance, float margin);Sets padding used by the server to grow selected local bounds before the instance transform. Applies to CustomAabb too, but does not change geometry or collision. A direct call does not update stored GeometryInstance3D.ExtraCullMargin. Use a nonnegative value; negative-argument validation in the GeometryInstance3D wrapper is not a contract of this low-level call.
| Name | Type | Default |
|---|---|---|
instance | Rid | — |
margin | float | — |
instanceThe rendering instance RID. Do not pass a mesh or other resource RID, and do not free a borrowed RID after configuring it.
marginAdditional growth on every side in local units; 0 removes the padding. The world-space result depends on the instance transform.
InstanceSetIgnoreCullingvoid
public static void InstanceSetIgnoreCulling(Rid instance, bool enabled);If true, ignores all culling on the specified 3D geometry instance, including frustum culling, occlusion culling, and layer culling. This is not the same as GeometryInstance3D.IgnoreOcclusionCulling, which only ignores occlusion culling but leaves frustum and layer culling intact.
| Name | Type | Default |
|---|---|---|
instance | Rid | — |
enabled | bool | — |
InstanceSetInterpolatedvoid
public static void InstanceSetInterpolated(Rid instance, bool interpolated);| Name | Type | Default |
|---|---|---|
instance | Rid | — |
interpolated | bool | — |
InstanceSetLayerMaskvoid
public static void InstanceSetLayerMask(Rid instance, uint mask);Sets the render layers that this instance will be drawn to. Equivalent to VisualInstance3D.Layers.
| Name | Type | Default |
|---|---|---|
instance | Rid | — |
mask | uint | — |
InstanceSetPivotDatavoid
public static void InstanceSetPivotData(Rid instance, float sortingOffset, bool useAabbCenter);Sets the sorting offset and switches between using the bounding box or instance origin for depth sorting.
| Name | Type | Default |
|---|---|---|
instance | Rid | — |
sortingOffset | float | — |
useAabbCenter | bool | — |
InstanceSetScenariovoid
public static void InstanceSetScenario(Rid instance, Rid scenario);Sets the scenario that the instance is in. The scenario is the 3D world that the objects will be displayed in.
| Name | Type | Default |
|---|---|---|
instance | Rid | — |
scenario | Rid | — |
InstanceSetSurfaceOverrideMaterialvoid
public static void InstanceSetSurfaceOverrideMaterial(Rid instance, int surface, Rid material);Sets the override material of a specific surface. Equivalent to MeshInstance3D.SetSurfaceOverrideMaterial.
| Name | Type | Default |
|---|---|---|
instance | Rid | — |
surface | int | — |
material | Rid | — |
InstanceSetTransformvoid
public static void InstanceSetTransform(Rid instance, Transform3D transform);Sets the world space transform of the instance. Equivalent to Entity3D.GlobalTransform.
| Name | Type | Default |
|---|---|---|
instance | Rid | — |
transform | Transform3D | — |
InstanceSetVisibilityParentvoid
public static void InstanceSetVisibilityParent(Rid instance, Rid parent);Sets the visibility parent for the given instance. Equivalent to Entity3D.VisibilityParent.
| Name | Type | Default |
|---|---|---|
instance | Rid | — |
parent | Rid | — |
InstanceSetVisiblevoid
public static void InstanceSetVisible(Rid instance, bool visible);Sets whether an instance is drawn or not. Equivalent to Entity3D.Visible.
| Name | Type | Default |
|---|---|---|
instance | Rid | — |
visible | bool | — |
InstanceTeleportvoid
public static void InstanceTeleport(Rid instance);Resets motion vectors and other interpolated values. Use this after teleporting a mesh from one position to another to avoid ghosting artifacts.
| Name | Type | Default |
|---|---|---|
instance | Rid | — |
InstancesCullAabblong[]
public static long[] InstancesCullAabb(Aabb aabb, Rid scenario = default);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.
Warning: This function is primarily intended for editor usage. For in-game use cases, prefer physics collision.
| Name | Type | Default |
|---|---|---|
aabb | Aabb | — |
scenario | Rid | default |
long[]InstancesCullConvexlong[]
public static long[] InstancesCullConvex(Reckfell.Collections.Array<Plane> convex, Rid scenario = default);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.
Warning: This function is primarily intended for editor usage. For in-game use cases, prefer physics collision.
| Name | Type | Default |
|---|---|---|
convex | Reckfell.Collections.Array<Plane> | — |
scenario | Rid | default |
long[]InstancesCullRaylong[]
public static long[] InstancesCullRay(Vector3 from, Vector3 to, Rid scenario = default);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.
Warning: This function is primarily intended for editor usage. For in-game use cases, prefer physics collision.
| Name | Type | Default |
|---|---|---|
from | Vector3 | — |
to | Vector3 | — |
scenario | Rid | default |
long[]IsOnRenderThreadbool
public static bool IsOnRenderThread();Returns true if our code is currently executing on the rendering thread.
boolIsRenderLoopEnabledbool
public static bool IsRenderLoopEnabled();boolLightAreaSetNormalizeEnergyvoid
public static void LightAreaSetNormalizeEnergy(Rid light, bool enable);Defines whether the energy of an AreaLight3D is normalized (divided) by its area. If set to true, changing the size does not affect the total energy output. Equivalent to AreaLight3D.AreaNormalizeEnergy.
| Name | Type | Default |
|---|---|---|
light | Rid | — |
enable | bool | — |
LightAreaSetSizevoid
public static void LightAreaSetSize(Rid light, Vector2 size);Sets the extents (width and height) in meters for this area light. Equivalent to AreaLight3D.AreaSize.
| Name | Type | Default |
|---|---|---|
light | Rid | — |
size | Vector2 | — |
LightDirectionalSetBlendSplitsvoid
public static void LightDirectionalSetBlendSplits(Rid light, bool enable);If true, this directional light will blend between shadow map splits resulting in a smoother transition between them. Equivalent to DirectionalLight3D.DirectionalShadowBlendSplits.
| Name | Type | Default |
|---|---|---|
light | Rid | — |
enable | bool | — |
LightDirectionalSetShadowModevoid
public static void LightDirectionalSetShadowMode(Rid light, RenderingServer.LightDirectionalShadowMode mode);Sets the shadow mode for this directional light. Equivalent to DirectionalLight3D.DirectionalShadowMode.
| Name | Type | Default |
|---|---|---|
light | Rid | — |
mode | RenderingServer.LightDirectionalShadowMode | — |
LightDirectionalSetSkyModevoid
public static void LightDirectionalSetSkyMode(Rid light, RenderingServer.LightDirectionalSkyMode mode);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.
| Name | Type | Default |
|---|---|---|
light | Rid | — |
mode | RenderingServer.LightDirectionalSkyMode | — |
LightOmniSetShadowModevoid
public static void LightOmniSetShadowMode(Rid light, RenderingServer.LightOmniShadowMode mode);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 OmniLight3D.OmniShadowMode.
| Name | Type | Default |
|---|---|---|
light | Rid | — |
mode | RenderingServer.LightOmniShadowMode | — |
LightProjectorsSetFiltervoid
public static void LightProjectorsSetFilter(RenderingServer.LightProjectorFilter filter);Sets the texture filter mode to use when rendering light projectors. This parameter is global and cannot be set on a per-light basis.
| Name | Type | Default |
|---|---|---|
filter | RenderingServer.LightProjectorFilter | — |
LightSetAllowContactShadowsvoid
public static void LightSetAllowContactShadows(Rid light, bool enable);If true, allows screen-space contact shadows for this light. Only used when ProjectSettings.rendering/lights_and_shadows/contact_shadow/enabled is enabled. Equivalent to Light3D.ShadowContactShadowsAllow.
| Name | Type | Default |
|---|---|---|
light | Rid | — |
enable | bool | — |
LightSetBakeModevoid
public static void LightSetBakeMode(Rid light, RenderingServer.LightBakeMode bakeMode);Sets the bake mode to use for the specified 3D light. Equivalent to Light3D.LightBakeMode.
| Name | Type | Default |
|---|---|---|
light | Rid | — |
bakeMode | RenderingServer.LightBakeMode | — |
LightSetColorvoid
public static void LightSetColor(Rid light, Color color);Sets the color of the light. Equivalent to Light3D.LightColor.
| Name | Type | Default |
|---|---|---|
light | Rid | — |
color | Color | — |
LightSetCullMaskvoid
public static void LightSetCullMask(Rid light, uint mask);Sets the cull mask for this 3D light. Lights only affect objects in the selected layers. Equivalent to Light3D.LightCullMask.
| Name | Type | Default |
|---|---|---|
light | Rid | — |
mask | uint | — |
LightSetDistanceFadevoid
public static void LightSetDistanceFade(Rid decal, bool enabled, float begin, float shadow, float length);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 Light3D.DistanceFadeEnabled, Light3D.DistanceFadeBegin, Light3D.DistanceFadeShadow, and Light3D.DistanceFadeLength.
| Name | Type | Default |
|---|---|---|
decal | Rid | — |
enabled | bool | — |
begin | float | — |
shadow | float | — |
length | float | — |
LightSetMaxSdfgiCascadevoid
public static void LightSetMaxSdfgiCascade(Rid light, uint cascade);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.
| Name | Type | Default |
|---|---|---|
light | Rid | — |
cascade | uint | — |
LightSetNegativevoid
public static void LightSetNegative(Rid light, bool enable);If true, the 3D light will subtract light instead of adding light. Equivalent to Light3D.LightNegative.
| Name | Type | Default |
|---|---|---|
light | Rid | — |
enable | bool | — |
LightSetParamvoid
public static void LightSetParam(Rid light, RenderingServer.LightParam param, float value);Sets the specified 3D light parameter. Equivalent to Light3D.SetParam.
| Name | Type | Default |
|---|---|---|
light | Rid | — |
param | RenderingServer.LightParam | — |
value | float | — |
LightSetProjectorvoid
public static void LightSetProjector(Rid light, Rid texture);Sets the projector texture to use for the specified 3D light. Equivalent to Light3D.LightProjector.
| Name | Type | Default |
|---|---|---|
light | Rid | — |
texture | Rid | — |
LightSetReverseCullFaceModevoid
public static void LightSetReverseCullFaceMode(Rid light, bool enabled);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 RenderingServer.InstanceGeometrySetCastShadowsSetting. Equivalent to Light3D.ShadowReverseCullFace.
| Name | Type | Default |
|---|---|---|
light | Rid | — |
enabled | bool | — |
LightSetShadowvoid
public static void LightSetShadow(Rid light, bool enabled);If true, light will cast shadows. Equivalent to Light3D.ShadowEnabled.
| Name | Type | Default |
|---|---|---|
light | Rid | — |
enabled | bool | — |
LightSetShadowCasterMaskvoid
public static void LightSetShadowCasterMask(Rid light, uint mask);Sets the shadow caster mask for this 3D light. Shadows will only be cast using objects in the selected layers. Equivalent to Light3D.ShadowCasterMask.
| Name | Type | Default |
|---|---|---|
light | Rid | — |
mask | uint | — |
LightmapCreateRid
public static Rid LightmapCreate();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.
Once finished with your RID, you will want to free the RID using the RenderingServer's RenderingServer.FreeRid method.
Note: The equivalent node is LightmapGI.
RidLightmapGetProbeCaptureBspTreeint[]
public static int[] LightmapGetProbeCaptureBspTree(Rid lightmap);Returns the BSP tree data used for accelerating probe lookups. The BSP data is structured as a series of six signed 32-bit values per BSP node in this order: float plane_x, float plane_y, float plane_z, float plane_distance, int32_t over, int32_t under. An empty leaf is denoted by the value -2147483648 (the minimum 32-bit signed integer). See also RenderingServer.LightmapSetProbeCaptureData.
| Name | Type | Default |
|---|---|---|
lightmap | Rid | — |
int[]LightmapGetProbeCapturePointsVector3[]
public static Vector3[] LightmapGetProbeCapturePoints(Rid lightmap);Returns the local space positions of each lightmap probe capture point. Keep in mind the lightmap instance may have a non-zero transform, which will affect the position of the probe capture points. See also RenderingServer.LightmapSetProbeCaptureData.
| Name | Type | Default |
|---|---|---|
lightmap | Rid | — |
Vector3[]LightmapGetProbeCaptureShColor[]
public static Color[] LightmapGetProbeCaptureSh(Rid lightmap);Returns the L0, L1, and L2 spherical harmonics data for each lightmap probe capture point. This is specified as 9 Color values per probe, which means the size of the returned data is always 9 times the number of probe points. See also RenderingServer.LightmapSetProbeCaptureData.
| Name | Type | Default |
|---|---|---|
lightmap | Rid | — |
Color[]LightmapGetProbeCaptureTetrahedraint[]
public static int[] LightmapGetProbeCaptureTetrahedra(Rid lightmap);Returns the tetrahedralization data used for interpolating between lightmap probe capture points. Each tetrahedron is specified as a series of 4 numbers, each being an index into the probe capture points array returned by RenderingServer.LightmapGetProbeCapturePoints. See also RenderingServer.LightmapSetProbeCaptureData.
| Name | Type | Default |
|---|---|---|
lightmap | Rid | — |
int[]LightmapSetBakedExposureNormalizationvoid
public static void LightmapSetBakedExposureNormalization(Rid lightmap, float bakedExposure);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 RenderingServer.CameraAttributesSetExposure.
| Name | Type | Default |
|---|---|---|
lightmap | Rid | — |
bakedExposure | float | — |
LightmapSetProbeBoundsvoid
public static void LightmapSetProbeBounds(Rid lightmap, Aabb bounds);Sets the bounds that this lightmap instance should visually affect, both in terms of static lightmap baking and probe-based global illumination.
| Name | Type | Default |
|---|---|---|
lightmap | Rid | — |
bounds | Aabb | — |
LightmapSetProbeCaptureData2 overloads
public static void LightmapSetProbeCaptureData(Rid lightmap, Vector3[] points, Color[] pointSh, int[] tetrahedra, int[] bspTree);Sets the probe capture data for the given lightmap instance. See RenderingServer.LightmapGetProbeCapturePoints, RenderingServer.LightmapGetProbeCaptureSh, RenderingServer.LightmapGetProbeCaptureTetrahedra, and RenderingServer.LightmapGetProbeCaptureBspTree for the expected data formats.
| Name | Type | Default |
|---|---|---|
lightmap | Rid | — |
points | Vector3[] | — |
pointSh | Color[] | — |
tetrahedra | int[] | — |
bspTree | int[] | — |
public static void LightmapSetProbeCaptureData(Rid lightmap, ReadOnlySpan<Vector3> points, ReadOnlySpan<Color> pointSh, ReadOnlySpan<int> tetrahedra, ReadOnlySpan<int> bspTree);Sets the probe capture data for the given lightmap instance. See RenderingServer.LightmapGetProbeCapturePoints, RenderingServer.LightmapGetProbeCaptureSh, RenderingServer.LightmapGetProbeCaptureTetrahedra, and RenderingServer.LightmapGetProbeCaptureBspTree for the expected data formats.
| Name | Type | Default |
|---|---|---|
lightmap | Rid | — |
points | ReadOnlySpan<Vector3> | — |
pointSh | ReadOnlySpan<Color> | — |
tetrahedra | ReadOnlySpan<int> | — |
bspTree | ReadOnlySpan<int> | — |
LightmapSetProbeCaptureUpdateSpeedvoid
public static void LightmapSetProbeCaptureUpdateSpeed(float speed);The framerate-independent update speed when representing dynamic object lighting from LightmapProbes. Higher values make dynamic object lighting update faster. Higher values can prevent fast-moving objects from having "outdated" indirect lighting displayed on them, at the cost of possible flickering when an object moves from a bright area to a shaded area. See also ProjectSettings.rendering/lightmapping/probe_capture/update_speed.
| Name | Type | Default |
|---|---|---|
speed | float | — |
LightmapSetProbeInteriorvoid
public static void LightmapSetProbeInterior(Rid lightmap, bool interior);Sets whether the lightmap instance should be considered as interior (when interior is true). If the lightmap is marked as interior, environment lighting is ignored when baking lightmaps.
| Name | Type | Default |
|---|---|---|
lightmap | Rid | — |
interior | bool | — |
LightmapSetTexturesvoid
public static void LightmapSetTextures(Rid lightmap, Rid light, bool usesSh);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 LightmapGI.Directional set to true, then uses_sh must also be true.
| Name | Type | Default |
|---|---|---|
lightmap | Rid | — |
light | Rid | — |
usesSh | bool | — |
LightmapsSetBicubicFiltervoid
public static void LightmapsSetBicubicFilter(bool enable);Toggles whether a bicubic filter should be used when lightmaps are sampled. This smoothens their appearance at a performance cost.
| Name | Type | Default |
|---|---|---|
enable | bool | — |
MakeSphereMeshRid
public static Rid MakeSphereMesh(int latitudes, int longitudes, float radius);Returns a mesh of a sphere with the given number of horizontal subdivisions, vertical subdivisions and radius. See also RenderingServer.GetTestCube.
| Name | Type | Default |
|---|---|---|
latitudes | int | — |
longitudes | int | — |
radius | float | — |
RidMaterialCreateRid
public static Rid MaterialCreate();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.
Once finished with your RID, you will want to free the RID using the RenderingServer's RenderingServer.FreeRid method.
Note: The equivalent resource is Material.
RidMaterialGetParamVariant
public static Variant MaterialGetParam(Rid material, StringName parameter);Returns the value of a certain material's parameter.
| Name | Type | Default |
|---|---|---|
material | Rid | — |
parameter | StringName | — |
VariantMaterialSetNextPassvoid
public static void MaterialSetNextPass(Rid material, Rid nextMaterial);Sets an object's next material.
| Name | Type | Default |
|---|---|---|
material | Rid | — |
nextMaterial | Rid | — |
MaterialSetParamvoid
public static void MaterialSetParam(Rid material, StringName parameter, Variant value);Sets a material's parameter.
| Name | Type | Default |
|---|---|---|
material | Rid | — |
parameter | StringName | — |
value | Variant | — |
MaterialSetRenderPriorityvoid
public static void MaterialSetRenderPriority(Rid material, int priority);Sets a material's render priority.
| Name | Type | Default |
|---|---|---|
material | Rid | — |
priority | int | — |
MaterialSetShadervoid
public static void MaterialSetShader(Rid shaderMaterial, Rid shader);Sets a shader material's shader.
| Name | Type | Default |
|---|---|---|
shaderMaterial | Rid | — |
shader | Rid | — |
MaterialSetUseDebandingvoid
public static void MaterialSetUseDebanding(bool enable);When using the Mobile renderer, RenderingServer.MaterialSetUseDebanding can be used to enable or disable the debanding feature of 3D materials (BaseMaterial3D and ShaderMaterial).
RenderingServer.MaterialSetUseDebanding has no effect when using the Compatibility or Forward+ renderer. In Forward+, Viewport debanding can be used instead.
See also ProjectSettings.rendering/anti_aliasing/quality/use_debanding and RenderingServer.ViewportSetUseDebanding.
| Name | Type | Default |
|---|---|---|
enable | bool | — |
MeshAddSurfacevoid
public static void MeshAddSurface(Rid mesh, Reckfell.Collections.Dictionary surface);Creates a new surface on the given mesh. Equivalent to RenderingServer.MeshAddSurfaceFromArrays, but takes a single Reckfell.Collections.Dictionary argument instead of separate arguments. The dictionary must follow this structure:
See also RenderingServer.MeshGetSurface, which returns data in the same structure defined above.
| Name | Type | Default |
|---|---|---|
mesh | Rid | — |
surface | Reckfell.Collections.Dictionary | — |
MeshAddSurfaceFromArraysvoid
public static void MeshAddSurfaceFromArrays(Rid mesh, RenderingServer.PrimitiveType primitive, Reckfell.Collections.Array arrays, Reckfell.Collections.Array blendShapes = null, Reckfell.Collections.Dictionary lods = null, RenderingServer.ArrayFormat compressFormat = RenderingServer.ArrayFormat.FlagFormatVersion1);Creates a new surface on the given mesh. RenderingServer.MeshGetSurfaceCount will become the surface index for this new surface.
Surfaces are created to be rendered using a primitive, which may be any of the values defined in Mesh.PrimitiveType.
The arrays argument is an array of arrays. Each of the Mesh.ArrayType.Max elements contains an array with some of the mesh data for this surface as described by the corresponding member of Mesh.ArrayType or null if it is not used by the surface. For example, arrays[Mesh.ArrayType.Index](/en/docs/api/mesh#member-index-23499c80bb) if it is used. The blend_shapesargument is an array of vertex data for each blend shape. Each element is an array of the same structure asarrays, but [Mesh.ArrayType.Vertex](/en/docs/api/mesh#member-vertex-87b0249d36), [Mesh.ArrayType.Normal](/en/docs/api/mesh#member-normal-138d58cd86), and [Mesh.ArrayType.Tangent](/en/docs/api/mesh#member-tangent-14eb4ead6f) are set if and only if they are set in arraysand all other entries arenull. The lods argument is a dictionary with [int[]](/en/docs/api/packedint32array) values. Each entry in the dictionary represents an LOD level of the surface, where the value is the [Mesh.ArrayType.Index](/en/docs/api/mesh#member-index-23499c80bb) array to use for the LOD level and the key is roughly proportional to the distance at which the LOD stats being used. I.e., increasing the key of an LOD also increases the distance that the objects has to be from the camera before the LOD is used. The compress_format argument is the bitwise OR of, as required: One value of [RenderingServer.ArrayFormat](/en/docs/api/renderingserver#enum-arrayformat) left shifted by ARRAY_FORMAT_CUSTOMn_SHIFT for each custom channel in use, [RenderingServer.ArrayFormat.FlagUseDynamicUpdate](/en/docs/api/renderingserver#member-flagusedynamicupdate-d4feaa23f9), [RenderingServer.ArrayFormat.FlagUse8BoneWeights](/en/docs/api/renderingserver#member-flaguse8boneweights-3c033c78c7), or [RenderingServer.ArrayFormat.FlagUsesEmptyVertexArray](/en/docs/api/renderingserver#member-flagusesemptyvertexarray-07eec33ad4). See [ArrayMesh.AddSurfaceFromArrays](/en/docs/api/arraymesh#member-addsurfacefromarrays-7effbb836f) and [ImporterMesh.AddSurface`](/en/docs/api/importermesh#member-addsurface-da30efdaa3) for higher-level equivalents of this method.
Note: When using indices, it is recommended to only use points, lines, or triangles.
| Name | Type | Default |
|---|---|---|
mesh | Rid | — |
primitive | RenderingServer.PrimitiveType | — |
arrays | Reckfell.Collections.Array | — |
blendShapes | Reckfell.Collections.Array | null |
lods | Reckfell.Collections.Dictionary | null |
compressFormat | RenderingServer.ArrayFormat | RenderingServer.ArrayFormat.FlagFormatVersion1 |
MeshClearvoid
public static void MeshClear(Rid mesh);Removes all surfaces from a mesh.
| Name | Type | Default |
|---|---|---|
mesh | Rid | — |
MeshCreateRid
public static Rid MeshCreate();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.
Once finished with your RID, you will want to free the RID using the RenderingServer's RenderingServer.FreeRid method.
To place in a scene, attach this mesh to an instance using RenderingServer.InstanceSetBase using the returned RID.
Note: The equivalent resource is Mesh.
RidMeshCreateFromSurfacesRid
public static Rid MeshCreateFromSurfaces(Reckfell.Collections.Array<Reckfell.Collections.Dictionary> surfaces, int blendShapeCount = 0);Creates a new mesh with predefined surfaces for it and adds the mesh to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all mesh_* RenderingServer functions. This method is more efficient for creating meshes with multiple surfaces compared to creating an empty mesh with RenderingServer.MeshCreate and adding surfaces one by one with RenderingServer.MeshAddSurface.
Each element in the surfaces array must follow the same structure as described in RenderingServer.MeshAddSurface. The blend_shape_count parameter must match the blend shape data defined in all surfaces.
Once finished with your RID, you will want to free the RID using the RenderingServer's RenderingServer.FreeRid method.
To place in a scene, attach this mesh to an instance using RenderingServer.InstanceSetBase using the returned RID.
Note: The equivalent resource is Mesh.
| Name | Type | Default |
|---|---|---|
surfaces | Reckfell.Collections.Array<Reckfell.Collections.Dictionary> | — |
blendShapeCount | int | 0 |
RidMeshGetBlendShapeCountint
public static int MeshGetBlendShapeCount(Rid mesh);Returns a mesh's blend shape count.
| Name | Type | Default |
|---|---|---|
mesh | Rid | — |
intMeshGetBlendShapeModeRenderingServer.BlendShapeMode
public static RenderingServer.BlendShapeMode MeshGetBlendShapeMode(Rid mesh);Returns a mesh's blend shape mode.
| Name | Type | Default |
|---|---|---|
mesh | Rid | — |
RenderingServer.BlendShapeModeMeshGetCustomAabbAabb
public static Aabb MeshGetCustomAabb(Rid mesh);Returns a mesh's custom aabb.
| Name | Type | Default |
|---|---|---|
mesh | Rid | — |
AabbMeshGetSurfaceReckfell.Collections.Dictionary
public static Reckfell.Collections.Dictionary MeshGetSurface(Rid mesh, int surface);Returns a mesh's surface as a dictionary following the same structure as described in RenderingServer.MeshAddSurface.
| Name | Type | Default |
|---|---|---|
mesh | Rid | — |
surface | int | — |
Reckfell.Collections.DictionaryMeshGetSurfaceCountint
public static int MeshGetSurfaceCount(Rid mesh);Returns a mesh's number of surfaces.
| Name | Type | Default |
|---|---|---|
mesh | Rid | — |
intMeshSetBlendShapeModevoid
public static void MeshSetBlendShapeMode(Rid mesh, RenderingServer.BlendShapeMode mode);Sets a mesh's blend shape mode.
| Name | Type | Default |
|---|---|---|
mesh | Rid | — |
mode | RenderingServer.BlendShapeMode | — |
MeshSetCustomAabbvoid
public static void MeshSetCustomAabb(Rid mesh, Aabb aabb);Sets a mesh's custom aabb.
| Name | Type | Default |
|---|---|---|
mesh | Rid | — |
aabb | Aabb | — |
MeshSetShadowMeshvoid
public static void MeshSetShadowMesh(Rid mesh, Rid shadowMesh);Sets an optional second mesh which can be used for rendering shadows and the depth prepass. Can be used to increase performance by supplying a mesh with fused vertices and only vertex position data (without normals, UVs, colors, etc.). Note: This mesh must have exactly the same vertex positions as the source mesh (including the source mesh's LODs, if present). If vertex positions differ, then the mesh will not draw correctly.
| Name | Type | Default |
|---|---|---|
mesh | Rid | — |
shadowMesh | Rid | — |
MeshSurfaceGetArraysReckfell.Collections.Array
public static Reckfell.Collections.Array MeshSurfaceGetArrays(Rid mesh, int surface);Returns a mesh's surface's buffer arrays.
| Name | Type | Default |
|---|---|---|
mesh | Rid | — |
surface | int | — |
Reckfell.Collections.ArrayMeshSurfaceGetAttributeBufferRdRidRid
public static Rid MeshSurfaceGetAttributeBufferRdRid(Rid mesh, int surface);Returns the RenderingDevice Rid handle of the attribute buffer of the given mesh surface (Color, UV, UV2, Custom0-3). The returned Rid can be used like any other buffer on the RenderingDevice, so the surface attributes can be read or written from a compute shader without a CPU round-trip.
To bind the buffer as a storage buffer in compute, the surface must have been created with the RenderingServer.ArrayFormat.FlagUseStorageBuffer flag set in its format.
Returns an invalid Rid if the surface has no attribute buffer or if the rendering backend does not expose RenderingDevice Rids (such as the OpenGL backend).
| Name | Type | Default |
|---|---|---|
mesh | Rid | — |
surface | int | — |
RidMeshSurfaceGetBlendShapeArraysReckfell.Collections.Array<Reckfell.Collections.Array>
public static Reckfell.Collections.Array<Reckfell.Collections.Array> MeshSurfaceGetBlendShapeArrays(Rid mesh, int surface);Returns a mesh's surface's arrays for blend shapes.
| Name | Type | Default |
|---|---|---|
mesh | Rid | — |
surface | int | — |
Reckfell.Collections.Array<Reckfell.Collections.Array>MeshSurfaceGetFormatAttributeStrideuint
public static uint MeshSurfaceGetFormatAttributeStride(RenderingServer.ArrayFormat format, int vertexCount);Returns the stride of the attribute buffer for a mesh with given format.
| Name | Type | Default |
|---|---|---|
format | RenderingServer.ArrayFormat | — |
vertexCount | int | — |
uintMeshSurfaceGetFormatIndexStrideuint
public static uint MeshSurfaceGetFormatIndexStride(RenderingServer.ArrayFormat format, int vertexCount);Returns the stride of the index buffer for a mesh with the given format.
| Name | Type | Default |
|---|---|---|
format | RenderingServer.ArrayFormat | — |
vertexCount | int | — |
uintMeshSurfaceGetFormatNormalTangentStrideuint
public static uint MeshSurfaceGetFormatNormalTangentStride(RenderingServer.ArrayFormat format, int vertexCount);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.
| Name | Type | Default |
|---|---|---|
format | RenderingServer.ArrayFormat | — |
vertexCount | int | — |
uintMeshSurfaceGetFormatOffsetuint
public static uint MeshSurfaceGetFormatOffset(RenderingServer.ArrayFormat format, int vertexCount, int arrayIndex);Returns the offset of a given attribute by array_index in the start of its respective buffer.
| Name | Type | Default |
|---|---|---|
format | RenderingServer.ArrayFormat | — |
vertexCount | int | — |
arrayIndex | int | — |
uintMeshSurfaceGetFormatSkinStrideuint
public static uint MeshSurfaceGetFormatSkinStride(RenderingServer.ArrayFormat format, int vertexCount);Returns the stride of the skin buffer for a mesh with given format.
| Name | Type | Default |
|---|---|---|
format | RenderingServer.ArrayFormat | — |
vertexCount | int | — |
uintMeshSurfaceGetFormatVertexStrideuint
public static uint MeshSurfaceGetFormatVertexStride(RenderingServer.ArrayFormat format, int vertexCount);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).
| Name | Type | Default |
|---|---|---|
format | RenderingServer.ArrayFormat | — |
vertexCount | int | — |
uintMeshSurfaceGetIndexBufferRdRidRid
public static Rid MeshSurfaceGetIndexBufferRdRid(Rid mesh, int surface);Returns the RenderingDevice Rid handle of the index buffer of the given mesh surface. The returned Rid can be used like any other buffer on the RenderingDevice, so the indices can be read or written from a compute shader without a CPU round-trip.
To bind the buffer as a storage buffer in compute, the surface must have been created with the RenderingServer.ArrayFormat.FlagUseStorageBuffer flag set in its format.
Returns an invalid Rid if the surface is not indexed or if the rendering backend does not expose RenderingDevice Rids (such as the OpenGL backend).
| Name | Type | Default |
|---|---|---|
mesh | Rid | — |
surface | int | — |
RidMeshSurfaceGetMaterialRid
public static Rid MeshSurfaceGetMaterial(Rid mesh, int surface);Returns a mesh's surface's material.
| Name | Type | Default |
|---|---|---|
mesh | Rid | — |
surface | int | — |
RidMeshSurfaceGetSkinBufferRdRidRid
public static Rid MeshSurfaceGetSkinBufferRdRid(Rid mesh, int surface);Returns the RenderingDevice Rid handle of the skin buffer of the given mesh surface (Bones, Weights). The returned Rid can be used like any other buffer on the RenderingDevice, so the skin data can be read or written from a compute shader without a CPU round-trip.
This buffer is created with the storage-buffer usage bit whenever the surface has skinning data, so it can be bound as a storage buffer in compute even without RenderingServer.ArrayFormat.FlagUseStorageBuffer.
Returns an invalid Rid if the surface has no skin buffer or if the rendering backend does not expose RenderingDevice Rids (such as the OpenGL backend).
| Name | Type | Default |
|---|---|---|
mesh | Rid | — |
surface | int | — |
RidMeshSurfaceGetVertexBufferRdRidRid
public static Rid MeshSurfaceGetVertexBufferRdRid(Rid mesh, int surface);Returns the RenderingDevice Rid handle of the vertex buffer of the given mesh surface (Vertex, Normal, Tangent). The returned Rid can be used like any other buffer on the RenderingDevice, so the surface vertices can be read or written from a compute shader without a CPU round-trip. This is the Mesh equivalent of RenderingServer.MultimeshGetBufferRdRid and is intended for GPU-driven mesh workflows (procedural meshes, ribbon trails, cloth, hair, grass) implemented from a ReckfellExtension.
To bind the buffer as a storage buffer in compute, the surface must have been created with the RenderingServer.ArrayFormat.FlagUseStorageBuffer flag set in its format.
Returns an invalid Rid if the surface has no vertex buffer or if the rendering backend does not expose RenderingDevice Rids (such as the OpenGL backend).
| Name | Type | Default |
|---|---|---|
mesh | Rid | — |
surface | int | — |
RidMeshSurfaceRemovevoid
public static void MeshSurfaceRemove(Rid mesh, int surface);Removes the surface at the given index from the Mesh, shifting surfaces with higher index down by one.
| Name | Type | Default |
|---|---|---|
mesh | Rid | — |
surface | int | — |
MeshSurfaceSetMaterialvoid
public static void MeshSurfaceSetMaterial(Rid mesh, int surface, Rid material);Sets a mesh's surface's material.
| Name | Type | Default |
|---|---|---|
mesh | Rid | — |
surface | int | — |
material | Rid | — |
MeshSurfaceUpdateAttributeRegion2 overloads
public static void MeshSurfaceUpdateAttributeRegion(Rid mesh, int surface, int offset, byte[] data);Updates the attribute buffer of the mesh surface with the given data. The expected data per attribute is 8 or 12 bytes (4 bytes per float, 2 floats per Vector2, and 3 floats per Vector3) depending on if the mesh is using Vector2 or Vector3 vertices. This value can be determined with RenderingServer.MeshSurfaceGetFormatAttributeStride instead.
The starting point of the updates can be changed with offset. The value of offset should be a multiple of 12 bytes in most cases to align to each attribute.
A Vector3[] of attribute locations can be converted into a byte[] using PackedVector3Array.to_byte_array for use in data.
| Name | Type | Default |
|---|---|---|
mesh | Rid | — |
surface | int | — |
offset | int | — |
data | byte[] | — |
public static void MeshSurfaceUpdateAttributeRegion(Rid mesh, int surface, int offset, ReadOnlySpan<byte> data);Updates the attribute buffer of the mesh surface with the given data. The expected data per attribute is 8 or 12 bytes (4 bytes per float, 2 floats per Vector2, and 3 floats per Vector3) depending on if the mesh is using Vector2 or Vector3 vertices. This value can be determined with RenderingServer.MeshSurfaceGetFormatAttributeStride instead.
The starting point of the updates can be changed with offset. The value of offset should be a multiple of 12 bytes in most cases to align to each attribute.
A Vector3[] of attribute locations can be converted into a byte[] using PackedVector3Array.to_byte_array for use in data.
| Name | Type | Default |
|---|---|---|
mesh | Rid | — |
surface | int | — |
offset | int | — |
data | ReadOnlySpan<byte> | — |
MeshSurfaceUpdateIndexRegion2 overloads
public static void MeshSurfaceUpdateIndexRegion(Rid mesh, int surface, int offset, byte[] data);Updates the index buffer of the mesh surface with the given data. The expected data are 16 or 32-bit unsigned integers, which can be determined with RenderingServer.MeshSurfaceGetFormatIndexStride.
| Name | Type | Default |
|---|---|---|
mesh | Rid | — |
surface | int | — |
offset | int | — |
data | byte[] | — |
public static void MeshSurfaceUpdateIndexRegion(Rid mesh, int surface, int offset, ReadOnlySpan<byte> data);Updates the index buffer of the mesh surface with the given data. The expected data are 16 or 32-bit unsigned integers, which can be determined with RenderingServer.MeshSurfaceGetFormatIndexStride.
| Name | Type | Default |
|---|---|---|
mesh | Rid | — |
surface | int | — |
offset | int | — |
data | ReadOnlySpan<byte> | — |
MeshSurfaceUpdateSkinRegion2 overloads
public static void MeshSurfaceUpdateSkinRegion(Rid mesh, int surface, int offset, byte[] data);Updates the skin buffer of the mesh surface with the given data. The expected data per skin is 8 or 12 bytes (4 bytes per float, 2 floats per Vector2, and 3 floats per Vector3) depending on if the mesh is using Vector2 or Vector3 vertices. This value can be determined with RenderingServer.MeshSurfaceGetFormatSkinStride instead.
The starting point of the updates can be changed with offset. The value of offset should be a multiple of 12 bytes in most cases to align to each skin.
A Vector3[] of skin locations can be converted into a byte[] using PackedVector3Array.to_byte_array for use in data.
| Name | Type | Default |
|---|---|---|
mesh | Rid | — |
surface | int | — |
offset | int | — |
data | byte[] | — |
public static void MeshSurfaceUpdateSkinRegion(Rid mesh, int surface, int offset, ReadOnlySpan<byte> data);Updates the skin buffer of the mesh surface with the given data. The expected data per skin is 8 or 12 bytes (4 bytes per float, 2 floats per Vector2, and 3 floats per Vector3) depending on if the mesh is using Vector2 or Vector3 vertices. This value can be determined with RenderingServer.MeshSurfaceGetFormatSkinStride instead.
The starting point of the updates can be changed with offset. The value of offset should be a multiple of 12 bytes in most cases to align to each skin.
A Vector3[] of skin locations can be converted into a byte[] using PackedVector3Array.to_byte_array for use in data.
| Name | Type | Default |
|---|---|---|
mesh | Rid | — |
surface | int | — |
offset | int | — |
data | ReadOnlySpan<byte> | — |
MeshSurfaceUpdateVertexRegion2 overloads
public static void MeshSurfaceUpdateVertexRegion(Rid mesh, int surface, int offset, byte[] data);Updates the vertex buffer of the mesh surface with the given data. The expected data per vertex is 8 or 12 bytes (4 bytes per float, 2 floats per Vector2, and 3 floats per Vector3) depending on if the mesh is using Vector2 or Vector3 vertices. This value can be determined with RenderingServer.MeshSurfaceGetFormatVertexStride instead.
The starting point of the updates can be changed with offset. The value of offset should be a multiple of 12 bytes in most cases to align to each vertex.
A Vector3[] of vertex locations can be converted into a byte[] using PackedVector3Array.to_byte_array for use in data.
| Name | Type | Default |
|---|---|---|
mesh | Rid | — |
surface | int | — |
offset | int | — |
data | byte[] | — |
public static void MeshSurfaceUpdateVertexRegion(Rid mesh, int surface, int offset, ReadOnlySpan<byte> data);Updates the vertex buffer of the mesh surface with the given data. The expected data per vertex is 8 or 12 bytes (4 bytes per float, 2 floats per Vector2, and 3 floats per Vector3) depending on if the mesh is using Vector2 or Vector3 vertices. This value can be determined with RenderingServer.MeshSurfaceGetFormatVertexStride instead.
The starting point of the updates can be changed with offset. The value of offset should be a multiple of 12 bytes in most cases to align to each vertex.
A Vector3[] of vertex locations can be converted into a byte[] using PackedVector3Array.to_byte_array for use in data.
| Name | Type | Default |
|---|---|---|
mesh | Rid | — |
surface | int | — |
offset | int | — |
data | ReadOnlySpan<byte> | — |
MultimeshAllocateData2 overloads
public static void MultimeshAllocateData(Rid multimesh, int instances, RenderingServer.MultimeshTransformFormat transformFormat, bool colorFormat, bool customDataFormat);Sets up the multimesh using the specified data. The number of instances is set by instances. The format of the instance transforms is set by transform_format, which should be set according to whether the multimesh is meant to be rendered in 2D or 3D. If color_format is true, each instance will have a color associated with it. If custom_data_format is true, each instance will have a custom data vector associated with it. If use_indirect is true, an indirect command buffer will be created for this multimesh, allowing the instance count to be modified directly on the GPU. See also RenderingServer.MultimeshGetCommandBufferRdRid.
| Name | Type | Default |
|---|---|---|
multimesh | Rid | — |
instances | int | — |
transformFormat | RenderingServer.MultimeshTransformFormat | — |
colorFormat | bool | — |
customDataFormat | bool | — |
public static void MultimeshAllocateData(Rid multimesh, int instances, RenderingServer.MultimeshTransformFormat transformFormat, bool colorFormat = false, bool customDataFormat = false, bool useIndirect = false);Sets up the multimesh using the specified data. The number of instances is set by instances. The format of the instance transforms is set by transform_format, which should be set according to whether the multimesh is meant to be rendered in 2D or 3D. If color_format is true, each instance will have a color associated with it. If custom_data_format is true, each instance will have a custom data vector associated with it. If use_indirect is true, an indirect command buffer will be created for this multimesh, allowing the instance count to be modified directly on the GPU. See also RenderingServer.MultimeshGetCommandBufferRdRid.
| Name | Type | Default |
|---|---|---|
multimesh | Rid | — |
instances | int | — |
transformFormat | RenderingServer.MultimeshTransformFormat | — |
colorFormat | bool | false |
customDataFormat | bool | false |
useIndirect | bool | false |
MultimeshCreateRid
public static Rid MultimeshCreate();Creates a new multimesh on the RenderingServer and returns an Rid handle. This RID will be used in all multimesh_* RenderingServer functions.
Once finished with your RID, you will want to free the RID using the RenderingServer's RenderingServer.FreeRid method.
To place in a scene, attach this multimesh to an instance using RenderingServer.InstanceSetBase using the returned RID.
Note: The equivalent resource is MultiMesh.
RidMultimeshGetAabbAabb
public static Aabb MultimeshGetAabb(Rid multimesh);Calculates and returns the axis-aligned bounding box that encloses all instances within the multimesh.
| Name | Type | Default |
|---|---|---|
multimesh | Rid | — |
AabbMultimeshGetBufferfloat[]
public static float[] MultimeshGetBuffer(Rid multimesh);Returns the MultiMesh data (such as instance transforms, colors, etc.). See RenderingServer.MultimeshSetBuffer for details on the returned data.
Note: If the buffer is in the engine's internal cache, it will have to be fetched from GPU memory and possibly decompressed. This means RenderingServer.MultimeshGetBuffer is potentially a slow operation and should be avoided whenever possible.
| Name | Type | Default |
|---|---|---|
multimesh | Rid | — |
float[]MultimeshGetBufferRdRidRid
public static Rid MultimeshGetBufferRdRid(Rid multimesh);Returns the RenderingDevice Rid handle of the MultiMesh, which can be used as any other buffer on the Rendering Device.
| Name | Type | Default |
|---|---|---|
multimesh | Rid | — |
RidMultimeshGetCommandBufferRdRidRid
public static Rid MultimeshGetCommandBufferRdRid(Rid multimesh);Returns the RenderingDevice Rid handle of the MultiMesh command buffer. This Rid is only valid if use_indirect is set to true when allocating data through RenderingServer.MultimeshAllocateData. It can be used to directly modify the instance count via buffer.
The data structure is dependent on both how many surfaces the mesh contains and whether it is indexed or not, the buffer has 5 integers in it, with the last unused if the mesh is not indexed.
Each of the values in the buffer correspond to these options:
Indexed:
0 - indexCount;
1 - instanceCount;
2 - firstIndex;
3 - vertexOffset;
4 - firstInstance;
Non-indexed:
0 - vertexCount;
1 - instanceCount;
2 - firstVertex;
3 - firstInstance;
4 - unused;| Name | Type | Default |
|---|---|---|
multimesh | Rid | — |
RidMultimeshGetCustomAabbAabb
public static Aabb MultimeshGetCustomAabb(Rid multimesh);Returns the custom AABB defined for this MultiMesh resource.
| Name | Type | Default |
|---|---|---|
multimesh | Rid | — |
AabbMultimeshGetInstanceCountint
public static int MultimeshGetInstanceCount(Rid multimesh);Returns the number of instances allocated for this multimesh.
| Name | Type | Default |
|---|---|---|
multimesh | Rid | — |
intMultimeshGetMeshRid
public static Rid MultimeshGetMesh(Rid multimesh);Returns the RID of the mesh that will be used in drawing this multimesh.
| Name | Type | Default |
|---|---|---|
multimesh | Rid | — |
RidMultimeshGetVisibleInstancesint
public static int MultimeshGetVisibleInstances(Rid multimesh);Returns the number of visible instances for this multimesh.
| Name | Type | Default |
|---|---|---|
multimesh | Rid | — |
intMultimeshInstanceGetColorColor
public static Color MultimeshInstanceGetColor(Rid multimesh, int index);Returns the color by which the specified instance will be modulated.
| Name | Type | Default |
|---|---|---|
multimesh | Rid | — |
index | int | — |
ColorMultimeshInstanceGetCustomDataColor
public static Color MultimeshInstanceGetCustomData(Rid multimesh, int index);Returns the custom data associated with the specified instance.
| Name | Type | Default |
|---|---|---|
multimesh | Rid | — |
index | int | — |
ColorMultimeshInstanceGetTransformTransform3D
public static Transform3D MultimeshInstanceGetTransform(Rid multimesh, int index);Returns the Transform3D of the specified instance.
| Name | Type | Default |
|---|---|---|
multimesh | Rid | — |
index | int | — |
Transform3DMultimeshInstanceGetTransform2DTransform2D
public static Transform2D MultimeshInstanceGetTransform2D(Rid multimesh, int index);Returns the Transform2D of the specified instance. For use when the multimesh is set to use 2D transforms.
| Name | Type | Default |
|---|---|---|
multimesh | Rid | — |
index | int | — |
Transform2DMultimeshInstanceResetPhysicsInterpolationvoid
public static void MultimeshInstanceResetPhysicsInterpolation(Rid multimesh, int index);Prevents physics interpolation for the specified instance during the current physics tick. This is useful when moving an instance to a new location, to give an instantaneous change rather than interpolation from the previous location.
| Name | Type | Default |
|---|---|---|
multimesh | Rid | — |
index | int | — |
MultimeshInstanceSetColorvoid
public static void MultimeshInstanceSetColor(Rid multimesh, int index, Color color);Sets the color by which this instance will be modulated. Equivalent to MultiMesh.SetInstanceColor.
| Name | Type | Default |
|---|---|---|
multimesh | Rid | — |
index | int | — |
color | Color | — |
MultimeshInstanceSetCustomDatavoid
public static void MultimeshInstanceSetCustomData(Rid multimesh, int index, Color customData);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 MultiMesh.SetInstanceCustomData.
| Name | Type | Default |
|---|---|---|
multimesh | Rid | — |
index | int | — |
customData | Color | — |
MultimeshInstanceSetTransformvoid
public static void MultimeshInstanceSetTransform(Rid multimesh, int index, Transform3D transform);Sets the Transform3D for this instance. Equivalent to MultiMesh.SetInstanceTransform.
| Name | Type | Default |
|---|---|---|
multimesh | Rid | — |
index | int | — |
transform | Transform3D | — |
MultimeshInstanceSetTransform2Dvoid
public static void MultimeshInstanceSetTransform2D(Rid multimesh, int index, Transform2D transform);Sets the Transform2D for this instance. For use when multimesh is used in 2D. Equivalent to MultiMesh.SetInstanceTransform2D.
| Name | Type | Default |
|---|---|---|
multimesh | Rid | — |
index | int | — |
transform | Transform2D | — |
MultimeshInstancesResetPhysicsInterpolationvoid
public static void MultimeshInstancesResetPhysicsInterpolation(Rid multimesh);Prevents physics interpolation for all instances during the current physics tick. This is useful when moving all instances to new locations, to give instantaneous changes rather than interpolation from the previous locations.
| Name | Type | Default |
|---|---|---|
multimesh | Rid | — |
MultimeshSetBuffer2 overloads
public static void MultimeshSetBuffer(Rid multimesh, ReadOnlySpan<float> buffer);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 RenderingServer.MultimeshGetBuffer.
The per-instance data size and expected data order is:
2D:
- Position: 8 floats (8 floats for Transform2D)
- Position + Vertex color: 12 floats (8 floats for Transform2D, 4 floats for Color)
- Position + Custom data: 12 floats (8 floats for Transform2D, 4 floats of custom data)
- Position + Vertex color + Custom data: 16 floats (8 floats for Transform2D, 4 floats for Color, 4 floats of custom data)
3D:
- Position: 12 floats (12 floats for Transform3D)
- Position + Vertex color: 16 floats (12 floats for Transform3D, 4 floats for Color)
- Position + Custom data: 16 floats (12 floats for Transform3D, 4 floats of custom data)
- Position + Vertex color + Custom data: 20 floats (12 floats for Transform3D, 4 floats for Color, 4 floats of custom data)Instance transforms are in row-major order. Specifically:
- For
Transform2Dthe float-order is:(x.x, y.x, padding_float, origin.x, x.y, y.y, padding_float, origin.y). - For
Transform3Dthe float-order is:(basis.x.x, basis.y.x, basis.z.x, origin.x, basis.x.y, basis.y.y, basis.z.y, origin.y, basis.x.z, basis.y.z, basis.z.z, origin.z).
| Name | Type | Default |
|---|---|---|
multimesh | Rid | — |
buffer | ReadOnlySpan<float> | — |
public static void MultimeshSetBuffer(Rid multimesh, float[] buffer);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 RenderingServer.MultimeshGetBuffer.
The per-instance data size and expected data order is:
2D:
- Position: 8 floats (8 floats for Transform2D)
- Position + Vertex color: 12 floats (8 floats for Transform2D, 4 floats for Color)
- Position + Custom data: 12 floats (8 floats for Transform2D, 4 floats of custom data)
- Position + Vertex color + Custom data: 16 floats (8 floats for Transform2D, 4 floats for Color, 4 floats of custom data)
3D:
- Position: 12 floats (12 floats for Transform3D)
- Position + Vertex color: 16 floats (12 floats for Transform3D, 4 floats for Color)
- Position + Custom data: 16 floats (12 floats for Transform3D, 4 floats of custom data)
- Position + Vertex color + Custom data: 20 floats (12 floats for Transform3D, 4 floats for Color, 4 floats of custom data)Instance transforms are in row-major order. Specifically:
- For
Transform2Dthe float-order is:(x.x, y.x, padding_float, origin.x, x.y, y.y, padding_float, origin.y). - For
Transform3Dthe float-order is:(basis.x.x, basis.y.x, basis.z.x, origin.x, basis.x.y, basis.y.y, basis.z.y, origin.y, basis.x.z, basis.y.z, basis.z.z, origin.z).
| Name | Type | Default |
|---|---|---|
multimesh | Rid | — |
buffer | float[] | — |
MultimeshSetBufferInterpolated2 overloads
public static void MultimeshSetBufferInterpolated(Rid multimesh, ReadOnlySpan<float> buffer, ReadOnlySpan<float> bufferPrevious);Alternative version of RenderingServer.MultimeshSetBuffer for use with physics interpolation.
Takes both an array of current data and an array of data for the previous physics tick.
| Name | Type | Default |
|---|---|---|
multimesh | Rid | — |
buffer | ReadOnlySpan<float> | — |
bufferPrevious | ReadOnlySpan<float> | — |
public static void MultimeshSetBufferInterpolated(Rid multimesh, float[] buffer, float[] bufferPrevious);Alternative version of RenderingServer.MultimeshSetBuffer for use with physics interpolation.
Takes both an array of current data and an array of data for the previous physics tick.
| Name | Type | Default |
|---|---|---|
multimesh | Rid | — |
buffer | float[] | — |
bufferPrevious | float[] | — |
MultimeshSetCustomAabbvoid
public static void MultimeshSetCustomAabb(Rid multimesh, Aabb aabb);Sets the custom AABB for this MultiMesh resource.
| Name | Type | Default |
|---|---|---|
multimesh | Rid | — |
aabb | Aabb | — |
MultimeshSetMeshvoid
public static void MultimeshSetMesh(Rid multimesh, Rid mesh);Sets the mesh to be drawn by the multimesh. Equivalent to MultiMesh.Mesh.
| Name | Type | Default |
|---|---|---|
multimesh | Rid | — |
mesh | Rid | — |
MultimeshSetPhysicsInterpolatedvoid
public static void MultimeshSetPhysicsInterpolated(Rid multimesh, bool interpolated);Turns on and off physics interpolation for this MultiMesh resource.
| Name | Type | Default |
|---|---|---|
multimesh | Rid | — |
interpolated | bool | — |
MultimeshSetPhysicsInterpolationQualityvoid
public static void MultimeshSetPhysicsInterpolationQuality(Rid multimesh, RenderingServer.MultimeshPhysicsInterpolationQuality quality);Sets the physics interpolation quality for the MultiMesh.
A value of RenderingServer.MultimeshPhysicsInterpolationQuality.Fast gives fast but low quality interpolation, a value of RenderingServer.MultimeshPhysicsInterpolationQuality.High gives slower but higher quality interpolation.
| Name | Type | Default |
|---|---|---|
multimesh | Rid | — |
quality | RenderingServer.MultimeshPhysicsInterpolationQuality | — |
MultimeshSetVisibleInstancesvoid
public static void MultimeshSetVisibleInstances(Rid multimesh, int visible);Sets the number of instances visible at a given time. If -1, all instances that have been allocated are drawn. Equivalent to MultiMesh.VisibleInstanceCount.
| Name | Type | Default |
|---|---|---|
multimesh | Rid | — |
visible | int | — |
OccluderCreateRid
public static Rid OccluderCreate();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.
Once finished with your RID, you will want to free the RID using the RenderingServer's RenderingServer.FreeRid method.
Note: The equivalent resource is Occluder3D (not to be confused with the OccluderInstance3D node).
RidOccluderSetMesh2 overloads
public static void OccluderSetMesh(Rid occluder, Vector3[] vertices, int[] indices);Sets the mesh data for the given occluder RID, which controls the shape of the occlusion culling that will be performed.
| Name | Type | Default |
|---|---|---|
occluder | Rid | — |
vertices | Vector3[] | — |
indices | int[] | — |
public static void OccluderSetMesh(Rid occluder, ReadOnlySpan<Vector3> vertices, ReadOnlySpan<int> indices);Sets the mesh data for the given occluder RID, which controls the shape of the occlusion culling that will be performed.
| Name | Type | Default |
|---|---|---|
occluder | Rid | — |
vertices | ReadOnlySpan<Vector3> | — |
indices | ReadOnlySpan<int> | — |
OmniLightCreateRid
public static Rid OmniLightCreate();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.
Once finished with your RID, you will want to free the RID using the RenderingServer's RenderingServer.FreeRid method.
To place in a scene, attach this omni light to an instance using RenderingServer.InstanceSetBase using the returned RID.
Note: The equivalent node is OmniLight3D.
RidParticlesCollisionCreateRid
public static Rid ParticlesCollisionCreate();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.
Note: The equivalent nodes are GpuParticlesCollision3D and GpuParticlesAttractor3D.
RidParticlesCollisionHeightFieldUpdatevoid
public static void ParticlesCollisionHeightFieldUpdate(Rid particlesCollision);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 GpuParticlesCollisionHeightField3D.UpdateMode.
| Name | Type | Default |
|---|---|---|
particlesCollision | Rid | — |
ParticlesCollisionSetAttractorAttenuationvoid
public static void ParticlesCollisionSetAttractorAttenuation(Rid particlesCollision, float curve);Sets the attenuation curve for the 3D GPU particles attractor specified by the particles_collision RID. Only used for attractors, not colliders. Equivalent to GpuParticlesAttractor3D.Attenuation.
| Name | Type | Default |
|---|---|---|
particlesCollision | Rid | — |
curve | float | — |
ParticlesCollisionSetAttractorDirectionalityvoid
public static void ParticlesCollisionSetAttractorDirectionality(Rid particlesCollision, float amount);Sets the directionality amount for the 3D GPU particles attractor specified by the particles_collision RID. Only used for attractors, not colliders. Equivalent to GpuParticlesAttractor3D.Directionality.
| Name | Type | Default |
|---|---|---|
particlesCollision | Rid | — |
amount | float | — |
ParticlesCollisionSetAttractorStrengthvoid
public static void ParticlesCollisionSetAttractorStrength(Rid particlesCollision, float strength);Sets the strength for the 3D GPU particles attractor specified by the particles_collision RID. Only used for attractors, not colliders. Equivalent to GpuParticlesAttractor3D.Strength.
| Name | Type | Default |
|---|---|---|
particlesCollision | Rid | — |
strength | float | — |
ParticlesCollisionSetBoxExtentsvoid
public static void ParticlesCollisionSetBoxExtents(Rid particlesCollision, Vector3 extents);Sets the extents for the 3D GPU particles collision by the particles_collision RID. Equivalent to GpuParticlesCollisionBox3D.Size, GpuParticlesCollisionSdf3D.Size, GpuParticlesCollisionHeightField3D.Size, GpuParticlesAttractorBox3D.Size or GpuParticlesAttractorVectorField3D.Size depending on the particles_collision type.
| Name | Type | Default |
|---|---|---|
particlesCollision | Rid | — |
extents | Vector3 | — |
ParticlesCollisionSetCollisionTypevoid
public static void ParticlesCollisionSetCollisionType(Rid particlesCollision, RenderingServer.ParticlesCollisionType type);Sets the collision or attractor shape type for the 3D GPU particles collision or attractor specified by the particles_collision RID.
| Name | Type | Default |
|---|---|---|
particlesCollision | Rid | — |
type | RenderingServer.ParticlesCollisionType | — |
ParticlesCollisionSetCullMaskvoid
public static void ParticlesCollisionSetCullMask(Rid particlesCollision, uint mask);Sets the cull mask for the 3D GPU particles collision or attractor specified by the particles_collision RID. Equivalent to GpuParticlesCollision3D.CullMask or GpuParticlesAttractor3D.CullMask depending on the particles_collision type.
| Name | Type | Default |
|---|---|---|
particlesCollision | Rid | — |
mask | uint | — |
ParticlesCollisionSetFieldTexturevoid
public static void ParticlesCollisionSetFieldTexture(Rid particlesCollision, Rid texture);Sets the signed distance field texture for the 3D GPU particles collision specified by the particles_collision RID. Equivalent to GpuParticlesCollisionSdf3D.Texture or GpuParticlesAttractorVectorField3D.Texture depending on the particles_collision type.
| Name | Type | Default |
|---|---|---|
particlesCollision | Rid | — |
texture | Rid | — |
ParticlesCollisionSetHeightFieldMaskvoid
public static void ParticlesCollisionSetHeightFieldMask(Rid particlesCollision, uint mask);Sets the heightfield mask for the 3D GPU particles heightfield collision specified by the particles_collision RID. Equivalent to GpuParticlesCollisionHeightField3D.HeightfieldMask.
| Name | Type | Default |
|---|---|---|
particlesCollision | Rid | — |
mask | uint | — |
ParticlesCollisionSetHeightFieldResolutionvoid
public static void ParticlesCollisionSetHeightFieldResolution(Rid particlesCollision, RenderingServer.ParticlesCollisionHeightfieldResolution resolution);Sets the heightmap resolution for the 3D GPU particles heightfield collision specified by the particles_collision RID. Equivalent to GpuParticlesCollisionHeightField3D.Resolution.
| Name | Type | Default |
|---|---|---|
particlesCollision | Rid | — |
resolution | RenderingServer.ParticlesCollisionHeightfieldResolution | — |
ParticlesCollisionSetSphereRadiusvoid
public static void ParticlesCollisionSetSphereRadius(Rid particlesCollision, float radius);Sets the radius for the 3D GPU particles sphere collision or attractor specified by the particles_collision RID. Equivalent to GpuParticlesCollisionSphere3D.Radius or GpuParticlesAttractorSphere3D.Radius depending on the particles_collision type.
| Name | Type | Default |
|---|---|---|
particlesCollision | Rid | — |
radius | float | — |
ParticlesCreateRid
public static Rid ParticlesCreate();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.
Once finished with your RID, you will want to free the RID using the RenderingServer's RenderingServer.FreeRid method.
To place in a scene, attach these particles to an instance using RenderingServer.InstanceSetBase using the returned RID.
Note: The equivalent nodes are GpuParticles2D and GpuParticles3D.
Note: All particles_* methods only apply to GPU-based particles, not CPU-based particles. CpuParticles2D and CpuParticles3D do not have equivalent RenderingServer functions available, as these use MultiMeshInstance2D and MultiMeshInstance3D under the hood (see multimesh_* methods).
RidParticlesEmitvoid
public static void ParticlesEmit(Rid particles, Transform3D transform, Vector3 velocity, Color color, Color custom, uint emitFlags);Manually emits particles from the particles instance.
| Name | Type | Default |
|---|---|---|
particles | Rid | — |
transform | Transform3D | — |
velocity | Vector3 | — |
color | Color | — |
custom | Color | — |
emitFlags | uint | — |
ParticlesGetCurrentAabbAabb
public static Aabb ParticlesGetCurrentAabb(Rid particles);Calculates and returns the axis-aligned bounding box that contains all the particles. Equivalent to GpuParticles3D.CaptureAabb.
| Name | Type | Default |
|---|---|---|
particles | Rid | — |
AabbParticlesGetEmittingbool
public static bool ParticlesGetEmitting(Rid particles);Returns true if particles are currently set to emitting.
| Name | Type | Default |
|---|---|---|
particles | Rid | — |
boolParticlesIsInactivebool
public static bool ParticlesIsInactive(Rid particles);Returns true if particles are not emitting and particles are set to inactive.
| Name | Type | Default |
|---|---|---|
particles | Rid | — |
boolParticlesRequestProcessvoid
public static void ParticlesRequestProcess(Rid particles);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 RenderingServer.InstancesCullAabb, RenderingServer.InstancesCullConvex, or RenderingServer.InstancesCullRay.
| Name | Type | Default |
|---|---|---|
particles | Rid | — |
ParticlesRequestProcessTime2 overloads
public static void ParticlesRequestProcessTime(Rid particles, float processTime);Requests the particles to process for extra process time during a single frame.
process_time defines the time that the particles will process while emitting is on. process_time_residual defines the time that particles will process with emitting turned off for the simulation. When combined with the particles' speed scale set to 0.0, this is useful to be able to seek a particle system timeline.
| Name | Type | Default |
|---|---|---|
particles | Rid | — |
processTime | float | — |
public static void ParticlesRequestProcessTime(Rid particles, float processTime, float processTimeResidual = 0f);Requests the particles to process for extra process time during a single frame.
process_time defines the time that the particles will process while emitting is on. process_time_residual defines the time that particles will process with emitting turned off for the simulation. When combined with the particles' speed scale set to 0.0, this is useful to be able to seek a particle system timeline.
| Name | Type | Default |
|---|---|---|
particles | Rid | — |
processTime | float | — |
processTimeResidual | float | 0f |
ParticlesRestartvoid
public static void ParticlesRestart(Rid particles);Reset the particles on the next update. Equivalent to GpuParticles3D.Restart.
| Name | Type | Default |
|---|---|---|
particles | Rid | — |
ParticlesSetAmountvoid
public static void ParticlesSetAmount(Rid particles, int amount);Sets the number of particles to be drawn and allocates the memory for them. Equivalent to GpuParticles3D.Amount.
| Name | Type | Default |
|---|---|---|
particles | Rid | — |
amount | int | — |
ParticlesSetAmountRatiovoid
public static void ParticlesSetAmountRatio(Rid particles, float ratio);Sets the amount ratio for particles to be emitted. Equivalent to GpuParticles3D.AmountRatio.
| Name | Type | Default |
|---|---|---|
particles | Rid | — |
ratio | float | — |
ParticlesSetCollisionBaseSizevoid
public static void ParticlesSetCollisionBaseSize(Rid particles, float size);Sets the base size for particle collision. Equivalent to GpuParticles3D.CollisionBaseSize.
| Name | Type | Default |
|---|---|---|
particles | Rid | — |
size | float | — |
ParticlesSetCustomAabbvoid
public static void ParticlesSetCustomAabb(Rid particles, Aabb aabb);Sets a custom axis-aligned bounding box for the particle system. Equivalent to GpuParticles3D.VisibilityAabb.
| Name | Type | Default |
|---|---|---|
particles | Rid | — |
aabb | Aabb | — |
ParticlesSetDrawOrdervoid
public static void ParticlesSetDrawOrder(Rid particles, RenderingServer.ParticlesDrawOrder order);Sets the draw order of the particles. Equivalent to GpuParticles3D.DrawOrder.
| Name | Type | Default |
|---|---|---|
particles | Rid | — |
order | RenderingServer.ParticlesDrawOrder | — |
ParticlesSetDrawPassMeshvoid
public static void ParticlesSetDrawPassMesh(Rid particles, int pass, Rid mesh);Sets the mesh to be used for the specified draw pass. Equivalent to GpuParticles3D.DrawPass1, GpuParticles3D.DrawPass2, GpuParticles3D.DrawPass3, and GpuParticles3D.DrawPass4.
| Name | Type | Default |
|---|---|---|
particles | Rid | — |
pass | int | — |
mesh | Rid | — |
ParticlesSetDrawPassesvoid
public static void ParticlesSetDrawPasses(Rid particles, int count);Sets the number of draw passes to use. Equivalent to GpuParticles3D.DrawPasses.
| Name | Type | Default |
|---|---|---|
particles | Rid | — |
count | int | — |
ParticlesSetEmissionTransformvoid
public static void ParticlesSetEmissionTransform(Rid particles, Transform3D transform);Sets the Transform3D that will be used by the particles when they first emit.
| Name | Type | Default |
|---|---|---|
particles | Rid | — |
transform | Transform3D | — |
ParticlesSetEmitterVelocityvoid
public static void ParticlesSetEmitterVelocity(Rid particles, Vector3 velocity);Sets the velocity of a particle node, that will be used by ParticleProcessMaterial.InheritVelocityRatio.
| Name | Type | Default |
|---|---|---|
particles | Rid | — |
velocity | Vector3 | — |
ParticlesSetEmittingvoid
public static void ParticlesSetEmitting(Rid particles, bool emitting);If true, particles will emit over time. Setting to false does not reset the particles, but only stops their emission. Equivalent to GpuParticles3D.Emitting.
| Name | Type | Default |
|---|---|---|
particles | Rid | — |
emitting | bool | — |
ParticlesSetExplosivenessRatiovoid
public static void ParticlesSetExplosivenessRatio(Rid particles, float ratio);Sets the explosiveness ratio. Equivalent to GpuParticles3D.Explosiveness.
| Name | Type | Default |
|---|---|---|
particles | Rid | — |
ratio | float | — |
ParticlesSetFixedFpsvoid
public static void ParticlesSetFixedFps(Rid particles, int fps);Sets the frame rate that the particle system rendering will be fixed to. Equivalent to GpuParticles3D.FixedFps.
| Name | Type | Default |
|---|---|---|
particles | Rid | — |
fps | int | — |
ParticlesSetFractionalDeltavoid
public static void ParticlesSetFractionalDelta(Rid particles, bool enable);If true, uses fractional delta which smooths the movement of the particles. Equivalent to GpuParticles3D.FractDelta.
| Name | Type | Default |
|---|---|---|
particles | Rid | — |
enable | bool | — |
ParticlesSetInterpToEndvoid
public static void ParticlesSetInterpToEnd(Rid particles, float factor);Sets the value that informs a ParticleProcessMaterial to rush all particles towards the end of their lifetime.
| Name | Type | Default |
|---|---|---|
particles | Rid | — |
factor | float | — |
ParticlesSetInterpolatevoid
public static void ParticlesSetInterpolate(Rid particles, bool enable);Sets whether particles should use interpolation between fixed steps. Equivalent to GpuParticles3D.Interpolate.
| Name | Type | Default |
|---|---|---|
particles | Rid | — |
enable | bool | — |
ParticlesSetLifetimevoid
public static void ParticlesSetLifetime(Rid particles, double lifetime);Sets the lifetime of each particle in the system. Equivalent to GpuParticles3D.Lifetime.
| Name | Type | Default |
|---|---|---|
particles | Rid | — |
lifetime | double | — |
ParticlesSetModevoid
public static void ParticlesSetMode(Rid particles, RenderingServer.ParticlesMode mode);Sets whether the GPU particles specified by the particles RID should be rendered in 2D or 3D according to mode.
| Name | Type | Default |
|---|---|---|
particles | Rid | — |
mode | RenderingServer.ParticlesMode | — |
ParticlesSetOneShotvoid
public static void ParticlesSetOneShot(Rid particles, bool oneShot);If true, particles will emit once and then stop. Equivalent to GpuParticles3D.OneShot.
| Name | Type | Default |
|---|---|---|
particles | Rid | — |
oneShot | bool | — |
ParticlesSetPreProcessTimevoid
public static void ParticlesSetPreProcessTime(Rid particles, double time);Sets the preprocess time for the particles' animation. This lets you delay starting an animation until after the particles have begun emitting. Equivalent to GpuParticles3D.Preprocess.
| Name | Type | Default |
|---|---|---|
particles | Rid | — |
time | double | — |
ParticlesSetProcessMaterialvoid
public static void ParticlesSetProcessMaterial(Rid particles, Rid material);Sets the material for processing the particles.
Note: This is not the material used to draw the materials. Equivalent to GpuParticles3D.ProcessMaterial.
| Name | Type | Default |
|---|---|---|
particles | Rid | — |
material | Rid | — |
ParticlesSetRandomnessRatiovoid
public static void ParticlesSetRandomnessRatio(Rid particles, float ratio);Sets the emission randomness ratio. This randomizes the emission of particles within their phase. Equivalent to GpuParticles3D.Randomness.
| Name | Type | Default |
|---|---|---|
particles | Rid | — |
ratio | float | — |
ParticlesSetSpeedScalevoid
public static void ParticlesSetSpeedScale(Rid particles, double scale);Sets the speed scale of the particle system. Equivalent to GpuParticles3D.SpeedScale.
| Name | Type | Default |
|---|---|---|
particles | Rid | — |
scale | double | — |
ParticlesSetSubemittervoid
public static void ParticlesSetSubemitter(Rid particles, Rid subemitterParticles);Sets the subemitter particles for the particle system. Equivalent to GpuParticles3D.SubEmitter.
| Name | Type | Default |
|---|---|---|
particles | Rid | — |
subemitterParticles | Rid | — |
ParticlesSetTrailBindPosesvoid
public static void ParticlesSetTrailBindPoses(Rid particles, Reckfell.Collections.Array<Transform3D> bindPoses);Sets the trail bind poses for the particle system. This specified as an array of Transform3Ds representing the bind pose for each draw pass. See GpuParticles3D.DrawSkin, Skin.GetBindCount, and Skin.GetBindPose. Set the value for each draw pass to Transform3D.Identity to use the default behavior, which is what built-in trails use (RibbonTrailMesh and TubeTrailMesh).
| Name | Type | Default |
|---|---|---|
particles | Rid | — |
bindPoses | Reckfell.Collections.Array<Transform3D> | — |
ParticlesSetTrailsvoid
public static void ParticlesSetTrails(Rid particles, bool enable, float lengthSec);If enable is true, enables trails for the particles with the specified length_sec in seconds. Equivalent to GpuParticles3D.TrailEnabled and GpuParticles3D.TrailLifetime.
| Name | Type | Default |
|---|---|---|
particles | Rid | — |
enable | bool | — |
lengthSec | float | — |
ParticlesSetTransformAlignvoid
public static void ParticlesSetTransformAlign(Rid particles, RenderingServer.ParticlesTransformAlign align);Sets the transform alignment for the particle system. Equivalent to GpuParticles3D.TransformAlign.
| Name | Type | Default |
|---|---|---|
particles | Rid | — |
align | RenderingServer.ParticlesTransformAlign | — |
ParticlesSetTransformAlignAxisvoid
public static void ParticlesSetTransformAlignAxis(Rid particles, RenderingServer.ParticlesTransformAlignAxis rotationAxis);Sets which axis to use for transform alignment.
| Name | Type | Default |
|---|---|---|
particles | Rid | — |
rotationAxis | RenderingServer.ParticlesTransformAlignAxis | — |
ParticlesSetTransformAlignChannelFiltervoid
public static void ParticlesSetTransformAlignChannelFilter(Rid particles, RenderingServer.ParticlesTransformAlignCustomSrc channelFilter);When using Z-Billboarding, which CUSTOM channel to read from.
| Name | Type | Default |
|---|---|---|
particles | Rid | — |
channelFilter | RenderingServer.ParticlesTransformAlignCustomSrc | — |
ParticlesSetUseLocalCoordinatesvoid
public static void ParticlesSetUseLocalCoordinates(Rid particles, bool enable);If true, particles use local coordinates. If false they use global coordinates. Equivalent to GpuParticles3D.LocalCoords.
| Name | Type | Default |
|---|---|---|
particles | Rid | — |
enable | bool | — |
PositionalSoftShadowFilterSetQualityvoid
public static void PositionalSoftShadowFilterSetQuality(RenderingServer.ShadowQuality quality);Sets the filter quality for omni and spot light shadows in 3D. See also ProjectSettings.rendering/lights_and_shadows/positional_shadow/soft_shadow_filter_quality. This parameter is global and cannot be set on a per-viewport basis.
| Name | Type | Default |
|---|---|---|
quality | RenderingServer.ShadowQuality | — |
ReflectionProbeCreateRid
public static Rid ReflectionProbeCreate();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.
Once finished with your RID, you will want to free the RID using the RenderingServer's RenderingServer.FreeRid method.
To place in a scene, attach this reflection probe to an instance using RenderingServer.InstanceSetBase using the returned RID.
Note: The equivalent node is ReflectionProbe.
RidReflectionProbeSetAmbientColorvoid
public static void ReflectionProbeSetAmbientColor(Rid probe, Color color);Sets the reflection probe's custom ambient light color. Equivalent to ReflectionProbe.AmbientColor.
| Name | Type | Default |
|---|---|---|
probe | Rid | — |
color | Color | — |
ReflectionProbeSetAmbientEnergyvoid
public static void ReflectionProbeSetAmbientEnergy(Rid probe, float energy);Sets the reflection probe's custom ambient light energy. Equivalent to ReflectionProbe.AmbientColorEnergy.
| Name | Type | Default |
|---|---|---|
probe | Rid | — |
energy | float | — |
ReflectionProbeSetAmbientModevoid
public static void ReflectionProbeSetAmbientMode(Rid probe, RenderingServer.ReflectionProbeAmbientMode mode);Sets the reflection probe's ambient light mode. Equivalent to ReflectionProbe.AmbientMode.
| Name | Type | Default |
|---|---|---|
probe | Rid | — |
mode | RenderingServer.ReflectionProbeAmbientMode | — |
ReflectionProbeSetAsInteriorvoid
public static void ReflectionProbeSetAsInterior(Rid probe, bool enable);If true, reflections will ignore sky contribution. Equivalent to ReflectionProbe.Interior.
| Name | Type | Default |
|---|---|---|
probe | Rid | — |
enable | bool | — |
ReflectionProbeSetBlendDistancevoid
public static void ReflectionProbeSetBlendDistance(Rid probe, float blendDistance);Sets the distance in meters over which a probe blends into the scene.
| Name | Type | Default |
|---|---|---|
probe | Rid | — |
blendDistance | float | — |
ReflectionProbeSetCullMaskvoid
public static void ReflectionProbeSetCullMask(Rid probe, uint layers);Sets the render cull mask for this reflection probe. Only instances with a matching layer will be reflected by this probe. Equivalent to ReflectionProbe.CullMask.
| Name | Type | Default |
|---|---|---|
probe | Rid | — |
layers | uint | — |
ReflectionProbeSetEnableBoxProjectionvoid
public static void ReflectionProbeSetEnableBoxProjection(Rid probe, bool enable);If true, uses box projection. This can make reflections look more correct in certain situations. Equivalent to ReflectionProbe.BoxProjection.
| Name | Type | Default |
|---|---|---|
probe | Rid | — |
enable | bool | — |
ReflectionProbeSetEnableShadowsvoid
public static void ReflectionProbeSetEnableShadows(Rid probe, bool enable);If true, computes shadows in the reflection probe. This makes the reflection much slower to compute. Equivalent to ReflectionProbe.EnableShadows.
| Name | Type | Default |
|---|---|---|
probe | Rid | — |
enable | bool | — |
ReflectionProbeSetIntensityvoid
public static void ReflectionProbeSetIntensity(Rid probe, float intensity);Sets the intensity of the reflection probe. Intensity modulates the strength of the reflection. Equivalent to ReflectionProbe.Intensity.
| Name | Type | Default |
|---|---|---|
probe | Rid | — |
intensity | float | — |
ReflectionProbeSetMaxDistancevoid
public static void ReflectionProbeSetMaxDistance(Rid probe, float distance);Sets the max distance away from the probe an object can be before it is culled. Equivalent to ReflectionProbe.MaxDistance.
| Name | Type | Default |
|---|---|---|
probe | Rid | — |
distance | float | — |
ReflectionProbeSetMeshLodThresholdvoid
public static void ReflectionProbeSetMeshLodThreshold(Rid probe, float pixels);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 ReflectionProbe.MeshLodThreshold.
| Name | Type | Default |
|---|---|---|
probe | Rid | — |
pixels | float | — |
ReflectionProbeSetOriginOffsetvoid
public static void ReflectionProbeSetOriginOffset(Rid probe, Vector3 offset);Sets the origin offset to be used when this reflection probe is in box project mode. Equivalent to ReflectionProbe.OriginOffset.
| Name | Type | Default |
|---|---|---|
probe | Rid | — |
offset | Vector3 | — |
ReflectionProbeSetReflectionMaskvoid
public static void ReflectionProbeSetReflectionMask(Rid probe, uint layers);Sets the render reflection mask for this reflection probe. Only instances with a matching layer will have reflections applied from this probe. Equivalent to ReflectionProbe.ReflectionMask.
| Name | Type | Default |
|---|---|---|
probe | Rid | — |
layers | uint | — |
ReflectionProbeSetResolutionvoid · Deprecated
public static void ReflectionProbeSetResolution(Rid probe, int resolution);Deprecated. This method does nothing.
| Name | Type | Default |
|---|---|---|
probe | Rid | — |
resolution | int | — |
ReflectionProbeSetSizevoid
public static void ReflectionProbeSetSize(Rid probe, Vector3 size);Sets the size of the area that the reflection probe will capture. Equivalent to ReflectionProbe.Size.
| Name | Type | Default |
|---|---|---|
probe | Rid | — |
size | Vector3 | — |
ReflectionProbeSetUpdateModevoid
public static void ReflectionProbeSetUpdateMode(Rid probe, RenderingServer.ReflectionProbeUpdateMode mode);Sets how often the reflection probe updates. Can either be once or every frame.
| Name | Type | Default |
|---|---|---|
probe | Rid | — |
mode | RenderingServer.ReflectionProbeUpdateMode | — |
RequestFrameDrawnCallbackvoid
public static void RequestFrameDrawnCallback(Callable callable);Schedules a callback to the given callable after a frame has been drawn.
| Name | Type | Default |
|---|---|---|
callable | Callable | — |
ScenarioCreateRid
public static Rid ScenarioCreate();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.
Once finished with your RID, you will want to free the RID using the RenderingServer's RenderingServer.FreeRid method.
The scenario is the 3D world that all the visual instances exist in.
RidScenarioSetCameraAttributesvoid
public static void ScenarioSetCameraAttributes(Rid scenario, Rid effects);Sets the camera attributes (effects) that will be used with this scenario. See also CameraAttributes.
| Name | Type | Default |
|---|---|---|
scenario | Rid | — |
effects | Rid | — |
ScenarioSetCompositorvoid
public static void ScenarioSetCompositor(Rid scenario, Rid compositor);Sets the compositor (compositor) that will be used with this scenario. See also Compositor.
| Name | Type | Default |
|---|---|---|
scenario | Rid | — |
compositor | Rid | — |
ScenarioSetEnvironmentvoid
public static void ScenarioSetEnvironment(Rid scenario, Rid environment);Sets the environment that will be used with this scenario. See also Environment.
| Name | Type | Default |
|---|---|---|
scenario | Rid | — |
environment | Rid | — |
ScenarioSetFallbackEnvironmentvoid
public static void ScenarioSetFallbackEnvironment(Rid scenario, Rid environment);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.
| Name | Type | Default |
|---|---|---|
scenario | Rid | — |
environment | Rid | — |
ScreenSpaceRoughnessLimiterSetActivevoid
public static void ScreenSpaceRoughnessLimiterSetActive(bool enable, float amount, float limit);Sets the screen-space roughness limiter parameters, such as whether it should be enabled and its thresholds. Equivalent to ProjectSettings.rendering/anti_aliasing/screen_space_roughness_limiter/enabled, ProjectSettings.rendering/anti_aliasing/screen_space_roughness_limiter/amount and ProjectSettings.rendering/anti_aliasing/screen_space_roughness_limiter/limit.
| Name | Type | Default |
|---|---|---|
enable | bool | — |
amount | float | — |
limit | float | — |
SetBootImagevoid · Deprecated
public static void SetBootImage(Image image, Color color, bool scale, bool useFilter = true);Sets a boot image. The color defines the background color. The value of scale indicates if the image will be scaled to fit the screen size. If use_filter is true, the image will be scaled with linear interpolation. If use_filter is false, the image will be scaled with nearest-neighbor interpolation.
| Name | Type | Default |
|---|---|---|
image | Image | — |
color | Color | — |
scale | bool | — |
useFilter | bool | true |
SetBootImageWithStretchvoid
public static void SetBootImageWithStretch(Image image, Color color, RenderingServer.SplashStretchMode stretchMode, bool useFilter = true);Sets a boot image. The color defines the background color. The value of stretch_mode indicates how the image will be stretched (see RenderingServer.SplashStretchMode for possible values). If use_filter is true, the image will be scaled with linear interpolation. If use_filter is false, the image will be scaled with nearest-neighbor interpolation.
| Name | Type | Default |
|---|---|---|
image | Image | — |
color | Color | — |
stretchMode | RenderingServer.SplashStretchMode | — |
useFilter | bool | true |
SetDebugGenerateWireframesvoid
public static void SetDebugGenerateWireframes(bool generate);If generate is true, generates debug wireframes for all meshes that are loaded when using the Compatibility renderer. By default, the engine does not generate debug wireframes at runtime, since they slow down loading of assets and take up VRAM.
Note: You must call this method before loading any meshes when using the Compatibility renderer. Otherwise, wireframes will not be used.
| Name | Type | Default |
|---|---|---|
generate | bool | — |
SetDefaultClearColorvoid
public static void SetDefaultClearColor(Color color);Sets the default clear color which is used when a specific clear color has not been selected. See also RenderingServer.GetDefaultClearColor.
| Name | Type | Default |
|---|---|---|
color | Color | — |
SetRenderLoopEnabledvoid
public static void SetRenderLoopEnabled(bool enabled);| Name | Type | Default |
|---|---|---|
enabled | bool | — |
ShaderCreateRid
public static Rid ShaderCreate();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.
Once finished with your RID, you will want to free the RID using the RenderingServer's RenderingServer.FreeRid method.
Note: The equivalent resource is Shader.
RidShaderGetCodestring
public static string ShaderGetCode(Rid shader);Returns a shader's source code as a string.
| Name | Type | Default |
|---|---|---|
shader | Rid | — |
stringShaderGetDefaultTextureParameterRid
public static Rid ShaderGetDefaultTextureParameter(Rid shader, StringName name, int index = 0);Returns a default texture from a shader searched by name.
Note: If the sampler array is used use index to access the specified texture.
| Name | Type | Default |
|---|---|---|
shader | Rid | — |
name | StringName | — |
index | int | 0 |
RidShaderGetParameterDefaultVariant
public static Variant ShaderGetParameterDefault(Rid shader, StringName name);Returns the default value for the specified shader uniform. This is usually the value written in the shader source code.
| Name | Type | Default |
|---|---|---|
shader | Rid | — |
name | StringName | — |
VariantShaderSetCodevoid
public static void ShaderSetCode(Rid shader, string code);Sets the shader's source code (which triggers recompilation after being changed).
| Name | Type | Default |
|---|---|---|
shader | Rid | — |
code | string | — |
ShaderSetDefaultTextureParametervoid
public static void ShaderSetDefaultTextureParameter(Rid shader, StringName name, Rid texture, int index = 0);Low-level Shader default texture assignment using RenderingServer RIDs, distinct from a particular material SetShaderParameter. The texture must belong to RenderingServer, not a local RenderingDevice. An empty RID clears the index entry. Retain resource lifetimes; ordinary code can use Shader.SetDefaultTextureParameter with Texture.
| Name | Type | Default |
|---|---|---|
shader | Rid | — |
name | StringName | — |
texture | Rid | — |
index | int | 0 |
shaderLive Shader RID, not ShaderMaterial.
nameSampler uniform name.
textureAppropriate texture RID, or an empty RID to clear.
indexSampler-array index, normally 0.
ShaderSetPathHintvoid
public static void ShaderSetPathHint(Rid shader, string path);Sets the path hint for the specified shader. This should generally match the Shader resource's Resource.ResourcePath.
| Name | Type | Default |
|---|---|---|
shader | Rid | — |
path | string | — |
SkeletonAllocateDatavoid
public static void SkeletonAllocateData(Rid skeleton, int bones, bool is2DSkeleton = false);Allocates data for this skeleton using the number of bones specified in bones. If is_2d_skeleton is true, the skeleton will be treated as a 2D skeleton instead of a 3D skeleton. See also RenderingServer.SkeletonGetBoneCount.
| Name | Type | Default |
|---|---|---|
skeleton | Rid | — |
bones | int | — |
is2DSkeleton | bool | false |
SkeletonBoneGetTransformTransform3D
public static Transform3D SkeletonBoneGetTransform(Rid skeleton, int bone);Returns the Transform3D set for a specific bone of this skeleton.
| Name | Type | Default |
|---|---|---|
skeleton | Rid | — |
bone | int | — |
Transform3DSkeletonBoneGetTransform2DTransform2D
public static Transform2D SkeletonBoneGetTransform2D(Rid skeleton, int bone);Returns the Transform2D set for a specific bone of this skeleton.
| Name | Type | Default |
|---|---|---|
skeleton | Rid | — |
bone | int | — |
Transform2DSkeletonBoneSetTransformvoid
public static void SkeletonBoneSetTransform(Rid skeleton, int bone, Transform3D transform);Sets the Transform3D for a specific bone of this skeleton.
| Name | Type | Default |
|---|---|---|
skeleton | Rid | — |
bone | int | — |
transform | Transform3D | — |
SkeletonBoneSetTransform2Dvoid
public static void SkeletonBoneSetTransform2D(Rid skeleton, int bone, Transform2D transform);Sets the Transform2D for a specific bone of this skeleton.
| Name | Type | Default |
|---|---|---|
skeleton | Rid | — |
bone | int | — |
transform | Transform2D | — |
SkeletonCreateRid
public static Rid SkeletonCreate();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.
Once finished with your RID, you will want to free the RID using the RenderingServer's RenderingServer.FreeRid method.
RidSkeletonGetBoneCountint
public static int SkeletonGetBoneCount(Rid skeleton);Returns the number of bones allocated for this skeleton. See also RenderingServer.SkeletonAllocateData.
| Name | Type | Default |
|---|---|---|
skeleton | Rid | — |
intSkeletonSetBaseTransform2Dvoid
public static void SkeletonSetBaseTransform2D(Rid skeleton, Transform2D baseTransform);Sets the base Transform2D to use for the specified skeleton.
| Name | Type | Default |
|---|---|---|
skeleton | Rid | — |
baseTransform | Transform2D | — |
SkyBakePanoramaImage
public static Image SkyBakePanorama(Rid sky, float energy, bool bakeIrradiance, Vector2I size);Reads prepared Sky radiance as a panorama Image of the requested size. Allow the active environment to create/update radiance first. Current RD returns null without prepared radiance; this call does not replace Sky setup or frame rendering. GPU readback costs work; do not perform it every frame. Dispose the caller-owned Image after use.
| Name | Type | Default |
|---|---|---|
sky | Rid | — |
energy | float | — |
bakeIrradiance | bool | — |
size | Vector2I | — |
skyRID of a live Sky resource, not an Environment or Shader.
energyResult RGB multiplier; the test uses 1.
bakeIrradiancetrue selects irradiance convolution; false reads radiance. The false path is separately checked.
sizePositive Image width and height, such as 64×32.
ImageNew panorama Image, or null when radiance is unavailable.
SkyCreateRid
public static Rid SkyCreate();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.
Once finished with your RID, you will want to free the RID using the RenderingServer's RenderingServer.FreeRid method.
RidSkySetMaterialvoid
public static void SkySetMaterial(Rid sky, Rid material);Sets the material that the sky uses to render the background, ambient and reflection maps.
| Name | Type | Default |
|---|---|---|
sky | Rid | — |
material | Rid | — |
SkySetModevoid
public static void SkySetMode(Rid sky, RenderingServer.SkyMode mode);Sets the process mode of the sky specified by the sky RID. Equivalent to Sky.ProcessMode.
| Name | Type | Default |
|---|---|---|
sky | Rid | — |
mode | RenderingServer.SkyMode | — |
SkySetRadianceSizevoid
public static void SkySetRadianceSize(Rid sky, int radianceSize);Sets the radiance_size of the sky specified by the sky RID (in pixels). Equivalent to Sky.RadianceSize.
| Name | Type | Default |
|---|---|---|
sky | Rid | — |
radianceSize | int | — |
SpotLightCreateRid
public static Rid SpotLightCreate();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.
Once finished with your RID, you will want to free the RID using the RenderingServer's RenderingServer.FreeRid method.
To place in a scene, attach this spot light to an instance using RenderingServer.InstanceSetBase using the returned RID.
RidSubSurfaceScatteringSetQualityvoid
public static void SubSurfaceScatteringSetQuality(RenderingServer.SubSurfaceScatteringQuality quality);Sets ProjectSettings.rendering/environment/subsurface_scattering/subsurface_scattering_quality to use when rendering materials that have subsurface scattering enabled.
| Name | Type | Default |
|---|---|---|
quality | RenderingServer.SubSurfaceScatteringQuality | — |
SubSurfaceScatteringSetScalevoid
public static void SubSurfaceScatteringSetScale(float scale, float depthScale);Sets the ProjectSettings.rendering/environment/subsurface_scattering/subsurface_scattering_scale and ProjectSettings.rendering/environment/subsurface_scattering/subsurface_scattering_depth_scale to use when rendering materials that have subsurface scattering enabled.
| Name | Type | Default |
|---|---|---|
scale | float | — |
depthScale | float | — |
Texture2DCreateRid
public static Rid Texture2DCreate(Image image);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.
Once finished with your RID, you will want to free the RID using the RenderingServer's RenderingServer.FreeRid method.
Note: The equivalent resource is Texture2D.
Note: Not to be confused with RenderingDevice.TextureCreate, which creates the graphics API's own texture type as opposed to the Reckfell-specific Texture2D resource.
| Name | Type | Default |
|---|---|---|
image | Image | — |
RidTexture2DGetImage
public static Image Texture2DGet(Rid texture);Returns an Image instance from the given texture Rid.
Example: Get the test texture from RenderingServer.GetTestTexture and apply it to a Sprite2D node:
| Name | Type | Default |
|---|---|---|
texture | Rid | — |
ImageTexture2DLayerGetImage
public static Image Texture2DLayerGet(Rid texture, int layer);Returns an Image instance from the given texture Rid and layer.
| Name | Type | Default |
|---|---|---|
texture | Rid | — |
layer | int | — |
ImageTexture2DLayeredCreateRid
public static Rid Texture2DLayeredCreate(Reckfell.Collections.Array<Image> layers, RenderingServer.TextureLayeredType layeredType);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.
Once finished with your RID, you will want to free the RID using the RenderingServer's RenderingServer.FreeRid method.
Note: The equivalent resource is TextureLayered.
| Name | Type | Default |
|---|---|---|
layers | Reckfell.Collections.Array<Image> | — |
layeredType | RenderingServer.TextureLayeredType | — |
RidTexture2DLayeredPlaceholderCreateRid
public static Rid Texture2DLayeredPlaceholderCreate(RenderingServer.TextureLayeredType layeredType);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 RenderingServer.Texture2DPlaceholderCreate.
Note: The equivalent resource is PlaceholderTextureLayered.
| Name | Type | Default |
|---|---|---|
layeredType | RenderingServer.TextureLayeredType | — |
RidTexture2DPlaceholderCreateRid
public static Rid Texture2DPlaceholderCreate();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 RenderingServer.Texture2DLayeredPlaceholderCreate.
Once finished with your RID, you will want to free the RID using the RenderingServer's RenderingServer.FreeRid method.
Note: The equivalent resource is PlaceholderTexture2D.
RidTexture2DUpdatevoid
public static void Texture2DUpdate(Rid texture, Image image, int layer);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).
Note: The image must have the same width, height and format as the current texture data. Otherwise, an error will be printed and the original texture won't be modified. If you need to use different width, height or format, use RenderingServer.TextureReplace instead.
| Name | Type | Default |
|---|---|---|
texture | Rid | — |
image | Image | — |
layer | int | — |
Texture3DCreateRid
public static Rid Texture3DCreate(Image.Format format, int width, int height, int depth, bool mipmaps, Reckfell.Collections.Array<Image> data);Note: The equivalent resource is Texture3D.
| Name | Type | Default |
|---|---|---|
format | Image.Format | — |
width | int | — |
height | int | — |
depth | int | — |
mipmaps | bool | — |
data | Reckfell.Collections.Array<Image> | — |
RidTexture3DGetReckfell.Collections.Array<Image>
public static Reckfell.Collections.Array<Image> Texture3DGet(Rid texture);Returns 3D texture data as an array of Images for the specified texture Rid.
| Name | Type | Default |
|---|---|---|
texture | Rid | — |
Reckfell.Collections.Array<Image>Texture3DPlaceholderCreateRid
public static Rid Texture3DPlaceholderCreate();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.
Once finished with your RID, you will want to free the RID using the RenderingServer's RenderingServer.FreeRid method.
Note: The equivalent resource is PlaceholderTexture3D.
RidTexture3DUpdatevoid
public static void Texture3DUpdate(Rid texture, Reckfell.Collections.Array<Image> data);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.
Note: The texture must have the same width, height, depth and format as the current texture data. Otherwise, an error will be printed and the original texture won't be modified. If you need to use different width, height, depth or format, use RenderingServer.TextureReplace instead.
| Name | Type | Default |
|---|---|---|
texture | Rid | — |
data | Reckfell.Collections.Array<Image> | — |
TextureCreateFromNativeHandleRid
public static Rid TextureCreateFromNativeHandle(RenderingServer.TextureType type, Image.Format format, ulong nativeHandle, int width, int height, int depth, int layers = 1, RenderingServer.TextureLayeredType layeredType = RenderingServer.TextureLayeredType.Layered2DArray);Creates a texture based on a native handle that was created outside of Reckfell's renderer.
Note: If using only the rendering device renderer, it's recommend to use RenderingDevice.TextureCreateFromExtension together with RenderingServer.TextureRdCreate, rather than this method. This way, the texture's format and usage can be controlled more effectively.
| Name | Type | Default |
|---|---|---|
type | RenderingServer.TextureType | — |
format | Image.Format | — |
nativeHandle | ulong | — |
width | int | — |
height | int | — |
depth | int | — |
layers | int | 1 |
layeredType | RenderingServer.TextureLayeredType | RenderingServer.TextureLayeredType.Layered2DArray |
RidTextureDrawableBlitRectvoid
public static void TextureDrawableBlitRect(Reckfell.Collections.Array<Rid> textures, Rect2I rect, Rid material, Color modulate, Reckfell.Collections.Array<Rid> sourceTextures, int toMipmap = 0);Low-level DrawableTexture2D write operation. Takes RenderingServer RIDs, not local RenderingDevice RIDs. Requires 1–4 distinct initialized equal-sized targets and 1–4 sources with no source/target aliasing. Prefer resource BlitRect/BlitRectMulti in ordinary code and retain resource lifetimes.
| Name | Type | Default |
|---|---|---|
textures | Reckfell.Collections.Array<Rid> | — |
rect | Rect2I | — |
material | Rid | — |
modulate | Color | — |
sourceTextures | Reckfell.Collections.Array<Rid> | — |
toMipmap | int | 0 |
textures1–4 destination RIDs in COLOR0 through 3 order.
rectShared rectangle relative to base target dimensions.
materialtexture_blit material RID, not a Shader RID.
modulateMODULATE color applied by shader code.
sourceTextures1–4 source RenderingServer RIDs in slot order; an empty RID selects current RD white fallback.
toMipmapAllocated destination level in every target.
TextureDrawableCreateRid
public static Rid TextureDrawableCreate(int width, int height, RenderingServer.TextureDrawableFormat format, Color? color = default, bool withMipmaps = false);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_drawable* RenderingServer functions.
Once finished with your RID, you will want to free the RID using the RenderingServer's RenderingServer.FreeRid method.
Note: The equivalent resource is DrawableTexture2D.
| Name | Type | Default |
|---|---|---|
width | int | — |
height | int | — |
format | RenderingServer.TextureDrawableFormat | — |
color | Color? | default |
withMipmaps | bool | false |
colorIf the parameter is null, then the default value is new Color(1.0f, 1.0f, 1.0f, 1.0f).
RidTextureDrawableGenerateMipmapsvoid
public static void TextureDrawableGenerateMipmaps(Rid texture);Calculates new MipMaps for the given Drawable texture.
| Name | Type | Default |
|---|---|---|
texture | Rid | — |
TextureDrawableGetDefaultMaterialRid
public static Rid TextureDrawableGetDefaultMaterial();Returns a ShaderMaterial with the default texture_blit Shader.
RidTextureGetFormatImage.Format
public static Image.Format TextureGetFormat(Rid texture);Returns the format for the texture.
| Name | Type | Default |
|---|---|---|
texture | Rid | — |
Image.FormatTextureGetNativeHandleulong
public static ulong TextureGetNativeHandle(Rid texture, bool srgb = false);Returns the internal graphics handle for this texture object. For use when communicating with third-party APIs mostly with ReckfellExtension.
srgb should be true when the texture uses nonlinear sRGB encoding and false when the texture uses linear encoding.
Note: This function returns a uint64_t which internally maps to a GLuint (OpenGL) or VkImage (Vulkan).
| Name | Type | Default |
|---|---|---|
texture | Rid | — |
srgb | bool | false |
ulongTextureGetPathstring
public static string TextureGetPath(Rid texture);Returns the resource path (starting with asset:// or uid://) for the specified texture RID. Returns an empty string if the resource is built-in. See also RenderingServer.TextureSetPath.
| Name | Type | Default |
|---|---|---|
texture | Rid | — |
stringTextureGetRdTextureRid
public static Rid TextureGetRdTexture(Rid texture, bool srgb = false);Returns a texture Rid that can be used with RenderingDevice.
srgb should be true when the texture uses nonlinear sRGB encoding and false when the texture uses linear encoding.
| Name | Type | Default |
|---|---|---|
texture | Rid | — |
srgb | bool | false |
RidTextureProxyCreateRid · Deprecated
public static Rid TextureProxyCreate(Rid @base);This method does nothing and always returns an invalid Rid.
| Name | Type | Default |
|---|---|---|
base | Rid | — |
RidTextureProxyUpdatevoid · Deprecated
public static void TextureProxyUpdate(Rid texture, Rid proxyTo);This method does nothing.
| Name | Type | Default |
|---|---|---|
texture | Rid | — |
proxyTo | Rid | — |
TextureRdCreateRid
public static Rid TextureRdCreate(Rid rdTexture, RenderingServer.TextureLayeredType layerType = RenderingServer.TextureLayeredType.Layered2DArray);Creates a new texture object based on a texture created directly on the RenderingDevice. If the texture contains layers, layer_type is used to define the layer type.
Once finished with your RID, you will want to free the RID using the RenderingServer's RenderingServer.FreeRid method.
Note: The RenderingServer's RenderingServer.FreeRid won't free the underlying rd_texture, you will want to free the rd_texture using RenderingDevice.FreeRid.
| Name | Type | Default |
|---|---|---|
rdTexture | Rid | — |
layerType | RenderingServer.TextureLayeredType | RenderingServer.TextureLayeredType.Layered2DArray |
RidTextureReplacevoid
public static void TextureReplace(Rid texture, Rid byTexture);Replaces texture's texture data by the texture specified by the by_texture RID, without changing texture's RID.
| Name | Type | Default |
|---|---|---|
texture | Rid | — |
byTexture | Rid | — |
TextureReplaceCompatiblevoid
public static void TextureReplaceCompatible(Rid texture, Rid byTexture);Replaces texture's texture data by the texture specified by the by_texture RID, without changing texture's RID.
Unlike RenderingServer.TextureReplace, this method automatically patches any uniform sets that reference texture so they point to the new underlying resource. This makes it suitable for replacing textures that are already bound in materials or shaders without invalidating existing draw state. The new texture may have different dimensions (e.g. for texture streaming mip level changes).
Textures that are not compatible will likely cause rendering errors, so it's recommended to only use this method on textures that are compatible with each other (e.g. same format and usage flags).
| Name | Type | Default |
|---|---|---|
texture | Rid | — |
byTexture | Rid | — |
TextureSetForceRedrawIfVisiblevoid
public static void TextureSetForceRedrawIfVisible(Rid texture, bool enable);Sets whether the texture RID should force redrawing when it's visible on screen when OS.LowProcessorUsageMode is true. This is used by AnimatedTexture to force redrawing.
| Name | Type | Default |
|---|---|---|
texture | Rid | — |
enable | bool | — |
TextureSetPathvoid
public static void TextureSetPath(Rid texture, string path);Sets the resource path for this texture RID. See also RenderingServer.TextureGetPath.
Note: This is purely a hint and does not cause the texture to be automatically saved when set to a asset:// path.
| Name | Type | Default |
|---|---|---|
texture | Rid | — |
path | string | — |
TextureSetSizeOverridevoid
public static void TextureSetSizeOverride(Rid texture, int width, int height);Sets the size at which the texture should be displayed in 2D, ignoring its original size. This does not rescale the texture data itself, only how it is drawn in 2D. Set width and height to 0 to disable the size override.
| Name | Type | Default |
|---|---|---|
texture | Rid | — |
width | int | — |
height | int | — |
ViewportAttachCameravoid
public static void ViewportAttachCamera(Rid viewport, Rid camera);Sets a viewport's camera.
| Name | Type | Default |
|---|---|---|
viewport | Rid | — |
camera | Rid | — |
ViewportAttachCanvasvoid
public static void ViewportAttachCanvas(Rid viewport, Rid canvas);Sets a viewport's canvas.
| Name | Type | Default |
|---|---|---|
viewport | Rid | — |
canvas | Rid | — |
ViewportAttachToScreenvoid
public static void ViewportAttachToScreen(Rid viewport, Rect2? rect = default, int screen = 0);Copies the viewport to a region of the screen specified by rect. If RenderingServer.ViewportSetRenderDirectToScreen 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.
For example, you can set the root viewport to not render at all with the following code:
Using this can result in significant optimization, especially on lower-end devices. However, it comes at the cost of having to manage your viewports manually. For further optimization, see RenderingServer.ViewportSetRenderDirectToScreen.
| Name | Type | Default |
|---|---|---|
viewport | Rid | — |
rect | Rect2? | default |
screen | int | 0 |
rectIf the parameter is null, then the default value is new Rect2(new Vector2(0.0f, 0.0f), new Vector2(0.0f, 0.0f)).
ViewportCreateRid
public static Rid ViewportCreate();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.
Once finished with your RID, you will want to free the RID using the RenderingServer's RenderingServer.FreeRid method.
Note: The equivalent node is Viewport.
RidViewportGetMeasuredRenderTimeCpudouble
public static double ViewportGetMeasuredRenderTimeCpu(Rid viewport);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 RenderingServer.GetFrameSetupTimeCpu. Unlike Engine.GetFramesPerSecond, this method will accurately reflect CPU utilization even if framerate is capped via V-Sync or Engine.MaxFps. See also RenderingServer.ViewportGetMeasuredRenderTimeGpu.
Note: Requires measurements to be enabled on the specified viewport using RenderingServer.ViewportSetMeasureRenderTime. Otherwise, this method returns 0.0.
| Name | Type | Default |
|---|---|---|
viewport | Rid | — |
doubleViewportGetMeasuredRenderTimeGpudouble
public static double ViewportGetMeasuredRenderTimeGpu(Rid viewport);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 Engine.GetFramesPerSecond, this method accurately reflects GPU utilization even if framerate is capped via V-Sync or Engine.MaxFps. See also RenderingServer.ViewportGetMeasuredRenderTimeCpu.
Note: Requires measurements to be enabled on the specified viewport using RenderingServer.ViewportSetMeasureRenderTime. Otherwise, this method returns 0.0.
Note: When GPU utilization is low enough during a certain period of time, GPUs will decrease their power state (which in turn decreases core and memory clock speeds). This can cause the reported GPU time to increase if GPU utilization is kept low enough by a framerate cap (compared to what it would be at the GPU's highest power state). Keep this in mind when benchmarking using RenderingServer.ViewportGetMeasuredRenderTimeGpu. This behavior can be overridden in the graphics driver settings at the cost of higher power usage.
| Name | Type | Default |
|---|---|---|
viewport | Rid | — |
doubleViewportGetRenderInfoint
public static int ViewportGetRenderInfo(Rid viewport, RenderingServer.ViewportRenderInfoType type, RenderingServer.ViewportRenderInfo info);Returns a statistic about the rendering engine which can be used for performance profiling. This is separated into render pass types, each of them having the same infos you can query (different passes will return different values).
See also RenderingServer.GetRenderingInfo, which returns global information across all viewports.
Note: Viewport rendering information is not available until at least 2 frames have been rendered by the engine. If rendering information is not available, RenderingServer.ViewportGetRenderInfo returns 0. To print rendering information in _ready() successfully, use the following:
| Name | Type | Default |
|---|---|---|
viewport | Rid | — |
type | RenderingServer.ViewportRenderInfoType | — |
info | RenderingServer.ViewportRenderInfo | — |
intViewportGetRenderTargetRid
public static Rid ViewportGetRenderTarget(Rid viewport);Returns the render target for the viewport.
| Name | Type | Default |
|---|---|---|
viewport | Rid | — |
RidViewportGetTextureRid
public static Rid ViewportGetTexture(Rid viewport);Returns the viewport's last rendered frame.
| Name | Type | Default |
|---|---|---|
viewport | Rid | — |
RidViewportGetUpdateModeRenderingServer.ViewportUpdateMode
public static RenderingServer.ViewportUpdateMode ViewportGetUpdateMode(Rid viewport);Returns the viewport's update mode. Warning: Calling this from any thread other than the rendering thread will be detrimental to performance.
| Name | Type | Default |
|---|---|---|
viewport | Rid | — |
RenderingServer.ViewportUpdateModeViewportRemoveCanvasvoid
public static void ViewportRemoveCanvas(Rid viewport, Rid canvas);Detaches a viewport from a canvas.
| Name | Type | Default |
|---|---|---|
viewport | Rid | — |
canvas | Rid | — |
ViewportSetActivevoid
public static void ViewportSetActive(Rid viewport, bool active);If true, sets the viewport active, else sets it inactive.
| Name | Type | Default |
|---|---|---|
viewport | Rid | — |
active | bool | — |
ViewportSetAnisotropicFilteringLevelvoid
public static void ViewportSetAnisotropicFilteringLevel(Rid viewport, RenderingServer.ViewportAnisotropicFiltering anisotropicFilteringLevel);Sets the maximum number of samples to take when using anisotropic filtering on textures (as a power of two). A higher sample count will result in sharper textures at oblique angles, but is more expensive to compute. A value of 0 forcibly disables anisotropic filtering, even on materials where it is enabled.
The anisotropic filtering level also affects decals and light projectors if they are configured to use anisotropic filtering. See ProjectSettings.rendering/textures/decals/filter and ProjectSettings.rendering/textures/light_projectors/filter.
Note: In 3D, for this setting to have an effect, set BaseMaterial3D.TextureFilter to BaseMaterial3D.TextureFilterEnum.LinearWithMipmapsAnisotropic or BaseMaterial3D.TextureFilterEnum.NearestWithMipmapsAnisotropic on materials.
Note: In 2D, for this setting to have an effect, set CanvasItem.TextureFilter to CanvasItem.TextureFilterEnum.LinearWithMipmapsAnisotropic or CanvasItem.TextureFilterEnum.NearestWithMipmapsAnisotropic on the CanvasItem node displaying the texture (or in CanvasTexture). However, anisotropic filtering is rarely useful in 2D, so only enable it for textures in 2D if it makes a meaningful visual difference.
| Name | Type | Default |
|---|---|---|
viewport | Rid | — |
anisotropicFilteringLevel | RenderingServer.ViewportAnisotropicFiltering | — |
ViewportSetCanvasCullMaskvoid
public static void ViewportSetCanvasCullMask(Rid viewport, uint canvasCullMask);Sets the rendering mask associated with this Viewport. Only CanvasItem nodes with a matching rendering visibility layer will be rendered by this Viewport.
| Name | Type | Default |
|---|---|---|
viewport | Rid | — |
canvasCullMask | uint | — |
ViewportSetCanvasStackingvoid
public static void ViewportSetCanvasStacking(Rid viewport, Rid canvas, int layer, int sublayer);Sets the stacking order for a viewport's canvas.
layer is the actual canvas layer, while sublayer specifies the stacking order of the canvas among those in the same layer.
Note: layer should be between RenderingServer.CanvasLayerMin and RenderingServer.CanvasLayerMax (inclusive). Any other value will wrap around.
| Name | Type | Default |
|---|---|---|
viewport | Rid | — |
canvas | Rid | — |
layer | int | — |
sublayer | int | — |
ViewportSetCanvasTransformvoid
public static void ViewportSetCanvasTransform(Rid viewport, Rid canvas, Transform2D offset);Sets the transformation of a viewport's canvas.
| Name | Type | Default |
|---|---|---|
viewport | Rid | — |
canvas | Rid | — |
offset | Transform2D | — |
ViewportSetClearModevoid
public static void ViewportSetClearMode(Rid viewport, RenderingServer.ViewportClearMode clearMode);Sets the clear mode of a viewport.
| Name | Type | Default |
|---|---|---|
viewport | Rid | — |
clearMode | RenderingServer.ViewportClearMode | — |
ViewportSetDebugDrawvoid
public static void ViewportSetDebugDraw(Rid viewport, RenderingServer.ViewportDebugDraw draw);Sets the debug draw mode of a viewport.
| Name | Type | Default |
|---|---|---|
viewport | Rid | — |
draw | RenderingServer.ViewportDebugDraw | — |
ViewportSetDefaultCanvasItemTextureFiltervoid
public static void ViewportSetDefaultCanvasItemTextureFilter(Rid viewport, RenderingServer.CanvasItemTextureFilter filter);Sets the default texture filtering mode for the specified viewport RID.
| Name | Type | Default |
|---|---|---|
viewport | Rid | — |
filter | RenderingServer.CanvasItemTextureFilter | — |
ViewportSetDefaultCanvasItemTextureRepeatvoid
public static void ViewportSetDefaultCanvasItemTextureRepeat(Rid viewport, RenderingServer.CanvasItemTextureRepeat repeat);Sets the default texture repeat mode for the specified viewport RID.
| Name | Type | Default |
|---|---|---|
viewport | Rid | — |
repeat | RenderingServer.CanvasItemTextureRepeat | — |
ViewportSetDisable2Dvoid
public static void ViewportSetDisable2D(Rid viewport, bool disable);If true, the viewport's canvas (i.e. 2D and GUI elements) is not rendered.
| Name | Type | Default |
|---|---|---|
viewport | Rid | — |
disable | bool | — |
ViewportSetDisable3Dvoid
public static void ViewportSetDisable3D(Rid viewport, bool disable);If true, the viewport's 3D elements are not rendered.
| Name | Type | Default |
|---|---|---|
viewport | Rid | — |
disable | bool | — |
ViewportSetEnvironmentModevoid
public static void ViewportSetEnvironmentMode(Rid viewport, RenderingServer.ViewportEnvironmentMode mode);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 RenderingServer.EnvironmentBG.Canvas. The default behavior is to inherit the setting from the viewport's parent. If the topmost parent is also set to RenderingServer.ViewportEnvironmentMode.Inherit, then the behavior will be the same as if it was set to RenderingServer.ViewportEnvironmentMode.Enabled.
| Name | Type | Default |
|---|---|---|
viewport | Rid | — |
mode | RenderingServer.ViewportEnvironmentMode | — |
ViewportSetFsrSharpnessvoid
public static void ViewportSetFsrSharpness(Rid viewport, float sharpness);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.
| Name | Type | Default |
|---|---|---|
viewport | Rid | — |
sharpness | float | — |
ViewportSetGlobalCanvasTransformvoid
public static void ViewportSetGlobalCanvasTransform(Rid viewport, Transform2D transform);Sets the viewport's global transformation matrix.
| Name | Type | Default |
|---|---|---|
viewport | Rid | — |
transform | Transform2D | — |
ViewportSetMeasureRenderTimevoid
public static void ViewportSetMeasureRenderTime(Rid viewport, bool enable);Sets the measurement for the given viewport RID (obtained using Viewport.GetViewportRid). Once enabled, RenderingServer.ViewportGetMeasuredRenderTimeCpu and RenderingServer.ViewportGetMeasuredRenderTimeGpu will return values greater than 0.0 when queried with the given viewport.
| Name | Type | Default |
|---|---|---|
viewport | Rid | — |
enable | bool | — |
ViewportSetMsaa2Dvoid
public static void ViewportSetMsaa2D(Rid viewport, RenderingServer.ViewportMsaa msaa);Sets the multisample antialiasing mode for 2D/Canvas on the specified viewport RID. Equivalent to ProjectSettings.rendering/anti_aliasing/quality/msaa_2d or Viewport.Msaa2D.
| Name | Type | Default |
|---|---|---|
viewport | Rid | — |
msaa | RenderingServer.ViewportMsaa | — |
ViewportSetMsaa3Dvoid
public static void ViewportSetMsaa3D(Rid viewport, RenderingServer.ViewportMsaa msaa);Sets the multisample antialiasing mode for 3D on the specified viewport RID. Equivalent to ProjectSettings.rendering/anti_aliasing/quality/msaa_3d or Viewport.Msaa3D.
| Name | Type | Default |
|---|---|---|
viewport | Rid | — |
msaa | RenderingServer.ViewportMsaa | — |
ViewportSetOcclusionCullingBuildQualityvoid
public static void ViewportSetOcclusionCullingBuildQuality(RenderingServer.ViewportOcclusionCullingBuildQuality quality);Sets the ProjectSettings.rendering/occlusion_culling/bvh_build_quality to use for occlusion culling. This parameter is global and cannot be set on a per-viewport basis.
| Name | Type | Default |
|---|---|---|
quality | RenderingServer.ViewportOcclusionCullingBuildQuality | — |
ViewportSetOcclusionRaysPerThreadvoid
public static void ViewportSetOcclusionRaysPerThread(int raysPerThread);Sets the ProjectSettings.rendering/occlusion_culling/occlusion_rays_per_thread to use for occlusion culling. This parameter is global and cannot be set on a per-viewport basis.
| Name | Type | Default |
|---|---|---|
raysPerThread | int | — |
ViewportSetParentViewportvoid
public static void ViewportSetParentViewport(Rid viewport, Rid parentViewport);Sets the viewport's parent to the viewport specified by the parent_viewport RID.
| Name | Type | Default |
|---|---|---|
viewport | Rid | — |
parentViewport | Rid | — |
ViewportSetPositionalShadowAtlasQuadrantSubdivisionvoid
public static void ViewportSetPositionalShadowAtlasQuadrantSubdivision(Rid viewport, int quadrant, int subdivision);Sets the number of subdivisions to use in the specified shadow atlas quadrant for omni and spot shadows. See also Viewport.SetPositionalShadowAtlasQuadrantSubdiv.
| Name | Type | Default |
|---|---|---|
viewport | Rid | — |
quadrant | int | — |
subdivision | int | — |
ViewportSetPositionalShadowAtlasSizevoid
public static void ViewportSetPositionalShadowAtlasSize(Rid viewport, int size, bool use16Bits = 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 use_16_bits 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.
Note: If this is set to 0, no positional shadows will be visible at all. This can improve performance significantly on low-end systems by reducing both the CPU and GPU load (as fewer draw calls are needed to draw the scene without shadows).
| Name | Type | Default |
|---|---|---|
viewport | Rid | — |
size | int | — |
use16Bits | bool | false |
ViewportSetRenderDirectToScreenvoid
public static void ViewportSetRenderDirectToScreen(Rid viewport, bool enabled);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.
| Name | Type | Default |
|---|---|---|
viewport | Rid | — |
enabled | bool | — |
ViewportSetScaling3DModevoid
public static void ViewportSetScaling3DMode(Rid viewport, RenderingServer.ViewportScaling3DMode scaling3DMode);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.
| Name | Type | Default |
|---|---|---|
viewport | Rid | — |
scaling3DMode | RenderingServer.ViewportScaling3DMode | — |
ViewportSetScaling3DScalevoid
public static void ViewportSetScaling3DScale(Rid viewport, float scale);Scales the 3D render buffer based on the viewport size uses an image filter specified in RenderingServer.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 RenderingServer.ViewportMsaa for multi-sample antialiasing, which is significantly cheaper but only smoothens the edges of polygons.
When using FSR upscaling, AMD recommends exposing the following values as preset options to users "Ultra Quality: 0.77", "Quality: 0.67", "Balanced: 0.59", "Performance: 0.5" instead of exposing the entire scale.
| Name | Type | Default |
|---|---|---|
viewport | Rid | — |
scale | float | — |
ViewportSetScenariovoid
public static void ViewportSetScenario(Rid viewport, Rid scenario);Sets a viewport's scenario. The scenario contains information about environment information, reflection atlas, etc.
| Name | Type | Default |
|---|---|---|
viewport | Rid | — |
scenario | Rid | — |
ViewportSetScreenSpaceAAvoid
public static void ViewportSetScreenSpaceAA(Rid viewport, RenderingServer.ViewportScreenSpaceAA mode);Sets the viewport's screen-space antialiasing mode. Equivalent to ProjectSettings.rendering/anti_aliasing/quality/screen_space_aa or Viewport.ScreenSpaceAA.
| Name | Type | Default |
|---|---|---|
viewport | Rid | — |
mode | RenderingServer.ViewportScreenSpaceAA | — |
ViewportSetSdfOversizeAndScalevoid
public static void ViewportSetSdfOversizeAndScale(Rid viewport, RenderingServer.ViewportSdfOversize oversize, RenderingServer.ViewportSdfScale scale);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.
| Name | Type | Default |
|---|---|---|
viewport | Rid | — |
oversize | RenderingServer.ViewportSdfOversize | — |
scale | RenderingServer.ViewportSdfScale | — |
ViewportSetSize2 overloads
public static void ViewportSetSize(Rid viewport, int width, int height);Sets the viewport's width and height in pixels. Optionally the view_count can be set to increase the number of view layers for stereo rendering.
| Name | Type | Default |
|---|---|---|
viewport | Rid | — |
width | int | — |
height | int | — |
public static void ViewportSetSize(Rid viewport, int width, int height, int viewCount = 1);Sets the viewport's width and height in pixels. Optionally the view_count can be set to increase the number of view layers for stereo rendering.
| Name | Type | Default |
|---|---|---|
viewport | Rid | — |
width | int | — |
height | int | — |
viewCount | int | 1 |
ViewportSetSnap2DTransformsToPixelvoid
public static void ViewportSetSnap2DTransformsToPixel(Rid viewport, bool enabled);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/snap_2d_transforms_to_pixel.
| Name | Type | Default |
|---|---|---|
viewport | Rid | — |
enabled | bool | — |
ViewportSetSnap2DVerticesToPixelvoid
public static void ViewportSetSnap2DVerticesToPixel(Rid viewport, bool enabled);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/snap_2d_vertices_to_pixel.
| Name | Type | Default |
|---|---|---|
viewport | Rid | — |
enabled | bool | — |
ViewportSetTextureMipmapBiasvoid
public static void ViewportSetTextureMipmapBias(Rid viewport, float mipmapBias);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/anti_aliasing/quality/use_taa) can help reduce the graininess visible when using negative mipmap bias.
Note: When the 3D scaling mode is set to FSR 1.0, this value is used to adjust the automatic mipmap bias which is calculated internally based on the scale factor. The formula for this is -log2(1.0 / scale) + mipmap_bias.
Note: This method is only supported in the Forward+ and Mobile renderers, not Compatibility. In Compatibility, this method is always treated as if mipmap_bias was set to 0.0.
| Name | Type | Default |
|---|---|---|
viewport | Rid | — |
mipmapBias | float | — |
ViewportSetTransparentBackgroundvoid
public static void ViewportSetTransparentBackground(Rid viewport, bool enabled);If true, the viewport renders its background as transparent.
| Name | Type | Default |
|---|---|---|
viewport | Rid | — |
enabled | bool | — |
ViewportSetUpdateModevoid
public static void ViewportSetUpdateMode(Rid viewport, RenderingServer.ViewportUpdateMode updateMode);Sets when the viewport should be updated.
| Name | Type | Default |
|---|---|---|
viewport | Rid | — |
updateMode | RenderingServer.ViewportUpdateMode | — |
ViewportSetUseDebandingvoid
public static void ViewportSetUseDebanding(Rid viewport, bool enable);Equivalent to Viewport.UseDebanding. See also ProjectSettings.rendering/anti_aliasing/quality/use_debanding.
| Name | Type | Default |
|---|---|---|
viewport | Rid | — |
enable | bool | — |
ViewportSetUseHdr2Dvoid
public static void ViewportSetUseHdr2D(Rid viewport, bool enabled);If true, 2D rendering will use a high dynamic range (HDR) RGBA16 format framebuffer. Additionally, 2D rendering will be performed on linear values and will be converted using the appropriate transfer function 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 to the 0-1 range and can be used in 3D rendering without color encoding 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 Viewport.UseHdr2D.
| Name | Type | Default |
|---|---|---|
viewport | Rid | — |
enabled | bool | — |
ViewportSetUseOcclusionCullingvoid
public static void ViewportSetUseOcclusionCulling(Rid viewport, bool enable);If true, enables occlusion culling on the specified viewport. Equivalent to ProjectSettings.rendering/occlusion_culling/use_occlusion_culling.
| Name | Type | Default |
|---|---|---|
viewport | Rid | — |
enable | bool | — |
ViewportSetUseTaavoid
public static void ViewportSetUseTaa(Rid viewport, bool enable);If true, use temporal antialiasing. Equivalent to ProjectSettings.rendering/anti_aliasing/quality/use_taa or Viewport.UseTaa.
| Name | Type | Default |
|---|---|---|
viewport | Rid | — |
enable | bool | — |
ViewportSetUseXRvoid
public static void ViewportSetUseXR(Rid viewport, bool useXR);If true, the viewport uses augmented or virtual reality technologies. See XRInterface.
| Name | Type | Default |
|---|---|---|
viewport | Rid | — |
useXR | bool | — |
ViewportSetVrsModevoid
public static void ViewportSetVrsMode(Rid viewport, RenderingServer.ViewportVrsMode mode);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.
| Name | Type | Default |
|---|---|---|
viewport | Rid | — |
mode | RenderingServer.ViewportVrsMode | — |
ViewportSetVrsTexturevoid
public static void ViewportSetVrsTexture(Rid viewport, Rid texture);The texture to use when the VRS mode is set to RenderingServer.ViewportVrsMode.Texture. Equivalent to ProjectSettings.rendering/vrs/texture.
| Name | Type | Default |
|---|---|---|
viewport | Rid | — |
texture | Rid | — |
ViewportSetVrsUpdateModevoid
public static void ViewportSetVrsUpdateMode(Rid viewport, RenderingServer.ViewportVrsUpdateMode mode);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.
If set to RenderingServer.ViewportVrsUpdateMode.Once, the input texture is copied once and the mode is changed to RenderingServer.ViewportVrsUpdateMode.Disabled.
| Name | Type | Default |
|---|---|---|
viewport | Rid | — |
mode | RenderingServer.ViewportVrsUpdateMode | — |
VisibilityNotifierCreateRid
public static Rid VisibilityNotifierCreate();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.
Once finished with your RID, you will want to free the RID using the RenderingServer's RenderingServer.FreeRid method.
To place in a scene, attach this notifier to an instance using RenderingServer.InstanceSetBase using the returned RID.
Note: The equivalent node is VisibleOnScreenNotifier3D.
RidVisibilityNotifierSetAabbvoid
public static void VisibilityNotifierSetAabb(Rid notifier, Aabb aabb);Sets the AABB of the specified visibility notifier.
| Name | Type | Default |
|---|---|---|
notifier | Rid | — |
aabb | Aabb | — |
VisibilityNotifierSetCallbacksvoid
public static void VisibilityNotifierSetCallbacks(Rid notifier, Callable enterCallable, Callable exitCallable);Sets the methods to be called when the notifier enters or exits the view.
| Name | Type | Default |
|---|---|---|
notifier | Rid | — |
enterCallable | Callable | — |
exitCallable | Callable | — |
VoxelGIAllocateData2 overloads
public static void VoxelGIAllocateData(Rid voxelGI, Transform3D toCellXform, Aabb aabb, Vector3I octreeSize, byte[] octreeCells, byte[] dataCells, byte[] distanceField, int[] levelCounts);Allocates and initializes the voxel GI data for the specified voxel_gi RID. octree_cells must be a multiple of 32. octree_cells must be double the size of data_cells. The allocated data can be retrieved later using the various voxel_gi_get_* methods.
| Name | Type | Default |
|---|---|---|
voxelGI | Rid | — |
toCellXform | Transform3D | — |
aabb | Aabb | — |
octreeSize | Vector3I | — |
octreeCells | byte[] | — |
dataCells | byte[] | — |
distanceField | byte[] | — |
levelCounts | int[] | — |
public static void VoxelGIAllocateData(Rid voxelGI, Transform3D toCellXform, Aabb aabb, Vector3I octreeSize, ReadOnlySpan<byte> octreeCells, ReadOnlySpan<byte> dataCells, ReadOnlySpan<byte> distanceField, ReadOnlySpan<int> levelCounts);Allocates and initializes the voxel GI data for the specified voxel_gi RID. octree_cells must be a multiple of 32. octree_cells must be double the size of data_cells. The allocated data can be retrieved later using the various voxel_gi_get_* methods.
| Name | Type | Default |
|---|---|---|
voxelGI | Rid | — |
toCellXform | Transform3D | — |
aabb | Aabb | — |
octreeSize | Vector3I | — |
octreeCells | ReadOnlySpan<byte> | — |
dataCells | ReadOnlySpan<byte> | — |
distanceField | ReadOnlySpan<byte> | — |
levelCounts | ReadOnlySpan<int> | — |
VoxelGICreateRid
public static Rid VoxelGICreate();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.
Once finished with your RID, you will want to free the RID using the RenderingServer's RenderingServer.FreeRid method.
Note: The equivalent node is VoxelGI.
RidVoxelGIGetDataCellsbyte[]
public static byte[] VoxelGIGetDataCells(Rid voxelGI);Returns the data cells for the specified voxel GI data instance. See also RenderingServer.VoxelGIAllocateData.
| Name | Type | Default |
|---|---|---|
voxelGI | Rid | — |
byte[]VoxelGIGetDistanceFieldbyte[]
public static byte[] VoxelGIGetDistanceField(Rid voxelGI);Returns the distance field data for the specified voxel GI data instance. See also RenderingServer.VoxelGIAllocateData.
| Name | Type | Default |
|---|---|---|
voxelGI | Rid | — |
byte[]VoxelGIGetLevelCountsint[]
public static int[] VoxelGIGetLevelCounts(Rid voxelGI);Returns the level counts for the specified voxel GI data instance. See also RenderingServer.VoxelGIAllocateData.
| Name | Type | Default |
|---|---|---|
voxelGI | Rid | — |
int[]VoxelGIGetOctreeCellsbyte[]
public static byte[] VoxelGIGetOctreeCells(Rid voxelGI);Returns the octree cell data for the specified voxel GI data instance. See also RenderingServer.VoxelGIAllocateData.
| Name | Type | Default |
|---|---|---|
voxelGI | Rid | — |
byte[]VoxelGIGetOctreeSizeVector3I
public static Vector3I VoxelGIGetOctreeSize(Rid voxelGI);Returns the octree size for the specified voxel GI data instance, which corresponds to the number of subdivisions per axis. This can be viewed in the editor by hovering the Bake VoxelGI button at the top of the 3D editor viewport when a VoxelGI node is selected and looking at the Subdivisions field in the tooltip.
| Name | Type | Default |
|---|---|---|
voxelGI | Rid | — |
Vector3IVoxelGIGetToCellXformTransform3D
public static Transform3D VoxelGIGetToCellXform(Rid voxelGI);Returns the transform to cell space for the specified voxel GI data instance. See also RenderingServer.VoxelGIAllocateData.
| Name | Type | Default |
|---|---|---|
voxelGI | Rid | — |
Transform3DVoxelGISetBakedExposureNormalizationvoid
public static void VoxelGISetBakedExposureNormalization(Rid voxelGI, float bakedExposure);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 RenderingServer.CameraAttributesSetExposure.
| Name | Type | Default |
|---|---|---|
voxelGI | Rid | — |
bakedExposure | float | — |
VoxelGISetBiasvoid
public static void VoxelGISetBias(Rid voxelGI, float bias);Sets the VoxelGIData.Bias value to use on the specified voxel_gi's Rid.
| Name | Type | Default |
|---|---|---|
voxelGI | Rid | — |
bias | float | — |
VoxelGISetDynamicRangevoid
public static void VoxelGISetDynamicRange(Rid voxelGI, float range);Sets the VoxelGIData.DynamicRange value to use on the specified voxel_gi's Rid.
| Name | Type | Default |
|---|---|---|
voxelGI | Rid | — |
range | float | — |
VoxelGISetEnergyvoid
public static void VoxelGISetEnergy(Rid voxelGI, float energy);Sets the VoxelGIData.Energy value to use on the specified voxel_gi's Rid.
| Name | Type | Default |
|---|---|---|
voxelGI | Rid | — |
energy | float | — |
VoxelGISetInteriorvoid
public static void VoxelGISetInterior(Rid voxelGI, bool enable);Sets the VoxelGIData.Interior value to use on the specified voxel_gi's Rid.
| Name | Type | Default |
|---|---|---|
voxelGI | Rid | — |
enable | bool | — |
VoxelGISetNormalBiasvoid
public static void VoxelGISetNormalBias(Rid voxelGI, float bias);Sets the VoxelGIData.NormalBias value to use on the specified voxel_gi's Rid.
| Name | Type | Default |
|---|---|---|
voxelGI | Rid | — |
bias | float | — |
VoxelGISetPropagationvoid
public static void VoxelGISetPropagation(Rid voxelGI, float amount);Sets the VoxelGIData.Propagation value to use on the specified voxel_gi's Rid.
| Name | Type | Default |
|---|---|---|
voxelGI | Rid | — |
amount | float | — |
VoxelGISetQualityvoid
public static void VoxelGISetQuality(RenderingServer.VoxelGIQuality quality);Sets the ProjectSettings.rendering/global_illumination/voxel_gi/quality value to use when rendering. This parameter is global and cannot be set on a per-VoxelGI basis.
| Name | Type | Default |
|---|---|---|
quality | RenderingServer.VoxelGIQuality | — |
VoxelGISetUseTwoBouncesvoid
public static void VoxelGISetUseTwoBounces(Rid voxelGI, bool enable);Sets the VoxelGIData.UseTwoBounces value to use on the specified voxel_gi's Rid.
| Name | Type | Default |
|---|---|---|
voxelGI | Rid | — |
enable | bool | — |
Signals and events2
FramePostDrawEvent
public static event Action FramePostDraw;Emitted at the end of the frame, after the RenderingServer has finished updating all the Viewports.
FramePreDrawEvent
public static event Action FramePreDraw;Emitted at the beginning of the frame, before the RenderingServer updates all the Viewports.
Fields and constants18
ArrayCustomCountField
public const long ArrayCustomCount = 4;The number of custom data arrays available (RenderingServer.ArrayType.Custom0, RenderingServer.ArrayType.Custom1, RenderingServer.ArrayType.Custom2, RenderingServer.ArrayType.Custom3).
ArrayWeightsSizeField
public const long ArrayWeightsSize = 4;Number of weights/bones per vertex.
CanvasItemZMaxField
public const long CanvasItemZMax = 4096;The maximum Z-layer for canvas items.
CanvasItemZMinField
public const long CanvasItemZMin = -4096;The minimum Z-layer for canvas items.
CanvasLayerMaxField
public const long CanvasLayerMax = 2147483647;The maximum canvas layer.
CanvasLayerMinField
public const long CanvasLayerMin = -2147483648;The minimum canvas layer.
MaterialRenderPriorityMaxField
public const long MaterialRenderPriorityMax = 127;The maximum renderpriority of all materials.
MaterialRenderPriorityMinField
public const long MaterialRenderPriorityMin = -128;The minimum renderpriority of all materials.
Max2DDirectionalLightsField
public const long Max2DDirectionalLights = 8;The maximum number of directional lights that can be rendered at a given time in 2D.
MaxCursorsField · Deprecated
public const long MaxCursors = 8;MaxGlowLevelsField
public const long MaxGlowLevels = 7;The maximum number of glow levels that can be used with the glow post-processing effect.
MaxMeshSurfacesField
public const long MaxMeshSurfaces = 256;The maximum number of surfaces a mesh can have.
NoIndexArrayField
public const long NoIndexArray = -1;Marks an error that shows that the index array is empty.
ParticlesEmitFlagColorField
public const long ParticlesEmitFlagColor = 8;Particle starts with specified color.
ParticlesEmitFlagCustomField
public const long ParticlesEmitFlagCustom = 16;Particle starts with specified CUSTOM data.
ParticlesEmitFlagPositionField
public const long ParticlesEmitFlagPosition = 1;Particle starts at the specified position.
ParticlesEmitFlagRotationScaleField
public const long ParticlesEmitFlagRotationScale = 2;Particle starts with specified rotation and scale.
ParticlesEmitFlagVelocityField
public const long ParticlesEmitFlagVelocity = 4;Particle starts with the specified velocity vector, which defines the emission direction and speed.
RenderingServer.ArrayCustomFormat
| Value | Description |
|---|---|
Max = 8 | Represents the size of the |
RFloat = 4 | Custom data array contains 32-bit-per-channel red color data. Values are floating-point in single precision. |
RgFloat = 5 | Custom data array contains 32-bit-per-channel red/green color data. Values are floating-point in single precision. |
RgHalf = 2 | Custom data array contains 16-bit-per-channel red/green color data. Values are floating-point in half precision. |
RgbFloat = 6 | Custom data array contains 32-bit-per-channel red/green/blue color data. Values are floating-point in single precision. |
Rgba8Snorm = 1 | Custom data array contains 8-bit-per-channel red/green/blue/alpha color data. Values are normalized, signed floating-point in the |
Rgba8Unorm = 0 | Custom data array contains 8-bit-per-channel red/green/blue/alpha color data. Values are normalized, unsigned floating-point in the |
RgbaFloat = 7 | Custom data array contains 32-bit-per-channel red/green/blue/alpha color data. Values are floating-point in single precision. |
RgbaHalf = 3 | Custom data array contains 16-bit-per-channel red/green/blue/alpha color data. Values are floating-point in half precision. |
RenderingServer.ArrayFormat
| Value | Description |
|---|---|
CompressFlagsBase = 25 | Shift of first compress flag. Compress flags should be passed to |
FlagCompressAttributes = 536870912 | Flag used to mark that a mesh is using compressed attributes (vertices, normals, tangents, UVs). When this form of compression is enabled, vertex positions will be packed into an RGBA16UNORM attribute and scaled in the vertex shader. The normal and tangent will be packed into an RG16UNORM representing an axis, and a 16-bit float stored in the A-channel of the vertex. UVs will use 16-bit normalized floats instead of full 32-bit signed floats. When using this compression mode you must use either vertices, normals, and tangents or only vertices. You cannot use normals without tangents. Importers will automatically enable this compression if they can. |
FlagFormatCurrentVersion = 34359738368 | Flag used to record the current version that the engine expects. Currently this is the same as |
FlagFormatVersion1 = 0 | Flag used to record the format used by prior mesh versions before the introduction of a version. |
FlagFormatVersion2 = 34359738368 | Flag used to record the second iteration of the mesh version flag. The primary difference between this and |
FlagFormatVersionBase = 35 | Flag used to mark the start of the bits used to store the mesh version. |
FlagFormatVersionMask = 255 | Flag used to isolate the bits used for mesh version after using |
FlagFormatVersionShift = 35 | Flag used to shift a mesh format int to bring the version into the lowest digits. |
FlagUse2DVertices = 33554432 | Flag used to mark that the array contains 2D vertices. |
FlagUse8BoneWeights = 134217728 | Flag used to mark that the array uses 8 bone weights instead of 4. |
FlagUseDynamicUpdate = 67108864 | Flag used to mark that the mesh data will use |
FlagUseStorageBuffer = 1073741824 | Flag used to mark that the surface's vertex, attribute, skin, and index buffers must be created with the storage-buffer usage bit so they can be bound as storage buffers in compute shaders. This is required to write into them from a compute pipeline through the |
FlagUsesEmptyVertexArray = 268435456 | Flag used to mark that the mesh does not have a vertex array and instead will infer vertex positions in the shader using indices and other information. |
FormatBlendShapeMask = 7 | Mask of mesh channels permitted in blend shapes. |
FormatBones = 1024 | Flag used to mark a bone information array. |
FormatColor = 8 | Flag used to mark a vertex color array. |
FormatCustom0 = 64 | Flag used to mark an array of custom per-vertex data for the first set of custom data. |
FormatCustom0Shift = 13 | Amount to shift |
FormatCustom1 = 128 | Flag used to mark an array of custom per-vertex data for the second set of custom data. |
FormatCustom1Shift = 16 | Amount to shift |
FormatCustom2 = 256 | Flag used to mark an array of custom per-vertex data for the third set of custom data. |
FormatCustom2Shift = 19 | Amount to shift |
FormatCustom3 = 512 | Flag used to mark an array of custom per-vertex data for the fourth set of custom data. |
FormatCustom3Shift = 22 | Amount to shift |
FormatCustomBase = 13 | Shift of first custom channel. |
FormatCustomBits = 3 | Number of format bits per custom channel. See |
FormatCustomMask = 7 | Mask of custom format bits per custom channel. Must be shifted by one of the SHIFT constants. See |
FormatIndex = 4096 | Flag used to mark an index array. |
FormatNormal = 2 | Flag used to mark a normal array. |
FormatTangent = 4 | Flag used to mark a tangent array. |
FormatTexUV = 16 | Flag used to mark a UV coordinates array. |
FormatTexUV2 = 32 | Flag used to mark a UV coordinates array for the second UV coordinates. |
FormatVertex = 1 | Flag used to mark a vertex position array. |
FormatWeights = 2048 | Flag used to mark a weights array. |
RenderingServer.ArrayType
| Value | Description |
|---|---|
Bones = 10 | Array contains bone information. |
Color = 3 | Array is a vertex color array. |
Custom0 = 6 | Array is a custom data array for the first set of custom data. |
Custom1 = 7 | Array is a custom data array for the second set of custom data. |
Custom2 = 8 | Array is a custom data array for the third set of custom data. |
Custom3 = 9 | Array is a custom data array for the fourth set of custom data. |
Index = 12 | Array is an index array. |
Max = 13 | Represents the size of the |
Normal = 1 | Array is a normal array. |
Tangent = 2 | Array is a tangent array. |
TexUV = 4 | Array is a UV coordinates array. |
TexUV2 = 5 | Array is a UV coordinates array for the second set of UV coordinates. |
Vertex = 0 | Array is a vertex position array. |
Weights = 11 | Array is weight information. |
RenderingServer.BakeChannels
| Value | Description |
|---|---|
AlbedoAlpha = 0 | Index of |
Emission = 3 | Index of |
Normal = 1 | Index of |
Orm = 2 | Index of |
RenderingServer.BlendShapeMode
| Value | Description |
|---|---|
Normalized = 0 | Blend shapes are normalized. |
Relative = 1 | Blend shapes are relative to base weight. |
RenderingServer.CanvasGroupMode
| Value | Description |
|---|---|
ClipAndDraw = 2 | Parent is used for clipping child, but parent is also drawn underneath child as normal before clipping child to its visible area. |
ClipOnly = 1 | Parent is used for the purposes of clipping only. Child is clipped to the parent's visible area, parent is not drawn. |
Disabled = 0 | Child draws over parent and is not clipped. |
Transparent = 3 |
RenderingServer.CanvasItemTextureFilter
| Value | Description |
|---|---|
Default = 0 | Uses the default filter mode for this |
Linear = 2 | The texture filter blends between the nearest 4 pixels. This makes the texture look smooth from up close, and grainy from a distance (due to mipmaps not being sampled). |
LinearWithMipmaps = 4 | The texture filter blends between the nearest 4 pixels and between the nearest 2 mipmaps (or uses the nearest mipmap if |
LinearWithMipmapsAnisotropic = 6 | The texture filter blends between the nearest 4 pixels and blends between 2 mipmaps (or uses the nearest mipmap if |
Max = 7 | Max value for |
Nearest = 1 | The texture filter reads from the nearest pixel only. This makes the texture look pixelated from up close, and grainy from a distance (due to mipmaps not being sampled). |
NearestWithMipmaps = 3 | The texture filter reads from the nearest pixel and blends between the nearest 2 mipmaps (or uses the nearest mipmap if |
NearestWithMipmapsAnisotropic = 5 | The texture filter reads from the nearest pixel and blends between 2 mipmaps (or uses the nearest mipmap if |
RenderingServer.CanvasItemTextureRepeat
| Value | Description |
|---|---|
Default = 0 | Uses the default repeat mode for this |
Disabled = 1 | Disables textures repeating. Instead, when reading UVs outside the 0-1 range, the value will be clamped to the edge of the texture, resulting in a stretched out look at the borders of the texture. |
Enabled = 2 | Enables the texture to repeat when UV coordinates are outside the 0-1 range. If using one of the linear filtering modes, this can result in artifacts at the edges of a texture when the sampler filters across the edges of the texture. |
Max = 4 | Max value for |
Mirror = 3 | Flip the texture when repeating so that the edge lines up instead of abruptly changing. |
RenderingServer.CanvasLightBlendMode
RenderingServer.CanvasLightMode
| Value | Description |
|---|---|
Directional = 1 | 2D directional (sun/moon) light (see |
Point = 0 | 2D point light (see |
RenderingServer.CanvasLightShadowFilter
| Value | Description |
|---|---|
Max = 3 | Max value of the |
None = 0 | Do not apply a filter to canvas light shadows. |
Pcf13 = 2 | Use PCF13 filtering to filter canvas light shadows. |
Pcf5 = 1 | Use PCF5 filtering to filter canvas light shadows. |
RenderingServer.CanvasOccluderPolygonCullMode
| Value | Description |
|---|---|
Clockwise = 1 | Culling of the canvas occluder is clockwise. |
CounterClockwise = 2 | Culling of the canvas occluder is counterclockwise. |
Disabled = 0 | Culling of the canvas occluder is disabled. |
RenderingServer.CanvasTextureChannel
| Value | Description |
|---|---|
Diffuse = 0 | Diffuse canvas texture ( |
Normal = 1 | Normal map canvas texture ( |
Specular = 2 | Specular map canvas texture ( |
RenderingServer.CompositorEffectCallbackType
| Value | Description |
|---|---|
Any = -1 | |
PostOpaque = 1 | The callback is called after our opaque rendering pass, but before our sky is rendered. |
PostSky = 2 | The callback is called after our sky is rendered, but before our back buffers are created (and if enabled, before subsurface scattering and/or screen space reflections). |
PostTransparent = 4 | The callback is called after our transparent rendering pass, but before any built-in post-processing effects and output to our render target. |
PreOpaque = 0 | The callback is called before our opaque rendering pass, but after depth prepass (if applicable). |
PreTransparent = 3 | The callback is called before our transparent rendering pass, but after our sky is rendered and we've created our back buffers. |
RenderingServer.CompositorEffectFlags
| Value | Description |
|---|---|
AccessResolvedColor = 1 | The rendering effect requires the color buffer to be resolved if MSAA is enabled. |
AccessResolvedDepth = 2 | The rendering effect requires the depth buffer to be resolved if MSAA is enabled. |
NeedsMotionVectors = 4 | The rendering effect requires motion vectors to be produced. |
NeedsRoughness = 8 | The rendering effect requires normals and roughness g-buffer to be produced (Forward+ only). |
NeedsSeparateSpecular = 16 | The rendering effect requires specular data to be separated out (Forward+ only). |
RenderingServer.CubeMapLayer
RenderingServer.DecalFilter
| Value | Description |
|---|---|
Linear = 1 | Linear filter for decals (use for non-pixel art decals). No mipmaps are used for rendering, which means decals at a distance will look smooth but blurry. This has roughly the same performance cost as using mipmaps. |
LinearMipmaps = 3 | Linear filter for decals (use for non-pixel art decals). Isotropic mipmaps are used for rendering, which means decals at a distance will look smooth but blurry. This has roughly the same performance cost as not using mipmaps. |
LinearMipmapsAnisotropic = 5 | Linear filter for decals (use for non-pixel art decals). Anisotropic mipmaps are used for rendering, which means decals at a distance will look smooth and sharp when viewed from oblique angles. This looks better compared to isotropic mipmaps, but is slower. The level of anisotropic filtering is defined by |
Nearest = 0 | Nearest-neighbor filter for decals (use for pixel art decals). No mipmaps are used for rendering, which means decals at a distance will look sharp but grainy. This has roughly the same performance cost as using mipmaps. |
NearestMipmaps = 2 | Nearest-neighbor filter for decals (use for pixel art decals). Isotropic mipmaps are used for rendering, which means decals at a distance will look smooth but blurry. This has roughly the same performance cost as not using mipmaps. |
NearestMipmapsAnisotropic = 4 | Nearest-neighbor filter for decals (use for pixel art decals). Anisotropic mipmaps are used for rendering, which means decals at a distance will look smooth and sharp when viewed from oblique angles. This looks better compared to isotropic mipmaps, but is slower. The level of anisotropic filtering is defined by |
RenderingServer.DecalTexture
| Value | Description |
|---|---|
Albedo = 0 | Albedo texture slot in a decal ( |
Emission = 3 | Emission texture slot in a decal ( |
Max = 4 | Represents the size of the |
Normal = 1 | Normal map texture slot in a decal ( |
Orm = 2 | Occlusion/Roughness/Metallic texture slot in a decal ( |
RenderingServer.DofBlurQuality
| Value | Description |
|---|---|
High = 3 | Highest quality DOF blur. Results in the smoothest looking blur by taking the most samples, but is also significantly slower. |
Low = 1 | Low quality DOF blur. |
Medium = 2 | Medium quality DOF blur. |
VeryLow = 0 | Lowest quality DOF blur. This is the fastest setting, but you may be able to see filtering artifacts. |
RenderingServer.DofBokehShape
| Value | Description |
|---|---|
Box = 0 | Calculate the DOF blur using a box filter. The fastest option, but results in obvious lines in blur pattern. |
Circle = 2 | Calculates DOF blur using a circle shaped filter. Best quality and most realistic, but slowest. Use only for areas where a lot of performance can be dedicated to post-processing (e.g. cutscenes). |
Hexagon = 1 | Calculates DOF blur using a hexagon shaped filter. |
RenderingServer.EnvironmentAmbientSource
RenderingServer.EnvironmentBG
| Value | Description |
|---|---|
CameraFeed = 5 | Displays a camera feed in the background. |
Canvas = 3 | Use a specified canvas layer as the background. This can be useful for instantiating a 2D scene in a 3D world. |
ClearColor = 0 | Use the clear color as background. |
Color = 1 | Use a specified color as the background. |
Keep = 4 | Do not clear the background, use whatever was rendered last frame as the background. |
Max = 6 | Represents the size of the |
Sky = 2 | Use a sky resource for the background. |
RenderingServer.EnvironmentFogMode
| Value | Description |
|---|---|
Depth = 1 | Use a simple fog model defined by start and end positions and a custom curve. While not physically accurate, this model can be useful when you need more artistic control. |
Exponential = 0 | Use a physically-based fog model defined primarily by fog density. |
RenderingServer.EnvironmentGlowBlendMode
| Value | Description |
|---|---|
Additive = 0 | Adds the glow effect to the scene. |
Mix = 4 | Mixes the glow image with the scene image. Best used with |
Replace = 3 | Replaces all pixels' color by the glow effect. This can be used to simulate a full-screen blur effect by tweaking the glow parameters to match the original image's brightness or to preview glow configuration in the editor. |
Screen = 1 | Adds the glow effect to the scene after modifying the glow influence based on the scene value; dark values will be highly influenced by glow and bright values will not be influenced by glow. This approach avoids bright values becoming overly bright from the glow effect. |
Softlight = 2 | Adds the glow effect to the tonemapped image after modifying the glow influence based on the image value; dark values and bright values will not be influenced by glow and mid-range values will be highly influenced by glow. This approach avoids bright values becoming overly bright from the glow effect. The glow will have the largest influence on image values of |
RenderingServer.EnvironmentReflectionSource
| Value | Description |
|---|---|
Bg = 0 | Use the background for reflections. |
Disabled = 1 | Disable reflections. |
Sky = 2 | Use the |
RenderingServer.EnvironmentSdfgiFramesToConverge
| Value | Description |
|---|---|
In10Frames = 1 | Configure SDFGI to fully converge over 10 frames. |
In15Frames = 2 | Configure SDFGI to fully converge over 15 frames. |
In20Frames = 3 | Configure SDFGI to fully converge over 20 frames. |
In25Frames = 4 | Configure SDFGI to fully converge over 25 frames. |
In30Frames = 5 | Configure SDFGI to fully converge over 30 frames. This is the least responsive, but creates the least noisy result with a given ray count. |
In5Frames = 0 | Converge SDFGI over 5 frames. This is the most responsive, but creates the most noisy result with a given ray count. |
Max = 6 | Represents the size of the |
RenderingServer.EnvironmentSdfgiFramesToUpdateLight
| Value | Description |
|---|---|
In16Frames = 4 | Update indirect light from dynamic lights in SDFGI over 16 frames. This is the least responsive, but has the lowest GPU requirements. |
In1Frame = 0 | Update indirect light from dynamic lights in SDFGI over 1 frame. This is the most responsive, but has the highest GPU requirements. |
In2Frames = 1 | Update indirect light from dynamic lights in SDFGI over 2 frames. |
In4Frames = 2 | Update indirect light from dynamic lights in SDFGI over 4 frames. |
In8Frames = 3 | Update indirect light from dynamic lights in SDFGI over 8 frames. |
Max = 5 | Represents the size of the |
RenderingServer.EnvironmentSdfgiRayCount
| Value | Description |
|---|---|
Count128 = 6 | Throw 128 rays per frame when converging SDFGI. This has very high GPU requirements, but creates the least noisy result. |
Count16 = 2 | Throw 16 rays per frame when converging SDFGI. |
Count32 = 3 | Throw 32 rays per frame when converging SDFGI. |
Count4 = 0 | Throw 4 rays per frame when converging SDFGI. This has the lowest GPU requirements, but creates the most noisy result. |
Count64 = 4 | Throw 64 rays per frame when converging SDFGI. |
Count8 = 1 | Throw 8 rays per frame when converging SDFGI. |
Count96 = 5 | Throw 96 rays per frame when converging SDFGI. This has high GPU requirements. |
Max = 7 | Represents the size of the |
RenderingServer.EnvironmentSdfgiyScale
| Value | Description |
|---|---|
Scale100Percent = 2 | Use 100% scale for SDFGI on the Y (vertical) axis. SDFGI cells will be as tall as they are wide. This is usually the best choice for highly vertical scenes. The downside is that light leaking may become more noticeable with thin floors and ceilings. |
Scale50Percent = 0 | Use 50% scale for SDFGI on the Y (vertical) axis. SDFGI cells will be twice as short as they are wide. This allows providing increased GI detail and reduced light leaking with thin floors and ceilings. This is usually the best choice for scenes that don't feature much verticality. |
Scale75Percent = 1 | Use 75% scale for SDFGI on the Y (vertical) axis. This is a balance between the 50% and 100% SDFGI Y scales. |
RenderingServer.EnvironmentSsaoQuality
| Value | Description |
|---|---|
High = 3 | High quality screen-space ambient occlusion. |
Low = 1 | Low quality screen-space ambient occlusion. |
Medium = 2 | Medium quality screen-space ambient occlusion. |
Ultra = 4 | Highest quality screen-space ambient occlusion. Uses the adaptive target setting which can be dynamically adjusted to smoothly balance performance and visual quality. |
VeryLow = 0 | Lowest quality of screen-space ambient occlusion. |
RenderingServer.EnvironmentSsilQuality
| Value | Description |
|---|---|
High = 3 | High quality screen-space indirect lighting. |
Low = 1 | Low quality screen-space indirect lighting. |
Medium = 2 | High quality screen-space indirect lighting. |
Ultra = 4 | Highest quality screen-space indirect lighting. Uses the adaptive target setting which can be dynamically adjusted to smoothly balance performance and visual quality. |
VeryLow = 0 | Lowest quality of screen-space indirect lighting. |
RenderingServer.EnvironmentSsrRoughnessQuality
| Value | Description |
|---|---|
Disabled = 0 | Lowest quality of roughness filter for screen-space reflections. Rough materials will not have blurrier screen-space reflections compared to smooth (non-rough) materials. This is the fastest option. |
High = 3 | High quality of roughness filter for screen-space reflections. This is the slowest option. |
Low = 1 | Low quality of roughness filter for screen-space reflections. |
Medium = 2 | Medium quality of roughness filter for screen-space reflections. |
RenderingServer.EnvironmentToneMapper
| Value | Description |
|---|---|
Aces = 3 | Uses a high-contrast film-like tonemapping curve and desaturates bright values for a more realistic appearance. Slightly slower than |
Agx = 4 | Uses an adjustable film-like tonemapping curve and desaturates bright values for a more realistic appearance. Better than other tonemappers at maintaining the hue of colors as they become brighter. The slowest tonemapping option. |
Filmic = 2 | Uses a film-like tonemapping curve to prevent clipping of bright values and provide better contrast than |
Linear = 0 | Does not modify color data, resulting in a linear tonemapping curve which unnaturally clips bright values, causing bright lighting to look blown out. The simplest and fastest tonemapper. |
Reinhard = 1 | A simple tonemapping curve that rolls off bright values to prevent clipping. This results in an image that can appear dull and low contrast. Slower than |
RenderingServer.Features
| Value | Description |
|---|---|
Multithreaded = 1 | |
Shaders = 0 |
RenderingServer.FogVolumeShape
| Value | Description |
|---|---|
Box = 3 |
|
Cone = 1 |
|
Cylinder = 2 |
|
Ellipsoid = 0 |
|
Max = 5 | Represents the size of the |
World = 4 |
|
RenderingServer.GlobalShaderParameterType
| Value | Description |
|---|---|
Bool = 0 | Boolean global shader parameter ( |
Bvec2 = 1 | 2-dimensional boolean vector global shader parameter ( |
Bvec3 = 2 | 3-dimensional boolean vector global shader parameter ( |
Bvec4 = 3 | 4-dimensional boolean vector global shader parameter ( |
Color = 17 | Color global shader parameter ( |
Float = 13 | Single-precision floating-point global shader parameter ( |
Int = 4 | Integer global shader parameter ( |
Ivec2 = 5 | 2-dimensional integer vector global shader parameter ( |
Ivec3 = 6 | 3-dimensional integer vector global shader parameter ( |
Ivec4 = 7 | 4-dimensional integer vector global shader parameter ( |
Mat2 = 19 | 2×2 matrix global shader parameter ( |
Mat3 = 20 | 3×3 matrix global shader parameter ( |
Mat4 = 21 | 4×4 matrix global shader parameter ( |
Max = 29 | Represents the size of the |
Rect2 = 18 | 2-dimensional floating-point rectangle global shader parameter ( |
Rect2I = 8 | 2-dimensional integer rectangle global shader parameter ( |
Sampler2D = 24 | 2D sampler global shader parameter ( |
Sampler2Darray = 25 | 2D sampler array global shader parameter ( |
Sampler3D = 26 | 3D sampler global shader parameter ( |
Samplercube = 27 | Cubemap sampler global shader parameter ( |
Samplerext = 28 | External sampler global shader parameter ( |
Transform = 23 | 3-dimensional transform global shader parameter ( |
Transform2D = 22 | 2-dimensional transform global shader parameter ( |
Uint = 9 | Unsigned integer global shader parameter ( |
Uvec2 = 10 | 2-dimensional unsigned integer vector global shader parameter ( |
Uvec3 = 11 | 3-dimensional unsigned integer vector global shader parameter ( |
Uvec4 = 12 | 4-dimensional unsigned integer vector global shader parameter ( |
Vec2 = 14 | 2-dimensional floating-point vector global shader parameter ( |
Vec3 = 15 | 3-dimensional floating-point vector global shader parameter ( |
Vec4 = 16 | 4-dimensional floating-point vector global shader parameter ( |
RenderingServer.InstanceFlags
| Value | Description |
|---|---|
DrawNextFrameIfVisible = 2 | When set, manually requests to draw geometry on next frame. |
IgnoreOcclusionCulling = 3 | Always draw, even if the instance would be culled by occlusion culling. Does not affect view frustum culling. |
Max = 4 | Represents the size of the |
UseBakedLight = 0 | Allows the instance to be used in baked lighting. |
UseDynamicGI = 1 | Allows the instance to be used with dynamic global illumination. |
RenderingServer.InstanceType
| Value | Description |
|---|---|
Decal = 7 | The instance is a decal. |
FogVolume = 12 | The instance is a fog volume. |
GeometryMask = 14 | A combination of the flags of geometry instances (mesh, multimesh, immediate and particles). |
Light = 5 | The instance is a light. |
Lightmap = 9 | The instance is a lightmap. |
Max = 13 | Represents the size of the |
Mesh = 1 | The instance is a mesh. |
Multimesh = 2 | The instance is a multimesh. |
None = 0 | The instance does not have a type. |
Occluder = 10 | The instance is an occlusion culling occluder. |
Particles = 3 | The instance is a particle emitter. |
ParticlesCollision = 4 | The instance is a GPUParticles collision shape. |
ReflectionProbe = 6 | The instance is a reflection probe. |
VisiblityNotifier = 11 | The instance is a visible on-screen notifier. |
VoxelGI = 8 | The instance is a VoxelGI. |
RenderingServer.LightBakeMode
| Value | Description |
|---|---|
Disabled = 0 | Light is ignored when baking. This is the fastest mode, but the light will be taken into account when baking global illumination. This mode should generally be used for dynamic lights that change quickly, as the effect of global illumination is less noticeable on those lights. |
Dynamic = 2 | Light is taken into account in dynamic baking ( |
Static = 1 | Light is taken into account in static baking ( |
RenderingServer.LightDirectionalShadowMode
| Value | Description |
|---|---|
Orthogonal = 0 | Use orthogonal shadow projection for directional light. |
Parallel2Splits = 1 | Use 2 splits for shadow projection when using directional light. |
Parallel4Splits = 2 | Use 4 splits for shadow projection when using directional light. |
RenderingServer.LightDirectionalSkyMode
| Value | Description |
|---|---|
LightAndSky = 0 | Use DirectionalLight3D in both sky rendering and scene lighting. |
LightOnly = 1 | Only use DirectionalLight3D in scene lighting. |
SkyOnly = 2 | Only use DirectionalLight3D in sky rendering. |
RenderingServer.LightOmniShadowMode
| Value | Description |
|---|---|
Cube = 1 | Use a cubemap shadow map for omni lights. Slower but better quality than dual paraboloid. |
DualParaboloid = 0 | Use a dual paraboloid shadow map for omni lights. |
RenderingServer.LightParam
| Value | Description |
|---|---|
Attenuation = 6 | The light's attenuation. |
ContactShadowBlur = 22 | Blurs the edges of the contact shadow. |
ContactShadowOpacity = 21 | Changes the opacity of the lights screen-space contact shadows. A value of |
Energy = 0 | The light's energy multiplier. |
IndirectEnergy = 1 | The light's indirect energy multiplier (final indirect energy is |
Intensity = 20 | Constant representing the intensity of the light, measured in Lumens when dealing with a |
Max = 23 | Represents the size of the |
Range = 4 | The light's range. |
ShadowBias = 15 | Bias for the shadow lookup to fix self-shadowing artifacts. |
ShadowBlur = 18 | Blurs the edges of the shadow. Can be used to hide pixel artifacts in low resolution shadow maps. A high value can make shadows appear grainy and can cause other unwanted artifacts. Try to keep as near default as possible. |
ShadowFadeStart = 13 | Proportion of shadow max distance where the shadow will start to fade out. |
ShadowMaxDistance = 9 | The maximum distance for shadow splits. Increasing this value will make directional shadows visible from further away, at the cost of lower overall shadow detail and performance (since more objects need to be included in the directional shadow rendering). |
ShadowNormalBias = 14 | Normal bias used to offset shadow lookup by object normal. Can be used to fix self-shadowing artifacts. |
ShadowOpacity = 17 | The light's shadow opacity. Values lower than |
ShadowPancakeSize = 16 | Sets the size of the directional shadow pancake. The pancake offsets the start of the shadow's camera frustum to provide a higher effective depth resolution for the shadow. However, a high pancake size can cause artifacts in the shadows of large objects that are close to the edge of the frustum. Reducing the pancake size can help. Setting the size to |
ShadowSplit1Offset = 10 | Proportion of shadow atlas occupied by the first split. |
ShadowSplit2Offset = 11 | Proportion of shadow atlas occupied by the second split. |
ShadowSplit3Offset = 12 | Proportion of shadow atlas occupied by the third split. The fourth split occupies the rest. |
Size = 5 | The size of the light when using spot light or omni light. The angular size of the light when using directional light. |
Specular = 3 | The light's influence on specularity. |
SpotAngle = 7 | The spotlight's angle. |
SpotAttenuation = 8 | The spotlight's attenuation. |
TransmittanceBias = 19 | |
VolumetricFogEnergy = 2 | The light's volumetric fog energy multiplier (final volumetric fog energy is |
RenderingServer.LightProjectorFilter
| Value | Description |
|---|---|
Linear = 1 | Linear filter for light projectors (use for non-pixel art light projectors). No mipmaps are used for rendering, which means light projectors at a distance will look smooth but blurry. This has roughly the same performance cost as using mipmaps. |
LinearMipmaps = 3 | Linear filter for light projectors (use for non-pixel art light projectors). Isotropic mipmaps are used for rendering, which means light projectors at a distance will look smooth but blurry. This has roughly the same performance cost as not using mipmaps. |
LinearMipmapsAnisotropic = 5 | Linear filter for light projectors (use for non-pixel art light projectors). Anisotropic mipmaps are used for rendering, which means light projectors at a distance will look smooth and sharp when viewed from oblique angles. This looks better compared to isotropic mipmaps, but is slower. The level of anisotropic filtering is defined by |
Nearest = 0 | Nearest-neighbor filter for light projectors (use for pixel art light projectors). No mipmaps are used for rendering, which means light projectors at a distance will look sharp but grainy. This has roughly the same performance cost as using mipmaps. |
NearestMipmaps = 2 | Nearest-neighbor filter for light projectors (use for pixel art light projectors). Isotropic mipmaps are used for rendering, which means light projectors at a distance will look smooth but blurry. This has roughly the same performance cost as not using mipmaps. |
NearestMipmapsAnisotropic = 4 | Nearest-neighbor filter for light projectors (use for pixel art light projectors). Anisotropic mipmaps are used for rendering, which means light projectors at a distance will look smooth and sharp when viewed from oblique angles. This looks better compared to isotropic mipmaps, but is slower. The level of anisotropic filtering is defined by |
RenderingServer.LightType
| Value | Description |
|---|---|
Area = 3 | Area light (see |
Directional = 0 | Directional (sun/moon) light (see |
Omni = 1 | Omni light (see |
Spot = 2 | Spot light (see |
RenderingServer.MultimeshPhysicsInterpolationQuality
RenderingServer.MultimeshTransformFormat
| Value | Description |
|---|---|
Transform2D = 0 | Use |
Transform3D = 1 | Use |
RenderingServer.NinePatchAxisMode
| Value | Description |
|---|---|
Stretch = 0 | The nine patch gets stretched where needed. |
Tile = 1 | The nine patch gets filled with tiles where needed. |
TileFit = 2 | The nine patch gets filled with tiles where needed and stretches them a bit if needed. |
RenderingServer.ParticlesCollisionHeightfieldResolution
| Value | Description |
|---|---|
Max = 6 | Represents the size of the |
Resolution1024 = 2 | 1024×1024 heightfield resolution for |
Resolution2048 = 3 | 2048×2048 heightfield resolution for |
Resolution256 = 0 | 256×256 heightfield resolution for |
Resolution4096 = 4 | 4096×4096 heightfield resolution for |
Resolution512 = 1 | 512×512 heightfield resolution for |
Resolution8192 = 5 | 8192×8192 heightfield resolution for |
RenderingServer.ParticlesCollisionType
| Value | Description |
|---|---|
BoxAttract = 1 | Box attractor type for |
BoxCollide = 4 | Box collision type for |
HeightfieldCollide = 6 | Heightfield collision type for |
SdfCollide = 5 | Signed distance field collision type for |
SphereAttract = 0 | Sphere attractor type for |
SphereCollide = 3 | Sphere collision type for |
VectorFieldAttract = 2 | Vector field attractor type for |
RenderingServer.ParticlesDrawOrder
| Value | Description |
|---|---|
Index = 0 | Draw particles in the order that they appear in the particles array. |
Lifetime = 1 | Sort particles based on their lifetime. In other words, the particle with the highest lifetime is drawn at the front. |
ReverseLifetime = 2 | Sort particles based on the inverse of their lifetime. In other words, the particle with the lowest lifetime is drawn at the front. |
ViewDepth = 3 | Sort particles based on their distance to the camera. |
RenderingServer.ParticlesMode
| Value | Description |
|---|---|
Mode2D = 0 | 2D particles. |
Mode3D = 1 | 3D particles. |
RenderingServer.ParticlesTransformAlign
| Value | Description |
|---|---|
Disabled = 0 | Do not align particle transforms relative to the camera or velocity. |
LocalBillboard = 4 | Billboard each particles around a local axis. |
YToVelocity = 2 | Align each particle's Y axis to the velocity vector. |
ZBillboard = 1 | Align each particle's Z axis to face the camera. |
ZBillboardYToVelocity = 3 | Align each particle's Z axis to face the camera and Y axis to the velocity vector. |
RenderingServer.ParticlesTransformAlignAxis
RenderingServer.ParticlesTransformAlignCustomSrc
| Value | Description |
|---|---|
Disabled = 0 | Do not read from CUSTOM when performing billboarding. |
W = 4 | Read from |
X = 1 | Read from |
Y = 2 | Read from |
Z = 3 | Read from |
RenderingServer.PipelineSource
| Value | Description |
|---|---|
Canvas = 0 | Pipeline compilation that was triggered by the 2D canvas renderer. |
Draw = 3 | Pipeline compilation that was triggered while drawing the scene. |
Max = 5 | Represents the size of the |
Mesh = 1 | Pipeline compilation that was triggered by loading a mesh. |
Specialization = 4 | Pipeline compilation that was triggered to optimize the current scene. |
Surface = 2 | Pipeline compilation that was triggered by building the surface cache before rendering the scene. |
RenderingServer.PrimitiveType
| Value | Description |
|---|---|
LineStrip = 2 | Primitive to draw consists of a line strip from start to end. |
Lines = 1 | Primitive to draw consists of lines. |
Max = 5 | Represents the size of the |
Points = 0 | Primitive to draw consists of points. |
TriangleStrip = 4 | Primitive to draw consists of a triangle strip (the last 3 vertices are always combined to make a triangle). |
Triangles = 3 | Primitive to draw consists of triangles. |
RenderingServer.ReflectionProbeAmbientMode
| Value | Description |
|---|---|
Color = 2 | Apply custom ambient lighting inside the reflection probe's box defined by its size. See |
Disabled = 0 | Do not apply any ambient lighting inside the reflection probe's box defined by its size. |
Environment = 1 | Apply automatically-sourced environment lighting inside the reflection probe's box defined by its size. |
RenderingServer.ReflectionProbeUpdateMode
| Value | Description |
|---|---|
Always = 1 | Reflection probe will update each frame. This mode is necessary to capture moving objects. |
Once = 0 | Reflection probe will update reflections once and then stop. |
RenderingServer.RenderingInfo
| Value | Description |
|---|---|
BufferMemUsed = 4 | Buffer memory used (in bytes). This includes vertex data, uniform buffers, and many miscellaneous buffer types used internally. |
PipelineCompilationsCanvas = 6 | Number of pipeline compilations that were triggered by the 2D canvas renderer. |
PipelineCompilationsDraw = 9 | Number of pipeline compilations that were triggered while drawing the scene. These compilations will show up as stutters during gameplay the first time a user runs the game and the pipeline is required. |
PipelineCompilationsMesh = 7 | Number of pipeline compilations that were triggered by loading meshes. These compilations will show up as longer loading times the first time a user runs the game and the pipeline is required. |
PipelineCompilationsSpecialization = 10 | Number of pipeline compilations that were triggered to optimize the current scene. These compilations are done in the background and should not cause any stutters whatsoever. |
PipelineCompilationsSurface = 8 | Number of pipeline compilations that were triggered by building the surface cache before rendering the scene. These compilations will show up as a stutter when loading a scene the first time a user runs the game and the pipeline is required. |
TextureMemUsed = 3 | Texture memory used (in bytes). |
TotalDrawCallsInFrame = 2 | Number of draw calls performed to render in the current 3D scene. This varies depending on camera position and rotation. |
TotalObjectsInFrame = 0 | Number of objects rendered in the current 3D scene. This varies depending on camera position and rotation. |
TotalPrimitivesInFrame = 1 | Number of points, lines, or triangles rendered in the current 3D scene. This varies depending on camera position and rotation. |
VideoMemUsed = 5 | Video memory used (in bytes). When using the Forward+ or Mobile renderers, this is always greater than the sum of |
RenderingServer.ShaderMode
| Value | Description |
|---|---|
CanvasItem = 1 | Shader is a 2D shader. |
Fog = 4 | Shader is a 3D fog shader. |
Max = 6 | Represents the size of the |
Particles = 2 | Shader is a particle shader (can be used in both 2D and 3D). |
Sky = 3 | Shader is a 3D sky shader. |
Spatial = 0 | Shader is a 3D shader. |
TextureBlit = 5 | Shader is a texture_blit shader. |
RenderingServer.ShadowCastingSetting
| Value | Description |
|---|---|
DoubleSided = 2 | Disable backface culling when rendering the shadow of the object. This is slightly slower but may result in more correct shadows. |
Off = 0 | Disable shadows from this instance. |
On = 1 | Cast shadows from this instance. |
ShadowsOnly = 3 | Only render the shadows from the object. The object itself will not be drawn. |
RenderingServer.ShadowQuality
| Value | Description |
|---|---|
Hard = 0 | Lowest shadow filtering quality (fastest). Soft shadows are not available with this quality setting, which means the |
Max = 6 | Represents the size of the |
SoftHigh = 4 | High low shadow filtering quality (slow). When using this quality setting, |
SoftLow = 2 | Low shadow filtering quality (fast). |
SoftMedium = 3 | Medium low shadow filtering quality (average). |
SoftUltra = 5 | Highest low shadow filtering quality (slowest). When using this quality setting, |
SoftVeryLow = 1 | Very low shadow filtering quality (faster). When using this quality setting, |
RenderingServer.SkyMode
| Value | Description |
|---|---|
Automatic = 0 | Automatically selects the appropriate process mode based on your sky shader. If your shader uses |
Incremental = 2 | Uses the same high quality importance sampling to process the radiance map as |
Quality = 1 | Uses high quality importance sampling to process the radiance map. In general, this results in much higher quality than |
Realtime = 3 | Uses the fast filtering algorithm to process the radiance map. In general this results in lower quality, but substantially faster run times. If you need better quality, but still need to update the sky every frame, consider turning on |
RenderingServer.SplashStretchMode
| Value | Description |
|---|---|
Cover = 4 | Stretches the image to cover the entire screen while preserving aspect ratio. |
Disabled = 0 | No stretching is applied. |
Ignore = 5 | Stretches the image to cover the entire screen but doesn't preserve aspect ratio. |
Keep = 1 | Stretches image to fullscreen while preserving aspect ratio. |
KeepHeight = 3 | Stretches the width of the image based on the height of the screen. |
KeepWidth = 2 | Stretches the height of the image based on the width of the screen. |
RenderingServer.SubSurfaceScatteringQuality
| Value | Description |
|---|---|
Disabled = 0 | Disables subsurface scattering entirely, even on materials that have |
High = 3 | High subsurface scattering quality. This has the highest GPU requirements. |
Low = 1 | Low subsurface scattering quality. |
Medium = 2 | Medium subsurface scattering quality. |
RenderingServer.TextureDrawableFormat
| Value | Description |
|---|---|
Rgba8 = 0 | OpenGL texture format RGBA with four components, each with a bitdepth of 8. |
Rgba8Srgb = 1 | OpenGL texture format RGBA with four components, each with a bitdepth of 8. When drawn to, an sRGB to linear color space conversion is performed. |
Rgbaf = 3 | OpenGL texture format GL_RGBA32F where there are four components, each a 32-bit floating-point value. |
Rgbah = 2 | OpenGL texture format GL_RGBA16F where there are four components, each a 16-bit "half-precision" floating-point value. |
RenderingServer.TextureLayeredType
| Value | Description |
|---|---|
Cubemap = 1 | Cubemap texture (see |
CubemapArray = 2 | Array of cubemap textures (see |
Layered2DArray = 0 | Array of 2-dimensional textures (see |
RenderingServer.TextureType
| Value | Description |
|---|---|
Layered = 1 | Layered texture. |
Type2D = 0 | 2D texture. |
Type3D = 2 | 3D texture. |
RenderingServer.ViewportAnisotropicFiltering
| Value | Description |
|---|---|
Anisotropy16X = 4 | Use 16× anisotropic filtering. |
Anisotropy2X = 1 | Use 2× anisotropic filtering. |
Anisotropy4X = 2 | Use 4× anisotropic filtering. This is the default value. |
Anisotropy8X = 3 | Use 8× anisotropic filtering. |
Disabled = 0 | Anisotropic filtering is disabled. |
Max = 5 | Represents the size of the |
RenderingServer.ViewportClearMode
| Value | Description |
|---|---|
Always = 0 | Always clear the viewport's render target before drawing. |
Never = 1 | Never clear the viewport's render target. |
OnlyNextFrame = 2 | Clear the viewport's render target on the next frame, then switch to |
RenderingServer.ViewportDebugDraw
| Value | Description |
|---|---|
ClusterDecals = 22 | Draws the |
ClusterOmniLights = 20 | Draws the |
ClusterReflectionProbes = 23 | Draws the |
ClusterSpotLights = 21 | Draws the |
DecalAtlas = 15 | Draws the decal atlas that stores decal textures from |
DirectionalShadowAtlas = 10 | Draws the shadow atlas that stores shadows from |
DisableLod = 19 | Disable mesh LOD. All meshes are drawn with full detail, which can be used to compare performance. |
Disabled = 0 | Debug draw is disabled. Default setting. |
GIBuffer = 18 | Draws the global illumination buffer from |
InternalBuffer = 26 | Internal buffer is drawn instead of regular scene so you can see the per-pixel output that will be used by post-processing effects. Note: Only supported when using the Forward+ or Mobile rendering methods. |
Lighting = 2 | Objects are displayed with only light information. Note: When using this debug draw mode, custom shaders are ignored since all materials in the scene temporarily use a debug material. This means the result from custom shader functions (such as vertex displacement) won't be visible anymore when using this debug draw mode. |
MotionVectors = 25 | Draws the motion vectors buffer. This is used by temporal antialiasing to correct for motion that occurs during gameplay. Note: Only supported when using the Forward+ rendering method. |
NormalBuffer = 5 | Normal buffer is drawn instead of regular scene so you can see the per-pixel normals that will be used by post-processing effects. |
Occluders = 24 | Draws the occlusion culling buffer. This low-resolution occlusion culling buffer is rasterized on the CPU and is used to check whether instances are occluded by other objects. Note: Only supported when using the Forward+ or Mobile rendering methods. |
Overdraw = 3 | Objects are displayed semi-transparent with additive blending so you can see where they are drawing over top of one another. A higher overdraw (represented by brighter colors) means you are wasting performance on drawing pixels that are being hidden behind others. Note: When using this debug draw mode, custom shaders are ignored since all materials in the scene temporarily use a debug material. This means the result from custom shader functions (such as vertex displacement) won't be visible anymore when using this debug draw mode. |
PssmSplits = 14 | Colors each PSSM split for the |
SceneLuminance = 11 | Draws the estimated scene luminance. This is a 1×1 texture that is generated when autoexposure is enabled to control the scene's exposure. Note: Only supported when using the Forward+ or Mobile rendering methods. |
Sdfgi = 16 | Draws SDFGI cascade data. This is the data structure that is used to bounce lighting against and create reflections. Note: Only supported when using the Forward+ rendering method. |
SdfgiProbes = 17 | Draws SDFGI probe data. This is the data structure that is used to give indirect lighting dynamic objects moving within the scene. When in the editor, left-clicking a probe will display additional bright dots that show its occlusion information. A white dot means the light is not occluded at all at the dot's position, while a red dot means the light is fully occluded. Intermediate values are possible. Note: Only supported when using the Forward+ rendering method. |
ShadowAtlas = 9 | Draws the shadow atlas that stores shadows from |
Ssao = 12 | Draws the screen space ambient occlusion texture instead of the scene so that you can clearly see how it is affecting objects. In order for this display mode to work, you must have |
Ssil = 13 | Draws the screen space indirect lighting texture instead of the scene so that you can clearly see how it is affecting objects. In order for this display mode to work, you must have |
Unshaded = 1 | Objects are displayed without light information. |
VoxelGIAlbedo = 6 | Objects are displayed with only the albedo value from |
VoxelGIEmission = 8 | Objects are displayed with only the emission color from |
VoxelGILighting = 7 | Objects are displayed with only the lighting value from |
Wireframe = 4 | Debug draw draws objects in wireframe.
Note: |
RenderingServer.ViewportEnvironmentMode
| Value | Description |
|---|---|
Disabled = 0 | Disable rendering of 3D environment over 2D canvas. |
Enabled = 1 | Enable rendering of 3D environment over 2D canvas. |
Inherit = 2 | Inherit enable/disable value from parent. If the topmost parent is also set to |
Max = 3 | Represents the size of the |
RenderingServer.ViewportMsaa
| Value | Description |
|---|---|
Disabled = 0 | Multisample antialiasing for 3D is disabled. This is the default value, and also the fastest setting. |
Max = 4 | Represents the size of the |
Msaa2X = 1 | Multisample antialiasing uses 2 samples per pixel for 3D. This has a moderate impact on performance. |
Msaa4X = 2 | Multisample antialiasing uses 4 samples per pixel for 3D. This has a high impact on performance. |
Msaa8X = 3 | Multisample antialiasing uses 8 samples per pixel for 3D. This has a very high impact on performance. Likely unsupported on low-end and older hardware. |
RenderingServer.ViewportOcclusionCullingBuildQuality
| Value | Description |
|---|---|
High = 2 | High occlusion culling BVH build quality (as defined by Embree). Results in the highest CPU usage, but most effective culling. |
Low = 0 | Low occlusion culling BVH build quality (as defined by Embree). Results in the lowest CPU usage, but least effective culling. |
Medium = 1 | Medium occlusion culling BVH build quality (as defined by Embree). |
RenderingServer.ViewportRenderInfo
| Value | Description |
|---|---|
DrawCallsInFrame = 2 | Number of draw calls during this frame. |
Max = 3 | Represents the size of the |
ObjectsInFrame = 0 | Number of objects drawn in a single frame. |
PrimitivesInFrame = 1 | Number of points, lines, or triangles drawn in a single frame. |
RenderingServer.ViewportRenderInfoType
| Value | Description |
|---|---|
Canvas = 2 | Canvas item rendering. This includes all 2D rendering. |
Max = 3 | Represents the size of the |
Shadow = 1 | Shadow render pass. Objects will be rendered several times depending on the number of amounts of lights with shadows and the number of directional shadow splits. |
Visible = 0 | Visible render pass (excluding shadows). |
RenderingServer.ViewportScaling3DMode
| Value | Description |
|---|---|
Bilinear = 0 | Use bilinear scaling for the viewport's 3D buffer. The amount of scaling can be set using |
Fsr = 1 | Use AMD FidelityFX Super Resolution 1.0 upscaling for the viewport's 3D buffer. The amount of scaling can be set using |
Fsr2 = 2 | Use AMD FidelityFX Super Resolution 2.2 upscaling for the viewport's 3D buffer. The amount of scaling can be set using |
Max = 6 | Represents the size of the |
MetalfxSpatial = 3 | Use MetalFX spatial upscaling for the viewport's 3D buffer. The amount of scaling can be set using |
MetalfxTemporal = 4 | Use MetalFX temporal upscaling for the viewport's 3D buffer. The amount of scaling can be set using |
Nearest = 5 | Use nearest-neighbor filtering for the viewport's 3D buffer. This looks crisper than |
RenderingServer.ViewportScreenSpaceAA
| Value | Description |
|---|---|
Disabled = 0 | Do not perform any antialiasing in the full screen post-process. |
Fxaa = 1 | Use fast approximate antialiasing. FXAA is a popular screen-space antialiasing method, which is fast but will make the image look blurry, especially at lower resolutions. It can still work relatively well at large resolutions such as 1440p and 4K. |
Max = 3 | Represents the size of the |
Smaa = 2 | Use subpixel morphological antialiasing. SMAA may produce clearer results than FXAA, but at a slightly higher performance cost. |
RenderingServer.ViewportSdfOversize
| Value | Description |
|---|---|
Max = 4 | Represents the size of the |
Oversize100Percent = 0 | Do not oversize the 2D signed distance field. Occluders may disappear when touching the viewport's edges, and |
Oversize120Percent = 1 | 2D signed distance field covers 20% of the viewport's size outside the viewport on each side (top, right, bottom, left). |
Oversize150Percent = 2 | 2D signed distance field covers 50% of the viewport's size outside the viewport on each side (top, right, bottom, left). |
Oversize200Percent = 3 | 2D signed distance field covers 100% of the viewport's size outside the viewport on each side (top, right, bottom, left). This has the highest GPU requirements. |
RenderingServer.ViewportSdfScale
| Value | Description |
|---|---|
Max = 3 | Represents the size of the |
Scale100Percent = 0 | Full resolution 2D signed distance field scale. This has the highest GPU requirements. |
Scale25Percent = 2 | Quarter resolution 2D signed distance field scale on each axis (6.25% of the viewport pixel count). This has the lowest GPU requirements. |
Scale50Percent = 1 | Half resolution 2D signed distance field scale on each axis (25% of the viewport pixel count). |
RenderingServer.ViewportUpdateMode
| Value | Description |
|---|---|
Always = 4 | Always update the viewport's render target. |
Disabled = 0 | Do not update the viewport's render target. |
Once = 1 | Update the viewport's render target once, then switch to |
WhenParentVisible = 3 | Update the viewport's render target only when its parent is visible. |
WhenVisible = 2 | Update the viewport's render target only when it is visible. This is the default value. |
RenderingServer.ViewportVrsMode
| Value | Description |
|---|---|
Disabled = 0 | Variable rate shading is disabled. |
Max = 3 | Represents the size of the |
Texture = 1 | Variable rate shading uses a texture. Note, for stereoscopic use a texture atlas with a texture for each view. |
XR = 2 | Variable rate shading texture is supplied by the primary |
RenderingServer.ViewportVrsUpdateMode
| Value | Description |
|---|---|
Always = 2 | The input texture for variable rate shading will be processed each frame. |
Disabled = 0 | The input texture for variable rate shading will not be processed. |
Max = 3 | Represents the size of the |
Once = 1 | The input texture for variable rate shading will be processed once. |
RenderingServer.VisibilityRangeFadeMode
| Value | Description |
|---|---|
Dependencies = 2 | Fade-in the given instance's dependencies when reaching its visibility range limits. |
Disabled = 0 | Disable visibility range fading for the given instance. |
Self = 1 | Fade-out the given instance when it approaches its visibility range limits. |