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

@:native("ArrayWeightsSize")staticread onlyARRAY_WEIGHTS_SIZE:Int

Number of weights/bones per vertex.

@:native("CanvasItemZMax")staticread onlyCANVAS_ITEM_Z_MAX:Int

The maximum Z-layer for canvas items.

@:native("CanvasItemZMin")staticread onlyCANVAS_ITEM_Z_MIN:Int

The minimum Z-layer for canvas items.

@:native("MaterialRenderPriorityMax")staticread onlyMATERIAL_RENDER_PRIORITY_MAX:Int

The maximum renderpriority of all materials.

@:native("MaterialRenderPriorityMin")staticread onlyMATERIAL_RENDER_PRIORITY_MIN:Int

The minimum renderpriority of all materials.

@:native("MaxCursors")staticread onlyMAX_CURSORS:Int

Unused enum in Godot 3.x.

@:native("MaxGlowLevels")staticread onlyMAX_GLOW_LEVELS:Int

Max number of glow levels that can be used with glow post-process effect.

@:native("NoIndexArray")staticread onlyNO_INDEX_ARRAY:Int

Marks an error that shows that the index array is empty.

@:native("RenderLoopEnabled")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.

@:native("Singleton")staticread onlySINGLETON:Object

staticread onlyonFramePostDraw:Signal<() ‑> Void>

frame_post_draw signal.

staticread onlyonFramePreDraw:Signal<() ‑> Void>

frame_pre_draw signal.

Static methods

@:native("BlackBarsSetImages")staticblackBarsSetImages(left:RID, top:RID, right:RID, bottom:RID):Void

Sets images to be rendered in the window margin.

@:native("BlackBarsSetMargins")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.

@:native("CameraCreate")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.

@:native("CameraSetCullMask")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.

@:native("CameraSetEnvironment")staticcameraSetEnvironment(camera:RID, env:RID):Void

Sets the environment used by this camera. Equivalent to godot.Camera.environment.

@:native("CameraSetFrustum")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.

@:native("CameraSetOrthogonal")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.

@:native("CameraSetPerspective")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.

@:native("CameraSetTransform")staticcameraSetTransform(camera:RID, transform:Transform):Void

Sets godot.Transform of camera.

@:native("CameraSetUseVerticalAspect")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.

@:native("CanvasCreate")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.

@:native("CanvasItemAddCircle")staticcanvasItemAddCircle(item:RID, pos:Vector2, radius:Single, color:Color):Void

Adds a circle command to the godot.CanvasItem's draw commands.

@:native("CanvasItemAddClipIgnore")staticcanvasItemAddClipIgnore(item:RID, ignore:Bool):Void

If ignore is true, the VisualServer does not perform clipping.

@:native("CanvasItemAddLine")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.

@:native("CanvasItemAddMesh")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)

@:native("CanvasItemAddMultimesh")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.

@:native("CanvasItemAddNinePatch")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)

@:native("CanvasItemAddParticles")staticcanvasItemAddParticles(item:RID, particles:RID, texture:RID, normalMap:RID):Void

Adds a particle system to the godot.CanvasItem's draw commands.

@:native("CanvasItemAddPolygon")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>()

@:native("CanvasItemAddPolyline")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.

@:native("CanvasItemAddPrimitive")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.

@:native("CanvasItemAddRect")staticcanvasItemAddRect(item:RID, rect:Rect2, color:Color):Void

Adds a rectangle to the godot.CanvasItem's draw commands.

@:native("CanvasItemAddSetTransform")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.

@:native("CanvasItemAddTextureRect")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)

@:native("CanvasItemAddTextureRectRegion")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)

@:native("CanvasItemAddTriangleArray")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>()

@:native("CanvasItemClear")staticcanvasItemClear(item:RID):Void

Clears the godot.CanvasItem and removes all commands in it.

@:native("CanvasItemCreate")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.

@:native("CanvasItemSetClip")staticcanvasItemSetClip(item:RID, clip:Bool):Void

Sets clipping for the godot.CanvasItem.

@:native("CanvasItemSetCopyToBackbuffer")staticcanvasItemSetCopyToBackbuffer(item:RID, enabled:Bool, rect:Rect2):Void

Sets the godot.CanvasItem to copy a rect to the backbuffer.

@:native("CanvasItemSetCustomRect")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))

@:native("CanvasItemSetDistanceFieldMode")staticcanvasItemSetDistanceFieldMode(item:RID, enabled:Bool):Void

Enables the use of distance fields for GUI elements that are rendering distance field based fonts.

@:native("CanvasItemSetDrawBehindParent")staticcanvasItemSetDrawBehindParent(item:RID, enabled:Bool):Void

Sets godot.CanvasItem to be drawn behind its parent.

@:native("CanvasItemSetDrawIndex")staticcanvasItemSetDrawIndex(item:RID, index:Int):Void

Sets the index for the godot.CanvasItem.

@:native("CanvasItemSetLightMask")staticcanvasItemSetLightMask(item:RID, mask:Int):Void

The light mask. See godot.LightOccluder2D for more information on light masks.

@:native("CanvasItemSetMaterial")staticcanvasItemSetMaterial(item:RID, material:RID):Void

Sets a new material to the godot.CanvasItem.

@:native("CanvasItemSetModulate")staticcanvasItemSetModulate(item:RID, color:Color):Void

Sets the color that modulates the godot.CanvasItem and its children.

@:native("CanvasItemSetParent")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.

@:native("CanvasItemSetSelfModulate")staticcanvasItemSetSelfModulate(item:RID, color:Color):Void

Sets the color that modulates the godot.CanvasItem without children.

@:native("CanvasItemSetSortChildrenByY")staticcanvasItemSetSortChildrenByY(item:RID, enabled:Bool):Void

Sets if godot.CanvasItem's children should be sorted by y-position.

@:native("CanvasItemSetTransform")staticcanvasItemSetTransform(item:RID, transform:Transform2D):Void

@:native("CanvasItemSetUseParentMaterial")staticcanvasItemSetUseParentMaterial(item:RID, enabled:Bool):Void

Sets if the godot.CanvasItem uses its parent's material.

@:native("CanvasItemSetVisible")staticcanvasItemSetVisible(item:RID, visible:Bool):Void

Sets if the canvas item (including its children) is visible.

@:native("CanvasItemSetZAsRelativeToParent")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.

