Server for anything visible. The visual server is the API backend for everything visible. The whole scene system mounts on it to display.
The visual server is completely opaque, the internals are entirely implementation specific and cannot be accessed.
The visual server can be used to bypass the scene system entirely.
Resources are created using the *_create
functions.
All objects are drawn to a viewport. You can use the godot.Viewport
attached to the godot.SceneTree
or you can create one yourself with godot.VisualServer.viewportCreate
. When using a custom scenario or canvas, the scenario or canvas needs to be attached to the viewport using godot.VisualServer.viewportSetScenario
or godot.VisualServer.viewportAttachCanvas
.
In 3D, all visual objects must be associated with a scenario. The scenario is a visual representation of the world. If accessing the visual server from a running game, the scenario can be accessed from the scene tree from any godot.Spatial
node with godot.Spatial.getWorld
. Otherwise, a scenario can be created with godot.VisualServer.scenarioCreate
.
Similarly, in 2D, a canvas is needed to draw all canvas items.
In 3D, all visible objects are comprised of a resource and an instance. A resource can be a mesh, a particle system, a light, or any other 3D object. In order to be visible resources must be attached to an instance using godot.VisualServer.instanceSetBase
. The instance must also be attached to the scenario using godot.VisualServer.instanceSetScenario
in order to be visible.
In 2D, all visible objects are some form of canvas item. In order to be visible, a canvas item needs to be the child of a canvas attached to a viewport, or it needs to be the child of another canvas item that is eventually attached to the canvas.
Static variables
staticread onlyMAX_GLOW_LEVELS:Int
Max number of glow levels that can be used with glow post-process effect.
staticRENDER_LOOP_ENABLED:Bool
If false
, disables rendering completely, but the engine logic is still being processed. You can call godot.VisualServer.forceDraw
to draw a frame even with rendering disabled.
Static methods
staticblackBarsSetImages(left:RID, top:RID, right:RID, bottom:RID):Void
Sets images to be rendered in the window margin.
staticblackBarsSetMargins(left:Int, top:Int, right:Int, bottom:Int):Void
Sets margin size, where black bars (or images, if godot.VisualServer.blackBarsSetImages
was used) are rendered.
staticcameraCreate():RID
Creates a camera and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all camera_*
VisualServer functions.
Once finished with your RID, you will want to free the RID using the VisualServer's godot.VisualServer.freeRid
static method.
staticcameraSetCullMask(camera:RID, layers:UInt):Void
Sets the cull mask associated with this camera. The cull mask describes which 3D layers are rendered by this camera. Equivalent to godot.Camera.cullMask
.
staticcameraSetEnvironment(camera:RID, env:RID):Void
Sets the environment used by this camera. Equivalent to godot.Camera.environment
.
staticcameraSetFrustum(camera:RID, size:Single, offset:Vector2, zNear:Single, zFar:Single):Void
Sets camera to use frustum projection. This mode allows adjusting the offset
argument to create "tilted frustum" effects.
staticcameraSetOrthogonal(camera:RID, size:Single, zNear:Single, zFar:Single):Void
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.
staticcameraSetPerspective(camera:RID, fovyDegrees:Single, zNear:Single, zFar:Single):Void
Sets camera to use perspective projection. Objects on the screen becomes smaller when they are far away.
staticcameraSetUseVerticalAspect(camera:RID, enable:Bool):Void
If true
, preserves the horizontal aspect ratio which is equivalent to godot.Camera_KeepAspectEnum.width
. If false
, preserves the vertical aspect ratio which is equivalent to godot.Camera_KeepAspectEnum.height
.
staticcanvasCreate():RID
Creates a canvas and returns the assigned godot.RID
. It can be accessed with the RID that is returned. This RID will be used in all canvas_*
VisualServer functions.
Once finished with your RID, you will want to free the RID using the VisualServer's godot.VisualServer.freeRid
static method.
staticcanvasItemAddCircle(item:RID, pos:Vector2, radius:Single, color:Color):Void
Adds a circle command to the godot.CanvasItem
's draw commands.
staticcanvasItemAddClipIgnore(item:RID, ignore:Bool):Void
If ignore is true
, the VisualServer does not perform clipping.
staticcanvasItemAddLine(item:RID, from:Vector2, to:Vector2, color:Color, ?width:Single, ?antialiased:Bool):Void
Adds a line command to the godot.CanvasItem
's draw commands.
staticcanvasItemAddMesh(item:RID, mesh:RID, ?transform:Transform2D, ?modulate:Color, ?texture:RID, ?normalMap:RID):Void
Adds a mesh command to the godot.CanvasItem
's draw commands.
Parameters:
transform | If the parameter is null, then the default value is Transform2D.Identity |
---|---|
modulate | If the parameter is null, then the default value is new Color(1, 1, 1, 1) |
staticcanvasItemAddMultimesh(item:RID, mesh:RID, texture:RID, ?normalMap:RID):Void
Adds a godot.MultiMesh
to the godot.CanvasItem
's draw commands. Only affects its aabb at the moment.
staticcanvasItemAddNinePatch(item:RID, rect:Rect2, source:Rect2, texture:RID, topleft:Vector2, bottomright:Vector2, ?xAxisMode:VisualServer_NinePatchAxisMode, ?yAxisMode:VisualServer_NinePatchAxisMode, ?drawCenter:Bool, ?modulate:Color, ?normalMap:RID):Void
Adds a nine patch image to the godot.CanvasItem
's draw commands.
See godot.NinePatchRect
for more explanation.
Parameters:
modulate | If the parameter is null, then the default value is new Color(1, 1, 1, 1) |
---|
staticcanvasItemAddParticles(item:RID, particles:RID, texture:RID, normalMap:RID):Void
Adds a particle system to the godot.CanvasItem
's draw commands.
staticcanvasItemAddPolygon(item:RID, points:Array<Vector2>, colors:Array<Color>, ?uvs:Array<Vector2>, ?texture:RID, ?normalMap:RID, ?antialiased:Bool):Void
Adds a polygon to the godot.CanvasItem
's draw commands.
Parameters:
uvs | If the parameter is null, then the default value is Array.Empty<Vector2>() |
---|
staticcanvasItemAddPolyline(item:RID, points:Array<Vector2>, colors:Array<Color>, ?width:Single, ?antialiased:Bool):Void
Adds a polyline, which is a line from multiple points with a width, to the godot.CanvasItem
's draw commands.
staticcanvasItemAddPrimitive(item:RID, points:Array<Vector2>, colors:Array<Color>, uvs:Array<Vector2>, texture:RID, ?width:Single, ?normalMap:RID):Void
Adds a primitive to the godot.CanvasItem
's draw commands.
staticcanvasItemAddRect(item:RID, rect:Rect2, color:Color):Void
Adds a rectangle to the godot.CanvasItem
's draw commands.
staticcanvasItemAddSetTransform(item:RID, transform:Transform2D):Void
Adds a godot.Transform2D
command to the godot.CanvasItem
's draw commands.
This sets the extra_matrix uniform when executed. This affects the later commands of the canvas item.
staticcanvasItemAddTextureRect(item:RID, rect:Rect2, texture:RID, ?tile:Bool, ?modulate:Color, ?transpose:Bool, ?normalMap:RID):Void
Adds a textured rect to the godot.CanvasItem
's draw commands.
Parameters:
modulate | If the parameter is null, then the default value is new Color(1, 1, 1, 1) |
---|
staticcanvasItemAddTextureRectRegion(item:RID, rect:Rect2, texture:RID, srcRect:Rect2, ?modulate:Color, ?transpose:Bool, ?normalMap:RID, ?clipUv:Bool):Void
Adds a texture rect with region setting to the godot.CanvasItem
's draw commands.
Parameters:
modulate | If the parameter is null, then the default value is new Color(1, 1, 1, 1) |
---|
staticcanvasItemAddTriangleArray(item:RID, indices:Array<Int>, points:Array<Vector2>, colors:Array<Color>, ?uvs:Array<Vector2>, ?bones:Array<Int>, ?weights:Array<Single>, ?texture:RID, ?count:Int, ?normalMap:RID, ?antialiased:Bool, ?antialiasingUseIndices:Bool):Void
Adds a triangle array to the godot.CanvasItem
's draw commands.
Parameters:
uvs | If the parameter is null, then the default value is Array.Empty<Vector2>() |
---|---|
bones | If the parameter is null, then the default value is Array.Empty<int>() |
weights | If the parameter is null, then the default value is Array.Empty<float>() |
staticcanvasItemCreate():RID
Creates a new godot.CanvasItem
and returns its godot.RID
. It can be accessed with the RID that is returned. This RID will be used in all canvas_item_*
VisualServer functions.
Once finished with your RID, you will want to free the RID using the VisualServer's godot.VisualServer.freeRid
static method.
staticcanvasItemSetCopyToBackbuffer(item:RID, enabled:Bool, rect:Rect2):Void
Sets the godot.CanvasItem
to copy a rect to the backbuffer.
staticcanvasItemSetCustomRect(item:RID, useCustomRect:Bool, ?rect:Rect2):Void
Defines a custom drawing rectangle for the godot.CanvasItem
.
Parameters:
rect | If the parameter is null, then the default value is new Rect2(new Vector2(0, 0), new Vector2(0, 0)) |
---|
staticcanvasItemSetDistanceFieldMode(item:RID, enabled:Bool):Void
Enables the use of distance fields for GUI elements that are rendering distance field based fonts.
staticcanvasItemSetDrawBehindParent(item:RID, enabled:Bool):Void
Sets godot.CanvasItem
to be drawn behind its parent.
staticcanvasItemSetLightMask(item:RID, mask:Int):Void
The light mask. See godot.LightOccluder2D
for more information on light masks.
staticcanvasItemSetMaterial(item:RID, material:RID):Void
Sets a new material to the godot.CanvasItem
.
staticcanvasItemSetModulate(item:RID, color:Color):Void
Sets the color that modulates the godot.CanvasItem
and its children.
staticcanvasItemSetParent(item:RID, parent:RID):Void
Sets the parent for the godot.CanvasItem
. The parent can be another canvas item, or it can be the root canvas that is attached to the viewport.
staticcanvasItemSetSelfModulate(item:RID, color:Color):Void
Sets the color that modulates the godot.CanvasItem
without children.
staticcanvasItemSetSortChildrenByY(item:RID, enabled:Bool):Void
Sets if godot.CanvasItem
's children should be sorted by y-position.
staticcanvasItemSetTransform(item:RID, transform:Transform2D):Void
Sets the godot.CanvasItem
's godot.Transform2D
.
staticcanvasItemSetUseParentMaterial(item:RID, enabled:Bool):Void
Sets if the godot.CanvasItem
uses its parent's material.
staticcanvasItemSetVisible(item:RID, visible:Bool):Void
Sets if the canvas item (including its children) is visible.
staticcanvasItemSetZAsRelativeToParent(item:RID, enabled:Bool):Void
If this is enabled, the Z index of the parent will be added to the children's Z index.
staticcanvasItemSetZIndex(item:RID, zIndex:Int):Void
Sets the godot.CanvasItem
's Z index, i.e. its draw order (lower indexes are drawn first).
staticcanvasLightAttachToCanvas(light:RID, canvas:RID):Void
Attaches the canvas light to the canvas. Removes it from its previous canvas.
staticcanvasLightCreate():RID
Creates a canvas light and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all canvas_light_*
VisualServer functions.
Once finished with your RID, you will want to free the RID using the VisualServer's godot.VisualServer.freeRid
static method.
staticcanvasLightOccluderAttachToCanvas(occluder:RID, canvas:RID):Void
Attaches a light occluder to the canvas. Removes it from its previous canvas.
staticcanvasLightOccluderCreate():RID
Creates a light occluder and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all canvas_light_ocluder_*
VisualServer functions.
Once finished with your RID, you will want to free the RID using the VisualServer's godot.VisualServer.freeRid
static method.
staticcanvasLightOccluderSetEnabled(occluder:RID, enabled:Bool):Void
Enables or disables light occluder.
staticcanvasLightOccluderSetLightMask(occluder:RID, mask:Int):Void
The light mask. See godot.LightOccluder2D
for more information on light masks.
staticcanvasLightOccluderSetTransform(occluder:RID, transform:Transform2D):Void
Sets a light occluder's godot.Transform2D
.
staticcanvasLightSetItemCullMask(light:RID, mask:Int):Void
The light mask. See godot.LightOccluder2D
for more information on light masks.
staticcanvasLightSetItemShadowCullMask(light:RID, mask:Int):Void
The binary mask used to determine which layers this canvas light's shadows affects. See godot.LightOccluder2D
for more information on light masks.
staticcanvasLightSetLayerRange(light:RID, minLayer:Int, maxLayer:Int):Void
The layer range that gets rendered with this light.
staticcanvasLightSetMode(light:RID, mode:VisualServer_CanvasLightMode):Void
The mode of the light, see godot.VisualServer_CanvasLightMode
constants.
staticcanvasLightSetScale(light:RID, scale:Single):Void
Sets the texture's scale factor of the light. Equivalent to godot.Light2D.textureScale
.
staticcanvasLightSetShadowBufferSize(light:RID, size:Int):Void
Sets the width of the shadow buffer, size gets scaled to the next power of two for this.
staticcanvasLightSetShadowColor(light:RID, color:Color):Void
Sets the color of the canvas light's shadow.
staticcanvasLightSetShadowEnabled(light:RID, enabled:Bool):Void
Enables or disables the canvas light's shadow.
staticcanvasLightSetShadowFilter(light:RID, filter:VisualServer_CanvasLightShadowFilter):Void
Sets the canvas light's shadow's filter, see godot.VisualServer_CanvasLightShadowFilter
constants.
staticcanvasLightSetShadowGradientLength(light:RID, length:Single):Void
Sets the length of the shadow's gradient.
staticcanvasLightSetShadowSmooth(light:RID, smooth:Single):Void
Smoothens the shadow. The lower, the smoother.
staticcanvasLightSetTexture(light:RID, texture:RID):Void
Sets texture to be used by light. Equivalent to godot.Light2D.texture
.
staticcanvasLightSetTextureOffset(light:RID, offset:Vector2):Void
Sets the offset of the light's texture. Equivalent to godot.Light2D.offset
.
staticcanvasLightSetTransform(light:RID, transform:Transform2D):Void
Sets the canvas light's godot.Transform2D
.
staticcanvasLightSetZRange(light:RID, minZ:Int, maxZ:Int):Void
Sets the Z range of objects that will be affected by this light. Equivalent to godot.Light2D.rangeZMin
and godot.Light2D.rangeZMax
.
staticcanvasOccluderPolygonCreate():RID
Creates a new light occluder polygon and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all canvas_occluder_polygon_*
VisualServer functions.
Once finished with your RID, you will want to free the RID using the VisualServer's godot.VisualServer.freeRid
static method.
staticcanvasOccluderPolygonSetCullMode(occluderPolygon:RID, mode:VisualServer_CanvasOccluderPolygonCullMode):Void
Sets an occluder polygons cull mode. See godot.VisualServer_CanvasOccluderPolygonCullMode
constants.
staticcanvasOccluderPolygonSetShape(occluderPolygon:RID, shape:HaxeArray<Vector2>, closed:Bool):Void
Sets the shape of the occluder polygon.
staticcanvasOccluderPolygonSetShapeAsLines(occluderPolygon:RID, shape:HaxeArray<Vector2>):Void
Sets the shape of the occluder polygon as lines.
staticcanvasSetItemMirroring(canvas:RID, item:RID, mirroring:Vector2):Void
A copy of the canvas item will be drawn with a local offset of the mirroring godot.Vector2
.
staticdirectionalLightCreate():RID
Creates a directional light and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID can be used in most light_*
VisualServer functions.
Once finished with your RID, you will want to free the RID using the VisualServer's godot.VisualServer.freeRid
static method.
To place in a scene, attach this directional light to an instance using godot.VisualServer.instanceSetBase
using the returned RID.
staticdraw(?swapBuffers:Bool, ?frameStep:Float):Void
Draws a frame. This method is deprecated, please use godot.VisualServer.forceDraw
instead.
staticenvironmentCreate():RID
Creates an environment and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all environment_*
VisualServer functions.
Once finished with your RID, you will want to free the RID using the VisualServer's godot.VisualServer.freeRid
static method.
staticenvironmentSetAdjustment(env:RID, enable:Bool, brightness:Single, contrast:Single, saturation:Single, ramp:RID):Void
Sets the values to be used with the "Adjustment" post-process effect. See godot.Environment
for more details.
staticenvironmentSetAmbientLight(env:RID, color:Color, ?energy:Single, ?skyContibution:Single):Void
Sets the ambient light parameters. See godot.Environment
for more details.
staticenvironmentSetBackground(env:RID, bg:VisualServer_EnvironmentBG):Void
Sets the BGMode of the environment. Equivalent to godot.Environment.backgroundMode
.
staticenvironmentSetBgColor(env:RID, color:Color):Void
Color displayed for clear areas of the scene (if using Custom color or Color+Sky background modes).
staticenvironmentSetBgEnergy(env:RID, energy:Single):Void
Sets the intensity of the background color.
staticenvironmentSetCanvasMaxLayer(env:RID, maxLayer:Int):Void
Sets the maximum layer to use if using Canvas background mode.
staticenvironmentSetDofBlurFar(env:RID, enable:Bool, distance:Single, transition:Single, farAmount:Single, quality:VisualServer_EnvironmentDOFBlurQuality):Void
Sets the values to be used with the "DoF Far Blur" post-process effect. See godot.Environment
for more details.
staticenvironmentSetDofBlurNear(env:RID, enable:Bool, distance:Single, transition:Single, farAmount:Single, quality:VisualServer_EnvironmentDOFBlurQuality):Void
Sets the values to be used with the "DoF Near Blur" post-process effect. See godot.Environment
for more details.
staticenvironmentSetFog(env:RID, enable:Bool, color:Color, sunColor:Color, sunAmount:Single):Void
Sets the variables to be used with the scene fog. See godot.Environment
for more details.
staticenvironmentSetFogDepth(env:RID, enable:Bool, depthBegin:Single, depthEnd:Single, depthCurve:Single, transmit:Bool, transmitCurve:Single):Void
Sets the variables to be used with the fog depth effect. See godot.Environment
for more details.
staticenvironmentSetFogHeight(env:RID, enable:Bool, minHeight:Single, maxHeight:Single, heightCurve:Single):Void
Sets the variables to be used with the fog height effect. See godot.Environment
for more details.
staticenvironmentSetGlow(env:RID, enable:Bool, levelFlags:Int, intensity:Single, strength:Single, bloomThreshold:Single, blendMode:VisualServer_EnvironmentGlowBlendMode, hdrBleedThreshold:Single, hdrBleedScale:Single, hdrLuminanceCap:Single, bicubicUpscale:Bool, highQuality:Bool):Void
Sets the variables to be used with the "glow" post-process effect. See godot.Environment
for more details.
staticenvironmentSetSky(env:RID, sky:RID):Void
Sets the godot.Sky
to be used as the environment's background when using BGMode sky. Equivalent to godot.Environment.backgroundSky
.
staticenvironmentSetSkyCustomFov(env:RID, scale:Single):Void
Sets a custom field of view for the background godot.Sky
. Equivalent to godot.Environment.backgroundSkyCustomFov
.
staticenvironmentSetSkyOrientation(env:RID, orientation:Basis):Void
Sets the rotation of the background godot.Sky
expressed as a godot.Basis
. Equivalent to godot.Environment.backgroundSkyOrientation
.
staticenvironmentSetSsao(env:RID, enable:Bool, radius:Single, intensity:Single, radius2:Single, intensity2:Single, bias:Single, lightAffect:Single, aoChannelAffect:Single, color:Color, quality:VisualServer_EnvironmentSSAOQuality, blur:VisualServer_EnvironmentSSAOBlur, bilateralSharpness:Single):Void
Sets the variables to be used with the "Screen Space Ambient Occlusion (SSAO)" post-process effect. See godot.Environment
for more details.
staticenvironmentSetSsr(env:RID, enable:Bool, maxSteps:Int, fadeIn:Single, fadeOut:Single, depthTolerance:Single, roughness:Bool):Void
Sets the variables to be used with the "screen space reflections" post-process effect. See godot.Environment
for more details.
staticenvironmentSetTonemap(env:RID, toneMapper:VisualServer_EnvironmentToneMapper, exposure:Single, white:Single, autoExposure:Bool, minLuminance:Single, maxLuminance:Single, autoExpSpeed:Single, autoExpGrey:Single):Void
Sets the variables to be used with the "tonemap" post-process effect. See godot.Environment
for more details.
staticforceDraw(?swapBuffers:Bool, ?frameStep:Float):Void
Forces a frame to be drawn when the function is called. Drawing a frame updates all godot.Viewport
s that are set to update. Use with extreme caution.
staticgetRenderInfo(info:VisualServer_RenderInfo):UInt64
Returns a certain information, see godot.VisualServer_RenderInfo
for options.
staticgetVideoAdapterName():String
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.
staticgetVideoAdapterVendor():String
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.
staticgiProbeCreate():RID
Creates a GI probe and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all gi_probe_*
VisualServer functions.
Once finished with your RID, you will want to free the RID using the VisualServer's godot.VisualServer.freeRid
static method.
To place in a scene, attach this GI probe to an instance using godot.VisualServer.instanceSetBase
using the returned RID.
staticgiProbeGetBias(probe:RID):Single
Returns the bias value for the GI probe. Bias is used to avoid self occlusion. Equivalent to godot.GIProbeData.bias
.
staticgiProbeGetBounds(probe:RID):AABB
Returns the axis-aligned bounding box that covers the full extent of the GI probe.
staticgiProbeGetCellSize(probe:RID):Single
Returns the cell size set by godot.VisualServer.giProbeSetCellSize
.
staticgiProbeGetDynamicRange(probe:RID):Int
Returns the dynamic range set for this GI probe. Equivalent to godot.GIProbe.dynamicRange
.
staticgiProbeGetEnergy(probe:RID):Single
Returns the energy multiplier for this GI probe. Equivalent to godot.GIProbe.energy
.
staticgiProbeGetNormalBias(probe:RID):Single
Returns the normal bias for this GI probe. Equivalent to godot.GIProbe.normalBias
.
staticgiProbeGetPropagation(probe:RID):Single
Returns the propagation value for this GI probe. Equivalent to godot.GIProbe.propagation
.
staticgiProbeGetToCellXform(probe:RID):Transform
Returns the Transform set by godot.VisualServer.giProbeSetToCellXform
.
staticgiProbeIsCompressed(probe:RID):Bool
Returns true
if the GI probe data associated with this GI probe is compressed. Equivalent to godot.GIProbe.compress
.
staticgiProbeIsInterior(probe:RID):Bool
Returns true
if the GI probe is set to interior, meaning it does not account for sky light. Equivalent to godot.GIProbe.interior
.
staticgiProbeSetBias(probe:RID, bias:Single):Void
Sets the bias value to avoid self-occlusion. Equivalent to godot.GIProbe.bias
.
staticgiProbeSetBounds(probe:RID, bounds:AABB):Void
Sets the axis-aligned bounding box that covers the extent of the GI probe.
staticgiProbeSetCellSize(probe:RID, range:Single):Void
Sets the size of individual cells within the GI probe.
staticgiProbeSetCompress(probe:RID, enable:Bool):Void
Sets the compression setting for the GI probe data. Compressed data will take up less space but may look worse. Equivalent to godot.GIProbe.compress
.
staticgiProbeSetDynamicData(probe:RID, data:HaxeArray<Int>):Void
Sets the data to be used in the GI probe for lighting calculations. Normally this is created and called internally within the godot.GIProbe
node. You should not try to set this yourself.
staticgiProbeSetDynamicRange(probe:RID, range:Int):Void
Sets the dynamic range of the GI probe. Dynamic range sets the limit for how bright lights can be. A smaller range captures greater detail but limits how bright lights can be. Equivalent to godot.GIProbe.dynamicRange
.
staticgiProbeSetEnergy(probe:RID, energy:Single):Void
Sets the energy multiplier for this GI probe. A higher energy makes the indirect light from the GI probe brighter. Equivalent to godot.GIProbe.energy
.
staticgiProbeSetInterior(probe:RID, enable:Bool):Void
Sets the interior value of this GI probe. A GI probe set to interior does not include the sky when calculating lighting. Equivalent to godot.GIProbe.interior
.
staticgiProbeSetNormalBias(probe:RID, bias:Single):Void
Sets the normal bias for this GI probe. Normal bias behaves similar to the other form of bias and may help reduce self-occlusion. Equivalent to godot.GIProbe.normalBias
.
staticgiProbeSetPropagation(probe:RID, propagation:Single):Void
Sets the propagation of light within this GI probe. Equivalent to godot.GIProbe.propagation
.
staticgiProbeSetToCellXform(probe:RID, xform:Transform):Void
Sets the to cell godot.Transform
for this GI probe.
statichasChanged():Bool
Returns true
if changes have been made to the VisualServer's data. godot.VisualServer.draw
is usually called if this happens.
statichasOsFeature(feature:String):Bool
Returns true
if the OS supports a certain feature. Features might be s3tc
, etc
, etc2
, pvrtc
and skinning_fallback
.
When rendering with GLES2, returns true
with skinning_fallback
in case the hardware doesn't support the default GPU skinning process.
staticimmediateBegin(immediate:RID, primitive:VisualServer_PrimitiveType, ?texture:RID):Void
Sets up godot.ImmediateGeometry
internals to prepare for drawing. Equivalent to godot.ImmediateGeometry.begin
.
staticimmediateClear(immediate:RID):Void
Clears everything that was set up between godot.VisualServer.immediateBegin
and godot.VisualServer.immediateEnd
. Equivalent to godot.ImmediateGeometry.clear
.
staticimmediateColor(immediate:RID, color:Color):Void
Sets the color to be used with next vertex. Equivalent to godot.ImmediateGeometry.setColor
.
staticimmediateCreate():RID
Creates an immediate geometry and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all immediate_*
VisualServer functions.
Once finished with your RID, you will want to free the RID using the VisualServer's godot.VisualServer.freeRid
static method.
To place in a scene, attach this immediate geometry to an instance using godot.VisualServer.instanceSetBase
using the returned RID.
staticimmediateEnd(immediate:RID):Void
Ends drawing the godot.ImmediateGeometry
and displays it. Equivalent to godot.ImmediateGeometry.end
.
staticimmediateGetMaterial(immediate:RID):RID
Returns the material assigned to the godot.ImmediateGeometry
.
staticimmediateNormal(immediate:RID, normal:Vector3):Void
Sets the normal to be used with next vertex. Equivalent to godot.ImmediateGeometry.setNormal
.
staticimmediateSetMaterial(immediate:RID, material:RID):Void
Sets the material to be used to draw the godot.ImmediateGeometry
.
staticimmediateTangent(immediate:RID, tangent:Plane):Void
Sets the tangent to be used with next vertex. Equivalent to godot.ImmediateGeometry.setTangent
.
staticimmediateUv(immediate:RID, texUv:Vector2):Void
Sets the UV to be used with next vertex. Equivalent to godot.ImmediateGeometry.setUv
.
staticimmediateUv2(immediate:RID, texUv:Vector2):Void
Sets the UV2 to be used with next vertex. Equivalent to godot.ImmediateGeometry.setUv2
.
staticimmediateVertex(immediate:RID, vertex:Vector3):Void
Adds the next vertex using the information provided in advance. Equivalent to godot.ImmediateGeometry.addVertex
.
staticimmediateVertex2d(immediate:RID, vertex:Vector2):Void
Adds the next vertex using the information provided in advance. This is a helper class that calls godot.VisualServer.immediateVertex
under the hood. Equivalent to godot.ImmediateGeometry.addVertex
.
staticinit():Void
Initializes the visual server. This function is called internally by platform-dependent code during engine initialization. If called from a running game, it will not do anything.
staticinstanceAttachObjectInstanceId(instance:RID, id:UInt64):Void
Attaches a unique Object ID to instance. Object ID must be attached to instance for proper culling with godot.VisualServer.instancesCullAabb
, godot.VisualServer.instancesCullConvex
, and godot.VisualServer.instancesCullRay
.
staticinstanceAttachSkeleton(instance:RID, skeleton:RID):Void
Attaches a skeleton to an instance. Removes the previous skeleton from the instance.
staticinstanceCreate():RID
Creates a visual instance and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all instance_*
VisualServer functions.
Once finished with your RID, you will want to free the RID using the VisualServer's godot.VisualServer.freeRid
static method.
An instance is a way of placing a 3D object in the scenario. Objects like particles, meshes, and reflection probes need to be associated with an instance to be visible in the scenario using godot.VisualServer.instanceSetBase
.
staticinstanceCreate2(base:RID, scenario:RID):RID
Creates a visual instance, adds it to the VisualServer, and sets both base and scenario. It can be accessed with the RID that is returned. This RID will be used in all instance_*
VisualServer functions.
Once finished with your RID, you will want to free the RID using the VisualServer's godot.VisualServer.freeRid
static method.
staticinstanceGeometrySetAsInstanceLod(instance:RID, asLodOfInstance:RID):Void
Not implemented in Godot 3.x.
staticinstanceGeometrySetCastShadowsSetting(instance:RID, shadowCastingSetting:VisualServer_ShadowCastingSetting):Void
Sets the shadow casting setting to one of godot.VisualServer_ShadowCastingSetting
. Equivalent to godot.GeometryInstance.castShadow
.
staticinstanceGeometrySetDrawRange(instance:RID, min:Single, max:Single, minMargin:Single, maxMargin:Single):Void
Not implemented in Godot 3.x.
staticinstanceGeometrySetFlag(instance:RID, flag:VisualServer_InstanceFlags, enabled:Bool):Void
Sets the flag for a given godot.VisualServer_InstanceFlags
. See godot.VisualServer_InstanceFlags
for more details.
staticinstanceGeometrySetMaterialOverride(instance:RID, material:RID):Void
Sets a material that will override the material for all surfaces on the mesh associated with this instance. Equivalent to godot.GeometryInstance.materialOverride
.
staticinstanceSetBase(instance:RID, base:RID):Void
Sets the base of the instance. A base can be any of the 3D objects that are created in the VisualServer that can be displayed. For example, any of the light types, mesh, multimesh, immediate geometry, particle system, reflection probe, lightmap capture, and the GI probe are all types that can be set as the base of an instance in order to be displayed in the scenario.
staticinstanceSetBlendShapeWeight(instance:RID, shape:Int, weight:Single):Void
Sets the weight for a given blend shape associated with this instance.
staticinstanceSetCustomAabb(instance:RID, aabb:AABB):Void
Sets a custom AABB to use when culling objects from the view frustum. Equivalent to godot.GeometryInstance.setCustomAabb
.
staticinstanceSetExtraVisibilityMargin(instance:RID, margin:Single):Void
Sets a margin to increase the size of the AABB when culling objects from the view frustum. This allows you to avoid culling objects that fall outside the view frustum. Equivalent to godot.GeometryInstance.extraCullMargin
.
staticinstanceSetLayerMask(instance:RID, mask:UInt):Void
Sets the render layers that this instance will be drawn to. Equivalent to godot.VisualInstance.layers
.
staticinstanceSetScenario(instance:RID, scenario:RID):Void
Sets the scenario that the instance is in. The scenario is the 3D world that the objects will be displayed in.
staticinstanceSetSurfaceMaterial(instance:RID, surface:Int, material:RID):Void
Sets the material of a specific surface. Equivalent to godot.MeshInstance.setSurfaceMaterial
.
staticinstanceSetTransform(instance:RID, transform:Transform):Void
Sets the world space transform of the instance. Equivalent to godot.Spatial.transform
.
staticinstanceSetUseLightmap(instance:RID, lightmapInstance:RID, lightmap:RID, ?lightmapSlice:Int, ?lightmapUvRect:Rect2):Void
Sets the lightmap to use with this instance.
Parameters:
lightmapUvRect | If the parameter is null, then the default value is new Rect2(new Vector2(0, 0), new Vector2(1, 1)) |
---|
staticinstanceSetVisible(instance:RID, visible:Bool):Void
Sets whether an instance is drawn or not. Equivalent to godot.Spatial.visible
.
staticinstancesCullAabb(aabb:AABB, ?scenario:RID):Array
Returns an array of object IDs intersecting with the provided AABB. Only visual 3D nodes are considered, such as godot.MeshInstance
or godot.DirectionalLight
. Use @GDScript.instance_from_id
to obtain the actual nodes. A scenario RID must be provided, which is available in the godot.World
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.
staticinstancesCullConvex(convex:Array, ?scenario:RID):Array
Returns an array of object IDs intersecting with the provided convex shape. Only visual 3D nodes are considered, such as godot.MeshInstance
or godot.DirectionalLight
. Use @GDScript.instance_from_id
to obtain the actual nodes. A scenario RID must be provided, which is available in the godot.World
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.
staticinstancesCullRay(from:Vector3, to:Vector3, ?scenario:RID):Array
Returns an array of object IDs intersecting with the provided 3D ray. Only visual 3D nodes are considered, such as godot.MeshInstance
or godot.DirectionalLight
. Use @GDScript.instance_from_id
to obtain the actual nodes. A scenario RID must be provided, which is available in the godot.World
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.
staticlightDirectionalSetBlendSplits(light:RID, enable:Bool):Void
If true
, this directional light will blend between shadow map splits resulting in a smoother transition between them. Equivalent to godot.DirectionalLight.directionalShadowBlendSplits
.
staticlightDirectionalSetShadowDepthRangeMode(light:RID, rangeMode:VisualServer_LightDirectionalShadowDepthRangeMode):Void
Sets the shadow depth range mode for this directional light. Equivalent to godot.DirectionalLight.directionalShadowDepthRange
. See godot.VisualServer_LightDirectionalShadowDepthRangeMode
for options.
staticlightDirectionalSetShadowMode(light:RID, mode:VisualServer_LightDirectionalShadowMode):Void
Sets the shadow mode for this directional light. Equivalent to godot.DirectionalLight.directionalShadowMode
. See godot.VisualServer_LightDirectionalShadowMode
for options.
staticlightOmniSetShadowDetail(light:RID, detail:VisualServer_LightOmniShadowDetail):Void
Sets whether to use vertical or horizontal detail for this omni light. This can be used to alleviate artifacts in the shadow map. Equivalent to godot.OmniLight.omniShadowDetail
.
staticlightOmniSetShadowMode(light:RID, mode:VisualServer_LightOmniShadowMode):Void
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 godot.OmniLight.omniShadowMode
.
staticlightSetBakeMode(light:RID, bakeMode:VisualServer_LightBakeMode):Void
Sets the bake mode for this light, see godot.VisualServer_LightBakeMode
for options. The bake mode affects how the light will be baked in godot.BakedLightmap
s and godot.GIProbe
s.
staticlightSetColor(light:RID, color:Color):Void
Sets the color of the light. Equivalent to godot.Light.lightColor
.
staticlightSetCullMask(light:RID, mask:UInt):Void
Sets the cull mask for this Light. Lights only affect objects in the selected layers. Equivalent to godot.Light.lightCullMask
.
staticlightSetNegative(light:RID, enable:Bool):Void
If true
, light will subtract light instead of adding light. Equivalent to godot.Light.lightNegative
.
staticlightSetParam(light:RID, param:VisualServer_LightParam, value:Single):Void
Sets the specified light parameter. See godot.VisualServer_LightParam
for options. Equivalent to godot.Light.setParam
.
staticlightSetReverseCullFaceMode(light:RID, enabled:Bool):Void
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 godot.VisualServer.instanceGeometrySetCastShadowsSetting
. Equivalent to godot.Light.shadowReverseCullFace
.
staticlightSetShadow(light:RID, enabled:Bool):Void
If true
, light will cast shadows. Equivalent to godot.Light.shadowEnabled
.
staticlightSetShadowColor(light:RID, color:Color):Void
Sets the color of the shadow cast by the light. Equivalent to godot.Light.shadowColor
.
staticlightSetUseGi(light:RID, enabled:Bool):Void
Sets whether GI probes capture light information from this light. Deprecated method. Use godot.VisualServer.lightSetBakeMode
instead. This method is only kept for compatibility reasons and calls godot.VisualServer.lightSetBakeMode
internally, setting the bake mode to godot.VisualServer_LightBakeMode.disabled
or godot.VisualServer_LightBakeMode.indirect
depending on the given parameter.
staticlightmapCaptureCreate():RID
Creates a lightmap capture and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all lightmap_capture_*
VisualServer functions.
Once finished with your RID, you will want to free the RID using the VisualServer's godot.VisualServer.freeRid
static method.
To place in a scene, attach this lightmap capture to an instance using godot.VisualServer.instanceSetBase
using the returned RID.
staticlightmapCaptureGetEnergy(capture:RID):Single
Returns the energy multiplier used by the lightmap capture.
staticinlinelightmapCaptureGetOctree(capture:RID):Array<UInt8>
Returns the octree used by the lightmap capture.
staticlightmapCaptureGetOctreeCellSubdiv(capture:RID):Int
Returns the cell subdivision amount used by this lightmap capture's octree.
staticlightmapCaptureGetOctreeCellTransform(capture:RID):Transform
Returns the cell transform for this lightmap capture's octree.
staticlightmapCaptureSetBounds(capture:RID, bounds:AABB):Void
Sets the size of the area covered by the lightmap capture. Equivalent to godot.BakedLightmapData.bounds
.
staticlightmapCaptureSetEnergy(capture:RID, energy:Single):Void
Sets the energy multiplier for this lightmap capture. Equivalent to godot.BakedLightmapData.energy
.
staticlightmapCaptureSetInterior(capture:RID, interior:Bool):Void
Sets the "interior" mode for this lightmap capture. Equivalent to godot.BakedLightmapData.interior
.
staticlightmapCaptureSetOctree(capture:RID, octree:HaxeArray<UInt8>):Void
Sets the octree to be used by this lightmap capture. This function is normally used by the godot.BakedLightmap
node. Equivalent to godot.BakedLightmapData.octree
.
staticlightmapCaptureSetOctreeCellSubdiv(capture:RID, subdiv:Int):Void
Sets the subdivision level of this lightmap capture's octree. Equivalent to godot.BakedLightmapData.cellSubdiv
.
staticlightmapCaptureSetOctreeCellTransform(capture:RID, xform:Transform):Void
Sets the octree cell transform for this lightmap capture's octree. Equivalent to godot.BakedLightmapData.cellSpaceTransform
.
staticmakeSphereMesh(latitudes:Int, longitudes:Int, radius:Single):RID
Returns a mesh of a sphere with the given amount of horizontal and vertical subdivisions.
staticmaterialCreate():RID
Creates an empty material and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all material_*
VisualServer functions.
Once finished with your RID, you will want to free the RID using the VisualServer's godot.VisualServer.freeRid
static method.
staticmaterialGetParam(material:RID, parameter:String):Dynamic
Returns the value of a certain material's parameter.
staticmaterialGetParamDefault(material:RID, parameter:String):Dynamic
Returns the default value for the param if available. Returns null
otherwise.
staticmaterialGetShader(shaderMaterial:RID):RID
Returns the shader of a certain material's shader. Returns an empty RID if the material doesn't have a shader.
staticmaterialSetParam(material:RID, parameter:String, value:Dynamic):Void
Sets a material's parameter.
staticmeshAddSurfaceFromArrays(mesh:RID, primitive:VisualServer_PrimitiveType, arrays:Array, ?blendShapes:Array, ?compressFormat:UInt):Void
Adds a surface generated from the Arrays to a mesh. See godot.VisualServer_PrimitiveType
constants for types.
Parameters:
blendShapes | If the parameter is null, then the default value is new Godot.Collections.Array { } |
---|
staticmeshCreate():RID
Creates a new mesh and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all mesh_*
VisualServer functions.
Once finished with your RID, you will want to free the RID using the VisualServer's godot.VisualServer.freeRid
static method.
To place in a scene, attach this mesh to an instance using godot.VisualServer.instanceSetBase
using the returned RID.
staticmeshSetBlendShapeMode(mesh:RID, mode:VisualServer_BlendShapeMode):Void
Sets a mesh's blend shape mode.
staticinlinemeshSurfaceGetArray(mesh:RID, surface:Int):Array<UInt8>
Returns a mesh's surface's vertex buffer.
staticmeshSurfaceGetArrayIndexLen(mesh:RID, surface:Int):Int
Returns a mesh's surface's amount of indices.
staticmeshSurfaceGetArrayLen(mesh:RID, surface:Int):Int
Returns a mesh's surface's amount of vertices.
staticmeshSurfaceGetBlendShapeArrays(mesh:RID, surface:Int):Array
Returns a mesh's surface's arrays for blend shapes.
staticmeshSurfaceGetFormatOffset(format:UInt, vertexLen:Int, indexLen:Int, arrayIndex:Int):UInt
Function is unused in Godot 3.x.
staticinlinemeshSurfaceGetIndexArray(mesh:RID, surface:Int):Array<UInt8>
Returns a mesh's surface's index buffer.
staticmeshSurfaceGetPrimitiveType(mesh:RID, surface:Int):VisualServer_PrimitiveType
Returns the primitive type of a mesh's surface.
staticmeshSurfaceGetSkeletonAabb(mesh:RID, surface:Int):Array
Returns the aabb of a mesh's surface's skeleton.
staticmeshSurfaceSetMaterial(mesh:RID, surface:Int, material:RID):Void
Sets a mesh's surface's material.
staticmeshSurfaceUpdateRegion(mesh:RID, surface:Int, offset:Int, data:HaxeArray<UInt8>):Void
Updates a specific region of a vertex buffer for the specified surface. Warning: this function alters the vertex buffer directly with no safety mechanisms, you can easily corrupt your mesh.
staticmultimeshAllocate(multimesh:RID, instances:Int, transformFormat:VisualServer_MultimeshTransformFormat, colorFormat:VisualServer_MultimeshColorFormat, ?customDataFormat:VisualServer_MultimeshCustomDataFormat):Void
Allocates space for the multimesh data. Format parameters determine how the data will be stored by OpenGL. See godot.VisualServer_MultimeshTransformFormat
, godot.VisualServer_MultimeshColorFormat
, and godot.VisualServer_MultimeshCustomDataFormat
for usage. Equivalent to godot.MultiMesh.instanceCount
.
staticmultimeshCreate():RID
Creates a new multimesh on the VisualServer and returns an godot.RID
handle. This RID will be used in all multimesh_*
VisualServer functions.
Once finished with your RID, you will want to free the RID using the VisualServer's godot.VisualServer.freeRid
static method.
To place in a scene, attach this multimesh to an instance using godot.VisualServer.instanceSetBase
using the returned RID.
staticmultimeshGetAabb(multimesh:RID):AABB
Calculates and returns the axis-aligned bounding box that encloses all instances within the multimesh.
staticmultimeshGetInstanceCount(multimesh:RID):Int
Returns the number of instances allocated for this multimesh.
staticmultimeshGetMesh(multimesh:RID):RID
Returns the RID of the mesh that will be used in drawing this multimesh.
staticmultimeshGetVisibleInstances(multimesh:RID):Int
Returns the number of visible instances for this multimesh.
staticmultimeshInstanceGetColor(multimesh:RID, index:Int):Color
Returns the color by which the specified instance will be modulated.
staticmultimeshInstanceGetCustomData(multimesh:RID, index:Int):Color
Returns the custom data associated with the specified instance.
staticmultimeshInstanceGetTransform(multimesh:RID, index:Int):Transform
Returns the godot.Transform
of the specified instance.
staticmultimeshInstanceGetTransform2d(multimesh:RID, index:Int):Transform2D
Returns the godot.Transform2D
of the specified instance. For use when the multimesh is set to use 2D transforms.
staticmultimeshInstanceSetColor(multimesh:RID, index:Int, color:Color):Void
Sets the color by which this instance will be modulated. Equivalent to godot.MultiMesh.setInstanceColor
.
staticmultimeshInstanceSetCustomData(multimesh:RID, index:Int, customData:Color):Void
Sets the custom data for this instance. Custom data is passed as a godot.Color
, but is interpreted as a vec4
in the shader. Equivalent to godot.MultiMesh.setInstanceCustomData
.
staticmultimeshInstanceSetTransform(multimesh:RID, index:Int, transform:Transform):Void
Sets the godot.Transform
for this instance. Equivalent to godot.MultiMesh.setInstanceTransform
.
staticmultimeshInstanceSetTransform2d(multimesh:RID, index:Int, transform:Transform2D):Void
Sets the godot.Transform2D
for this instance. For use when multimesh is used in 2D. Equivalent to godot.MultiMesh.setInstanceTransform2d
.
staticmultimeshSetAsBulkArray(multimesh:RID, array:HaxeArray<Single>):Void
Sets all data related to the instances in one go. This is especially useful when loading the data from disk or preparing the data from GDNative.
All data is packed in one large float array. An array may look like this: Transform for instance 1, color data for instance 1, custom data for instance 1, transform for instance 2, color data for instance 2, etc.
godot.Transform
is stored as 12 floats, godot.Transform2D
is stored as 8 floats, COLOR_8BIT
/ CUSTOM_DATA_8BIT
is stored as 1 float (4 bytes as is) and COLOR_FLOAT
/ CUSTOM_DATA_FLOAT
is stored as 4 floats.
staticmultimeshSetMesh(multimesh:RID, mesh:RID):Void
Sets the mesh to be drawn by the multimesh. Equivalent to godot.MultiMesh.mesh
.
staticmultimeshSetVisibleInstances(multimesh:RID, visible:Int):Void
Sets the number of instances visible at a given time. If -1, all instances that have been allocated are drawn. Equivalent to godot.MultiMesh.visibleInstanceCount
.
staticomniLightCreate():RID
Creates a new omni light and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID can be used in most light_*
VisualServer functions.
Once finished with your RID, you will want to free the RID using the VisualServer's godot.VisualServer.freeRid
static method.
To place in a scene, attach this omni light to an instance using godot.VisualServer.instanceSetBase
using the returned RID.
staticparticlesCreate():RID
Creates a particle system and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all particles_*
VisualServer functions.
Once finished with your RID, you will want to free the RID using the VisualServer's godot.VisualServer.freeRid
static method.
To place in a scene, attach these particles to an instance using godot.VisualServer.instanceSetBase
using the returned RID.
staticparticlesGetCurrentAabb(particles:RID):AABB
Calculates and returns the axis-aligned bounding box that contains all the particles. Equivalent to godot.Particles.captureAabb
.
staticparticlesGetEmitting(particles:RID):Bool
Returns true
if particles are currently set to emitting.
staticparticlesIsInactive(particles:RID):Bool
Returns true
if particles are not emitting and particles are set to inactive.
staticparticlesRequestProcess(particles:RID):Void
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 godot.VisualServer.instancesCullAabb
, godot.VisualServer.instancesCullConvex
, or godot.VisualServer.instancesCullRay
.
staticparticlesRestart(particles:RID):Void
Reset the particles on the next update. Equivalent to godot.Particles.restart
.
staticparticlesSetAmount(particles:RID, amount:Int):Void
Sets the number of particles to be drawn and allocates the memory for them. Equivalent to godot.Particles.amount
.
staticparticlesSetCustomAabb(particles:RID, aabb:AABB):Void
Sets a custom axis-aligned bounding box for the particle system. Equivalent to godot.Particles.visibilityAabb
.
staticparticlesSetDrawOrder(particles:RID, order:VisualServer_ParticlesDrawOrder):Void
Sets the draw order of the particles to one of the named enums from godot.VisualServer_ParticlesDrawOrder
. See godot.VisualServer_ParticlesDrawOrder
for options. Equivalent to godot.Particles.drawOrder
.
staticparticlesSetDrawPassMesh(particles:RID, pass:Int, mesh:RID):Void
Sets the mesh to be used for the specified draw pass. Equivalent to godot.Particles.drawPass1
, godot.Particles.drawPass2
, godot.Particles.drawPass3
, and godot.Particles.drawPass4
.
staticparticlesSetDrawPasses(particles:RID, count:Int):Void
Sets the number of draw passes to use. Equivalent to godot.Particles.drawPasses
.
staticparticlesSetEmissionTransform(particles:RID, transform:Transform):Void
Sets the godot.Transform
that will be used by the particles when they first emit.
staticparticlesSetEmitting(particles:RID, emitting:Bool):Void
If true
, particles will emit over time. Setting to false does not reset the particles, but only stops their emission. Equivalent to godot.Particles.emitting
.
staticparticlesSetExplosivenessRatio(particles:RID, ratio:Single):Void
Sets the explosiveness ratio. Equivalent to godot.Particles.explosiveness
.
staticparticlesSetFixedFps(particles:RID, fps:Int):Void
Sets the frame rate that the particle system rendering will be fixed to. Equivalent to godot.Particles.fixedFps
.
staticparticlesSetFractionalDelta(particles:RID, enable:Bool):Void
If true
, uses fractional delta which smooths the movement of the particles. Equivalent to godot.Particles.fractDelta
.
staticparticlesSetLifetime(particles:RID, lifetime:Single):Void
Sets the lifetime of each particle in the system. Equivalent to godot.Particles.lifetime
.
staticparticlesSetOneShot(particles:RID, oneShot:Bool):Void
If true
, particles will emit once and then stop. Equivalent to godot.Particles.oneShot
.
staticparticlesSetPreProcessTime(particles:RID, time:Single):Void
Sets the preprocess time for the particles' animation. This lets you delay starting an animation until after the particles have begun emitting. Equivalent to godot.Particles.preprocess
.
staticparticlesSetProcessMaterial(particles:RID, material:RID):Void
Sets the material for processing the particles.
Note: This is not the material used to draw the materials. Equivalent to godot.Particles.processMaterial
.
staticparticlesSetRandomnessRatio(particles:RID, ratio:Single):Void
Sets the emission randomness ratio. This randomizes the emission of particles within their phase. Equivalent to godot.Particles.randomness
.
staticparticlesSetSpeedScale(particles:RID, scale:Single):Void
Sets the speed scale of the particle system. Equivalent to godot.Particles.speedScale
.
staticparticlesSetUseLocalCoordinates(particles:RID, enable:Bool):Void
If true
, particles use local coordinates. If false
they use global coordinates. Equivalent to godot.Particles.localCoords
.
staticreflectionProbeCreate():RID
Creates a reflection probe and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all reflection_probe_*
VisualServer functions.
Once finished with your RID, you will want to free the RID using the VisualServer's godot.VisualServer.freeRid
static method.
To place in a scene, attach this reflection probe to an instance using godot.VisualServer.instanceSetBase
using the returned RID.
staticreflectionProbeSetAsInterior(probe:RID, enable:Bool):Void
If true
, reflections will ignore sky contribution. Equivalent to godot.ReflectionProbe.interiorEnable
.
staticreflectionProbeSetCullMask(probe:RID, layers:UInt):Void
Sets the render cull mask for this reflection probe. Only instances with a matching cull mask will be rendered by this probe. Equivalent to godot.ReflectionProbe.cullMask
.
staticreflectionProbeSetEnableBoxProjection(probe:RID, enable:Bool):Void
If true
, uses box projection. This can make reflections look more correct in certain situations. Equivalent to godot.ReflectionProbe.boxProjection
.
staticreflectionProbeSetEnableShadows(probe:RID, enable:Bool):Void
If true
, computes shadows in the reflection probe. This makes the reflection much slower to compute. Equivalent to godot.ReflectionProbe.enableShadows
.
staticreflectionProbeSetExtents(probe:RID, extents:Vector3):Void
Sets the size of the area that the reflection probe will capture. Equivalent to godot.ReflectionProbe.extents
.
staticreflectionProbeSetIntensity(probe:RID, intensity:Single):Void
Sets the intensity of the reflection probe. Intensity modulates the strength of the reflection. Equivalent to godot.ReflectionProbe.intensity
.
staticreflectionProbeSetInteriorAmbient(probe:RID, color:Color):Void
Sets the ambient light color for this reflection probe when set to interior mode. Equivalent to godot.ReflectionProbe.interiorAmbientColor
.
staticreflectionProbeSetInteriorAmbientEnergy(probe:RID, energy:Single):Void
Sets the energy multiplier for this reflection probes ambient light contribution when set to interior mode. Equivalent to godot.ReflectionProbe.interiorAmbientEnergy
.
staticreflectionProbeSetInteriorAmbientProbeContribution(probe:RID, contrib:Single):Void
Sets the contribution value for how much the reflection affects the ambient light for this reflection probe when set to interior mode. Useful so that ambient light matches the color of the room. Equivalent to godot.ReflectionProbe.interiorAmbientContrib
.
staticreflectionProbeSetMaxDistance(probe:RID, distance:Single):Void
Sets the max distance away from the probe an object can be before it is culled. Equivalent to godot.ReflectionProbe.maxDistance
.
staticreflectionProbeSetOriginOffset(probe:RID, offset:Vector3):Void
Sets the origin offset to be used when this reflection probe is in box project mode. Equivalent to godot.ReflectionProbe.originOffset
.
staticreflectionProbeSetUpdateMode(probe:RID, mode:VisualServer_ReflectionProbeUpdateMode):Void
Sets how often the reflection probe updates. Can either be once or every frame. See godot.VisualServer_ReflectionProbeUpdateMode
for options.
staticrequestFrameDrawnCallback(where:Object, method:String, userdata:Dynamic):Void
Schedules a callback to the corresponding named method
on where
after a frame has been drawn.
The callback method must use only 1 argument which will be called with userdata
.
staticscenarioCreate():RID
Creates a scenario and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all scenario_*
VisualServer functions.
Once finished with your RID, you will want to free the RID using the VisualServer's godot.VisualServer.freeRid
static method.
The scenario is the 3D world that all the visual instances exist in.
staticscenarioSetDebug(scenario:RID, debugMode:VisualServer_ScenarioDebugMode):Void
Sets the godot.VisualServer_ScenarioDebugMode
for this scenario. See godot.VisualServer_ScenarioDebugMode
for options.
staticscenarioSetEnvironment(scenario:RID, environment:RID):Void
Sets the environment that will be used with this scenario.
staticscenarioSetFallbackEnvironment(scenario:RID, environment:RID):Void
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.
staticscenarioSetReflectionAtlasSize(scenario:RID, size:Int, subdiv:Int):Void
Sets the size of the reflection atlas shared by all reflection probes in this scenario.
staticsetBootImage(image:Image, color:Color, scale:Bool, ?useFilter:Bool):Void
Sets a boot image. The color defines the background color. If scale
is true
, the image will be scaled to fit the screen size. If 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.
staticsetDebugGenerateWireframes(generate:Bool):Void
If true
, the engine will generate wireframes for use with the wireframe debug mode.
staticsetDefaultClearColor(color:Color):Void
Sets the default clear color which is used when a specific clear color has not been selected.
staticsetShaderTimeScale(scale:Single):Void
Sets the scale to apply to the passage of time for the shaders' TIME
builtin.
The default value is 1.0
, which means TIME
will count the real time as it goes by, without narrowing or stretching it.
staticshaderCreate():RID
Creates an empty shader and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all shader_*
VisualServer functions.
Once finished with your RID, you will want to free the RID using the VisualServer's godot.VisualServer.freeRid
static method.
staticshaderGetDefaultTextureParam(shader:RID, name:String):RID
Returns a default texture from a shader searched by name.
staticshaderSetDefaultTextureParam(shader:RID, name:String, texture:RID):Void
Sets a shader's default texture. Overwrites the texture given by name.
staticskeletonAllocate(skeleton:RID, bones:Int, ?is2dSkeleton:Bool):Void
Allocates the GPU buffers for this skeleton.
staticskeletonBoneGetTransform(skeleton:RID, bone:Int):Transform
Returns the godot.Transform
set for a specific bone of this skeleton.
staticskeletonBoneGetTransform2d(skeleton:RID, bone:Int):Transform2D
Returns the godot.Transform2D
set for a specific bone of this skeleton.
staticskeletonBoneSetTransform(skeleton:RID, bone:Int, transform:Transform):Void
Sets the godot.Transform
for a specific bone of this skeleton.
staticskeletonBoneSetTransform2d(skeleton:RID, bone:Int, transform:Transform2D):Void
Sets the godot.Transform2D
for a specific bone of this skeleton.
staticskeletonCreate():RID
Creates a skeleton and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all skeleton_*
VisualServer functions.
Once finished with your RID, you will want to free the RID using the VisualServer's godot.VisualServer.freeRid
static method.
staticskeletonGetBoneCount(skeleton:RID):Int
Returns the number of bones allocated for this skeleton.
staticskyCreate():RID
Creates an empty sky and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all sky_*
VisualServer functions.
Once finished with your RID, you will want to free the RID using the VisualServer's godot.VisualServer.freeRid
static method.
staticspotLightCreate():RID
Creates a spot light and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID can be used in most light_*
VisualServer functions.
Once finished with your RID, you will want to free the RID using the VisualServer's godot.VisualServer.freeRid
static method.
To place in a scene, attach this spot light to an instance using godot.VisualServer.instanceSetBase
using the returned RID.
statictextureAllocate(texture:RID, width:Int, height:Int, depth3d:Int, format:Image_Format, type:VisualServer_TextureType, ?flags:UInt):Void
Allocates the GPU memory for the texture.
statictextureCreate():RID
Creates an empty texture and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all texture_*
VisualServer functions.
Once finished with your RID, you will want to free the RID using the VisualServer's godot.VisualServer.freeRid
static method.
statictextureCreateFromImage(image:Image, ?flags:UInt):RID
Creates a texture, allocates the space for an image, and fills in the image.
statictextureGetData(texture:RID, ?cubeSide:Int):Image
Returns a copy of a texture's image unless it's a CubeMap, in which case it returns the godot.RID
of the image at one of the cubes sides.
statictextureGetType(texture:RID):VisualServer_TextureType
Returns the type of the texture, can be any of the godot.VisualServer_TextureType
.
statictextureSetData(texture:RID, image:Image, ?layer:Int):Void
Sets the texture's image data. If it's a CubeMap, it sets the image data at a cube side.
statictextureSetDataPartial(texture:RID, image:Image, srcX:Int, srcY:Int, srcW:Int, srcH:Int, dstX:Int, dstY:Int, dstMip:Int, ?layer:Int):Void
Sets a part of the data for a texture. Warning: this function calls the underlying graphics API directly and may corrupt your texture if used improperly.
statictextureSetFlags(texture:RID, flags:UInt):Void
Sets the texture's flags. See godot.VisualServer_TextureFlags
for options.
statictextureSetShrinkAllX2OnSetData(shrink:Bool):Void
If true
, sets internal processes to shrink all image data to half the size.
statictextureSetSizeOverride(texture:RID, width:Int, height:Int, depth:Int):Void
Resizes the texture to the specified dimensions.
statictexturesKeepOriginal(enable:Bool):Void
If true
, the image will be stored in the texture's images array if overwritten.
staticviewportAttachToScreen(viewport:RID, ?rect:Rect2, ?screen:Int):Void
Copies viewport to a region of the screen specified by rect
. If godot.Viewport.renderDirectToScreen
is true
, then 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:
func _ready():
get_viewport().set_attach_to_screen_rect(Rect2())
$Viewport.set_attach_to_screen_rect(Rect2(0, 0, 600, 600))
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 a further optimization see, godot.VisualServer.viewportSetRenderDirectToScreen
.
Parameters:
rect | If the parameter is null, then the default value is new Rect2(new Vector2(0, 0), new Vector2(0, 0)) |
---|
staticviewportCreate():RID
Creates an empty viewport and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all viewport_*
VisualServer functions.
Once finished with your RID, you will want to free the RID using the VisualServer's godot.VisualServer.freeRid
static method.
staticviewportGetRenderInfo(viewport:RID, info:VisualServer_ViewportRenderInfo):Int
Returns a viewport's render information. For options, see the godot.VisualServer_ViewportRenderInfo
constants.
staticviewportRemoveCanvas(viewport:RID, canvas:RID):Void
Detaches a viewport from a canvas and vice versa.
staticviewportSetActive(viewport:RID, active:Bool):Void
If true
, sets the viewport active, else sets it inactive.
staticviewportSetCanvasStacking(viewport:RID, canvas:RID, layer:Int, sublayer:Int):Void
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.
staticviewportSetCanvasTransform(viewport:RID, canvas:RID, offset:Transform2D):Void
Sets the transformation of a viewport's canvas.
staticviewportSetClearMode(viewport:RID, clearMode:VisualServer_ViewportClearMode):Void
Sets the clear mode of a viewport. See godot.VisualServer_ViewportClearMode
for options.
staticviewportSetDebugDraw(viewport:RID, draw:VisualServer_ViewportDebugDraw):Void
Sets the debug draw mode of a viewport. See godot.VisualServer_ViewportDebugDraw
for options.
staticviewportSetDisable3d(viewport:RID, disabled:Bool):Void
If true
, a viewport's 3D rendering is disabled.
staticviewportSetDisableEnvironment(viewport:RID, disabled:Bool):Void
If true
, rendering of a viewport's environment is disabled.
staticviewportSetGlobalCanvasTransform(viewport:RID, transform:Transform2D):Void
Sets the viewport's global transformation matrix.
staticviewportSetHideCanvas(viewport:RID, hidden:Bool):Void
If true
, the viewport's canvas is not rendered.
staticviewportSetMsaa(viewport:RID, msaa:VisualServer_ViewportMSAA):Void
Sets the anti-aliasing mode. See godot.VisualServer_ViewportMSAA
for options.
staticviewportSetParentViewport(viewport:RID, parentViewport:RID):Void
Sets the viewport's parent to another viewport.
staticviewportSetRenderDirectToScreen(viewport:RID, enabled:Bool):Void
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.
staticviewportSetScenario(viewport:RID, scenario:RID):Void
Sets a viewport's scenario.
The scenario contains information about the godot.VisualServer_ScenarioDebugMode
, environment information, reflection atlas etc.
staticviewportSetShadowAtlasQuadrantSubdivision(viewport:RID, quadrant:Int, subdivision:Int):Void
Sets the shadow atlas quadrant's subdivision.
staticviewportSetShadowAtlasSize(viewport:RID, size:Int):Void
Sets the size of the shadow atlas's images (used for omni and spot lights). The value will be rounded up to the nearest power of 2.
staticviewportSetSharpenIntensity(viewport:RID, intensity:Single):Void
Sets the sharpening intensity
for the viewport
. If set to a value greater than 0.0
, contrast-adaptive sharpening will be applied to the 3D viewport. This has a low performance cost and can be used to recover some of the sharpness lost from using FXAA. Values around 0.5
generally give the best results. See also godot.VisualServer.viewportSetUseFxaa
.
staticviewportSetSize(viewport:RID, width:Int, height:Int):Void
Sets the viewport's width and height.
staticviewportSetTransparentBackground(viewport:RID, enabled:Bool):Void
If true
, the viewport renders its background as transparent.
staticviewportSetUpdateMode(viewport:RID, updateMode:VisualServer_ViewportUpdateMode):Void
Sets when the viewport should be updated. See godot.VisualServer_ViewportUpdateMode
constants for options.
staticviewportSetUsage(viewport:RID, usage:VisualServer_ViewportUsage):Void
Sets the viewport's 2D/3D mode. See godot.VisualServer_ViewportUsage
constants for options.
staticviewportSetUseArvr(viewport:RID, useArvr:Bool):Void
If true
, the viewport uses augmented or virtual reality technologies. See godot.ARVRInterface
.
staticviewportSetUseDebanding(viewport:RID, debanding:Bool):Void
If true
, uses a fast post-processing filter to make banding significantly less visible. In some cases, debanding may introduce a slightly noticeable dithering pattern. It's recommended to enable debanding only when actually needed since the dithering pattern will make lossless-compressed screenshots larger.
Note: Only available on the GLES3 backend. godot.Viewport.hdr
must also be true
for debanding to be effective.
staticviewportSetUseFxaa(viewport:RID, fxaa:Bool):Void
Enables fast approximate antialiasing for this viewport. 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. Some of the lost sharpness can be recovered by enabling contrast-adaptive sharpening (see godot.VisualServer.viewportSetSharpenIntensity
).
staticviewportSetVflip(viewport:RID, enabled:Bool):Void
If true
, the viewport's rendering is flipped vertically.