@:native("CanvasItemSetZIndex")staticcanvasItemSetZIndex(item:RID, zIndex:Int):Void

Sets the godot.CanvasItem's Z index, i.e. its draw order (lower indexes are drawn first).

@:native("CanvasLightAttachToCanvas")staticcanvasLightAttachToCanvas(light:RID, canvas:RID):Void

Attaches the canvas light to the canvas. Removes it from its previous canvas.

@:native("CanvasLightCreate")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.

@:native("CanvasLightOccluderAttachToCanvas")staticcanvasLightOccluderAttachToCanvas(occluder:RID, canvas:RID):Void

Attaches a light occluder to the canvas. Removes it from its previous canvas.

@:native("CanvasLightOccluderCreate")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.

@:native("CanvasLightOccluderSetEnabled")staticcanvasLightOccluderSetEnabled(occluder:RID, enabled:Bool):Void

Enables or disables light occluder.

@:native("CanvasLightOccluderSetLightMask")staticcanvasLightOccluderSetLightMask(occluder:RID, mask:Int):Void

The light mask. See godot.LightOccluder2D for more information on light masks.

@:native("CanvasLightOccluderSetPolygon")staticcanvasLightOccluderSetPolygon(occluder:RID, polygon:RID):Void

Sets a light occluder's polygon.

@:native("CanvasLightOccluderSetTransform")staticcanvasLightOccluderSetTransform(occluder:RID, transform:Transform2D):Void

Sets a light occluder's godot.Transform2D.

@:native("CanvasLightSetColor")staticcanvasLightSetColor(light:RID, color:Color):Void

Sets the color for a light.

@:native("CanvasLightSetEnabled")staticcanvasLightSetEnabled(light:RID, enabled:Bool):Void

Enables or disables a canvas light.

@:native("CanvasLightSetEnergy")staticcanvasLightSetEnergy(light:RID, energy:Single):Void

Sets a canvas light's energy.

@:native("CanvasLightSetHeight")staticcanvasLightSetHeight(light:RID, height:Single):Void

Sets a canvas light's height.

@:native("CanvasLightSetItemCullMask")staticcanvasLightSetItemCullMask(light:RID, mask:Int):Void

The light mask. See godot.LightOccluder2D for more information on light masks.

@:native("CanvasLightSetItemShadowCullMask")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.

@:native("CanvasLightSetLayerRange")staticcanvasLightSetLayerRange(light:RID, minLayer:Int, maxLayer:Int):Void

The layer range that gets rendered with this light.

@:native("CanvasLightSetMode")staticcanvasLightSetMode(light:RID, mode:VisualServer_CanvasLightMode):Void

The mode of the light, see godot.VisualServer_CanvasLightMode constants.

@:native("CanvasLightSetScale")staticcanvasLightSetScale(light:RID, scale:Single):Void

Sets the texture's scale factor of the light. Equivalent to godot.Light2D.textureScale.

@:native("CanvasLightSetShadowBufferSize")staticcanvasLightSetShadowBufferSize(light:RID, size:Int):Void

Sets the width of the shadow buffer, size gets scaled to the next power of two for this.

@:native("CanvasLightSetShadowColor")staticcanvasLightSetShadowColor(light:RID, color:Color):Void

Sets the color of the canvas light's shadow.

@:native("CanvasLightSetShadowEnabled")staticcanvasLightSetShadowEnabled(light:RID, enabled:Bool):Void

Enables or disables the canvas light's shadow.

@:native("CanvasLightSetShadowFilter")staticcanvasLightSetShadowFilter(light:RID, filter:VisualServer_CanvasLightShadowFilter):Void

Sets the canvas light's shadow's filter, see godot.VisualServer_CanvasLightShadowFilter constants.

@:native("CanvasLightSetShadowGradientLength")staticcanvasLightSetShadowGradientLength(light:RID, length:Single):Void

Sets the length of the shadow's gradient.

@:native("CanvasLightSetShadowSmooth")staticcanvasLightSetShadowSmooth(light:RID, smooth:Single):Void

Smoothens the shadow. The lower, the smoother.

@:native("CanvasLightSetTexture")staticcanvasLightSetTexture(light:RID, texture:RID):Void

Sets texture to be used by light. Equivalent to godot.Light2D.texture.

@:native("CanvasLightSetTextureOffset")staticcanvasLightSetTextureOffset(light:RID, offset:Vector2):Void

Sets the offset of the light's texture. Equivalent to godot.Light2D.offset.

@:native("CanvasLightSetTransform")staticcanvasLightSetTransform(light:RID, transform:Transform2D):Void

Sets the canvas light's godot.Transform2D.

@:native("CanvasLightSetZRange")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.

@:native("CanvasOccluderPolygonCreate")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.

@:native("CanvasOccluderPolygonSetCullMode")staticcanvasOccluderPolygonSetCullMode(occluderPolygon:RID, mode:VisualServer_CanvasOccluderPolygonCullMode):Void

Sets an occluder polygons cull mode. See godot.VisualServer_CanvasOccluderPolygonCullMode constants.

@:native("CanvasOccluderPolygonSetShape")staticcanvasOccluderPolygonSetShape(occluderPolygon:RID, shape:HaxeArray<Vector2>, closed:Bool):Void

Sets the shape of the occluder polygon.

@:native("CanvasOccluderPolygonSetShapeAsLines")staticcanvasOccluderPolygonSetShapeAsLines(occluderPolygon:RID, shape:HaxeArray<Vector2>):Void

Sets the shape of the occluder polygon as lines.

@:native("CanvasSetItemMirroring")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.

@:native("CanvasSetModulate")staticcanvasSetModulate(canvas:RID, color:Color):Void

Modulates all colors in the given canvas.

@:native("DirectionalLightCreate")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.

@:native("Draw")staticdraw(?swapBuffers:Bool, ?frameStep:Float):Void

Draws a frame. This method is deprecated, please use godot.VisualServer.forceDraw instead.

@:native("EnvironmentCreate")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.

@:native("EnvironmentSetAdjustment")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.

@:native("EnvironmentSetAmbientLight")staticenvironmentSetAmbientLight(env:RID, color:Color, ?energy:Single, ?skyContibution:Single):Void

Sets the ambient light parameters. See godot.Environment for more details.

@:native("EnvironmentSetBackground")staticenvironmentSetBackground(env:RID, bg:VisualServer_EnvironmentBG):Void

Sets the BGMode of the environment. Equivalent to godot.Environment.backgroundMode.

@:native("EnvironmentSetBgColor")staticenvironmentSetBgColor(env:RID, color:Color):Void

Color displayed for clear areas of the scene (if using Custom color or Color+Sky background modes).

@:native("EnvironmentSetBgEnergy")staticenvironmentSetBgEnergy(env:RID, energy:Single):Void

Sets the intensity of the background color.

@:native("EnvironmentSetCanvasMaxLayer")staticenvironmentSetCanvasMaxLayer(env:RID, maxLayer:Int):Void

Sets the maximum layer to use if using Canvas background mode.

@:native("EnvironmentSetDofBlurFar")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.

@:native("EnvironmentSetDofBlurNear")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.

@:native("EnvironmentSetFog")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.

@:native("EnvironmentSetFogDepth")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.

@:native("EnvironmentSetFogHeight")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.

@:native("EnvironmentSetGlow")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.

@:native("EnvironmentSetSky")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.

@:native("EnvironmentSetSkyCustomFov")staticenvironmentSetSkyCustomFov(env:RID, scale:Single):Void

Sets a custom field of view for the background godot.Sky. Equivalent to godot.Environment.backgroundSkyCustomFov.

@:native("EnvironmentSetSkyOrientation")staticenvironmentSetSkyOrientation(env:RID, orientation:Basis):Void

Sets the rotation of the background godot.Sky expressed as a godot.Basis. Equivalent to godot.Environment.backgroundSkyOrientation.

@:native("EnvironmentSetSsao")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.

@:native("EnvironmentSetSsr")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.

@:native("EnvironmentSetTonemap")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.

@:native("Finish")staticfinish():Void

Removes buffers and clears testcubes.

@:native("ForceDraw")staticforceDraw(?swapBuffers:Bool, ?frameStep:Float):Void

Forces a frame to be drawn when the function is called. Drawing a frame updates all godot.Viewports that are set to update. Use with extreme caution.

@:native("ForceSync")staticforceSync():Void

Synchronizes threads.

@:native("FreeRid")staticfreeRid(rid:RID):Void

Tries to free an object in the VisualServer.

@:native("GetRenderInfo")staticgetRenderInfo(info:VisualServer_RenderInfo):UInt64

Returns a certain information, see godot.VisualServer_RenderInfo for options.

@:native("GetTestCube")staticgetTestCube():RID

Returns the id of the test cube. Creates one if none exists.

@:native("GetTestTexture")staticgetTestTexture():RID

Returns the id of the test texture. Creates one if none exists.

@:native("GetVideoAdapterName")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.

@:native("GetVideoAdapterVendor")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.

@:native("GetWhiteTexture")staticgetWhiteTexture():RID

Returns the id of a white texture. Creates one if none exists.

@:native("GiProbeCreate")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.

@:native("GiProbeGetBias")staticgiProbeGetBias(probe:RID):Single

Returns the bias value for the GI probe. Bias is used to avoid self occlusion. Equivalent to godot.GIProbeData.bias.

@:native("GiProbeGetBounds")staticgiProbeGetBounds(probe:RID):AABB

Returns the axis-aligned bounding box that covers the full extent of the GI probe.

@:native("GiProbeGetCellSize")staticgiProbeGetCellSize(probe:RID):Single

Returns the cell size set by godot.VisualServer.giProbeSetCellSize.

staticinlinegiProbeGetDynamicData(probe:RID):Array<Int>

Returns the data used by the GI probe.

@:native("GiProbeGetDynamicRange")staticgiProbeGetDynamicRange(probe:RID):Int

Returns the dynamic range set for this GI probe. Equivalent to godot.GIProbe.dynamicRange.

@:native("GiProbeGetEnergy")staticgiProbeGetEnergy(probe:RID):Single

Returns the energy multiplier for this GI probe. Equivalent to godot.GIProbe.energy.

@:native("GiProbeGetNormalBias")staticgiProbeGetNormalBias(probe:RID):Single

Returns the normal bias for this GI probe. Equivalent to godot.GIProbe.normalBias.

@:native("GiProbeGetPropagation")staticgiProbeGetPropagation(probe:RID):Single

Returns the propagation value for this GI probe. Equivalent to godot.GIProbe.propagation.

@:native("GiProbeGetToCellXform")staticgiProbeGetToCellXform(probe:RID):Transform

Returns the Transform set by godot.VisualServer.giProbeSetToCellXform.

@:native("GiProbeIsCompressed")staticgiProbeIsCompressed(probe:RID):Bool

Returns true if the GI probe data associated with this GI probe is compressed. Equivalent to godot.GIProbe.compress.

@:native("GiProbeIsInterior")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.

@:native("GiProbeSetBias")staticgiProbeSetBias(probe:RID, bias:Single):Void

Sets the bias value to avoid self-occlusion. Equivalent to godot.GIProbe.bias.

@:native("GiProbeSetBounds")staticgiProbeSetBounds(probe:RID, bounds:AABB):Void

Sets the axis-aligned bounding box that covers the extent of the GI probe.

@:native("GiProbeSetCellSize")staticgiProbeSetCellSize(probe:RID, range:Single):Void

Sets the size of individual cells within the GI probe.

@:native("GiProbeSetCompress")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.

@:native("GiProbeSetDynamicData")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.

@:native("GiProbeSetDynamicRange")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.

@:native("GiProbeSetEnergy")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.

@:native("GiProbeSetInterior")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.

@:native("GiProbeSetNormalBias")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.

@:native("GiProbeSetPropagation")staticgiProbeSetPropagation(probe:RID, propagation:Single):Void

Sets the propagation of light within this GI probe. Equivalent to godot.GIProbe.propagation.

@:native("GiProbeSetToCellXform")staticgiProbeSetToCellXform(probe:RID, xform:Transform):Void

Sets the to cell godot.Transform for this GI probe.

@:native("HasChanged")statichasChanged():Bool

Returns true if changes have been made to the VisualServer's data. godot.VisualServer.draw is usually called if this happens.

@:native("HasFeature")statichasFeature(feature:VisualServer_Features):Bool

Not yet implemented. Always returns false.

@:native("HasOsFeature")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.

@:native("ImmediateBegin")staticimmediateBegin(immediate:RID, primitive:VisualServer_PrimitiveType, ?texture:RID):Void

Sets up godot.ImmediateGeometry internals to prepare for drawing. Equivalent to godot.ImmediateGeometry.begin.

@:native("ImmediateClear")staticimmediateClear(immediate:RID):Void

Clears everything that was set up between godot.VisualServer.immediateBegin and godot.VisualServer.immediateEnd. Equivalent to godot.ImmediateGeometry.clear.

@:native("ImmediateColor")staticimmediateColor(immediate:RID, color:Color):Void

Sets the color to be used with next vertex. Equivalent to godot.ImmediateGeometry.setColor.

@:native("ImmediateCreate")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.

@:native("ImmediateEnd")staticimmediateEnd(immediate:RID):Void

Ends drawing the godot.ImmediateGeometry and displays it. Equivalent to godot.ImmediateGeometry.end.

@:native("ImmediateGetMaterial")staticimmediateGetMaterial(immediate:RID):RID

Returns the material assigned to the godot.ImmediateGeometry.

@:native("ImmediateNormal")staticimmediateNormal(immediate:RID, normal:Vector3):Void

Sets the normal to be used with next vertex. Equivalent to godot.ImmediateGeometry.setNormal.

@:native("ImmediateSetMaterial")staticimmediateSetMaterial(immediate:RID, material:RID):Void

Sets the material to be used to draw the godot.ImmediateGeometry.

@:native("ImmediateTangent")staticimmediateTangent(immediate:RID, tangent:Plane):Void

Sets the tangent to be used with next vertex. Equivalent to godot.ImmediateGeometry.setTangent.

@:native("ImmediateUv")staticimmediateUv(immediate:RID, texUv:Vector2):Void

Sets the UV to be used with next vertex. Equivalent to godot.ImmediateGeometry.setUv.

@:native("ImmediateUv2")staticimmediateUv2(immediate:RID, texUv:Vector2):Void

Sets the UV2 to be used with next vertex. Equivalent to godot.ImmediateGeometry.setUv2.

@:native("ImmediateVertex")staticimmediateVertex(immediate:RID, vertex:Vector3):Void

Adds the next vertex using the information provided in advance. Equivalent to godot.ImmediateGeometry.addVertex.

@:native("ImmediateVertex2d")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.

@:native("Init")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.

@:native("InstanceAttachObjectInstanceId")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.

@:native("InstanceAttachSkeleton")staticinstanceAttachSkeleton(instance:RID, skeleton:RID):Void

Attaches a skeleton to an instance. Removes the previous skeleton from the instance.

@:native("InstanceCreate")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.

@:native("InstanceCreate2")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.

@:native("InstanceGeometrySetAsInstanceLod")staticinstanceGeometrySetAsInstanceLod(instance:RID, asLodOfInstance:RID):Void

Not implemented in Godot 3.x.

@:native("InstanceGeometrySetCastShadowsSetting")staticinstanceGeometrySetCastShadowsSetting(instance:RID, shadowCastingSetting:VisualServer_ShadowCastingSetting):Void

Sets the shadow casting setting to one of godot.VisualServer_ShadowCastingSetting. Equivalent to godot.GeometryInstance.castShadow.

@:native("InstanceGeometrySetDrawRange")staticinstanceGeometrySetDrawRange(instance:RID, min:Single, max:Single, minMargin:Single, maxMargin:Single):Void

Not implemented in Godot 3.x.

@:native("InstanceGeometrySetFlag")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.

@:native("InstanceGeometrySetMaterialOverride")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.

@:native("InstanceSetBase")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.

@:native("InstanceSetBlendShapeWeight")staticinstanceSetBlendShapeWeight(instance:RID, shape:Int, weight:Single):Void

Sets the weight for a given blend shape associated with this instance.

@:native("InstanceSetCustomAabb")staticinstanceSetCustomAabb(instance:RID, aabb:AABB):Void

Sets a custom AABB to use when culling objects from the view frustum. Equivalent to godot.GeometryInstance.setCustomAabb.

@:native("InstanceSetExterior")staticinstanceSetExterior(instance:RID, enabled:Bool):Void

Function not implemented in Godot 3.x.

@:native("InstanceSetExtraVisibilityMargin")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.

@:native("InstanceSetLayerMask")staticinstanceSetLayerMask(instance:RID, mask:UInt):Void

Sets the render layers that this instance will be drawn to. Equivalent to godot.VisualInstance.layers.

@:native("InstanceSetScenario")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.

@:native("InstanceSetSurfaceMaterial")staticinstanceSetSurfaceMaterial(instance:RID, surface:Int, material:RID):Void

Sets the material of a specific surface. Equivalent to godot.MeshInstance.setSurfaceMaterial.

@:native("InstanceSetTransform")staticinstanceSetTransform(instance:RID, transform:Transform):Void

Sets the world space transform of the instance. Equivalent to godot.Spatial.transform.

@:native("InstanceSetUseLightmap")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))

@:native("InstanceSetVisible")staticinstanceSetVisible(instance:RID, visible:Bool):Void

Sets whether an instance is drawn or not. Equivalent to godot.Spatial.visible.

@:native("InstancesCullAabb")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.

@:native("InstancesCullConvex")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.

@:native("InstancesCullRay")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.

@:native("IsRenderLoopEnabled")staticisRenderLoopEnabled():Bool

@:native("LightDirectionalSetBlendSplits")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.

@:native("LightDirectionalSetShadowDepthRangeMode")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.

@:native("LightDirectionalSetShadowMode")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.

@:native("LightOmniSetShadowDetail")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.

@:native("LightOmniSetShadowMode")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.

@:native("LightSetBakeMode")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.BakedLightmaps and godot.GIProbes.

@:native("LightSetColor")staticlightSetColor(light:RID, color:Color):Void

Sets the color of the light. Equivalent to godot.Light.lightColor.

@:native("LightSetCullMask")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.

@:native("LightSetNegative")staticlightSetNegative(light:RID, enable:Bool):Void

If true, light will subtract light instead of adding light. Equivalent to godot.Light.lightNegative.

@:native("LightSetParam")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.

@:native("LightSetProjector")staticlightSetProjector(light:RID, texture:RID):Void

Not implemented in Godot 3.x.

@:native("LightSetReverseCullFaceMode")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.

@:native("LightSetShadow")staticlightSetShadow(light:RID, enabled:Bool):Void

If true, light will cast shadows. Equivalent to godot.Light.shadowEnabled.

@:native("LightSetShadowColor")staticlightSetShadowColor(light:RID, color:Color):Void

Sets the color of the shadow cast by the light. Equivalent to godot.Light.shadowColor.

@:native("LightSetUseGi")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.

@:native("LightmapCaptureCreate")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.

@:native("LightmapCaptureGetBounds")staticlightmapCaptureGetBounds(capture:RID):AABB

Returns the size of the lightmap capture area.

@:native("LightmapCaptureGetEnergy")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.

@:native("LightmapCaptureGetOctreeCellSubdiv")staticlightmapCaptureGetOctreeCellSubdiv(capture:RID):Int

Returns the cell subdivision amount used by this lightmap capture's octree.

@:native("LightmapCaptureGetOctreeCellTransform")staticlightmapCaptureGetOctreeCellTransform(capture:RID):Transform

Returns the cell transform for this lightmap capture's octree.

@:native("LightmapCaptureIsInterior")staticlightmapCaptureIsInterior(capture:RID):Bool

Returns true if capture is in "interior" mode.

@:native("LightmapCaptureSetBounds")staticlightmapCaptureSetBounds(capture:RID, bounds:AABB):Void

Sets the size of the area covered by the lightmap capture. Equivalent to godot.BakedLightmapData.bounds.

@:native("LightmapCaptureSetEnergy")staticlightmapCaptureSetEnergy(capture:RID, energy:Single):Void

Sets the energy multiplier for this lightmap capture. Equivalent to godot.BakedLightmapData.energy.

@:native("LightmapCaptureSetInterior")staticlightmapCaptureSetInterior(capture:RID, interior:Bool):Void

Sets the "interior" mode for this lightmap capture. Equivalent to godot.BakedLightmapData.interior.

@:native("LightmapCaptureSetOctree")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.

@:native("LightmapCaptureSetOctreeCellSubdiv")staticlightmapCaptureSetOctreeCellSubdiv(capture:RID, subdiv:Int):Void

Sets the subdivision level of this lightmap capture's octree. Equivalent to godot.BakedLightmapData.cellSubdiv.

@:native("LightmapCaptureSetOctreeCellTransform")staticlightmapCaptureSetOctreeCellTransform(capture:RID, xform:Transform):Void

Sets the octree cell transform for this lightmap capture's octree. Equivalent to godot.BakedLightmapData.cellSpaceTransform.

@:native("MakeSphereMesh")staticmakeSphereMesh(latitudes:Int, longitudes:Int, radius:Single):RID

Returns a mesh of a sphere with the given amount of horizontal and vertical subdivisions.

@:native("MaterialCreate")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.

@:native("MaterialGetParam")staticmaterialGetParam(material:RID, parameter:String):Dynamic

Returns the value of a certain material's parameter.

@:native("MaterialGetParamDefault")staticmaterialGetParamDefault(material:RID, parameter:String):Dynamic

Returns the default value for the param if available. Returns null otherwise.

@:native("MaterialGetShader")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.

@:native("MaterialSetLineWidth")staticmaterialSetLineWidth(material:RID, width:Single):Void

Sets a material's line width.

@:native("MaterialSetNextPass")staticmaterialSetNextPass(material:RID, nextMaterial:RID):Void

Sets an object's next material.

@:native("MaterialSetParam")staticmaterialSetParam(material:RID, parameter:String, value:Dynamic):Void

Sets a material's parameter.

@:native("MaterialSetRenderPriority")staticmaterialSetRenderPriority(material:RID, priority:Int):Void

Sets a material's render priority.

@:native("MaterialSetShader")staticmaterialSetShader(shaderMaterial:RID, shader:RID):Void

Sets a shader material's shader.

@:native("MeshAddSurfaceFromArrays")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 { }

@:native("MeshClear")staticmeshClear(mesh:RID):Void

Removes all surfaces from a mesh.

@:native("MeshCreate")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.

@:native("MeshGetBlendShapeCount")staticmeshGetBlendShapeCount(mesh:RID):Int

Returns a mesh's blend shape count.

@:native("MeshGetBlendShapeMode")staticmeshGetBlendShapeMode(mesh:RID):VisualServer_BlendShapeMode

Returns a mesh's blend shape mode.

@:native("MeshGetCustomAabb")staticmeshGetCustomAabb(mesh:RID):AABB

Returns a mesh's custom aabb.

@:native("MeshGetSurfaceCount")staticmeshGetSurfaceCount(mesh:RID):Int

Returns a mesh's number of surfaces.

@:native("MeshRemoveSurface")staticmeshRemoveSurface(mesh:RID, index:Int):Void

Removes a mesh's surface.

@:native("MeshSetBlendShapeCount")staticmeshSetBlendShapeCount(mesh:RID, amount:Int):Void

Sets a mesh's blend shape count.

@:native("MeshSetBlendShapeMode")staticmeshSetBlendShapeMode(mesh:RID, mode:VisualServer_BlendShapeMode):Void

Sets a mesh's blend shape mode.

@:native("MeshSetCustomAabb")staticmeshSetCustomAabb(mesh:RID, aabb:AABB):Void

Sets a mesh's custom aabb.

@:native("MeshSurfaceGetAabb")staticmeshSurfaceGetAabb(mesh:RID, surface:Int):AABB

Returns a mesh's surface's aabb.

staticinlinemeshSurfaceGetArray(mesh:RID, surface:Int):Array<UInt8>

Returns a mesh's surface's vertex buffer.

@:native("MeshSurfaceGetArrayIndexLen")staticmeshSurfaceGetArrayIndexLen(mesh:RID, surface:Int):Int

Returns a mesh's surface's amount of indices.

@:native("MeshSurfaceGetArrayLen")staticmeshSurfaceGetArrayLen(mesh:RID, surface:Int):Int

Returns a mesh's surface's amount of vertices.

@:native("MeshSurfaceGetArrays")staticmeshSurfaceGetArrays(mesh:RID, surface:Int):Array

Returns a mesh's surface's buffer arrays.

@:native("MeshSurfaceGetBlendShapeArrays")staticmeshSurfaceGetBlendShapeArrays(mesh:RID, surface:Int):Array

Returns a mesh's surface's arrays for blend shapes.

@:native("MeshSurfaceGetFormat")staticmeshSurfaceGetFormat(mesh:RID, surface:Int):UInt

Returns the format of a mesh's surface.

@:native("MeshSurfaceGetFormatOffset")staticmeshSurfaceGetFormatOffset(format:UInt, vertexLen:Int, indexLen:Int, arrayIndex:Int):UInt

Function is unused in Godot 3.x.

@:native("MeshSurfaceGetFormatStride")staticmeshSurfaceGetFormatStride(format:UInt, vertexLen:Int, indexLen:Int, arrayIndex:Int):UInt

staticinlinemeshSurfaceGetIndexArray(mesh:RID, surface:Int):Array<UInt8>

Returns a mesh's surface's index buffer.

@:native("MeshSurfaceGetMaterial")staticmeshSurfaceGetMaterial(mesh:RID, surface:Int):RID

Returns a mesh's surface's material.

@:native("MeshSurfaceGetPrimitiveType")staticmeshSurfaceGetPrimitiveType(mesh:RID, surface:Int):VisualServer_PrimitiveType

Returns the primitive type of a mesh's surface.

@:native("MeshSurfaceGetSkeletonAabb")staticmeshSurfaceGetSkeletonAabb(mesh:RID, surface:Int):Array

Returns the aabb of a mesh's surface's skeleton.

@:native("MeshSurfaceSetMaterial")staticmeshSurfaceSetMaterial(mesh:RID, surface:Int, material:RID):Void

Sets a mesh's surface's material.

@:native("MeshSurfaceUpdateRegion")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.

@:native("MultimeshAllocate")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.

@:native("MultimeshCreate")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.

@:native("MultimeshGetAabb")staticmultimeshGetAabb(multimesh:RID):AABB

Calculates and returns the axis-aligned bounding box that encloses all instances within the multimesh.

@:native("MultimeshGetInstanceCount")staticmultimeshGetInstanceCount(multimesh:RID):Int

Returns the number of instances allocated for this multimesh.

@:native("MultimeshGetMesh")staticmultimeshGetMesh(multimesh:RID):RID

Returns the RID of the mesh that will be used in drawing this multimesh.

@:native("MultimeshGetVisibleInstances")staticmultimeshGetVisibleInstances(multimesh:RID):Int

Returns the number of visible instances for this multimesh.

@:native("MultimeshInstanceGetColor")staticmultimeshInstanceGetColor(multimesh:RID, index:Int):Color

Returns the color by which the specified instance will be modulated.

@:native("MultimeshInstanceGetCustomData")staticmultimeshInstanceGetCustomData(multimesh:RID, index:Int):Color

Returns the custom data associated with the specified instance.

@:native("MultimeshInstanceGetTransform")staticmultimeshInstanceGetTransform(multimesh:RID, index:Int):Transform

Returns the godot.Transform of the specified instance.

@:native("MultimeshInstanceGetTransform2d")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.

@:native("MultimeshInstanceSetColor")staticmultimeshInstanceSetColor(multimesh:RID, index:Int, color:Color):Void

Sets the color by which this instance will be modulated. Equivalent to godot.MultiMesh.setInstanceColor.

@:native("MultimeshInstanceSetCustomData")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.

@:native("MultimeshInstanceSetTransform")staticmultimeshInstanceSetTransform(multimesh:RID, index:Int, transform:Transform):Void

Sets the godot.Transform for this instance. Equivalent to godot.MultiMesh.setInstanceTransform.

@:native("MultimeshInstanceSetTransform2d")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.

@:native("MultimeshSetAsBulkArray")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.

@:native("MultimeshSetMesh")staticmultimeshSetMesh(multimesh:RID, mesh:RID):Void

Sets the mesh to be drawn by the multimesh. Equivalent to godot.MultiMesh.mesh.

@:native("MultimeshSetVisibleInstances")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.

@:native("OmniLightCreate")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.

@:native("ParticlesCreate")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.

@:native("ParticlesGetCurrentAabb")staticparticlesGetCurrentAabb(particles:RID):AABB

Calculates and returns the axis-aligned bounding box that contains all the particles. Equivalent to godot.Particles.captureAabb.

@:native("ParticlesGetEmitting")staticparticlesGetEmitting(particles:RID):Bool

Returns true if particles are currently set to emitting.

@:native("ParticlesIsInactive")staticparticlesIsInactive(particles:RID):Bool

Returns true if particles are not emitting and particles are set to inactive.

@:native("ParticlesRequestProcess")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.

@:native("ParticlesRestart")staticparticlesRestart(particles:RID):Void

Reset the particles on the next update. Equivalent to godot.Particles.restart.

@:native("ParticlesSetAmount")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.

@:native("ParticlesSetCustomAabb")staticparticlesSetCustomAabb(particles:RID, aabb:AABB):Void

Sets a custom axis-aligned bounding box for the particle system. Equivalent to godot.Particles.visibilityAabb.

@:native("ParticlesSetDrawOrder")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.

@:native("ParticlesSetDrawPassMesh")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.

@:native("ParticlesSetDrawPasses")staticparticlesSetDrawPasses(particles:RID, count:Int):Void

Sets the number of draw passes to use. Equivalent to godot.Particles.drawPasses.

@:native("ParticlesSetEmissionTransform")staticparticlesSetEmissionTransform(particles:RID, transform:Transform):Void

Sets the godot.Transform that will be used by the particles when they first emit.

@:native("ParticlesSetEmitting")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.

@:native("ParticlesSetExplosivenessRatio")staticparticlesSetExplosivenessRatio(particles:RID, ratio:Single):Void

Sets the explosiveness ratio. Equivalent to godot.Particles.explosiveness.

@:native("ParticlesSetFixedFps")staticparticlesSetFixedFps(particles:RID, fps:Int):Void

Sets the frame rate that the particle system rendering will be fixed to. Equivalent to godot.Particles.fixedFps.

@:native("ParticlesSetFractionalDelta")staticparticlesSetFractionalDelta(particles:RID, enable:Bool):Void

If true, uses fractional delta which smooths the movement of the particles. Equivalent to godot.Particles.fractDelta.

@:native("ParticlesSetLifetime")staticparticlesSetLifetime(particles:RID, lifetime:Single):Void

Sets the lifetime of each particle in the system. Equivalent to godot.Particles.lifetime.

@:native("ParticlesSetOneShot")staticparticlesSetOneShot(particles:RID, oneShot:Bool):Void

If true, particles will emit once and then stop. Equivalent to godot.Particles.oneShot.

@:native("ParticlesSetPreProcessTime")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.

@:native("ParticlesSetProcessMaterial")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.

@:native("ParticlesSetRandomnessRatio")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.

@:native("ParticlesSetSpeedScale")staticparticlesSetSpeedScale(particles:RID, scale:Single):Void

Sets the speed scale of the particle system. Equivalent to godot.Particles.speedScale.

@:native("ParticlesSetUseLocalCoordinates")staticparticlesSetUseLocalCoordinates(particles:RID, enable:Bool):Void

If true, particles use local coordinates. If false they use global coordinates. Equivalent to godot.Particles.localCoords.

@:native("ReflectionProbeCreate")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.

@:native("ReflectionProbeSetAsInterior")staticreflectionProbeSetAsInterior(probe:RID, enable:Bool):Void

If true, reflections will ignore sky contribution. Equivalent to godot.ReflectionProbe.interiorEnable.

@:native("ReflectionProbeSetCullMask")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.

@:native("ReflectionProbeSetEnableBoxProjection")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.

@:native("ReflectionProbeSetEnableShadows")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.

@:native("ReflectionProbeSetExtents")staticreflectionProbeSetExtents(probe:RID, extents:Vector3):Void

Sets the size of the area that the reflection probe will capture. Equivalent to godot.ReflectionProbe.extents.

@:native("ReflectionProbeSetIntensity")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.

@:native("ReflectionProbeSetInteriorAmbient")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.

@:native("ReflectionProbeSetInteriorAmbientEnergy")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.

@:native("ReflectionProbeSetInteriorAmbientProbeContribution")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.

@:native("ReflectionProbeSetMaxDistance")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.

@:native("ReflectionProbeSetOriginOffset")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.

@:native("ReflectionProbeSetUpdateMode")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.

@:native("RequestFrameDrawnCallback")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.

@:native("ScenarioCreate")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.

@:native("ScenarioSetDebug")staticscenarioSetDebug(scenario:RID, debugMode:VisualServer_ScenarioDebugMode):Void

@:native("ScenarioSetEnvironment")staticscenarioSetEnvironment(scenario:RID, environment:RID):Void

Sets the environment that will be used with this scenario.

@:native("ScenarioSetFallbackEnvironment")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.

@:native("ScenarioSetReflectionAtlasSize")staticscenarioSetReflectionAtlasSize(scenario:RID, size:Int, subdiv:Int):Void

Sets the size of the reflection atlas shared by all reflection probes in this scenario.

@:native("SetBootImage")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.

@:native("SetDebugGenerateWireframes")staticsetDebugGenerateWireframes(generate:Bool):Void

If true, the engine will generate wireframes for use with the wireframe debug mode.

@:native("SetDefaultClearColor")staticsetDefaultClearColor(color:Color):Void

Sets the default clear color which is used when a specific clear color has not been selected.

@:native("SetRenderLoopEnabled")staticsetRenderLoopEnabled(enabled:Bool):Void

@:native("SetShaderTimeScale")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.

@:native("SetUseOcclusionCulling")staticsetUseOcclusionCulling(enable:Bool):Void

Enables or disables occlusion culling.

@:native("ShaderCreate")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.

@:native("ShaderGetCode")staticshaderGetCode(shader:RID):String

Returns a shader's code.

@:native("ShaderGetDefaultTextureParam")staticshaderGetDefaultTextureParam(shader:RID, name:String):RID

Returns a default texture from a shader searched by name.

@:native("ShaderGetParamList")staticshaderGetParamList(shader:RID):Array

Returns the parameters of a shader.

@:native("ShaderSetCode")staticshaderSetCode(shader:RID, code:String):Void

Sets a shader's code.

@:native("ShaderSetDefaultTextureParam")staticshaderSetDefaultTextureParam(shader:RID, name:String, texture:RID):Void

Sets a shader's default texture. Overwrites the texture given by name.

@:native("SkeletonAllocate")staticskeletonAllocate(skeleton:RID, bones:Int, ?is2dSkeleton:Bool):Void

Allocates the GPU buffers for this skeleton.

@:native("SkeletonBoneGetTransform")staticskeletonBoneGetTransform(skeleton:RID, bone:Int):Transform

Returns the godot.Transform set for a specific bone of this skeleton.

@:native("SkeletonBoneGetTransform2d")staticskeletonBoneGetTransform2d(skeleton:RID, bone:Int):Transform2D

Returns the godot.Transform2D set for a specific bone of this skeleton.

@:native("SkeletonBoneSetTransform")staticskeletonBoneSetTransform(skeleton:RID, bone:Int, transform:Transform):Void

Sets the godot.Transform for a specific bone of this skeleton.

@:native("SkeletonBoneSetTransform2d")staticskeletonBoneSetTransform2d(skeleton:RID, bone:Int, transform:Transform2D):Void

Sets the godot.Transform2D for a specific bone of this skeleton.

@:native("SkeletonCreate")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.

@:native("SkeletonGetBoneCount")staticskeletonGetBoneCount(skeleton:RID):Int

Returns the number of bones allocated for this skeleton.

@:native("SkyCreate")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.

@:native("SkySetTexture")staticskySetTexture(sky:RID, cubeMap:RID, radianceSize:Int):Void

Sets a sky's texture.

@:native("SpotLightCreate")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.

@:native("Sync")staticsync():Void

Not implemented in Godot 3.x.

@:native("TextureAllocate")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.

@:native("TextureBind")statictextureBind(texture:RID, number:UInt):Void

Binds the texture to a texture slot.

@:native("TextureCreate")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.

@:native("TextureCreateFromImage")statictextureCreateFromImage(image:Image, ?flags:UInt):RID

Creates a texture, allocates the space for an image, and fills in the image.

@:native("TextureDebugUsage")statictextureDebugUsage():Array

Returns a list of all the textures and their information.

@:native("TextureGetData")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.

@:native("TextureGetDepth")statictextureGetDepth(texture:RID):UInt

Returns the depth of the texture.

@:native("TextureGetFlags")statictextureGetFlags(texture:RID):UInt

Returns the flags of a texture.

@:native("TextureGetFormat")statictextureGetFormat(texture:RID):Image_Format

Returns the format of the texture's image.

@:native("TextureGetHeight")statictextureGetHeight(texture:RID):UInt

Returns the texture's height.

@:native("TextureGetPath")statictextureGetPath(texture:RID):String

Returns the texture's path.

@:native("TextureGetTexid")statictextureGetTexid(texture:RID):UInt

Returns the opengl id of the texture's image.

@:native("TextureGetType")statictextureGetType(texture:RID):VisualServer_TextureType

Returns the type of the texture, can be any of the godot.VisualServer_TextureType.

@:native("TextureGetWidth")statictextureGetWidth(texture:RID):UInt

Returns the texture's width.

@:native("TextureSetData")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.

@:native("TextureSetDataPartial")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.

@:native("TextureSetFlags")statictextureSetFlags(texture:RID, flags:UInt):Void

Sets the texture's flags. See godot.VisualServer_TextureFlags for options.

@:native("TextureSetPath")statictextureSetPath(texture:RID, path:String):Void

Sets the texture's path.

@:native("TextureSetShrinkAllX2OnSetData")statictextureSetShrinkAllX2OnSetData(shrink:Bool):Void

If true, sets internal processes to shrink all image data to half the size.

@:native("TextureSetSizeOverride")statictextureSetSizeOverride(texture:RID, width:Int, height:Int, depth:Int):Void

Resizes the texture to the specified dimensions.

@:native("TexturesKeepOriginal")statictexturesKeepOriginal(enable:Bool):Void

If true, the image will be stored in the texture's images array if overwritten.

@:native("ViewportAttachCamera")staticviewportAttachCamera(viewport:RID, camera:RID):Void

Sets a viewport's camera.

@:native("ViewportAttachCanvas")staticviewportAttachCanvas(viewport:RID, canvas:RID):Void

Sets a viewport's canvas.

@:native("ViewportAttachToScreen")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))

@:native("ViewportCreate")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.

@:native("ViewportDetach")staticviewportDetach(viewport:RID):Void

Detaches the viewport from the screen.

@:native("ViewportGetRenderInfo")staticviewportGetRenderInfo(viewport:RID, info:VisualServer_ViewportRenderInfo):Int

Returns a viewport's render information. For options, see the godot.VisualServer_ViewportRenderInfo constants.

@:native("ViewportGetTexture")staticviewportGetTexture(viewport:RID):RID

Returns the viewport's last rendered frame.

@:native("ViewportRemoveCanvas")staticviewportRemoveCanvas(viewport:RID, canvas:RID):Void

Detaches a viewport from a canvas and vice versa.

@:native("ViewportSetActive")staticviewportSetActive(viewport:RID, active:Bool):Void

If true, sets the viewport active, else sets it inactive.

@:native("ViewportSetCanvasStacking")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.

@:native("ViewportSetCanvasTransform")staticviewportSetCanvasTransform(viewport:RID, canvas:RID, offset:Transform2D):Void

Sets the transformation of a viewport's canvas.

@:native("ViewportSetClearMode")staticviewportSetClearMode(viewport:RID, clearMode:VisualServer_ViewportClearMode):Void

Sets the clear mode of a viewport. See godot.VisualServer_ViewportClearMode for options.

@:native("ViewportSetDebugDraw")staticviewportSetDebugDraw(viewport:RID, draw:VisualServer_ViewportDebugDraw):Void

Sets the debug draw mode of a viewport. See godot.VisualServer_ViewportDebugDraw for options.

@:native("ViewportSetDisable3d")staticviewportSetDisable3d(viewport:RID, disabled:Bool):Void

If true, a viewport's 3D rendering is disabled.

@:native("ViewportSetDisableEnvironment")staticviewportSetDisableEnvironment(viewport:RID, disabled:Bool):Void

If true, rendering of a viewport's environment is disabled.

@:native("ViewportSetGlobalCanvasTransform")staticviewportSetGlobalCanvasTransform(viewport:RID, transform:Transform2D):Void

Sets the viewport's global transformation matrix.

@:native("ViewportSetHdr")staticviewportSetHdr(viewport:RID, enabled:Bool):Void

If true, the viewport renders to hdr.

@:native("ViewportSetHideCanvas")staticviewportSetHideCanvas(viewport:RID, hidden:Bool):Void

If true, the viewport's canvas is not rendered.

@:native("ViewportSetHideScenario")staticviewportSetHideScenario(viewport:RID, hidden:Bool):Void

Currently unimplemented in Godot 3.x.

@:native("ViewportSetMsaa")staticviewportSetMsaa(viewport:RID, msaa:VisualServer_ViewportMSAA):Void

Sets the anti-aliasing mode. See godot.VisualServer_ViewportMSAA for options.

@:native("ViewportSetParentViewport")staticviewportSetParentViewport(viewport:RID, parentViewport:RID):Void

Sets the viewport's parent to another viewport.

@:native("ViewportSetRenderDirectToScreen")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.

@:native("ViewportSetScenario")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.

@:native("ViewportSetShadowAtlasQuadrantSubdivision")staticviewportSetShadowAtlasQuadrantSubdivision(viewport:RID, quadrant:Int, subdivision:Int):Void

Sets the shadow atlas quadrant's subdivision.

@:native("ViewportSetShadowAtlasSize")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.

@:native("ViewportSetSharpenIntensity")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.

@:native("ViewportSetSize")staticviewportSetSize(viewport:RID, width:Int, height:Int):Void

Sets the viewport's width and height.

@:native("ViewportSetTransparentBackground")staticviewportSetTransparentBackground(viewport:RID, enabled:Bool):Void

If true, the viewport renders its background as transparent.

@:native("ViewportSetUpdateMode")staticviewportSetUpdateMode(viewport:RID, updateMode:VisualServer_ViewportUpdateMode):Void

Sets when the viewport should be updated. See godot.VisualServer_ViewportUpdateMode constants for options.

@:native("ViewportSetUsage")staticviewportSetUsage(viewport:RID, usage:VisualServer_ViewportUsage):Void

Sets the viewport's 2D/3D mode. See godot.VisualServer_ViewportUsage constants for options.

@:native("ViewportSetUseArvr")staticviewportSetUseArvr(viewport:RID, useArvr:Bool):Void

If true, the viewport uses augmented or virtual reality technologies. See godot.ARVRInterface.

@:native("ViewportSetUseDebanding")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.

@:native("ViewportSetUseFxaa")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).

@:native("ViewportSetVflip")staticviewportSetVflip(viewport:RID, enabled:Bool):Void

If true, the viewport's rendering is flipped vertically.