From 37776b28677ab4c4cb61047df1fe9816e9b63642 Mon Sep 17 00:00:00 2001 From: reduz Date: Wed, 30 Jun 2021 23:17:47 -0300 Subject: Clean up RenderingServer and its bindings * Rewrote bindings for RenderingServer. * They are now all up to date. * Several unused methods and deprecated features were cleaned up. --- doc/classes/ImageTexture.xml | 4 +- doc/classes/RenderingServer.xml | 4391 ++++++++++++++------ doc/classes/VoxelGIData.xml | 6 - editor/debugger/editor_profiler.cpp | 2 +- editor/debugger/editor_visual_profiler.cpp | 2 +- editor/editor_node.cpp | 4 +- editor/plugins/canvas_item_editor_plugin.cpp | 4 +- editor/plugins/node_3d_editor_plugin.cpp | 2 - editor/plugins/node_3d_editor_plugin.h | 2 - .../videodecoder/video_stream_gdnative.cpp | 2 +- modules/theora/video_stream_theora.cpp | 2 +- scene/3d/voxel_gi.cpp | 48 - scene/3d/voxel_gi.h | 13 - scene/resources/texture.cpp | 10 +- scene/resources/texture.h | 2 +- servers/rendering/rasterizer_dummy.h | 9 - servers/rendering/renderer_canvas_render.h | 2 - .../renderer_rd/renderer_canvas_render_rd.h | 2 - .../rendering/renderer_rd/renderer_scene_gi_rd.cpp | 3 - .../rendering/renderer_rd/renderer_scene_gi_rd.h | 6 +- .../rendering/renderer_rd/renderer_storage_rd.cpp | 37 +- .../rendering/renderer_rd/renderer_storage_rd.h | 9 - servers/rendering/renderer_rd/shaders/gi.glsl | 27 +- servers/rendering/renderer_scene.h | 2 - servers/rendering/renderer_scene_cull.cpp | 9 - servers/rendering/renderer_scene_cull.h | 4 - .../rendering/renderer_scene_occlusion_cull.cpp | 2 +- servers/rendering/renderer_storage.h | 7 - servers/rendering/renderer_viewport.cpp | 17 +- servers/rendering/renderer_viewport.h | 10 +- servers/rendering/rendering_server_default.cpp | 26 - servers/rendering/rendering_server_default.h | 38 +- servers/rendering_server.cpp | 1263 ++++-- servers/rendering_server.h | 123 +- 34 files changed, 4105 insertions(+), 1985 deletions(-) diff --git a/doc/classes/ImageTexture.xml b/doc/classes/ImageTexture.xml index 5fef56e354..f89b6ad57b 100644 --- a/doc/classes/ImageTexture.xml +++ b/doc/classes/ImageTexture.xml @@ -61,10 +61,8 @@ - - - Replaces the texture's data with a new [Image]. If [code]immediate[/code] is [code]true[/code], it will take effect immediately after the call. + Replaces the texture's data with a new [Image]. [b]Note:[/b] The texture has to be initialized first with the [method create_from_image] method before it can be updated. The new image dimensions, format, and mipmaps configuration should match the existing texture's image configuration, otherwise it has to be re-created with the [method create_from_image] method. Use this method over [method create_from_image] if you need to update the texture frequently, which is faster than allocating additional memory for a new texture each time. diff --git a/doc/classes/RenderingServer.xml b/doc/classes/RenderingServer.xml index acfa277dcb..8b6763463c 100644 --- a/doc/classes/RenderingServer.xml +++ b/doc/classes/RenderingServer.xml @@ -18,42 +18,92 @@ https://docs.godotengine.org/en/latest/tutorials/optimization/using_servers.html - - + + - + + + + + - + + + + + + + + Creates a camera and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]camera_*[/code] RenderingServer functions. + Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method. + + + + + + + + + + + + - + - + - Sets images to be rendered in the window margin. - + - + - + - + - + + + + + + + + + - Sets margin size, where black bars (or images, if [method black_bars_set_images] was used) are rendered. - - + + + + + + + + + + + + + + + + + + + + + + + + - Creates a camera and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]camera_*[/code] RenderingServer functions. - Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method. @@ -155,2764 +205,4449 @@ Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method. - + + + + + + + - Clears the [CanvasItem] and removes all commands in it. - + - - - + - Sets the [CanvasItem] to copy a rect to the backbuffer. - + - + + + + + + + - Sets the index for the [CanvasItem]. - + - + + + + + + + - Sets a new material to the [CanvasItem]. - + - + + + - Sets if the [CanvasItem] uses its parent's material. - + - + + + + + + + + + + + + + + + + + - If this is enabled, the Z index of the parent will be added to the children's Z index. - + - + + + - Sets the [CanvasItem]'s Z index, i.e. its draw order (lower indexes are drawn first). - + - + - + + + + + + + - Attaches the canvas light to the canvas. Removes it from its previous canvas. - - - - - - - Creates a canvas light and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]canvas_light_*[/code] RenderingServer functions. - Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method. - + - + - + + + + + + + - Attaches a light occluder to the canvas. Removes it from its previous canvas. - - + + + + + + + + + + + + + + - Creates a light occluder and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]canvas_light_ocluder_*[/code] RenderingServer functions. - Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method. - + - + - + + + - Enables or disables light occluder. - + - + - + - The light mask. See [LightOccluder2D] for more information on light masks. - + - + - + + + + + + + + + - Sets a light occluder's polygon. - + - + - + + + + + + + + + + + - Sets a light occluder's [Transform2D]. - + - + - + + + + + + + + + + + + + + + - Sets the color for a light. - + - - - + - Enables or disables a canvas light. + Clears the [CanvasItem] and removes all commands in it. - - + + - - - - - Sets a canvas light's energy. - + - + - + + + + + + + + + - Sets a canvas light's height. - + - + - + - The light mask. See [LightOccluder2D] for more information on light masks. - + - + - + + + - The binary mask used to determine which layers this canvas light's shadows affects. See [LightOccluder2D] for more information on light masks. + Sets the [CanvasItem] to copy a rect to the backbuffer. - + - + - + - + - The layer range that gets rendered with this light. - + - + - + - The mode of the light, see [enum CanvasLightMode] constants. - + - + - + - Sets the color of the canvas light's shadow. - + - + - Enables or disables the canvas light's shadow. - + - + - + - Sets the canvas light's shadow's filter, see [enum CanvasLightShadowFilter] constants. - + - + - + - Smoothens the shadow. The lower, the smoother. + Sets the index for the [CanvasItem]. - + - + - + - Sets the texture to be used by a [PointLight2D]. Equivalent to [member PointLight2D.texture]. - + - + - + - Sets the offset of a [PointLight2D]'s texture. Equivalent to [member PointLight2D.offset]. + Sets a new material to the [CanvasItem]. - + - + - + - Sets the scale factor of a [PointLight2D]'s texture. Equivalent to [member PointLight2D.texture_scale]. - + - + - + - Sets the canvas light's [Transform2D]. - + - + - + - + + + + + + + + + - Sets the Z range of objects that will be affected by this light. Equivalent to [member Light2D.range_z_min] and [member Light2D.range_z_max]. - - + + + + + + - Creates a new light occluder polygon and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]canvas_occluder_polygon_*[/code] RenderingServer functions. - Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method. - + - + - + - Sets an occluder polygons cull mode. See [enum CanvasOccluderPolygonCullMode] constants. + Sets if the [CanvasItem] uses its parent's material. - + - + - + - + + + + + - Sets the shape of the occluder polygon. - + - + - + - + + + + + + + + + - A copy of the canvas item will be drawn with a local offset of the mirroring [Vector2]. + If this is enabled, the Z index of the parent will be added to the children's Z index. - + - + - + - Modulates all colors in the given canvas. + Sets the [CanvasItem]'s Z index, i.e. its draw order (lower indexes are drawn first). - - + + + + + + + Attaches the canvas light to the canvas. Removes it from its previous canvas. - + - Creates a directional light and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID can be used in most [code]light_*[/code] RenderingServer functions. + Creates a canvas light and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]canvas_light_*[/code] RenderingServer functions. Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method. - To place in a scene, attach this directional light to an instance using [method instance_set_base] using the returned RID. - + + + + + + + + + Attaches a light occluder to the canvas. Removes it from its previous canvas. + + + - Creates an environment and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]environment_*[/code] RenderingServer functions. + Creates a light occluder and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]canvas_light_ocluder_*[/code] RenderingServer functions. Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method. - + - + - - - - - - - - - - - Sets the values to be used with the "Adjustment" post-process effect. See [Environment] for more details. - + - - - - - - - - - - - + - + + Enables or disables light occluder. - + - + - + - Sets the [i]BGMode[/i] of the environment. Equivalent to [member Environment.background_mode]. + The light mask. See [LightOccluder2D] for more information on light masks. - + - + - + - Color displayed for clear areas of the scene (if using Custom color or Color+Sky background modes). + Sets a light occluder's polygon. - + - + - + - Sets the intensity of the background color. + Sets a light occluder's [Transform2D]. - + - + - + - Sets the maximum layer to use if using Canvas background mode. + Sets the color for a light. - + - - - - - - - - - - - - - - - + - + + Enables or disables a canvas light. - + - - - - - - - - - - - - - - - - - - - + - + + Sets a canvas light's energy. - + - + - + - Sets the [Sky] to be used as the environment's background when using [i]BGMode[/i] sky. Equivalent to [member Environment.sky]. + Sets a canvas light's height. - + - + - + - Sets a custom field of view for the background [Sky]. Equivalent to [member Environment.sky_custom_fov]. + The light mask. See [LightOccluder2D] for more information on light masks. - + - + - + - Sets the rotation of the background [Sky] expressed as a [Basis]. Equivalent to [member Environment.sky_rotation], where the rotation vector is used to construct the [Basis]. + The binary mask used to determine which layers this canvas light's shadows affects. See [LightOccluder2D] for more information on light masks. - + - + - + - - - - - - - - - - - - - - - + - Sets the variables to be used with the "screen space ambient occlusion" post-process effect. See [Environment] for more details. + The layer range that gets rendered with this light. - + - - - - - - - - - + - + - Sets the variables to be used with the "screen space reflections" post-process effect. See [Environment] for more details. + The mode of the light, see [enum CanvasLightMode] constants. - + - - - - - - - - - - - + - + - + + Sets the color of the canvas light's shadow. + + + + + + - + - Sets the variables to be used with the "tonemap" post-process effect. See [Environment] for more details. + Enables or disables the canvas light's shadow. - + + + + + - Removes buffers and clears testcubes. + Sets the canvas light's shadow's filter, see [enum CanvasLightShadowFilter] constants. - + - + - + - Forces a frame to be drawn when the function is called. Drawing a frame updates all [Viewport]s that are set to update. Use with extreme caution. + Smoothens the shadow. The lower, the smoother. - + + + + + - Synchronizes threads. + Sets the texture to be used by a [PointLight2D]. Equivalent to [member PointLight2D.texture]. - + - + + + - Tries to free an object in the RenderingServer. + Sets the offset of a [PointLight2D]'s texture. Equivalent to [member PointLight2D.offset]. - - + + + + + + + Sets the scale factor of a [PointLight2D]'s texture. Equivalent to [member PointLight2D.texture_scale]. - - + + - + + + - Returns a certain information, see [enum RenderInfo] for options. + Sets the canvas light's [Transform2D]. - - + + + + + + + + - Returns the id of the test cube. Creates one if none exists. + Sets the Z range of objects that will be affected by this light. Equivalent to [member Light2D.range_z_min] and [member Light2D.range_z_max]. - + - Returns the id of the test texture. Creates one if none exists. + Creates a new light occluder polygon and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]canvas_occluder_polygon_*[/code] RenderingServer functions. + Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method. - - + + + + + + - Returns the name of the video adapter (e.g. "GeForce GTX 1080/PCIe/SSE2"). - [b]Note:[/b] When running a headless or server binary, this function returns an empty string. + Sets an occluder polygons cull mode. See [enum CanvasOccluderPolygonCullMode] constants. - - + + + + + + + + - Returns the vendor of the video adapter (e.g. "NVIDIA Corporation"). - [b]Note:[/b] When running a headless or server binary, this function returns an empty string. + Sets the shape of the occluder polygon. - - + + + + - Returns the id of a white texture. Creates one if none exists. - + - + - + - + + A copy of the canvas item will be drawn with a local offset of the mirroring [Vector2]. - - + + - + + + + Modulates all colors in the given canvas. - - + + + + - - + + - - - + - + + + + + - + - + - + + + - - + + + + + + - Returns [code]true[/code] if changes have been made to the RenderingServer's data. [method force_draw] is usually called if this happens. - - + + - + + + - Not yet implemented. Always returns [code]false[/code]. - - + + - - - Returns [code]true[/code] if the OS supports a certain feature. Features might be [code]s3tc[/code], [code]etc[/code], [code]etc2[/code] and [code]pvrtc[/code]. - - + + - Initializes the rendering server. This function is called internally by platform-dependent code during engine initialization. If called from a running game, it will not do anything. - + - + - + - Attaches a unique Object ID to instance. Object ID must be attached to instance for proper culling with [method instances_cull_aabb], [method instances_cull_convex], and [method instances_cull_ray]. - + - + - + - Attaches a skeleton to an instance. Removes the previous skeleton from the instance. - - + + + + + + + + + + - Creates a visual instance and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]instance_*[/code] RenderingServer functions. - Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] 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 [method instance_set_base]. - - + + - + - + - Creates a visual instance, adds it to the RenderingServer, and sets both base and scenario. It can be accessed with the RID that is returned. This RID will be used in all [code]instance_*[/code] RenderingServer functions. - Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method. - + - + - + - Sets the shadow casting setting to one of [enum ShadowCastingSetting]. Equivalent to [member GeometryInstance3D.cast_shadow]. - + - + - + - + - Sets the flag for a given [enum InstanceFlags]. See [enum InstanceFlags] for more details. - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Creates a directional light and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID can be used in most [code]light_*[/code] RenderingServer functions. + Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method. + To place in a scene, attach this directional light to an instance using [method instance_set_base] using the returned RID. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Creates an environment and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]environment_*[/code] RenderingServer functions. + Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sets the values to be used with the "Adjustment" post-process effect. See [Environment] for more details. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sets the [i]BGMode[/i] of the environment. Equivalent to [member Environment.background_mode]. + + + + + + + + + + + Color displayed for clear areas of the scene (if using Custom color or Color+Sky background modes). + + + + + + + + + + + Sets the intensity of the background color. + + + + + + + + + + + Sets the maximum layer to use if using Canvas background mode. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sets the [Sky] to be used as the environment's background when using [i]BGMode[/i] sky. Equivalent to [member Environment.sky]. + + + + + + + + + + + Sets a custom field of view for the background [Sky]. Equivalent to [member Environment.sky_custom_fov]. + + + + + + + + + + + Sets the rotation of the background [Sky] expressed as a [Basis]. Equivalent to [member Environment.sky_rotation], where the rotation vector is used to construct the [Basis]. + + + + + + + + + + + + + + + + + + + + + + + + + + + Sets the variables to be used with the "screen space ambient occlusion" post-process effect. See [Environment] for more details. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sets the variables to be used with the "screen space reflections" post-process effect. See [Environment] for more details. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sets the variables to be used with the "tonemap" post-process effect. See [Environment] for more details. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Tries to free an object in the RenderingServer. + + + + + + + + + + + + + + + Returns a certain information, see [enum RenderInfo] for options. + + + + + + + Returns the id of the test cube. Creates one if none exists. + + + + + + + Returns the id of the test texture. Creates one if none exists. + + + + + + + Returns the name of the video adapter (e.g. "GeForce GTX 1080/PCIe/SSE2"). + [b]Note:[/b] When running a headless or server binary, this function returns an empty string. + + + + + + + Returns the vendor of the video adapter (e.g. "NVIDIA Corporation"). + [b]Note:[/b] When running a headless or server binary, this function returns an empty string. + + + + + + + Returns the id of a white texture. Creates one if none exists. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Returns [code]true[/code] if changes have been made to the RenderingServer's data. [method force_draw] is usually called if this happens. + + + + + + + + + Not yet implemented. Always returns [code]false[/code]. + + + + + + + + + Returns [code]true[/code] if the OS supports a certain feature. Features might be [code]s3tc[/code], [code]etc[/code], [code]etc2[/code] and [code]pvrtc[/code]. + + + + + + + + + + + Attaches a unique Object ID to instance. Object ID must be attached to instance for proper culling with [method instances_cull_aabb], [method instances_cull_convex], and [method instances_cull_ray]. + + + + + + + + + + + Attaches a skeleton to an instance. Removes the previous skeleton from the instance. + + + + + + + Creates a visual instance and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]instance_*[/code] RenderingServer functions. + Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] 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 [method instance_set_base]. + + + + + + + + + + + Creates a visual instance, adds it to the RenderingServer, and sets both base and scenario. It can be accessed with the RID that is returned. This RID will be used in all [code]instance_*[/code] RenderingServer functions. + Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sets the shadow casting setting to one of [enum ShadowCastingSetting]. Equivalent to [member GeometryInstance3D.cast_shadow]. + + + + + + + + + + + + + Sets the flag for a given [enum InstanceFlags]. See [enum InstanceFlags] for more details. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sets a material that will override the material for all surfaces on the mesh associated with this instance. Equivalent to [member GeometryInstance3D.material_override]. + + + + + + + + + + - Sets a material that will override the material for all surfaces on the mesh associated with this instance. Equivalent to [member GeometryInstance3D.material_override]. - + + + + + + + + + + + + Sets the visibility range values for the given geometry instance. Equivalent to [member GeometryInstance3D.visibility_range_begin] and related properties. + + + + + + + + + + + Sets the base of the instance. A base can be any of the 3D objects that are created in the RenderingServer that can be displayed. For example, any of the light types, mesh, multimesh, immediate geometry, particle system, reflection probe, lightmap, 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. + + + + + + + + + + + + + Sets the weight for a given blend shape associated with this instance. + + + + + + + + + + + Sets a custom AABB to use when culling objects from the view frustum. Equivalent to [method GeometryInstance3D.set_custom_aabb]. + + + + + + + + + + + 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 [member GeometryInstance3D.extra_cull_margin]. + + + + + + + + + + + Sets the render layers that this instance will be drawn to. Equivalent to [member VisualInstance3D.layers]. + + + + + + + + + + + Sets the scenario that the instance is in. The scenario is the 3D world that the objects will be displayed in. + + + + + + + + + + + + + Sets the override material of a specific surface. Equivalent to [method MeshInstance3D.set_surface_override_material]. + + + + + + + + + + + Sets the world space transform of the instance. Equivalent to [member Node3D.transform]. + + + + + + + + + + + Sets the visibility parent for the given instance. Equivalent to [member Node3D.visibility_parent]. + + + + + + + + + + + Sets whether an instance is drawn or not. Equivalent to [member Node3D.visible]. + + + + + + + + + + + Returns an array of object IDs intersecting with the provided AABB. Only visual 3D nodes are considered, such as [MeshInstance3D] or [DirectionalLight3D]. Use [method @GlobalScope.instance_from_id] to obtain the actual nodes. A scenario RID must be provided, which is available in the [World3D] you want to query. This forces an update for all resources queued to update. + [b]Warning:[/b] This function is primarily intended for editor usage. For in-game use cases, prefer physics collision. + + + + + + + + + + + Returns an array of object IDs intersecting with the provided convex shape. Only visual 3D nodes are considered, such as [MeshInstance3D] or [DirectionalLight3D]. Use [method @GlobalScope.instance_from_id] to obtain the actual nodes. A scenario RID must be provided, which is available in the [World3D] you want to query. This forces an update for all resources queued to update. + [b]Warning:[/b] This function is primarily intended for editor usage. For in-game use cases, prefer physics collision. + + + + + + + + + + + + + Returns an array of object IDs intersecting with the provided 3D ray. Only visual 3D nodes are considered, such as [MeshInstance3D] or [DirectionalLight3D]. Use [method @GlobalScope.instance_from_id] to obtain the actual nodes. A scenario RID must be provided, which is available in the [World3D] you want to query. This forces an update for all resources queued to update. + [b]Warning:[/b] This function is primarily intended for editor usage. For in-game use cases, prefer physics collision. + + + + + + + + + + + If [code]true[/code], this directional light will blend between shadow map splits resulting in a smoother transition between them. Equivalent to [member DirectionalLight3D.directional_shadow_blend_splits]. + + + + + + + + + + + Sets the shadow depth range mode for this directional light. Equivalent to [member DirectionalLight3D.directional_shadow_depth_range]. See [enum LightDirectionalShadowDepthRangeMode] for options. + + + + + + + + + + + Sets the shadow mode for this directional light. Equivalent to [member DirectionalLight3D.directional_shadow_mode]. See [enum LightDirectionalShadowMode] for options. + + + + + + + + + + + If [code]true[/code], this light will not be used for anything except sky shaders. Use this for lights that impact your sky shader that you may want to hide from affecting the rest of the scene. For example, you may want to enable this when the sun in your sky shader falls below the horizon. + + + + + + + + + + + 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 [member OmniLight3D.omni_shadow_mode]. + + + + + + + + + + + + + + + + + + + + + Sets the color of the light. Equivalent to [member Light3D.light_color]. + + + + + + + + + + + Sets the cull mask for this Light3D. Lights only affect objects in the selected layers. Equivalent to [member Light3D.light_cull_mask]. + + + + + + + + + + + + + + + + + + + + + If [code]true[/code], light will subtract light instead of adding light. Equivalent to [member Light3D.light_negative]. + + + + + + + + + + + + + Sets the specified light parameter. See [enum LightParam] for options. Equivalent to [method Light3D.set_param]. + + + + + + + + + + + Not implemented in Godot 3.x. + + + + + + + + + + + If [code]true[/code], 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 [method instance_geometry_set_cast_shadows_setting]. Equivalent to [member Light3D.shadow_reverse_cull_face]. + + + + + + + + + + + If [code]true[/code], light will cast shadows. Equivalent to [member Light3D.shadow_enabled]. + + + + + + + + + + + Sets the color of the shadow cast by the light. Equivalent to [member Light3D.shadow_color]. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Returns a mesh of a sphere with the given amount of horizontal and vertical subdivisions. + + + + + + + Creates an empty material and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]material_*[/code] RenderingServer functions. + Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method. + + + + + + + + + + + Returns the value of a certain material's parameter. + + + + + + + + + + + Sets an object's next material. + + + + + + + + + + + + + Sets a material's parameter. + + + + + + + + + + + Sets a material's render priority. + + + + + + + + + + + Sets a shader material's shader. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Removes all surfaces from a mesh. + + + + + + + Creates a new mesh and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]mesh_*[/code] RenderingServer functions. + Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method. + To place in a scene, attach this mesh to an instance using [method instance_set_base] using the returned RID. + + + + + + + + + + + + + + + + + + + Returns a mesh's blend shape count. + + + + + + + + + Returns a mesh's blend shape mode. + + + + + + + + + Returns a mesh's custom aabb. + + + + + + + + + + + + + + + + + + + Returns a mesh's number of surfaces. + + + + + + - + - + + Sets a mesh's blend shape mode. + + + + + + - + - + + Sets a mesh's custom aabb. + + + + + + + + + + + + + + + + + + + + + Returns a mesh's surface's buffer arrays. + + + + + + + + + + + Returns a mesh's surface's arrays for blend shapes. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Returns a mesh's surface's material. + + + + + + + + + + + + + Sets a mesh's surface's material. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Creates a new multimesh on the RenderingServer and returns an [RID] handle. This RID will be used in all [code]multimesh_*[/code] RenderingServer functions. + Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method. + To place in a scene, attach this multimesh to an instance using [method instance_set_base] using the returned RID. + + + + + + + + + Calculates and returns the axis-aligned bounding box that encloses all instances within the multimesh. + + + + + + + + + + + + + + + + + Returns the number of instances allocated for this multimesh. + + + + + + + + + Returns the RID of the mesh that will be used in drawing this multimesh. + + + + + + + + + Returns the number of visible instances for this multimesh. + + + + + + + + + + + Returns the color by which the specified instance will be modulated. + + + + + + + + + + + Returns the custom data associated with the specified instance. + + + + + + + + - Sets the visibility range values for the given geometry instance. Equivalent to [member GeometryInstance3D.visibility_range_begin] and related properties. + Returns the [Transform3D] of the specified instance. - - + + - + - + - Sets the base of the instance. A base can be any of the 3D objects that are created in the RenderingServer that can be displayed. For example, any of the light types, mesh, multimesh, immediate geometry, particle system, reflection probe, lightmap, 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. + Returns the [Transform2D] of the specified instance. For use when the multimesh is set to use 2D transforms. - + - + - + - + - Sets the weight for a given blend shape associated with this instance. + Sets the color by which this instance will be modulated. Equivalent to [method MultiMesh.set_instance_color]. - + - + - + + + - Sets a custom AABB to use when culling objects from the view frustum. Equivalent to [method GeometryInstance3D.set_custom_aabb]. + Sets the custom data for this instance. Custom data is passed as a [Color], but is interpreted as a [code]vec4[/code] in the shader. Equivalent to [method MultiMesh.set_instance_custom_data]. - + - + - + + + - Function not implemented in Godot 3.x. + Sets the [Transform3D] for this instance. Equivalent to [method MultiMesh.set_instance_transform]. - + - + - + + + - 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 [member GeometryInstance3D.extra_cull_margin]. + Sets the [Transform2D] for this instance. For use when multimesh is used in 2D. Equivalent to [method MultiMesh.set_instance_transform_2d]. - + - + - + - Sets the render layers that this instance will be drawn to. Equivalent to [member VisualInstance3D.layers]. - + - + - + - Sets the scenario that the instance is in. The scenario is the 3D world that the objects will be displayed in. + Sets the mesh to be drawn by the multimesh. Equivalent to [member MultiMesh.mesh]. - + - - - + - + - Sets the override material of a specific surface. Equivalent to [method MeshInstance3D.set_surface_override_material]. + Sets the number of instances visible at a given time. If -1, all instances that have been allocated are drawn. Equivalent to [member MultiMesh.visible_instance_count]. - - + + - - - - - Sets the world space transform of the instance. Equivalent to [member Node3D.transform]. - + - + - + + + - Sets the visibility parent for the given instance. Equivalent to [member Node3D.visibility_parent]. - - + + - - - - - Sets whether an instance is drawn or not. Equivalent to [member Node3D.visible]. + Creates a new omni light and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID can be used in most [code]light_*[/code] RenderingServer functions. + Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method. + To place in a scene, attach this omni light to an instance using [method instance_set_base] using the returned RID. - - + + - - - - - Returns an array of object IDs intersecting with the provided AABB. Only visual 3D nodes are considered, such as [MeshInstance3D] or [DirectionalLight3D]. Use [method @GlobalScope.instance_from_id] to obtain the actual nodes. A scenario RID must be provided, which is available in the [World3D] you want to query. This forces an update for all resources queued to update. - [b]Warning:[/b] This function is primarily intended for editor usage. For in-game use cases, prefer physics collision. - - + + - - - + - Returns an array of object IDs intersecting with the provided convex shape. Only visual 3D nodes are considered, such as [MeshInstance3D] or [DirectionalLight3D]. Use [method @GlobalScope.instance_from_id] to obtain the actual nodes. A scenario RID must be provided, which is available in the [World3D] you want to query. This forces an update for all resources queued to update. - [b]Warning:[/b] This function is primarily intended for editor usage. For in-game use cases, prefer physics collision. - - + + - + - - - + - Returns an array of object IDs intersecting with the provided 3D ray. Only visual 3D nodes are considered, such as [MeshInstance3D] or [DirectionalLight3D]. Use [method @GlobalScope.instance_from_id] to obtain the actual nodes. A scenario RID must be provided, which is available in the [World3D] you want to query. This forces an update for all resources queued to update. - [b]Warning:[/b] This function is primarily intended for editor usage. For in-game use cases, prefer physics collision. - + - + - + - If [code]true[/code], this directional light will blend between shadow map splits resulting in a smoother transition between them. Equivalent to [member DirectionalLight3D.directional_shadow_blend_splits]. - + - + - + - Sets the shadow depth range mode for this directional light. Equivalent to [member DirectionalLight3D.directional_shadow_depth_range]. See [enum LightDirectionalShadowDepthRangeMode] for options. - + - + - + - Sets the shadow mode for this directional light. Equivalent to [member DirectionalLight3D.directional_shadow_mode]. See [enum LightDirectionalShadowMode] for options. - + - + - + - If [code]true[/code], this light will not be used for anything except sky shaders. Use this for lights that impact your sky shader that you may want to hide from affecting the rest of the scene. For example, you may want to enable this when the sun in your sky shader falls below the horizon. - + - + - + - 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 [member OmniLight3D.omni_shadow_mode]. - + - + - + - + - + - + - Sets the color of the light. Equivalent to [member Light3D.light_color]. - + - + - + - Sets the cull mask for this Light3D. Lights only affect objects in the selected layers. Equivalent to [member Light3D.light_cull_mask]. - - + + - - - - - If [code]true[/code], light will subtract light instead of adding light. Equivalent to [member Light3D.light_negative]. + Creates a particle system and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]particles_*[/code] RenderingServer functions. + Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method. + To place in a scene, attach these particles to an instance using [method instance_set_base] using the returned RID. - + - + - + - + + + + + + + - Sets the specified light parameter. See [enum LightParam] for options. Equivalent to [method Light3D.set_param]. - - + + - - - + - Not implemented in Godot 3.x. + Calculates and returns the axis-aligned bounding box that contains all the particles. Equivalent to [method GPUParticles3D.capture_aabb]. - - + + - + - + + Returns [code]true[/code] if particles are currently set to emitting. + + + + + + - If [code]true[/code], 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 [method instance_geometry_set_cast_shadows_setting]. Equivalent to [member Light3D.shadow_reverse_cull_face]. + Returns [code]true[/code] if particles are not emitting and particles are set to inactive. - + - - - + - If [code]true[/code], light will cast shadows. Equivalent to [member Light3D.shadow_enabled]. + 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 [method instances_cull_aabb], [method instances_cull_convex], or [method instances_cull_ray]. - + - - - + - Sets the color of the shadow cast by the light. Equivalent to [member Light3D.shadow_color]. + Reset the particles on the next update. Equivalent to [method GPUParticles3D.restart]. - - + + - - - + - + - Returns a mesh of a sphere with the given amount of horizontal and vertical subdivisions. + Sets the number of particles to be drawn and allocates the memory for them. Equivalent to [member GPUParticles3D.amount]. - - + + + + + + - Creates an empty material and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]material_*[/code] RenderingServer functions. - Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method. - - + + - + - + - Returns the value of a certain material's parameter. + Sets a custom axis-aligned bounding box for the particle system. Equivalent to [member GPUParticles3D.visibility_aabb]. - + - + - + - Sets an object's next material. + Sets the draw order of the particles to one of the named enums from [enum ParticlesDrawOrder]. See [enum ParticlesDrawOrder] for options. Equivalent to [member GPUParticles3D.draw_order]. - + - + - + - + - Sets a material's parameter. + Sets the mesh to be used for the specified draw pass. Equivalent to [member GPUParticles3D.draw_pass_1], [member GPUParticles3D.draw_pass_2], [member GPUParticles3D.draw_pass_3], and [member GPUParticles3D.draw_pass_4]. - + - + - + - Sets a material's render priority. + Sets the number of draw passes to use. Equivalent to [member GPUParticles3D.draw_passes]. - + - + - + - Sets a shader material's shader. + Sets the [Transform3D] that will be used by the particles when they first emit. - + - + + + - Removes all surfaces from a mesh. + If [code]true[/code], particles will emit over time. Setting to false does not reset the particles, but only stops their emission. Equivalent to [member GPUParticles3D.emitting]. - - + + + + + + - Creates a new mesh and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]mesh_*[/code] RenderingServer functions. - Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method. - To place in a scene, attach this mesh to an instance using [method instance_set_base] using the returned RID. + Sets the explosiveness ratio. Equivalent to [member GPUParticles3D.explosiveness]. - - + + - + + + - Returns a mesh's blend shape count. + Sets the frame rate that the particle system rendering will be fixed to. Equivalent to [member GPUParticles3D.fixed_fps]. - - + + - + + + - Returns a mesh's blend shape mode. + If [code]true[/code], uses fractional delta which smooths the movement of the particles. Equivalent to [member GPUParticles3D.fract_delta]. - - + + - + + + - Returns a mesh's custom aabb. - - + + - + + + - Returns a mesh's number of surfaces. + Sets the lifetime of each particle in the system. Equivalent to [member GPUParticles3D.lifetime]. - + - + - + - Sets a mesh's blend shape mode. - + - + - + - Sets a mesh's custom aabb. + If [code]true[/code], particles will emit once and then stop. Equivalent to [member GPUParticles3D.one_shot]. - - + + - + - + - Returns a mesh's surface's buffer arrays. + Sets the preprocess time for the particles' animation. This lets you delay starting an animation until after the particles have begun emitting. Equivalent to [member GPUParticles3D.preprocess]. - - + + - + - + - Returns a mesh's surface's arrays for blend shapes. + Sets the material for processing the particles. Note: this is not the material used to draw the materials. Equivalent to [member GPUParticles3D.process_material]. - - + + - + - + + Sets the emission randomness ratio. This randomizes the emission of particles within their phase. Equivalent to [member GPUParticles3D.randomness]. - - + + - - - + - + + Sets the speed scale of the particle system. Equivalent to [member GPUParticles3D.speed_scale]. - - + + - + - + - - + + - + - + - - + + - + - + + + - Returns a mesh's surface's material. - + - - - + - + - Sets a mesh's surface's material. - + - - - - - - - + - + + If [code]true[/code], particles use local coordinates. If [code]false[/code] they use global coordinates. Equivalent to [member GPUParticles3D.local_coords]. - + - Creates a new multimesh on the RenderingServer and returns an [RID] handle. This RID will be used in all [code]multimesh_*[/code] RenderingServer functions. + Creates a reflection probe and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]reflection_probe_*[/code] RenderingServer functions. Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method. - To place in a scene, attach this multimesh to an instance using [method instance_set_base] using the returned RID. + To place in a scene, attach this reflection probe to an instance using [method instance_set_base] using the returned RID. - - + + - + - - Calculates and returns the axis-aligned bounding box that encloses all instances within the multimesh. - - - - - - + - - + + - + + + - Returns the number of instances allocated for this multimesh. - - + + - + + + - Returns the RID of the mesh that will be used in drawing this multimesh. - - + + - + + + - Returns the number of visible instances for this multimesh. + If [code]true[/code], reflections will ignore sky contribution. Equivalent to [member ReflectionProbe.interior]. - - + + - + - + - Returns the color by which the specified instance will be modulated. + Sets the render cull mask for this reflection probe. Only instances with a matching cull mask will be rendered by this probe. Equivalent to [member ReflectionProbe.cull_mask]. - - + + - + - + - Returns the custom data associated with the specified instance. + If [code]true[/code], uses box projection. This can make reflections look more correct in certain situations. Equivalent to [member ReflectionProbe.box_projection]. - - + + - + - + - Returns the [Transform3D] of the specified instance. + If [code]true[/code], computes shadows in the reflection probe. This makes the reflection much slower to compute. Equivalent to [member ReflectionProbe.enable_shadows]. - - + + - + - + - Returns the [Transform2D] of the specified instance. For use when the multimesh is set to use 2D transforms. + Sets the size of the area that the reflection probe will capture. Equivalent to [member ReflectionProbe.extents]. - + - - - + - + - Sets the color by which this instance will be modulated. Equivalent to [method MultiMesh.set_instance_color]. + Sets the intensity of the reflection probe. Intensity modulates the strength of the reflection. Equivalent to [member ReflectionProbe.intensity]. - + - - - + - + - Sets the custom data for this instance. Custom data is passed as a [Color], but is interpreted as a [code]vec4[/code] in the shader. Equivalent to [method MultiMesh.set_instance_custom_data]. - + - - - + - + - Sets the [Transform3D] for this instance. Equivalent to [method MultiMesh.set_instance_transform]. + Sets the max distance away from the probe an object can be before it is culled. Equivalent to [member ReflectionProbe.max_distance]. - + - - - + - + - Sets the [Transform2D] for this instance. For use when multimesh is used in 2D. Equivalent to [method MultiMesh.set_instance_transform_2d]. + Sets the origin offset to be used when this reflection probe is in box project mode. Equivalent to [member ReflectionProbe.origin_offset]. - + - + - + - + - + - + - Sets the mesh to be drawn by the multimesh. Equivalent to [member MultiMesh.mesh]. + Sets how often the reflection probe updates. Can either be once or every frame. See [enum ReflectionProbeUpdateMode] for options. - + - + - + + + - Sets the number of instances visible at a given time. If -1, all instances that have been allocated are drawn. Equivalent to [member MultiMesh.visible_instance_count]. + Schedules a callback to the corresponding named [code]method[/code] on [code]where[/code] after a frame has been drawn. + The callback method must use only 1 argument which will be called with [code]userdata[/code]. - + + Creates a scenario and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]scenario_*[/code] RenderingServer functions. + Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method. + The scenario is the 3D world that all the visual instances exist in. - + - - - + - + - - + + + + + + - Creates a new omni light and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID can be used in most [code]light_*[/code] RenderingServer functions. - Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method. - To place in a scene, attach this omni light to an instance using [method instance_set_base] using the returned RID. + Sets the environment that will be used with this scenario. - - + + + + + + - Creates a particle system and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]particles_*[/code] RenderingServer functions. - Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method. - To place in a scene, attach these particles to an instance using [method instance_set_base] using the returned RID. + Sets the fallback environment to be used by this scenario. The fallback environment is used if no environment is set. Internally, this is used by the editor to provide a default environment. - - + + - + + + + + - Calculates and returns the axis-aligned bounding box that contains all the particles. Equivalent to [method GPUParticles3D.capture_aabb]. - - + + - + + + + + + + - Returns [code]true[/code] if particles are currently set to emitting. + Sets a boot image. The color defines the background color. If [code]scale[/code] is [code]true[/code], the image will be scaled to fit the screen size. If [code]use_filter[/code] is [code]true[/code], the image will be scaled with linear interpolation. If [code]use_filter[/code] is [code]false[/code], the image will be scaled with nearest-neighbor interpolation. - - + + - + - Returns [code]true[/code] if particles are not emitting and particles are set to inactive. + If [code]true[/code], the engine will generate wireframes for use with the wireframe debug mode. - + - + - 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 [method instances_cull_aabb], [method instances_cull_convex], or [method instances_cull_ray]. + Sets the default clear color which is used when a specific clear color has not been selected. - - + + - + + Creates an empty shader and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]shader_*[/code] RenderingServer functions. + Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method. + + + + + + - Reset the particles on the next update. Equivalent to [method GPUParticles3D.restart]. + Returns a shader's code. - - + + - + - + - Sets the number of particles to be drawn and allocates the memory for them. Equivalent to [member GPUParticles3D.amount]. + Returns a default texture from a shader searched by name. - - + + - + - + - Sets a custom axis-aligned bounding box for the particle system. Equivalent to [member GPUParticles3D.visibility_aabb]. - - + + - - - + - Sets the draw order of the particles to one of the named enums from [enum ParticlesDrawOrder]. See [enum ParticlesDrawOrder] for options. Equivalent to [member GPUParticles3D.draw_order]. + Returns the parameters of a shader. - + - + - + - + - Sets the mesh to be used for the specified draw pass. Equivalent to [member GPUParticles3D.draw_pass_1], [member GPUParticles3D.draw_pass_2], [member GPUParticles3D.draw_pass_3], and [member GPUParticles3D.draw_pass_4]. + Sets a shader's default texture. Overwrites the texture given by name. - + - - - + - Sets the number of draw passes to use. Equivalent to [member GPUParticles3D.draw_passes]. - + - + - + + + - Sets the [Transform3D] that will be used by the particles when they first emit. - - + + - + - + - If [code]true[/code], particles will emit over time. Setting to false does not reset the particles, but only stops their emission. Equivalent to [member GPUParticles3D.emitting]. + Returns the [Transform3D] set for a specific bone of this skeleton. - + + + + + + + + + Returns the [Transform2D] set for a specific bone of this skeleton. + + + - + - + + + - Sets the explosiveness ratio. Equivalent to [member GPUParticles3D.explosiveness]. + Sets the [Transform3D] for a specific bone of this skeleton. - + - + - + + + - Sets the frame rate that the particle system rendering will be fixed to. Equivalent to [member GPUParticles3D.fixed_fps]. + Sets the [Transform2D] for a specific bone of this skeleton. - - + + - - - - - If [code]true[/code], uses fractional delta which smooths the movement of the particles. Equivalent to [member GPUParticles3D.fract_delta]. + Creates a skeleton and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]skeleton_*[/code] RenderingServer functions. + Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method. - - + + - - - + - Sets the lifetime of each particle in the system. Equivalent to [member GPUParticles3D.lifetime]. + Returns the number of bones allocated for this skeleton. - + - + - + - If [code]true[/code], particles will emit once and then stop. Equivalent to [member GPUParticles3D.one_shot]. - - + + - + - + + + + + - Sets the preprocess time for the particles' animation. This lets you delay starting an animation until after the particles have begun emitting. Equivalent to [member GPUParticles3D.preprocess]. - - + + - - - - - Sets the material for processing the particles. Note: this is not the material used to draw the materials. Equivalent to [member GPUParticles3D.process_material]. + Creates an empty sky and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]sky_*[/code] RenderingServer functions. + Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method. - + - + - + - Sets the emission randomness ratio. This randomizes the emission of particles within their phase. Equivalent to [member GPUParticles3D.randomness]. + Sets the material that the sky uses to render the background and reflection maps. - + - + - + - Sets the speed scale of the particle system. Equivalent to [member GPUParticles3D.speed_scale]. - + - + - + - If [code]true[/code], particles use local coordinates. If [code]false[/code] they use global coordinates. Equivalent to [member GPUParticles3D.local_coords]. - + - Creates a reflection probe and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]reflection_probe_*[/code] RenderingServer functions. + Creates a spot light and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID can be used in most [code]light_*[/code] RenderingServer functions. Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method. - To place in a scene, attach this reflection probe to an instance using [method instance_set_base] using the returned RID. + To place in a scene, attach this spot light to an instance using [method instance_set_base] using the returned RID. - + - - - + - + - + - + - - + + - - - + - - + + - - - + - If [code]true[/code], reflections will ignore sky contribution. Equivalent to [member ReflectionProbe.interior]. - - + + - + - + - Sets the render cull mask for this reflection probe. Only instances with a matching cull mask will be rendered by this probe. Equivalent to [member ReflectionProbe.cull_mask]. - - + + - + - + - If [code]true[/code], uses box projection. This can make reflections look more correct in certain situations. Equivalent to [member ReflectionProbe.box_projection]. - - + + - - - + - If [code]true[/code], computes shadows in the reflection probe. This makes the reflection much slower to compute. Equivalent to [member ReflectionProbe.enable_shadows]. - - + + - - - - - Sets the size of the area that the reflection probe will capture. Equivalent to [member ReflectionProbe.extents]. - + - + - + + + - Sets the intensity of the reflection probe. Intensity modulates the strength of the reflection. Equivalent to [member ReflectionProbe.intensity]. - - + + - + - + + + + + + + + + - Sets the max distance away from the probe an object can be before it is culled. Equivalent to [member ReflectionProbe.max_distance]. - - + + - - - + - Sets the origin offset to be used when this reflection probe is in box project mode. Equivalent to [member ReflectionProbe.origin_offset]. - - + + - - - - - Sets how often the reflection probe updates. Can either be once or every frame. See [enum ReflectionProbeUpdateMode] for options. - + - + - + - + + + + + + + - Schedules a callback to the corresponding named [code]method[/code] on [code]where[/code] after a frame has been drawn. - The callback method must use only 1 argument which will be called with [code]userdata[/code]. - + + + - Creates a scenario and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]scenario_*[/code] RenderingServer functions. - Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method. - The scenario is the 3D world that all the visual instances exist in. - + - + - + - + - + - + - Sets the [enum ScenarioDebugMode] for this scenario. See [enum ScenarioDebugMode] for options. - + - + - + - Sets the environment that will be used with this scenario. - + - + - + - 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. - + - + - + - + - + + + + + + + + + - Sets a boot image. The color defines the background color. If [code]scale[/code] is [code]true[/code], the image will be scaled to fit the screen size. If [code]use_filter[/code] is [code]true[/code], the image will be scaled with linear interpolation. If [code]use_filter[/code] is [code]false[/code], the image will be scaled with nearest-neighbor interpolation. + Sets a viewport's camera. - + - + + + - If [code]true[/code], the engine will generate wireframes for use with the wireframe debug mode. + Sets a viewport's canvas. - + - + + + + + - Sets the default clear color which is used when a specific clear color has not been selected. + Copies the viewport to a region of the screen specified by [code]rect[/code]. If [method viewport_set_render_direct_to_screen] is [code]true[/code], then the viewport does not use a framebuffer and the contents of the viewport are rendered directly to screen. However, note that the root viewport is drawn last, therefore it will draw over the screen. Accordingly, you must set the root viewport to an area that does not cover the area that you have attached this viewport to. + For example, you can set the root viewport to not render at all with the following code: + FIXME: The method seems to be non-existent. + [codeblocks] + [gdscript] + func _ready(): + get_viewport().set_attach_to_screen_rect(Rect2()) + $Viewport.set_attach_to_screen_rect(Rect2(0, 0, 600, 600)) + [/gdscript] + [/codeblocks] + 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, [method viewport_set_render_direct_to_screen]. - + - Creates an empty shader and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]shader_*[/code] RenderingServer functions. + Creates an empty viewport and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]viewport_*[/code] RenderingServer functions. Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method. - - + + + + + + + + + + - + - Returns a shader's code. - - + + - + - + - Returns a default texture from a shader searched by name. + Returns a viewport's render information. For options, see the [enum ViewportRenderInfo] constants. - - + + - - - + + Returns the viewport's last rendered frame. - - + + - + + + - Returns the parameters of a shader. + Detaches a viewport from a canvas and vice versa. - + - + - + - Sets a shader's code. + If [code]true[/code], sets the viewport active, else sets it inactive. - + - + - + - + + + - Sets a shader's default texture. Overwrites the texture given by name. + Sets the stacking order for a viewport's canvas. + [code]layer[/code] is the actual canvas layer, while [code]sublayer[/code] specifies the stacking order of the canvas among those in the same layer. - + - + - + - + + Sets the transformation of a viewport's canvas. - - + + - + - + - Returns the [Transform3D] set for a specific bone of this skeleton. + Sets the clear mode of a viewport. See [enum ViewportClearMode] for options. - - + + - + - + - Returns the [Transform2D] set for a specific bone of this skeleton. + Sets the debug draw mode of a viewport. See [enum ViewportDebugDraw] for options. - + - - - + - + - Sets the [Transform3D] for a specific bone of this skeleton. - + - - - + - + - Sets the [Transform2D] for a specific bone of this skeleton. - - + + + + + + - Creates a skeleton and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]skeleton_*[/code] RenderingServer functions. - Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method. + If [code]true[/code], the viewport's canvas is not rendered. - - + + - + + + - Returns the number of bones allocated for this skeleton. - - + + + + + + - Creates an empty sky and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]sky_*[/code] RenderingServer functions. - Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method. + If [code]true[/code], rendering of a viewport's environment is disabled. - + - + - + - Sets the material that the sky uses to render the background and reflection maps. + Sets the viewport's global transformation matrix. - - + + + + + + - Creates a spot light and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID can be used in most [code]light_*[/code] RenderingServer functions. - Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method. - To place in a scene, attach this spot light to an instance using [method instance_set_base] using the returned RID. - - + + - + + + + Sets the anti-aliasing mode. See [enum ViewportMSAA] for options. - - + + - + - + - - - + - Sets a viewport's camera. - + - + - Sets a viewport's canvas. + Sets the viewport's parent to another viewport. - + - - - + - Copies the viewport to a region of the screen specified by [code]rect[/code]. If [method viewport_set_render_direct_to_screen] is [code]true[/code], then the viewport does not use a framebuffer and the contents of the viewport are rendered directly to screen. However, note that the root viewport is drawn last, therefore it will draw over the screen. Accordingly, you must set the root viewport to an area that does not cover the area that you have attached this viewport to. - For example, you can set the root viewport to not render at all with the following code: - FIXME: The method seems to be non-existent. - [codeblocks] - [gdscript] - func _ready(): - get_viewport().set_attach_to_screen_rect(Rect2()) - $Viewport.set_attach_to_screen_rect(Rect2(0, 0, 600, 600)) - [/gdscript] - [/codeblocks] - 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, [method viewport_set_render_direct_to_screen]. - - - - - - - Creates an empty viewport and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]viewport_*[/code] RenderingServer functions. - Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method. + If [code]true[/code], 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 [code]SCREEN_TEXTURE[/code]. 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. - - + + + + + Sets a viewport's scenario. + The scenario contains information about environment information, reflection atlas etc. - - + + + + - - + + - + + + - Returns a viewport's render information. For options, see the [enum ViewportRenderInfo] constants. - - + + + + + + - Returns the viewport's last rendered frame. + Sets the shadow atlas quadrant's subdivision. - + - + + + - Detaches a viewport from a canvas and vice versa. + 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. - + - + + + - If [code]true[/code], sets the viewport active, else sets it inactive. + Sets the viewport's width and height. - + - - - - - + - Sets the stacking order for a viewport's canvas. - [code]layer[/code] is the actual canvas layer, while [code]sublayer[/code] specifies the stacking order of the canvas among those in the same layer. - + - - - + - Sets the transformation of a viewport's canvas. - + - + - Sets the clear mode of a viewport. See [enum ViewportClearMode] for options. + If [code]true[/code], the viewport renders its background as transparent. - + - + - Sets the debug draw mode of a viewport. See [enum ViewportDebugDraw] for options. + Sets when the viewport should be updated. See [enum ViewportUpdateMode] constants for options. - + - + - If [code]true[/code], rendering of a viewport's environment is disabled. - + - + - Sets the viewport's global transformation matrix. - + - + - If [code]true[/code], the viewport's canvas is not rendered. + If [code]true[/code], the viewport uses augmented or virtual reality technologies. See [XRInterface]. + + + + + + - + - + - + - Currently unimplemented in Godot 3.x. - + - + - + + + - + - + - + + + + + + + + + + + + + - Sets the anti-aliasing mode. See [enum ViewportMSAA] for options. - - + + - - - - + + - + - - + + - - - + - Sets the viewport's parent to another viewport. - - + + - + - + + + + + + + - If [code]true[/code], 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 [code]SCREEN_TEXTURE[/code]. 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. - - + + - + - + + + + + + + - Sets a viewport's scenario. - The scenario contains information about the [enum ScenarioDebugMode], environment information, reflection atlas etc. - + - + - - - + - Sets the shadow atlas quadrant's subdivision. - + - - - + - + - 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. - + - + - - - + - Sets the viewport's width and height. - + - + - + - If [code]true[/code], the viewport renders its background as transparent. - + - + - + - Sets when the viewport should be updated. See [enum ViewportUpdateMode] constants for options. - + - + - + - + - - - + - + - + - + - If [code]true[/code], the viewport uses augmented or virtual reality technologies. See [XRInterface]. @@ -2952,6 +4687,8 @@ Unused enum in Godot 3.x. + + @@ -3029,6 +4766,26 @@ Represents the size of the [enum ArrayType] enum. + + + + + + + + + + + + + + + + + + + + Flag used to mark a vertex array. @@ -3068,6 +4825,8 @@ + + @@ -3176,6 +4935,8 @@ Blurs the edges of the shadow. Can be used to hide pixel artifacts in low resolution shadow maps. A high value can make shadows appear grainy and can cause other unwanted artifacts. Try to keep as near default as possible. + + @@ -3208,6 +4969,18 @@ Optimize use of shadow maps, increasing the effective resolution. But may result in shadows moving or flickering slightly. + + + + + + + + + + + + Reflection probe will update reflections once and then stop. @@ -3230,15 +5003,71 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + Draw particles in the order that they appear in the particles array. Sort particles based on their lifetime. + + Sort particles based on their distance to the camera. + + + + + + + + + + + + + + + + + + + + + + + + + + + + Do not update the viewport. @@ -3262,6 +5091,24 @@ The viewport is cleared once, then the clear mode is set to [constant VIEWPORT_CLEAR_NEVER]. + + + + + + + + + + + + + + + + + + Multisample antialiasing is disabled. @@ -3285,6 +5132,12 @@ + + + + + + Number of objects drawn in a single frame. @@ -3356,11 +5209,25 @@ + + + + + + + + + + + + Uses high quality importance sampling to process the radiance map. In general, this results in much higher quality than [constant Sky.PROCESS_MODE_REALTIME] but takes much longer to generate. This should not be used if you plan on changing the sky at runtime. If you are finding that the reflection is not blurry enough and is showing sparkles or fireflies, try increasing [member ProjectSettings.rendering/reflections/sky_reflections/ggx_samples]. + + Uses the fast filtering algorithm to process the radiance map. In general this results in lower quality, but substantially faster run times. [b]Note:[/b] The fast filtering algorithm is limited to 256x256 cubemaps, so [member Sky.radiance_size] must be set to [constant Sky.RADIANCE_SIZE_256]. @@ -3457,64 +5324,88 @@ Highest quality screen space ambient occlusion. Uses the adaptive setting which can be dynamically adjusted to smoothly balance performance and visual quality. - + - + - + - + - - Lowest quality DOF blur. This is the fastest setting, but you may be able to see filtering artifacts. + - - Low quality DOF blur. + - - Medium quality DOF blur. + - - Highest quality DOF blur. Results in the smoothest looking blur by taking the most samples, but is also significantly slower. + - - Calculate the DOF blur using a box filter. The fastest option, but results in obvious lines in blur pattern. + - - Calculates DOF blur using a hexagon shaped filter. + - - Calculates DOF blur using a circle shaped filter. Best quality and most realistic, but slowest. Use only for areas where a lot of performance can be dedicated to post-processing (e.g. cutscenes). + - + - + - + - + - + - + - - Do not use a debug mode. + - - Draw all objects as wireframe models. + - - Draw all objects in a way that displays how much overdraw is occurring. Overdraw occurs when a section of pixels is drawn and shaded and then another object covers it up. To optimize a scene, you should reduce overdraw. + - - Draw all objects without shading. Equivalent to setting all objects shaders to [code]unshaded[/code]. + - + - + - + + + + + + + + + + + + + + + + + + Calculate the DOF blur using a box filter. The fastest option, but results in obvious lines in blur pattern. + + + Calculates DOF blur using a hexagon shaped filter. + + + Calculates DOF blur using a circle shaped filter. Best quality and most realistic, but slowest. Use only for areas where a lot of performance can be dedicated to post-processing (e.g. cutscenes). + + + Lowest quality DOF blur. This is the fastest setting, but you may be able to see filtering artifacts. + + + Low quality DOF blur. + + + Medium quality DOF blur. + + + Highest quality DOF blur. Results in the smoothest looking blur by taking the most samples, but is also significantly slower. The instance does not have a type. @@ -3547,6 +5438,8 @@ + + Represents the size of the [enum InstanceType] enum. @@ -3579,6 +5472,20 @@ Only render the shadows from the object. The object itself will not be drawn. + + + + + + + + + + + + + + The nine patch gets stretched where needed. diff --git a/doc/classes/VoxelGIData.xml b/doc/classes/VoxelGIData.xml index 88a0411e2b..f613002233 100644 --- a/doc/classes/VoxelGIData.xml +++ b/doc/classes/VoxelGIData.xml @@ -66,12 +66,6 @@ - - - - - - diff --git a/editor/debugger/editor_profiler.cpp b/editor/debugger/editor_profiler.cpp index 449aaa42ff..ba84040b0c 100644 --- a/editor/debugger/editor_profiler.cpp +++ b/editor/debugger/editor_profiler.cpp @@ -315,7 +315,7 @@ void EditorProfiler::_update_plot() { graph_texture->create_from_image(img); } - graph_texture->update(img, true); + graph_texture->update(img); graph->set_texture(graph_texture); graph->update(); diff --git a/editor/debugger/editor_visual_profiler.cpp b/editor/debugger/editor_visual_profiler.cpp index d3948dee97..171d0574e0 100644 --- a/editor/debugger/editor_visual_profiler.cpp +++ b/editor/debugger/editor_visual_profiler.cpp @@ -309,7 +309,7 @@ void EditorVisualProfiler::_update_plot() { graph_texture->create_from_image(img); } - graph_texture->update(img, true); + graph_texture->update(img); graph->set_texture(graph_texture); graph->update(); diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 31f84d2508..7d6021b0f6 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -591,8 +591,7 @@ void EditorNode::_notification(int p_what) { _initializing_addons = false; } - RenderingServer::get_singleton()->viewport_set_hide_scenario(get_scene_root()->get_viewport_rid(), true); - RenderingServer::get_singleton()->viewport_set_hide_canvas(get_scene_root()->get_viewport_rid(), true); + RenderingServer::get_singleton()->viewport_set_disable_2d(get_scene_root()->get_viewport_rid(), true); RenderingServer::get_singleton()->viewport_set_disable_environment(get_viewport()->get_viewport_rid(), true); feature_profile_manager->notify_changed(); @@ -6119,7 +6118,6 @@ EditorNode::EditorNode() { scene_root->set_embed_subwindows_hint(true); scene_root->set_disable_3d(true); - RenderingServer::get_singleton()->viewport_set_hide_scenario(scene_root->get_viewport_rid(), true); scene_root->set_disable_input(true); scene_root->set_as_audio_listener_2d(true); diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp index 25002fd995..c63cfd3057 100644 --- a/editor/plugins/canvas_item_editor_plugin.cpp +++ b/editor/plugins/canvas_item_editor_plugin.cpp @@ -5623,12 +5623,12 @@ void CanvasItemEditorPlugin::make_visible(bool p_visible) { if (p_visible) { canvas_item_editor->show(); canvas_item_editor->set_physics_process(true); - RenderingServer::get_singleton()->viewport_set_hide_canvas(editor->get_scene_root()->get_viewport_rid(), false); + RenderingServer::get_singleton()->viewport_set_disable_2d(editor->get_scene_root()->get_viewport_rid(), false); } else { canvas_item_editor->hide(); canvas_item_editor->set_physics_process(false); - RenderingServer::get_singleton()->viewport_set_hide_canvas(editor->get_scene_root()->get_viewport_rid(), true); + RenderingServer::get_singleton()->viewport_set_disable_2d(editor->get_scene_root()->get_viewport_rid(), true); } } diff --git a/editor/plugins/node_3d_editor_plugin.cpp b/editor/plugins/node_3d_editor_plugin.cpp index d964644d38..f63c91e8a0 100644 --- a/editor/plugins/node_3d_editor_plugin.cpp +++ b/editor/plugins/node_3d_editor_plugin.cpp @@ -7073,8 +7073,6 @@ Node3DEditor::Node3DEditor(EditorNode *p_editor) { xform_dialog->connect("confirmed", callable_mp(this, &Node3DEditor::_xform_dialog_action)); - scenario_debug = RenderingServer::SCENARIO_DEBUG_DISABLED; - selected = nullptr; set_process_unhandled_key_input(true); diff --git a/editor/plugins/node_3d_editor_plugin.h b/editor/plugins/node_3d_editor_plugin.h index 02f89a12de..ac0b2e1859 100644 --- a/editor/plugins/node_3d_editor_plugin.h +++ b/editor/plugins/node_3d_editor_plugin.h @@ -600,8 +600,6 @@ private: ToolMode tool_mode; - RenderingServer::ScenarioDebugMode scenario_debug; - RID origin; RID origin_instance; bool origin_enabled; diff --git a/modules/gdnative/videodecoder/video_stream_gdnative.cpp b/modules/gdnative/videodecoder/video_stream_gdnative.cpp index 26b044c0ef..4c9bfb395d 100644 --- a/modules/gdnative/videodecoder/video_stream_gdnative.cpp +++ b/modules/gdnative/videodecoder/video_stream_gdnative.cpp @@ -185,7 +185,7 @@ void VideoStreamPlaybackGDNative::update_texture() { Ref img = memnew(Image(texture_size.width, texture_size.height, 0, Image::FORMAT_RGBA8, *pba)); - texture->update(img, true); + texture->update(img); } // ctor and dtor diff --git a/modules/theora/video_stream_theora.cpp b/modules/theora/video_stream_theora.cpp index 40be067a91..2f6faec8ec 100644 --- a/modules/theora/video_stream_theora.cpp +++ b/modules/theora/video_stream_theora.cpp @@ -108,7 +108,7 @@ void VideoStreamPlaybackTheora::video_write() { Ref img = memnew(Image(size.x, size.y, 0, Image::FORMAT_RGBA8, frame_data)); //zero copy image creation - texture->update(img, true); //zero copy send to visual server + texture->update(img); //zero copy send to visual server frames_pending = 1; } diff --git a/scene/3d/voxel_gi.cpp b/scene/3d/voxel_gi.cpp index 5558930df8..3da59ac4c0 100644 --- a/scene/3d/voxel_gi.cpp +++ b/scene/3d/voxel_gi.cpp @@ -143,15 +143,6 @@ float VoxelGIData::get_propagation() const { return propagation; } -void VoxelGIData::set_anisotropy_strength(float p_anisotropy_strength) { - RS::get_singleton()->voxel_gi_set_anisotropy_strength(probe, p_anisotropy_strength); - anisotropy_strength = p_anisotropy_strength; -} - -float VoxelGIData::get_anisotropy_strength() const { - return anisotropy_strength; -} - void VoxelGIData::set_energy(float p_energy) { RS::get_singleton()->voxel_gi_set_energy(probe, p_energy); energy = p_energy; @@ -161,24 +152,6 @@ float VoxelGIData::get_energy() const { return energy; } -void VoxelGIData::set_ao(float p_ao) { - RS::get_singleton()->voxel_gi_set_ao(probe, p_ao); - ao = p_ao; -} - -float VoxelGIData::get_ao() const { - return ao; -} - -void VoxelGIData::set_ao_size(float p_ao_size) { - RS::get_singleton()->voxel_gi_set_ao_size(probe, p_ao_size); - ao_size = p_ao_size; -} - -float VoxelGIData::get_ao_size() const { - return ao_size; -} - void VoxelGIData::set_bias(float p_bias) { RS::get_singleton()->voxel_gi_set_bias(probe, p_bias); bias = p_bias; @@ -219,15 +192,6 @@ RID VoxelGIData::get_rid() const { return probe; } -void VoxelGIData::_validate_property(PropertyInfo &property) const { - if (property.name == "anisotropy_strength") { - bool anisotropy_enabled = ProjectSettings::get_singleton()->get("rendering/global_illumination/voxel_gi/anisotropic"); - if (!anisotropy_enabled) { - property.usage = PROPERTY_USAGE_NOEDITOR; - } - } -} - void VoxelGIData::_bind_methods() { ClassDB::bind_method(D_METHOD("allocate", "to_cell_xform", "aabb", "octree_size", "octree_cells", "data_cells", "distance_field", "level_counts"), &VoxelGIData::allocate); @@ -253,15 +217,6 @@ void VoxelGIData::_bind_methods() { ClassDB::bind_method(D_METHOD("set_propagation", "propagation"), &VoxelGIData::set_propagation); ClassDB::bind_method(D_METHOD("get_propagation"), &VoxelGIData::get_propagation); - ClassDB::bind_method(D_METHOD("set_anisotropy_strength", "strength"), &VoxelGIData::set_anisotropy_strength); - ClassDB::bind_method(D_METHOD("get_anisotropy_strength"), &VoxelGIData::get_anisotropy_strength); - - ClassDB::bind_method(D_METHOD("set_ao", "ao"), &VoxelGIData::set_ao); - ClassDB::bind_method(D_METHOD("get_ao"), &VoxelGIData::get_ao); - - ClassDB::bind_method(D_METHOD("set_ao_size", "strength"), &VoxelGIData::set_ao_size); - ClassDB::bind_method(D_METHOD("get_ao_size"), &VoxelGIData::get_ao_size); - ClassDB::bind_method(D_METHOD("set_interior", "interior"), &VoxelGIData::set_interior); ClassDB::bind_method(D_METHOD("is_interior"), &VoxelGIData::is_interior); @@ -278,9 +233,6 @@ void VoxelGIData::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "bias", PROPERTY_HINT_RANGE, "0,8,0.01"), "set_bias", "get_bias"); ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "normal_bias", PROPERTY_HINT_RANGE, "0,8,0.01"), "set_normal_bias", "get_normal_bias"); ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "propagation", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_propagation", "get_propagation"); - ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "anisotropy_strength", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_anisotropy_strength", "get_anisotropy_strength"); - ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "ao", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_ao", "get_ao"); - ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "ao_size", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_ao_size", "get_ao_size"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "use_two_bounces"), "set_use_two_bounces", "is_using_two_bounces"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "interior"), "set_interior", "is_interior"); } diff --git a/scene/3d/voxel_gi.h b/scene/3d/voxel_gi.h index 5b9ee28b33..434d209421 100644 --- a/scene/3d/voxel_gi.h +++ b/scene/3d/voxel_gi.h @@ -51,15 +51,11 @@ class VoxelGIData : public Resource { float bias = 1.5; float normal_bias = 0.0; float propagation = 0.7; - float anisotropy_strength = 0.5; - float ao = 0.0; - float ao_size = 0.5; bool interior = false; bool use_two_bounces = false; protected: static void _bind_methods(); - void _validate_property(PropertyInfo &property) const override; public: void allocate(const Transform3D &p_to_cell_xform, const AABB &p_aabb, const Vector3 &p_octree_size, const Vector &p_octree_cells, const Vector &p_data_cells, const Vector &p_distance_field, const Vector &p_level_counts); @@ -77,15 +73,6 @@ public: void set_propagation(float p_propagation); float get_propagation() const; - void set_anisotropy_strength(float p_anisotropy_strength); - float get_anisotropy_strength() const; - - void set_ao(float p_ao); - float get_ao() const; - - void set_ao_size(float p_ao_size); - float get_ao_size() const; - void set_energy(float p_energy); float get_energy() const; diff --git a/scene/resources/texture.cpp b/scene/resources/texture.cpp index acc85cf7df..72031c3a69 100644 --- a/scene/resources/texture.cpp +++ b/scene/resources/texture.cpp @@ -173,7 +173,7 @@ Image::Format ImageTexture::get_format() const { return format; } -void ImageTexture::update(const Ref &p_image, bool p_immediate) { +void ImageTexture::update(const Ref &p_image) { ERR_FAIL_COND_MSG(p_image.is_null(), "Invalid image"); ERR_FAIL_COND_MSG(texture.is_null(), "Texture is not initialized."); ERR_FAIL_COND_MSG(p_image->get_width() != w || p_image->get_height() != h, @@ -183,11 +183,7 @@ void ImageTexture::update(const Ref &p_image, bool p_immediate) { ERR_FAIL_COND_MSG(mipmaps != p_image->has_mipmaps(), "The new image mipmaps configuration must match the texture's image mipmaps configuration"); - if (p_immediate) { - RenderingServer::get_singleton()->texture_2d_update_immediate(texture, p_image); - } else { - RenderingServer::get_singleton()->texture_2d_update(texture, p_image); - } + RenderingServer::get_singleton()->texture_2d_update(texture, p_image); notify_property_list_changed(); emit_changed(); @@ -305,7 +301,7 @@ void ImageTexture::_bind_methods() { ClassDB::bind_method(D_METHOD("create_from_image", "image"), &ImageTexture::create_from_image); ClassDB::bind_method(D_METHOD("get_format"), &ImageTexture::get_format); - ClassDB::bind_method(D_METHOD("update", "image", "immediate"), &ImageTexture::update, DEFVAL(false)); + ClassDB::bind_method(D_METHOD("update", "image"), &ImageTexture::update); ClassDB::bind_method(D_METHOD("set_size_override", "size"), &ImageTexture::set_size_override); ClassDB::bind_method(D_METHOD("_reload_hook", "rid"), &ImageTexture::_reload_hook); } diff --git a/scene/resources/texture.h b/scene/resources/texture.h index 3b1815266d..40193e3ff6 100644 --- a/scene/resources/texture.h +++ b/scene/resources/texture.h @@ -107,7 +107,7 @@ public: Image::Format get_format() const; - void update(const Ref &p_image, bool p_immediate = false); + void update(const Ref &p_image); Ref get_image() const override; int get_width() const override; diff --git a/servers/rendering/rasterizer_dummy.h b/servers/rendering/rasterizer_dummy.h index bc5aae2b48..62914bad8a 100644 --- a/servers/rendering/rasterizer_dummy.h +++ b/servers/rendering/rasterizer_dummy.h @@ -225,7 +225,6 @@ public: } void texture_2d_layered_initialize(RID p_texture, const Vector> &p_layers, RS::TextureLayeredType p_layered_type) override {} - void texture_2d_update_immediate(RID p_texture, const Ref &p_image, int p_layer = 0) override {} void texture_2d_update(RID p_texture, const Ref &p_image, int p_layer = 0) override {} void texture_3d_initialize(RID p_texture, Image::Format, int p_width, int p_height, int p_depth, bool p_mipmaps, const Vector> &p_data) override {} void texture_3d_update(RID p_texture, const Vector> &p_data) override {} @@ -491,12 +490,6 @@ public: void voxel_gi_set_energy(RID p_voxel_gi, float p_range) override {} float voxel_gi_get_energy(RID p_voxel_gi) const override { return 0.0; } - void voxel_gi_set_ao(RID p_voxel_gi, float p_ao) override {} - float voxel_gi_get_ao(RID p_voxel_gi) const override { return 0; } - - void voxel_gi_set_ao_size(RID p_voxel_gi, float p_strength) override {} - float voxel_gi_get_ao_size(RID p_voxel_gi) const override { return 0; } - void voxel_gi_set_bias(RID p_voxel_gi, float p_range) override {} float voxel_gi_get_bias(RID p_voxel_gi) const override { return 0.0; } @@ -719,8 +712,6 @@ public: void occluder_polygon_set_cull_mode(RID p_occluder, RS::CanvasOccluderPolygonCullMode p_mode) override {} void set_shadow_texture_size(int p_size) override {} - void draw_window_margins(int *p_margins, RID *p_margin_textures) override {} - bool free(RID p_rid) override { return true; } void update() override {} diff --git a/servers/rendering/renderer_canvas_render.h b/servers/rendering/renderer_canvas_render.h index c10b9db035..8afe9ef410 100644 --- a/servers/rendering/renderer_canvas_render.h +++ b/servers/rendering/renderer_canvas_render.h @@ -608,8 +608,6 @@ public: virtual void occluder_polygon_set_cull_mode(RID p_occluder, RS::CanvasOccluderPolygonCullMode p_mode) = 0; virtual void set_shadow_texture_size(int p_size) = 0; - virtual void draw_window_margins(int *p_margins, RID *p_margin_textures) = 0; - virtual bool free(RID p_rid) = 0; virtual void update() = 0; diff --git a/servers/rendering/renderer_rd/renderer_canvas_render_rd.h b/servers/rendering/renderer_rd/renderer_canvas_render_rd.h index 8c1376e2dc..1bc3769450 100644 --- a/servers/rendering/renderer_rd/renderer_canvas_render_rd.h +++ b/servers/rendering/renderer_rd/renderer_canvas_render_rd.h @@ -457,8 +457,6 @@ public: void canvas_debug_viewport_shadows(Light *p_lights_with_shadow) {} - void draw_window_margins(int *p_margins, RID *p_margin_textures) {} - virtual void set_shadow_texture_size(int p_size); void set_time(double p_time); diff --git a/servers/rendering/renderer_rd/renderer_scene_gi_rd.cpp b/servers/rendering/renderer_rd/renderer_scene_gi_rd.cpp index be1642998c..9228e06d7e 100644 --- a/servers/rendering/renderer_rd/renderer_scene_gi_rd.cpp +++ b/servers/rendering/renderer_rd/renderer_scene_gi_rd.cpp @@ -3078,9 +3078,6 @@ void RendererSceneGIRD::setup_voxel_gi_instances(RID p_render_buffers, const Tra gipd.bias = storage->voxel_gi_get_bias(base_probe); gipd.normal_bias = storage->voxel_gi_get_normal_bias(base_probe); gipd.blend_ambient = !storage->voxel_gi_is_interior(base_probe); - gipd.anisotropy_strength = 0; - gipd.ao = storage->voxel_gi_get_ao(base_probe); - gipd.ao_size = Math::pow(storage->voxel_gi_get_ao_size(base_probe), 4.0f); gipd.mipmaps = gipi->mipmaps.size(); } diff --git a/servers/rendering/renderer_rd/renderer_scene_gi_rd.h b/servers/rendering/renderer_rd/renderer_scene_gi_rd.h index 45fc7b3951..128bf09063 100644 --- a/servers/rendering/renderer_rd/renderer_scene_gi_rd.h +++ b/servers/rendering/renderer_rd/renderer_scene_gi_rd.h @@ -611,9 +611,9 @@ public: uint32_t blend_ambient; uint32_t texture_slot; - float anisotropy_strength; - float ao; - float ao_size; + uint32_t pad0; + uint32_t pad1; + uint32_t pad2; uint32_t mipmaps; }; diff --git a/servers/rendering/renderer_rd/renderer_storage_rd.cpp b/servers/rendering/renderer_rd/renderer_storage_rd.cpp index ee6fee6142..8c5e1dfde8 100644 --- a/servers/rendering/renderer_rd/renderer_storage_rd.cpp +++ b/servers/rendering/renderer_rd/renderer_storage_rd.cpp @@ -35,6 +35,7 @@ #include "core/io/resource_loader.h" #include "core/math/math_defs.h" #include "renderer_compositor_rd.h" +#include "servers/rendering/rendering_server_globals.h" #include "servers/rendering/shader_language.h" bool RendererStorageRD::can_create_resources_async() const { @@ -883,10 +884,6 @@ void RendererStorageRD::_texture_2d_update(RID p_texture, const Ref &p_im RD::get_singleton()->texture_update(tex->rd_texture, p_layer, validated->get_data()); } -void RendererStorageRD::texture_2d_update_immediate(RID p_texture, const Ref &p_image, int p_layer) { - _texture_2d_update(p_texture, p_image, p_layer, true); -} - void RendererStorageRD::texture_2d_update(RID p_texture, const Ref &p_image, int p_layer) { _texture_2d_update(p_texture, p_image, p_layer, false); } @@ -3921,6 +3918,7 @@ void RendererStorageRD::particles_set_emitting(RID p_particles, bool p_emitting) } bool RendererStorageRD::particles_get_emitting(RID p_particles) { + ERR_FAIL_COND_V_MSG(RSG::threaded, false, "This function should never be used with threaded rendering, as it stalls the renderer."); Particles *particles = particles_owner.getornull(p_particles); ERR_FAIL_COND_V(!particles, false); @@ -4243,6 +4241,10 @@ void RendererStorageRD::particles_request_process(RID p_particles) { } AABB RendererStorageRD::particles_get_current_aabb(RID p_particles) { + if (RSG::threaded) { + WARN_PRINT_ONCE("Calling this function with threaded rendering enabled stalls the renderer, use with care."); + } + const Particles *particles = particles_owner.getornull(p_particles); ERR_FAIL_COND_V(!particles, AABB()); @@ -5127,6 +5129,7 @@ void RendererStorageRD::update_particles() { } bool RendererStorageRD::particles_is_inactive(RID p_particles) const { + ERR_FAIL_COND_V_MSG(RSG::threaded, false, "This function should never be used with threaded rendering, as it stalls the renderer."); const Particles *particles = particles_owner.getornull(p_particles); ERR_FAIL_COND_V(!particles, false); return !particles->emitting && particles->inactive; @@ -6635,32 +6638,6 @@ float RendererStorageRD::voxel_gi_get_energy(RID p_voxel_gi) const { return voxel_gi->energy; } -void RendererStorageRD::voxel_gi_set_ao(RID p_voxel_gi, float p_ao) { - VoxelGI *voxel_gi = voxel_gi_owner.getornull(p_voxel_gi); - ERR_FAIL_COND(!voxel_gi); - - voxel_gi->ao = p_ao; -} - -float RendererStorageRD::voxel_gi_get_ao(RID p_voxel_gi) const { - VoxelGI *voxel_gi = voxel_gi_owner.getornull(p_voxel_gi); - ERR_FAIL_COND_V(!voxel_gi, 0); - return voxel_gi->ao; -} - -void RendererStorageRD::voxel_gi_set_ao_size(RID p_voxel_gi, float p_strength) { - VoxelGI *voxel_gi = voxel_gi_owner.getornull(p_voxel_gi); - ERR_FAIL_COND(!voxel_gi); - - voxel_gi->ao_size = p_strength; -} - -float RendererStorageRD::voxel_gi_get_ao_size(RID p_voxel_gi) const { - VoxelGI *voxel_gi = voxel_gi_owner.getornull(p_voxel_gi); - ERR_FAIL_COND_V(!voxel_gi, 0); - return voxel_gi->ao_size; -} - void RendererStorageRD::voxel_gi_set_bias(RID p_voxel_gi, float p_bias) { VoxelGI *voxel_gi = voxel_gi_owner.getornull(p_voxel_gi); ERR_FAIL_COND(!voxel_gi); diff --git a/servers/rendering/renderer_rd/renderer_storage_rd.h b/servers/rendering/renderer_rd/renderer_storage_rd.h index e09b1d6b16..3dc5b32421 100644 --- a/servers/rendering/renderer_rd/renderer_storage_rd.h +++ b/servers/rendering/renderer_rd/renderer_storage_rd.h @@ -1076,8 +1076,6 @@ private: float dynamic_range = 4.0; float energy = 1.0; - float ao = 0.0; - float ao_size = 0.5; float bias = 1.4; float normal_bias = 0.0; float propagation = 0.7; @@ -1298,7 +1296,6 @@ public: virtual void _texture_2d_update(RID p_texture, const Ref &p_image, int p_layer, bool p_immediate); - virtual void texture_2d_update_immediate(RID p_texture, const Ref &p_image, int p_layer = 0); //mostly used for video and streaming virtual void texture_2d_update(RID p_texture, const Ref &p_image, int p_layer = 0); virtual void texture_3d_update(RID p_texture, const Vector> &p_data); virtual void texture_proxy_update(RID p_texture, RID p_proxy_to); @@ -2040,12 +2037,6 @@ public: void voxel_gi_set_energy(RID p_voxel_gi, float p_energy); float voxel_gi_get_energy(RID p_voxel_gi) const; - void voxel_gi_set_ao(RID p_voxel_gi, float p_ao); - float voxel_gi_get_ao(RID p_voxel_gi) const; - - void voxel_gi_set_ao_size(RID p_voxel_gi, float p_strength); - float voxel_gi_get_ao_size(RID p_voxel_gi) const; - void voxel_gi_set_bias(RID p_voxel_gi, float p_bias); float voxel_gi_get_bias(RID p_voxel_gi) const; diff --git a/servers/rendering/renderer_rd/shaders/gi.glsl b/servers/rendering/renderer_rd/shaders/gi.glsl index 3977f4efa0..60c881881d 100644 --- a/servers/rendering/renderer_rd/shaders/gi.glsl +++ b/servers/rendering/renderer_rd/shaders/gi.glsl @@ -77,9 +77,9 @@ struct VoxelGIData { bool blend_ambient; uint texture_slot; - float anisotropy_strength; - float ambient_occlusion; - float ambient_occlusion_size; + uint pad0; + uint pad1; + uint pad2; uint mipmaps; }; @@ -551,27 +551,6 @@ void voxel_gi_compute(uint index, vec3 position, vec3 normal, vec3 ref_vec, mat3 } } - if (voxel_gi_instances.data[index].ambient_occlusion > 0.001) { - float size = 1.0 + voxel_gi_instances.data[index].ambient_occlusion_size * 7.0; - - float taps, blend; - blend = modf(size, taps); - float ao = 0.0; - for (float i = 1.0; i <= taps; i++) { - vec3 ofs = (position + normal * (i * 0.5 + 1.0)) * cell_size; - ao += textureLod(sampler3D(voxel_gi_textures[index], linear_sampler_with_mipmaps), ofs, i - 1.0).a * i; - } - - if (blend > 0.001) { - vec3 ofs = (position + normal * ((taps + 1.0) * 0.5 + 1.0)) * cell_size; - ao += textureLod(sampler3D(voxel_gi_textures[index], linear_sampler_with_mipmaps), ofs, taps).a * (taps + 1.0) * blend; - } - - ao = 1.0 - min(1.0, ao); - - light.rgb = mix(params.ao_color, light.rgb, mix(1.0, ao, voxel_gi_instances.data[index].ambient_occlusion)); - } - light.rgb *= voxel_gi_instances.data[index].dynamic_range; if (!voxel_gi_instances.data[index].blend_ambient) { light.a = 1.0; diff --git a/servers/rendering/renderer_scene.h b/servers/rendering/renderer_scene.h index d71425f465..d2e9f64335 100644 --- a/servers/rendering/renderer_scene.h +++ b/servers/rendering/renderer_scene.h @@ -56,7 +56,6 @@ public: virtual RID scenario_allocate() = 0; virtual void scenario_initialize(RID p_rid) = 0; - virtual void scenario_set_debug(RID p_scenario, RS::ScenarioDebugMode p_debug_mode) = 0; virtual void scenario_set_environment(RID p_scenario, RID p_environment) = 0; virtual void scenario_set_camera_effects(RID p_scenario, RID p_fx) = 0; virtual void scenario_set_fallback_environment(RID p_scenario, RID p_environment) = 0; @@ -81,7 +80,6 @@ public: virtual void instance_set_custom_aabb(RID p_instance, AABB p_aabb) = 0; virtual void instance_attach_skeleton(RID p_instance, RID p_skeleton) = 0; - virtual void instance_set_exterior(RID p_instance, bool p_enabled) = 0; virtual void instance_set_extra_visibility_margin(RID p_instance, real_t p_margin) = 0; virtual void instance_set_visibility_parent(RID p_instance, RID p_parent_instance) = 0; diff --git a/servers/rendering/renderer_scene_cull.cpp b/servers/rendering/renderer_scene_cull.cpp index 7e7139463b..52b247376a 100644 --- a/servers/rendering/renderer_scene_cull.cpp +++ b/servers/rendering/renderer_scene_cull.cpp @@ -330,12 +330,6 @@ void RendererSceneCull::scenario_initialize(RID p_rid) { RendererSceneOcclusionCull::get_singleton()->add_scenario(p_rid); } -void RendererSceneCull::scenario_set_debug(RID p_scenario, RS::ScenarioDebugMode p_debug_mode) { - Scenario *scenario = scenario_owner.getornull(p_scenario); - ERR_FAIL_COND(!scenario); - scenario->debug = p_debug_mode; -} - void RendererSceneCull::scenario_set_environment(RID p_scenario, RID p_environment) { Scenario *scenario = scenario_owner.getornull(p_scenario); ERR_FAIL_COND(!scenario); @@ -939,9 +933,6 @@ void RendererSceneCull::instance_attach_skeleton(RID p_instance, RID p_skeleton) } } -void RendererSceneCull::instance_set_exterior(RID p_instance, bool p_enabled) { -} - void RendererSceneCull::instance_set_extra_visibility_margin(RID p_instance, real_t p_margin) { Instance *instance = instance_owner.getornull(p_instance); ERR_FAIL_COND(!instance); diff --git a/servers/rendering/renderer_scene_cull.h b/servers/rendering/renderer_scene_cull.h index e303f3c739..53fb197fcc 100644 --- a/servers/rendering/renderer_scene_cull.h +++ b/servers/rendering/renderer_scene_cull.h @@ -315,7 +315,6 @@ public: DynamicBVH indexers[INDEXER_MAX]; - RS::ScenarioDebugMode debug; RID self; List directional_lights; @@ -338,7 +337,6 @@ public: Scenario() { indexers[INDEXER_GEOMETRY].set_index(INDEXER_GEOMETRY); indexers[INDEXER_VOLUMES].set_index(INDEXER_VOLUMES); - debug = RS::SCENARIO_DEBUG_DISABLED; used_viewport_visibility_bits = 0; } }; @@ -355,7 +353,6 @@ public: virtual RID scenario_allocate(); virtual void scenario_initialize(RID p_rid); - virtual void scenario_set_debug(RID p_scenario, RS::ScenarioDebugMode p_debug_mode); virtual void scenario_set_environment(RID p_scenario, RID p_environment); virtual void scenario_set_camera_effects(RID p_scenario, RID p_fx); virtual void scenario_set_fallback_environment(RID p_scenario, RID p_environment); @@ -914,7 +911,6 @@ public: virtual void instance_set_custom_aabb(RID p_instance, AABB p_aabb); virtual void instance_attach_skeleton(RID p_instance, RID p_skeleton); - virtual void instance_set_exterior(RID p_instance, bool p_enabled); virtual void instance_set_extra_visibility_margin(RID p_instance, real_t p_margin); diff --git a/servers/rendering/renderer_scene_occlusion_cull.cpp b/servers/rendering/renderer_scene_occlusion_cull.cpp index 54795f32a7..1b8aea36d7 100644 --- a/servers/rendering/renderer_scene_occlusion_cull.cpp +++ b/servers/rendering/renderer_scene_occlusion_cull.cpp @@ -185,7 +185,7 @@ RID RendererSceneOcclusionCull::HZBuffer::get_debug_texture() { if (debug_texture.is_null()) { debug_texture = RS::get_singleton()->texture_2d_create(debug_image); } else { - RenderingServer::get_singleton()->texture_2d_update_immediate(debug_texture, debug_image); + RenderingServer::get_singleton()->texture_2d_update(debug_texture, debug_image); } return debug_texture; diff --git a/servers/rendering/renderer_storage.h b/servers/rendering/renderer_storage.h index 62b23acedf..1c3e6a1eb2 100644 --- a/servers/rendering/renderer_storage.h +++ b/servers/rendering/renderer_storage.h @@ -130,7 +130,6 @@ public: virtual void texture_3d_initialize(RID p_texture, Image::Format, int p_width, int p_height, int p_depth, bool p_mipmaps, const Vector> &p_data) = 0; virtual void texture_proxy_initialize(RID p_texture, RID p_base) = 0; //all slices, then all the mipmaps, must be coherent - virtual void texture_2d_update_immediate(RID p_texture, const Ref &p_image, int p_layer = 0) = 0; //mostly used for video and streaming virtual void texture_2d_update(RID p_texture, const Ref &p_image, int p_layer = 0) = 0; virtual void texture_3d_update(RID p_texture, const Vector> &p_data) = 0; virtual void texture_proxy_update(RID p_proxy, RID p_base) = 0; @@ -422,12 +421,6 @@ public: virtual void voxel_gi_set_energy(RID p_voxel_gi, float p_energy) = 0; virtual float voxel_gi_get_energy(RID p_voxel_gi) const = 0; - virtual void voxel_gi_set_ao(RID p_voxel_gi, float p_ao) = 0; - virtual float voxel_gi_get_ao(RID p_voxel_gi) const = 0; - - virtual void voxel_gi_set_ao_size(RID p_voxel_gi, float p_strength) = 0; - virtual float voxel_gi_get_ao_size(RID p_voxel_gi) const = 0; - virtual void voxel_gi_set_bias(RID p_voxel_gi, float p_bias) = 0; virtual float voxel_gi_get_bias(RID p_voxel_gi) const = 0; diff --git a/servers/rendering/renderer_viewport.cpp b/servers/rendering/renderer_viewport.cpp index 2cf4c035a9..b3301fc607 100644 --- a/servers/rendering/renderer_viewport.cpp +++ b/servers/rendering/renderer_viewport.cpp @@ -114,7 +114,7 @@ void RendererViewport::_draw_viewport(Viewport *p_viewport, uint32_t p_view_coun Color bgcolor = RSG::storage->get_default_clear_color(); - if (!p_viewport->hide_canvas && !p_viewport->disable_environment && RSG::scene->is_scenario(p_viewport->scenario)) { + if (!p_viewport->disable_2d && !p_viewport->disable_environment && RSG::scene->is_scenario(p_viewport->scenario)) { RID environment = RSG::scene->scenario_get_environment(p_viewport->scenario); if (RSG::scene->is_environment(environment)) { scenario_draw_canvas_bg = RSG::scene->environment_get_background(environment) == RS::ENV_BG_CANVAS; @@ -145,7 +145,7 @@ void RendererViewport::_draw_viewport(Viewport *p_viewport, uint32_t p_view_coun _draw_3d(p_viewport); } - if (!p_viewport->hide_canvas) { + if (!p_viewport->disable_2d) { int i = 0; Map canvas_map; @@ -633,8 +633,6 @@ void RendererViewport::viewport_initialize(RID p_rid) { viewport_owner.initialize_rid(p_rid); Viewport *viewport = viewport_owner.getornull(p_rid); viewport->self = p_rid; - viewport->hide_scenario = false; - viewport->hide_canvas = false; viewport->render_target = RSG::storage->render_target_create(); viewport->shadow_atlas = RSG::scene->shadow_atlas_create(); viewport->viewport_render_direct_to_screen = false; @@ -791,18 +789,11 @@ RID RendererViewport::viewport_get_occluder_debug_texture(RID p_viewport) const return RID(); } -void RendererViewport::viewport_set_hide_scenario(RID p_viewport, bool p_hide) { +void RendererViewport::viewport_set_disable_2d(RID p_viewport, bool p_disable) { Viewport *viewport = viewport_owner.getornull(p_viewport); ERR_FAIL_COND(!viewport); - viewport->hide_scenario = p_hide; -} - -void RendererViewport::viewport_set_hide_canvas(RID p_viewport, bool p_hide) { - Viewport *viewport = viewport_owner.getornull(p_viewport); - ERR_FAIL_COND(!viewport); - - viewport->hide_canvas = p_hide; + viewport->disable_2d = p_disable; } void RendererViewport::viewport_set_disable_environment(RID p_viewport, bool p_disable) { diff --git a/servers/rendering/renderer_viewport.h b/servers/rendering/renderer_viewport.h index ca40829648..bf47bda148 100644 --- a/servers/rendering/renderer_viewport.h +++ b/servers/rendering/renderer_viewport.h @@ -68,9 +68,8 @@ public: Rect2 viewport_to_screen_rect; bool viewport_render_direct_to_screen; - bool hide_scenario; - bool hide_canvas; - bool disable_environment; + bool disable_2d = false; + bool disable_environment = false; bool disable_3d = false; bool measure_render_time; @@ -138,7 +137,7 @@ public: update_mode = RS::VIEWPORT_UPDATE_WHEN_VISIBLE; clear_mode = RS::VIEWPORT_CLEAR_ALWAYS; transparent_bg = false; - disable_environment = false; + viewport_to_screen = DisplayServer::INVALID_WINDOW_ID; shadow_atlas_size = 0; measure_render_time = false; @@ -218,8 +217,7 @@ public: RID viewport_get_texture(RID p_viewport) const; RID viewport_get_occluder_debug_texture(RID p_viewport) const; - void viewport_set_hide_scenario(RID p_viewport, bool p_hide); - void viewport_set_hide_canvas(RID p_viewport, bool p_hide); + void viewport_set_disable_2d(RID p_viewport, bool p_disable); void viewport_set_disable_environment(RID p_viewport, bool p_disable); void viewport_set_disable_3d(RID p_viewport, bool p_disable); diff --git a/servers/rendering/rendering_server_default.cpp b/servers/rendering/rendering_server_default.cpp index 629d212b69..aad6163a16 100644 --- a/servers/rendering/rendering_server_default.cpp +++ b/servers/rendering/rendering_server_default.cpp @@ -42,26 +42,6 @@ int RenderingServerDefault::changes = 0; -/* BLACK BARS */ - -void RenderingServerDefault::black_bars_set_margins(int p_left, int p_top, int p_right, int p_bottom) { - black_margin[SIDE_LEFT] = p_left; - black_margin[SIDE_TOP] = p_top; - black_margin[SIDE_RIGHT] = p_right; - black_margin[SIDE_BOTTOM] = p_bottom; -} - -void RenderingServerDefault::black_bars_set_images(RID p_left, RID p_top, RID p_right, RID p_bottom) { - black_image[SIDE_LEFT] = p_left; - black_image[SIDE_TOP] = p_top; - black_image[SIDE_RIGHT] = p_right; - black_image[SIDE_BOTTOM] = p_bottom; -} - -void RenderingServerDefault::_draw_margins() { - RSG::canvas_render->draw_window_margins(black_margin, black_image); -}; - /* FREE */ void RenderingServerDefault::_free(RID p_rid) { @@ -114,7 +94,6 @@ void RenderingServerDefault::_draw(bool p_swap_buffers, double frame_step) { RSG::viewport->draw_viewports(); RSG::canvas_render->update(); - _draw_margins(); RSG::rasterizer->end_frame(p_swap_buffers); RSG::canvas->update_visibility_notifiers(); @@ -410,11 +389,6 @@ RenderingServerDefault::RenderingServerDefault(bool p_create_thread) : sr->set_scene_render(RSG::rasterizer->get_scene()); frame_profile_frame = 0; - - for (int i = 0; i < 4; i++) { - black_margin[i] = 0; - black_image[i] = RID(); - } } RenderingServerDefault::~RenderingServerDefault() { diff --git a/servers/rendering/rendering_server_default.h b/servers/rendering/rendering_server_default.h index 22c1f6d909..8de3d893ce 100644 --- a/servers/rendering/rendering_server_default.h +++ b/servers/rendering/rendering_server_default.h @@ -58,9 +58,6 @@ class RenderingServerDefault : public RenderingServer { static int changes; RID test_cube; - int black_margin[4]; - RID black_image[4]; - struct FrameDrawnCallbacks { ObjectID object; StringName method; @@ -69,7 +66,6 @@ class RenderingServerDefault : public RenderingServer { List frame_drawn_callbacks; - void _draw_margins(); static void _changes_changed() {} uint64_t frame_profile_frame; @@ -192,8 +188,6 @@ public: FUNCRIDTEX6(texture_3d, Image::Format, int, int, int, bool, const Vector> &) FUNCRIDTEX1(texture_proxy, RID) - //goes pass-through - FUNC3(texture_2d_update_immediate, RID, const Ref &, int) //these go through command queue if they are in another thread FUNC3(texture_2d_update, RID, const Ref &, int) FUNC2(texture_3d_update, RID, const Vector> &) @@ -418,34 +412,12 @@ public: FUNC1RC(Transform3D, voxel_gi_get_to_cell_xform, RID) FUNC2(voxel_gi_set_dynamic_range, RID, float) - FUNC1RC(float, voxel_gi_get_dynamic_range, RID) - FUNC2(voxel_gi_set_propagation, RID, float) - FUNC1RC(float, voxel_gi_get_propagation, RID) - FUNC2(voxel_gi_set_energy, RID, float) - FUNC1RC(float, voxel_gi_get_energy, RID) - - FUNC2(voxel_gi_set_ao, RID, float) - FUNC1RC(float, voxel_gi_get_ao, RID) - - FUNC2(voxel_gi_set_ao_size, RID, float) - FUNC1RC(float, voxel_gi_get_ao_size, RID) - FUNC2(voxel_gi_set_bias, RID, float) - FUNC1RC(float, voxel_gi_get_bias, RID) - FUNC2(voxel_gi_set_normal_bias, RID, float) - FUNC1RC(float, voxel_gi_get_normal_bias, RID) - FUNC2(voxel_gi_set_interior, RID, bool) - FUNC1RC(bool, voxel_gi_is_interior, RID) - FUNC2(voxel_gi_set_use_two_bounces, RID, bool) - FUNC1RC(bool, voxel_gi_is_using_two_bounces, RID) - - FUNC2(voxel_gi_set_anisotropy_strength, RID, float) - FUNC1RC(float, voxel_gi_get_anisotropy_strength, RID) /* LIGHTMAP */ @@ -569,8 +541,7 @@ public: FUNC1RC(RID, viewport_get_texture, RID) - FUNC2(viewport_set_hide_scenario, RID, bool) - FUNC2(viewport_set_hide_canvas, RID, bool) + FUNC2(viewport_set_disable_2d, RID, bool) FUNC2(viewport_set_disable_environment, RID, bool) FUNC2(viewport_set_disable_3d, RID, bool) @@ -697,7 +668,6 @@ public: FUNCRIDSPLIT(scenario) - FUNC2(scenario_set_debug, RID, ScenarioDebugMode) FUNC2(scenario_set_environment, RID, RID) FUNC2(scenario_set_camera_effects, RID, RID) FUNC2(scenario_set_fallback_environment, RID, RID) @@ -717,7 +687,6 @@ public: FUNC2(instance_set_custom_aabb, RID, AABB) FUNC2(instance_attach_skeleton, RID, RID) - FUNC2(instance_set_exterior, RID, bool) FUNC2(instance_set_extra_visibility_margin, RID, real_t) FUNC2(instance_set_visibility_parent, RID, RID) @@ -885,11 +854,6 @@ public: #undef WRITE_ACTION #undef SYNC_DEBUG - /* BLACK BARS */ - - virtual void black_bars_set_margins(int p_left, int p_top, int p_right, int p_bottom) override; - virtual void black_bars_set_images(RID p_left, RID p_top, RID p_right, RID p_bottom) override; - /* FREE */ virtual void free(RID p_rid) override { diff --git a/servers/rendering_server.cpp b/servers/rendering_server.cpp index b7e20631c9..b89049a82f 100644 --- a/servers/rendering_server.cpp +++ b/servers/rendering_server.cpp @@ -31,7 +31,7 @@ #include "rendering_server.h" #include "core/config/project_settings.h" - +#include "servers/rendering/rendering_server_globals.h" RenderingServer *RenderingServer::singleton = nullptr; RenderingServer *(*RenderingServer::create_func)() = nullptr; @@ -67,12 +67,6 @@ Array RenderingServer::_texture_debug_usage_bind() { return arr; } -Array RenderingServer::_shader_get_param_list_bind(RID p_shader) const { - List l; - shader_get_param_list(p_shader, &l); - return convert_property_list(&l); -} - static Array to_array(const Vector &ids) { Array a; a.resize(ids.size()); @@ -83,16 +77,25 @@ static Array to_array(const Vector &ids) { } Array RenderingServer::_instances_cull_aabb_bind(const AABB &p_aabb, RID p_scenario) const { + if (RSG::threaded) { + WARN_PRINT_ONCE("Using this function with a threaded renderer hurts performance, as it causes a server stall."); + } Vector ids = instances_cull_aabb(p_aabb, p_scenario); return to_array(ids); } Array RenderingServer::_instances_cull_ray_bind(const Vector3 &p_from, const Vector3 &p_to, RID p_scenario) const { + if (RSG::threaded) { + WARN_PRINT_ONCE("Using this function with a threaded renderer hurts performance, as it causes a server stall."); + } Vector ids = instances_cull_ray(p_from, p_to, p_scenario); return to_array(ids); } Array RenderingServer::_instances_cull_convex_bind(const Array &p_convex, RID p_scenario) const { + if (RSG::threaded) { + WARN_PRINT_ONCE("Using this function with a threaded renderer hurts performance, as it causes a server stall."); + } Vector planes; for (int i = 0; i < p_convex.size(); ++i) { Variant v = p_convex[i]; @@ -1441,29 +1444,247 @@ RenderingDevice *RenderingServer::create_local_rendering_device() const { return RenderingDevice::get_singleton()->create_local_device(); } +static Vector> _get_imgvec(const TypedArray &p_layers) { + Vector> images; + images.resize(p_layers.size()); + for (int i = 0; i < p_layers.size(); i++) { + images.write[i] = p_layers[i]; + } + return images; +} +RID RenderingServer::_texture_2d_layered_create(const TypedArray &p_layers, TextureLayeredType p_layered_type) { + return texture_2d_layered_create(_get_imgvec(p_layers), p_layered_type); +} +RID RenderingServer::_texture_3d_create(Image::Format p_format, int p_width, int p_height, int p_depth, bool p_mipmaps, const TypedArray &p_data) { + return texture_3d_create(p_format, p_width, p_height, p_depth, p_mipmaps, _get_imgvec(p_data)); +} + +void RenderingServer::_texture_3d_update(RID p_texture, const TypedArray &p_data) { + texture_3d_update(p_texture, _get_imgvec(p_data)); +} + +TypedArray RenderingServer::_texture_3d_get(RID p_texture) const { + Vector> images = texture_3d_get(p_texture); + TypedArray ret; + ret.resize(images.size()); + for (int i = 0; i < images.size(); i++) { + ret[i] = images[i]; + } + return ret; +} + +TypedArray RenderingServer::_shader_get_param_list(RID p_shader) const { + List l; + shader_get_param_list(p_shader, &l); + return convert_property_list(&l); +} + +static RS::SurfaceData _dict_to_surf(const Dictionary &p_dictionary) { + ERR_FAIL_COND_V(!p_dictionary.has("primitive"), RS::SurfaceData()); + ERR_FAIL_COND_V(!p_dictionary.has("format"), RS::SurfaceData()); + ERR_FAIL_COND_V(!p_dictionary.has("vertex_data"), RS::SurfaceData()); + ERR_FAIL_COND_V(!p_dictionary.has("vertex_count"), RS::SurfaceData()); + ERR_FAIL_COND_V(!p_dictionary.has("aabb"), RS::SurfaceData()); + + RS::SurfaceData sd; + + sd.primitive = RS::PrimitiveType(int(p_dictionary["primitive"])); + sd.format = p_dictionary["format"]; + sd.vertex_data = p_dictionary["vertex_data"]; + if (p_dictionary.has("attribute_data")) { + sd.attribute_data = p_dictionary["attribute_data"]; + } + if (p_dictionary.has("skin_data")) { + sd.skin_data = p_dictionary["skin_data"]; + } + + sd.vertex_count = p_dictionary["vertex_count"]; + + if (p_dictionary.has("index_data")) { + sd.index_data = p_dictionary["index_data"]; + ERR_FAIL_COND_V(!p_dictionary.has("index_count"), RS::SurfaceData()); + sd.index_count = p_dictionary["index_count"]; + } + + sd.aabb = p_dictionary["aabb"]; + + if (p_dictionary.has("lods")) { + Array lods = p_dictionary["lods"]; + for (int i = 0; i < lods.size(); i++) { + Dictionary lod = lods[i]; + ERR_CONTINUE(!lod.has("edge_length")); + ERR_CONTINUE(!lod.has("index_data")); + RS::SurfaceData::LOD l; + l.edge_length = lod["edge_length"]; + l.index_data = lod["index_data"]; + sd.lods.push_back(l); + } + } + + if (p_dictionary.has("bone_aabbs")) { + Array aabbs = p_dictionary["bone_aabbs"]; + for (int i = 0; i < aabbs.size(); i++) { + AABB aabb = aabbs[i]; + sd.bone_aabbs.push_back(aabb); + } + } + + if (p_dictionary.has("blend_shape_data")) { + sd.blend_shape_data = p_dictionary["blend_shape_data"]; + } + + if (p_dictionary.has("material")) { + sd.material = p_dictionary["material"]; + } + + return sd; +} +RID RenderingServer::_mesh_create_from_surfaces(const TypedArray &p_surfaces, int p_blend_shape_count) { + Vector surfaces; + for (int i = 0; i < p_surfaces.size(); i++) { + surfaces.push_back(_dict_to_surf(p_surfaces[i])); + } + return mesh_create_from_surfaces(surfaces); +} +void RenderingServer::_mesh_add_surface(RID p_mesh, const Dictionary &p_surface) { + mesh_add_surface(p_mesh, _dict_to_surf(p_surface)); +} +Dictionary RenderingServer::_mesh_get_surface(RID p_mesh, int p_idx) { + RS::SurfaceData sd = mesh_get_surface(p_mesh, p_idx); + + Dictionary d; + d["primitive"] = sd.primitive; + d["format"] = sd.format; + d["vertex_data"] = sd.vertex_data; + if (sd.attribute_data.size()) { + d["attribute_data"] = sd.attribute_data; + } + if (sd.skin_data.size()) { + d["skin_data"] = sd.skin_data; + } + d["vertex_count"] = sd.vertex_count; + if (sd.index_count) { + d["index_data"] = sd.index_data; + d["index_count"] = sd.index_count; + } + d["aabb"] = sd.aabb; + + if (sd.lods.size()) { + Array lods; + for (int i = 0; i < sd.lods.size(); i++) { + Dictionary ld; + ld["edge_length"] = sd.lods[i].edge_length; + ld["index_data"] = sd.lods[i].index_data; + lods.push_back(lods); + } + d["lods"] = lods; + } + + if (sd.bone_aabbs.size()) { + Array aabbs; + for (int i = 0; i < sd.bone_aabbs.size(); i++) { + aabbs.push_back(sd.bone_aabbs[i]); + } + d["bone_aabbs"] = aabbs; + } + + if (sd.blend_shape_data.size()) { + d["blend_shape_data"] = sd.blend_shape_data; + } + + if (sd.material.is_valid()) { + d["material"] = sd.material; + } + return d; +} + +Array RenderingServer::_instance_geometry_get_shader_parameter_list(RID p_instance) const { + List params; + instance_geometry_get_shader_parameter_list(p_instance, ¶ms); + return convert_property_list(¶ms); +} + +TypedArray RenderingServer::_bake_render_uv2(RID p_base, const TypedArray &p_material_overrides, const Size2i &p_image_size) { + Vector mat_overrides; + for (int i = 0; i < p_material_overrides.size(); i++) { + mat_overrides.push_back(p_material_overrides[i]); + } + return bake_render_uv2(p_base, mat_overrides, p_image_size); +} + +void RenderingServer::_particles_set_trail_bind_poses(RID p_particles, const TypedArray &p_bind_poses) { + Vector tbposes; + tbposes.resize(p_bind_poses.size()); + for (int i = 0; i < p_bind_poses.size(); i++) { + tbposes.write[i] = p_bind_poses[i]; + } + particles_set_trail_bind_poses(p_particles, tbposes); +} + void RenderingServer::_bind_methods() { - ClassDB::bind_method(D_METHOD("force_sync"), &RenderingServer::sync); - ClassDB::bind_method(D_METHOD("force_draw", "swap_buffers", "frame_step"), &RenderingServer::draw, DEFVAL(true), DEFVAL(0.0)); - ClassDB::bind_method(D_METHOD("create_local_rendering_device"), &RenderingServer::create_local_rendering_device); + BIND_CONSTANT(NO_INDEX_ARRAY); + BIND_CONSTANT(ARRAY_WEIGHTS_SIZE); + BIND_CONSTANT(CANVAS_ITEM_Z_MIN); + BIND_CONSTANT(CANVAS_ITEM_Z_MAX); + BIND_CONSTANT(MAX_GLOW_LEVELS); + BIND_CONSTANT(MAX_CURSORS); + BIND_CONSTANT(MAX_2D_DIRECTIONAL_LIGHTS); -#ifndef _MSC_VER -#warning TODO all texture methods need re-binding -#endif + /* TEXTURE */ ClassDB::bind_method(D_METHOD("texture_2d_create", "image"), &RenderingServer::texture_2d_create); + ClassDB::bind_method(D_METHOD("texture_2d_layered_create", "layers", "layered_type"), &RenderingServer::_texture_2d_layered_create); + ClassDB::bind_method(D_METHOD("texture_3d_create", "format", "width", "height", "depth", "mipmaps", "data"), &RenderingServer::_texture_3d_create); + ClassDB::bind_method(D_METHOD("texture_proxy_create", "base"), &RenderingServer::texture_proxy_create); + + ClassDB::bind_method(D_METHOD("texture_2d_update", "texture", "image", "layer"), &RenderingServer::texture_2d_update); + ClassDB::bind_method(D_METHOD("texture_3d_update", "texture", "data"), &RenderingServer::_texture_3d_update); + ClassDB::bind_method(D_METHOD("texture_proxy_update", "texture", "proxy_to"), &RenderingServer::texture_proxy_update); + + ClassDB::bind_method(D_METHOD("texture_2d_placeholder_create"), &RenderingServer::texture_2d_placeholder_create); + ClassDB::bind_method(D_METHOD("texture_2d_layered_placeholder_create", "layered_type"), &RenderingServer::texture_2d_layered_placeholder_create); + ClassDB::bind_method(D_METHOD("texture_3d_placeholder_create"), &RenderingServer::texture_3d_placeholder_create); + ClassDB::bind_method(D_METHOD("texture_2d_get", "texture"), &RenderingServer::texture_2d_get); + ClassDB::bind_method(D_METHOD("texture_2d_layer_get", "texture", "layer"), &RenderingServer::texture_2d_layer_get); + ClassDB::bind_method(D_METHOD("texture_3d_get", "texture"), &RenderingServer::_texture_3d_get); + + ClassDB::bind_method(D_METHOD("texture_replace", "texture", "by_texture"), &RenderingServer::texture_replace); + ClassDB::bind_method(D_METHOD("texture_set_size_override", "texture", "width", "height"), &RenderingServer::texture_set_size_override); + + ClassDB::bind_method(D_METHOD("texture_set_path", "texture", "path"), &RenderingServer::texture_set_path); + ClassDB::bind_method(D_METHOD("texture_get_path", "texture"), &RenderingServer::texture_get_path); + + ClassDB::bind_method(D_METHOD("texture_set_force_redraw_if_visible", "texture", "enable"), &RenderingServer::texture_set_force_redraw_if_visible); + + BIND_ENUM_CONSTANT(TEXTURE_LAYERED_2D_ARRAY); + BIND_ENUM_CONSTANT(TEXTURE_LAYERED_CUBEMAP); + BIND_ENUM_CONSTANT(TEXTURE_LAYERED_CUBEMAP_ARRAY); + + BIND_ENUM_CONSTANT(CUBEMAP_LAYER_LEFT); + BIND_ENUM_CONSTANT(CUBEMAP_LAYER_RIGHT); + BIND_ENUM_CONSTANT(CUBEMAP_LAYER_BOTTOM); + BIND_ENUM_CONSTANT(CUBEMAP_LAYER_TOP); + BIND_ENUM_CONSTANT(CUBEMAP_LAYER_FRONT); + BIND_ENUM_CONSTANT(CUBEMAP_LAYER_BACK); + + /* SHADER */ -#ifndef _3D_DISABLED - ClassDB::bind_method(D_METHOD("sky_create"), &RenderingServer::sky_create); - ClassDB::bind_method(D_METHOD("sky_set_material", "sky", "material"), &RenderingServer::sky_set_material); -#endif ClassDB::bind_method(D_METHOD("shader_create"), &RenderingServer::shader_create); - ClassDB::bind_method(D_METHOD("shader_set_code", "shader", "code"), &RenderingServer::shader_set_code); ClassDB::bind_method(D_METHOD("shader_get_code", "shader"), &RenderingServer::shader_get_code); - ClassDB::bind_method(D_METHOD("shader_get_param_list", "shader"), &RenderingServer::_shader_get_param_list_bind); - ClassDB::bind_method(D_METHOD("shader_set_default_texture_param", "shader", "name", "texture"), &RenderingServer::shader_set_default_texture_param); - ClassDB::bind_method(D_METHOD("shader_get_default_texture_param", "shader", "name"), &RenderingServer::shader_get_default_texture_param); - ClassDB::bind_method(D_METHOD("shader_get_param_default", "material", "parameter"), &RenderingServer::shader_get_param_default); + ClassDB::bind_method(D_METHOD("shader_get_param_list", "shader"), &RenderingServer::_shader_get_param_list); + ClassDB::bind_method(D_METHOD("shader_get_param_default", "shader", "param"), &RenderingServer::shader_get_param_default); + + ClassDB::bind_method(D_METHOD("shader_set_default_texture_param", "shader", "param", "texture"), &RenderingServer::shader_set_default_texture_param); + ClassDB::bind_method(D_METHOD("shader_get_default_texture_param", "shader", "param"), &RenderingServer::shader_get_default_texture_param); + + BIND_ENUM_CONSTANT(SHADER_SPATIAL); + BIND_ENUM_CONSTANT(SHADER_CANVAS_ITEM); + BIND_ENUM_CONSTANT(SHADER_PARTICLES); + BIND_ENUM_CONSTANT(SHADER_SKY); + BIND_ENUM_CONSTANT(SHADER_MAX); + + /* MATERIAL */ ClassDB::bind_method(D_METHOD("material_create"), &RenderingServer::material_create); ClassDB::bind_method(D_METHOD("material_set_shader", "shader_material", "shader"), &RenderingServer::material_set_shader); @@ -1473,18 +1694,26 @@ void RenderingServer::_bind_methods() { ClassDB::bind_method(D_METHOD("material_set_next_pass", "material", "next_material"), &RenderingServer::material_set_next_pass); + BIND_CONSTANT(MATERIAL_RENDER_PRIORITY_MIN); + BIND_CONSTANT(MATERIAL_RENDER_PRIORITY_MAX); + + /* MESH API */ + + ClassDB::bind_method(D_METHOD("mesh_create_from_surfaces", "surfaces", "blend_shape_count"), &RenderingServer::_mesh_create_from_surfaces, DEFVAL(0)); ClassDB::bind_method(D_METHOD("mesh_create"), &RenderingServer::mesh_create); ClassDB::bind_method(D_METHOD("mesh_surface_get_format_offset", "format", "vertex_count", "array_index"), &RenderingServer::mesh_surface_get_format_offset); ClassDB::bind_method(D_METHOD("mesh_surface_get_format_vertex_stride", "format", "vertex_count"), &RenderingServer::mesh_surface_get_format_vertex_stride); ClassDB::bind_method(D_METHOD("mesh_surface_get_format_attribute_stride", "format", "vertex_count"), &RenderingServer::mesh_surface_get_format_attribute_stride); ClassDB::bind_method(D_METHOD("mesh_surface_get_format_skin_stride", "format", "vertex_count"), &RenderingServer::mesh_surface_get_format_skin_stride); - //ClassDB::bind_method(D_METHOD("mesh_add_surface_from_arrays", "mesh", "primitive", "arrays", "blend_shapes", "lods", "compress_format"), &RenderingServer::mesh_add_surface_from_arrays, DEFVAL(Array()), DEFVAL(Dictionary()), DEFVAL(ARRAY_COMPRESS_DEFAULT)); + ClassDB::bind_method(D_METHOD("mesh_add_surface", "mesh", "surface"), &RenderingServer::_mesh_add_surface); + ClassDB::bind_method(D_METHOD("mesh_add_surface_from_arrays", "mesh", "primitive", "arrays", "blend_shapes", "lods", "compress_format"), &RenderingServer::mesh_add_surface_from_arrays, DEFVAL(Array()), DEFVAL(Dictionary()), DEFVAL(0)); ClassDB::bind_method(D_METHOD("mesh_get_blend_shape_count", "mesh"), &RenderingServer::mesh_get_blend_shape_count); ClassDB::bind_method(D_METHOD("mesh_set_blend_shape_mode", "mesh", "mode"), &RenderingServer::mesh_set_blend_shape_mode); ClassDB::bind_method(D_METHOD("mesh_get_blend_shape_mode", "mesh"), &RenderingServer::mesh_get_blend_shape_mode); ClassDB::bind_method(D_METHOD("mesh_surface_set_material", "mesh", "surface", "material"), &RenderingServer::mesh_surface_set_material); ClassDB::bind_method(D_METHOD("mesh_surface_get_material", "mesh", "surface"), &RenderingServer::mesh_surface_get_material); + ClassDB::bind_method(D_METHOD("mesh_get_surface", "mesh", "surface"), &RenderingServer::_mesh_get_surface); ClassDB::bind_method(D_METHOD("mesh_surface_get_arrays", "mesh", "surface"), &RenderingServer::mesh_surface_get_arrays); ClassDB::bind_method(D_METHOD("mesh_surface_get_blend_shape_arrays", "mesh", "surface"), &RenderingServer::mesh_surface_get_blend_shape_arrays); ClassDB::bind_method(D_METHOD("mesh_get_surface_count", "mesh"), &RenderingServer::mesh_get_surface_count); @@ -1492,6 +1721,81 @@ void RenderingServer::_bind_methods() { ClassDB::bind_method(D_METHOD("mesh_get_custom_aabb", "mesh"), &RenderingServer::mesh_get_custom_aabb); ClassDB::bind_method(D_METHOD("mesh_clear", "mesh"), &RenderingServer::mesh_clear); + ClassDB::bind_method(D_METHOD("mesh_surface_update_vertex_region", "mesh", "surface", "offset", "data"), &RenderingServer::mesh_surface_update_vertex_region); + ClassDB::bind_method(D_METHOD("mesh_surface_update_attribute_region", "mesh", "surface", "offset", "data"), &RenderingServer::mesh_surface_update_attribute_region); + ClassDB::bind_method(D_METHOD("mesh_surface_update_skin_region", "mesh", "surface", "offset", "data"), &RenderingServer::mesh_surface_update_skin_region); + + ClassDB::bind_method(D_METHOD("mesh_set_shadow_mesh", "mesh", "shadow_mesh"), &RenderingServer::mesh_set_shadow_mesh); + + BIND_ENUM_CONSTANT(ARRAY_VERTEX); + BIND_ENUM_CONSTANT(ARRAY_NORMAL); + BIND_ENUM_CONSTANT(ARRAY_TANGENT); + BIND_ENUM_CONSTANT(ARRAY_COLOR); + BIND_ENUM_CONSTANT(ARRAY_TEX_UV); + BIND_ENUM_CONSTANT(ARRAY_TEX_UV2); + BIND_ENUM_CONSTANT(ARRAY_CUSTOM0); + BIND_ENUM_CONSTANT(ARRAY_CUSTOM1); + BIND_ENUM_CONSTANT(ARRAY_CUSTOM2); + BIND_ENUM_CONSTANT(ARRAY_CUSTOM3); + BIND_ENUM_CONSTANT(ARRAY_BONES); + BIND_ENUM_CONSTANT(ARRAY_WEIGHTS); + BIND_ENUM_CONSTANT(ARRAY_INDEX); + BIND_ENUM_CONSTANT(ARRAY_MAX); + + BIND_CONSTANT(ARRAY_CUSTOM_COUNT); + + BIND_ENUM_CONSTANT(ARRAY_CUSTOM_RGBA8_UNORM); + BIND_ENUM_CONSTANT(ARRAY_CUSTOM_RGBA8_SNORM); + BIND_ENUM_CONSTANT(ARRAY_CUSTOM_RG_HALF); + BIND_ENUM_CONSTANT(ARRAY_CUSTOM_RGBA_HALF); + BIND_ENUM_CONSTANT(ARRAY_CUSTOM_R_FLOAT); + BIND_ENUM_CONSTANT(ARRAY_CUSTOM_RG_FLOAT); + BIND_ENUM_CONSTANT(ARRAY_CUSTOM_RGB_FLOAT); + BIND_ENUM_CONSTANT(ARRAY_CUSTOM_RGBA_FLOAT); + BIND_ENUM_CONSTANT(ARRAY_CUSTOM_MAX); + + BIND_ENUM_CONSTANT(ARRAY_FORMAT_VERTEX); + BIND_ENUM_CONSTANT(ARRAY_FORMAT_NORMAL); + BIND_ENUM_CONSTANT(ARRAY_FORMAT_TANGENT); + BIND_ENUM_CONSTANT(ARRAY_FORMAT_COLOR); + BIND_ENUM_CONSTANT(ARRAY_FORMAT_TEX_UV); + BIND_ENUM_CONSTANT(ARRAY_FORMAT_TEX_UV2); + BIND_ENUM_CONSTANT(ARRAY_FORMAT_CUSTOM0); + BIND_ENUM_CONSTANT(ARRAY_FORMAT_CUSTOM1); + BIND_ENUM_CONSTANT(ARRAY_FORMAT_CUSTOM2); + BIND_ENUM_CONSTANT(ARRAY_FORMAT_CUSTOM3); + BIND_ENUM_CONSTANT(ARRAY_FORMAT_BONES); + BIND_ENUM_CONSTANT(ARRAY_FORMAT_WEIGHTS); + BIND_ENUM_CONSTANT(ARRAY_FORMAT_INDEX); + + BIND_ENUM_CONSTANT(ARRAY_FORMAT_BLEND_SHAPE_MASK); + + BIND_ENUM_CONSTANT(ARRAY_FORMAT_CUSTOM_BASE); + BIND_ENUM_CONSTANT(ARRAY_FORMAT_CUSTOM_BITS); + BIND_ENUM_CONSTANT(ARRAY_FORMAT_CUSTOM0_SHIFT); + BIND_ENUM_CONSTANT(ARRAY_FORMAT_CUSTOM1_SHIFT); + BIND_ENUM_CONSTANT(ARRAY_FORMAT_CUSTOM2_SHIFT); + BIND_ENUM_CONSTANT(ARRAY_FORMAT_CUSTOM3_SHIFT); + + BIND_ENUM_CONSTANT(ARRAY_FORMAT_CUSTOM_MASK); + BIND_ENUM_CONSTANT(ARRAY_COMPRESS_FLAGS_BASE); + + BIND_ENUM_CONSTANT(ARRAY_FLAG_USE_2D_VERTICES); + BIND_ENUM_CONSTANT(ARRAY_FLAG_USE_DYNAMIC_UPDATE); + BIND_ENUM_CONSTANT(ARRAY_FLAG_USE_8_BONE_WEIGHTS); + + BIND_ENUM_CONSTANT(PRIMITIVE_POINTS); + BIND_ENUM_CONSTANT(PRIMITIVE_LINES); + BIND_ENUM_CONSTANT(PRIMITIVE_LINE_STRIP); + BIND_ENUM_CONSTANT(PRIMITIVE_TRIANGLES); + BIND_ENUM_CONSTANT(PRIMITIVE_TRIANGLE_STRIP); + BIND_ENUM_CONSTANT(PRIMITIVE_MAX); + + BIND_ENUM_CONSTANT(BLEND_SHAPE_MODE_NORMALIZED); + BIND_ENUM_CONSTANT(BLEND_SHAPE_MODE_RELATIVE); + + /* MULTIMESH API */ + ClassDB::bind_method(D_METHOD("multimesh_create"), &RenderingServer::multimesh_create); ClassDB::bind_method(D_METHOD("multimesh_allocate_data", "multimesh", "instances", "transform_format", "color_format", "custom_data_format"), &RenderingServer::multimesh_allocate_data, DEFVAL(false), DEFVAL(false)); ClassDB::bind_method(D_METHOD("multimesh_get_instance_count", "multimesh"), &RenderingServer::multimesh_get_instance_count); @@ -1511,6 +1815,11 @@ void RenderingServer::_bind_methods() { ClassDB::bind_method(D_METHOD("multimesh_set_buffer", "multimesh", "buffer"), &RenderingServer::multimesh_set_buffer); ClassDB::bind_method(D_METHOD("multimesh_get_buffer", "multimesh"), &RenderingServer::multimesh_get_buffer); + BIND_ENUM_CONSTANT(MULTIMESH_TRANSFORM_2D); + BIND_ENUM_CONSTANT(MULTIMESH_TRANSFORM_3D); + + /* SKELETON API */ + ClassDB::bind_method(D_METHOD("skeleton_create"), &RenderingServer::skeleton_create); ClassDB::bind_method(D_METHOD("skeleton_allocate_data", "skeleton", "bones", "is_2d_skeleton"), &RenderingServer::skeleton_allocate_data, DEFVAL(false)); ClassDB::bind_method(D_METHOD("skeleton_get_bone_count", "skeleton"), &RenderingServer::skeleton_get_bone_count); @@ -1518,8 +1827,10 @@ void RenderingServer::_bind_methods() { ClassDB::bind_method(D_METHOD("skeleton_bone_get_transform", "skeleton", "bone"), &RenderingServer::skeleton_bone_get_transform); ClassDB::bind_method(D_METHOD("skeleton_bone_set_transform_2d", "skeleton", "bone", "transform"), &RenderingServer::skeleton_bone_set_transform_2d); ClassDB::bind_method(D_METHOD("skeleton_bone_get_transform_2d", "skeleton", "bone"), &RenderingServer::skeleton_bone_get_transform_2d); + ClassDB::bind_method(D_METHOD("skeleton_set_base_transform_2d", "skeleton", "base_transform"), &RenderingServer::skeleton_set_base_transform_2d); + + /* Light API */ -#ifndef _3D_DISABLED ClassDB::bind_method(D_METHOD("directional_light_create"), &RenderingServer::directional_light_create); ClassDB::bind_method(D_METHOD("omni_light_create"), &RenderingServer::omni_light_create); ClassDB::bind_method(D_METHOD("spot_light_create"), &RenderingServer::spot_light_create); @@ -1533,6 +1844,7 @@ void RenderingServer::_bind_methods() { ClassDB::bind_method(D_METHOD("light_set_cull_mask", "light", "mask"), &RenderingServer::light_set_cull_mask); ClassDB::bind_method(D_METHOD("light_set_reverse_cull_face_mode", "light", "enabled"), &RenderingServer::light_set_reverse_cull_face_mode); ClassDB::bind_method(D_METHOD("light_set_bake_mode", "light", "bake_mode"), &RenderingServer::light_set_bake_mode); + ClassDB::bind_method(D_METHOD("light_set_max_sdfgi_cascade", "light", "cascade"), &RenderingServer::light_set_max_sdfgi_cascade); ClassDB::bind_method(D_METHOD("light_omni_set_shadow_mode", "light", "mode"), &RenderingServer::light_omni_set_shadow_mode); @@ -1541,6 +1853,58 @@ void RenderingServer::_bind_methods() { ClassDB::bind_method(D_METHOD("light_directional_set_sky_only", "light", "enable"), &RenderingServer::light_directional_set_sky_only); ClassDB::bind_method(D_METHOD("light_directional_set_shadow_depth_range_mode", "light", "range_mode"), &RenderingServer::light_directional_set_shadow_depth_range_mode); + BIND_ENUM_CONSTANT(LIGHT_DIRECTIONAL); + BIND_ENUM_CONSTANT(LIGHT_OMNI); + BIND_ENUM_CONSTANT(LIGHT_SPOT); + + BIND_ENUM_CONSTANT(LIGHT_PARAM_ENERGY); + BIND_ENUM_CONSTANT(LIGHT_PARAM_INDIRECT_ENERGY); + BIND_ENUM_CONSTANT(LIGHT_PARAM_SPECULAR); + BIND_ENUM_CONSTANT(LIGHT_PARAM_RANGE); + BIND_ENUM_CONSTANT(LIGHT_PARAM_SIZE); + BIND_ENUM_CONSTANT(LIGHT_PARAM_ATTENUATION); + BIND_ENUM_CONSTANT(LIGHT_PARAM_SPOT_ANGLE); + BIND_ENUM_CONSTANT(LIGHT_PARAM_SPOT_ATTENUATION); + BIND_ENUM_CONSTANT(LIGHT_PARAM_SHADOW_MAX_DISTANCE); + BIND_ENUM_CONSTANT(LIGHT_PARAM_SHADOW_SPLIT_1_OFFSET); + BIND_ENUM_CONSTANT(LIGHT_PARAM_SHADOW_SPLIT_2_OFFSET); + BIND_ENUM_CONSTANT(LIGHT_PARAM_SHADOW_SPLIT_3_OFFSET); + BIND_ENUM_CONSTANT(LIGHT_PARAM_SHADOW_FADE_START); + BIND_ENUM_CONSTANT(LIGHT_PARAM_SHADOW_NORMAL_BIAS); + BIND_ENUM_CONSTANT(LIGHT_PARAM_SHADOW_BIAS); + BIND_ENUM_CONSTANT(LIGHT_PARAM_SHADOW_PANCAKE_SIZE); + BIND_ENUM_CONSTANT(LIGHT_PARAM_SHADOW_BLUR); + BIND_ENUM_CONSTANT(LIGHT_PARAM_SHADOW_VOLUMETRIC_FOG_FADE); + BIND_ENUM_CONSTANT(LIGHT_PARAM_TRANSMITTANCE_BIAS); + BIND_ENUM_CONSTANT(LIGHT_PARAM_MAX); + + BIND_ENUM_CONSTANT(LIGHT_BAKE_DISABLED); + BIND_ENUM_CONSTANT(LIGHT_BAKE_DYNAMIC); + BIND_ENUM_CONSTANT(LIGHT_BAKE_STATIC); + + BIND_ENUM_CONSTANT(LIGHT_OMNI_SHADOW_DUAL_PARABOLOID); + BIND_ENUM_CONSTANT(LIGHT_OMNI_SHADOW_CUBE); + + BIND_ENUM_CONSTANT(LIGHT_DIRECTIONAL_SHADOW_ORTHOGONAL); + BIND_ENUM_CONSTANT(LIGHT_DIRECTIONAL_SHADOW_PARALLEL_2_SPLITS); + BIND_ENUM_CONSTANT(LIGHT_DIRECTIONAL_SHADOW_PARALLEL_4_SPLITS); + + BIND_ENUM_CONSTANT(LIGHT_DIRECTIONAL_SHADOW_DEPTH_RANGE_STABLE); + BIND_ENUM_CONSTANT(LIGHT_DIRECTIONAL_SHADOW_DEPTH_RANGE_OPTIMIZED); + + ClassDB::bind_method(D_METHOD("shadows_quality_set", "quality"), &RenderingServer::shadows_quality_set); + ClassDB::bind_method(D_METHOD("directional_shadow_quality_set", "quality"), &RenderingServer::directional_shadow_quality_set); + ClassDB::bind_method(D_METHOD("directional_shadow_atlas_set_size", "size", "is_16bits"), &RenderingServer::directional_shadow_atlas_set_size); + + BIND_ENUM_CONSTANT(SHADOW_QUALITY_HARD); + BIND_ENUM_CONSTANT(SHADOW_QUALITY_SOFT_LOW); + BIND_ENUM_CONSTANT(SHADOW_QUALITY_SOFT_MEDIUM); + BIND_ENUM_CONSTANT(SHADOW_QUALITY_SOFT_HIGH); + BIND_ENUM_CONSTANT(SHADOW_QUALITY_SOFT_ULTRA); + BIND_ENUM_CONSTANT(SHADOW_QUALITY_MAX); + + /* REFLECTION PROBE */ + ClassDB::bind_method(D_METHOD("reflection_probe_create"), &RenderingServer::reflection_probe_create); ClassDB::bind_method(D_METHOD("reflection_probe_set_update_mode", "probe", "mode"), &RenderingServer::reflection_probe_set_update_mode); ClassDB::bind_method(D_METHOD("reflection_probe_set_intensity", "probe", "intensity"), &RenderingServer::reflection_probe_set_intensity); @@ -1554,54 +1918,77 @@ void RenderingServer::_bind_methods() { ClassDB::bind_method(D_METHOD("reflection_probe_set_enable_box_projection", "probe", "enable"), &RenderingServer::reflection_probe_set_enable_box_projection); ClassDB::bind_method(D_METHOD("reflection_probe_set_enable_shadows", "probe", "enable"), &RenderingServer::reflection_probe_set_enable_shadows); ClassDB::bind_method(D_METHOD("reflection_probe_set_cull_mask", "probe", "layers"), &RenderingServer::reflection_probe_set_cull_mask); + ClassDB::bind_method(D_METHOD("reflection_probe_set_resolution", "probe", "resolution"), &RenderingServer::reflection_probe_set_resolution); + ClassDB::bind_method(D_METHOD("reflection_probe_set_lod_threshold", "probe", "pixels"), &RenderingServer::reflection_probe_set_lod_threshold); -#ifndef _MSC_VER -#warning TODO all voxel_gi methods need re-binding -#endif -#if 0 - ClassDB::bind_method(D_METHOD("voxel_gi_create"), &RenderingServer::voxel_gi_create); - ClassDB::bind_method(D_METHOD("voxel_gi_set_bounds", "probe", "bounds"), &RenderingServer::voxel_gi_set_bounds); - ClassDB::bind_method(D_METHOD("voxel_gi_get_bounds", "probe"), &RenderingServer::voxel_gi_get_bounds); - ClassDB::bind_method(D_METHOD("voxel_gi_set_cell_size", "probe", "range"), &RenderingServer::voxel_gi_set_cell_size); - ClassDB::bind_method(D_METHOD("voxel_gi_get_cell_size", "probe"), &RenderingServer::voxel_gi_get_cell_size); - ClassDB::bind_method(D_METHOD("voxel_gi_set_to_cell_xform", "probe", "xform"), &RenderingServer::voxel_gi_set_to_cell_xform); - ClassDB::bind_method(D_METHOD("voxel_gi_get_to_cell_xform", "probe"), &RenderingServer::voxel_gi_get_to_cell_xform); - ClassDB::bind_method(D_METHOD("voxel_gi_set_dynamic_data", "probe", "data"), &RenderingServer::voxel_gi_set_dynamic_data); - ClassDB::bind_method(D_METHOD("voxel_gi_get_dynamic_data", "probe"), &RenderingServer::voxel_gi_get_dynamic_data); - ClassDB::bind_method(D_METHOD("voxel_gi_set_dynamic_range", "probe", "range"), &RenderingServer::voxel_gi_set_dynamic_range); - ClassDB::bind_method(D_METHOD("voxel_gi_get_dynamic_range", "probe"), &RenderingServer::voxel_gi_get_dynamic_range); - ClassDB::bind_method(D_METHOD("voxel_gi_set_energy", "probe", "energy"), &RenderingServer::voxel_gi_set_energy); - ClassDB::bind_method(D_METHOD("voxel_gi_get_energy", "probe"), &RenderingServer::voxel_gi_get_energy); - ClassDB::bind_method(D_METHOD("voxel_gi_set_bias", "probe", "bias"), &RenderingServer::voxel_gi_set_bias); - ClassDB::bind_method(D_METHOD("voxel_gi_get_bias", "probe"), &RenderingServer::voxel_gi_get_bias); - ClassDB::bind_method(D_METHOD("voxel_gi_set_normal_bias", "probe", "bias"), &RenderingServer::voxel_gi_set_normal_bias); - ClassDB::bind_method(D_METHOD("voxel_gi_get_normal_bias", "probe"), &RenderingServer::voxel_gi_get_normal_bias); - ClassDB::bind_method(D_METHOD("voxel_gi_set_propagation", "probe", "propagation"), &RenderingServer::voxel_gi_set_propagation); - ClassDB::bind_method(D_METHOD("voxel_gi_get_propagation", "probe"), &RenderingServer::voxel_gi_get_propagation); - ClassDB::bind_method(D_METHOD("voxel_gi_set_interior", "probe", "enable"), &RenderingServer::voxel_gi_set_interior); - ClassDB::bind_method(D_METHOD("voxel_gi_is_interior", "probe"), &RenderingServer::voxel_gi_is_interior); - ClassDB::bind_method(D_METHOD("voxel_gi_set_compress", "probe", "enable"), &RenderingServer::voxel_gi_set_compress); - ClassDB::bind_method(D_METHOD("voxel_gi_is_compressed", "probe"), &RenderingServer::voxel_gi_is_compressed); -#endif - /* - ClassDB::bind_method(D_METHOD("lightmap_create()"), &RenderingServer::lightmap_capture_create); - ClassDB::bind_method(D_METHOD("lightmap_capture_set_bounds", "capture", "bounds"), &RenderingServer::lightmap_capture_set_bounds); - ClassDB::bind_method(D_METHOD("lightmap_capture_get_bounds", "capture"), &RenderingServer::lightmap_capture_get_bounds); - ClassDB::bind_method(D_METHOD("lightmap_capture_set_octree", "capture", "octree"), &RenderingServer::lightmap_capture_set_octree); - ClassDB::bind_method(D_METHOD("lightmap_capture_set_octree_cell_transform", "capture", "xform"), &RenderingServer::lightmap_capture_set_octree_cell_transform); - ClassDB::bind_method(D_METHOD("lightmap_capture_get_octree_cell_transform", "capture"), &RenderingServer::lightmap_capture_get_octree_cell_transform); - ClassDB::bind_method(D_METHOD("lightmap_capture_set_octree_cell_subdiv", "capture", "subdiv"), &RenderingServer::lightmap_capture_set_octree_cell_subdiv); - ClassDB::bind_method(D_METHOD("lightmap_capture_get_octree_cell_subdiv", "capture"), &RenderingServer::lightmap_capture_get_octree_cell_subdiv); - ClassDB::bind_method(D_METHOD("lightmap_capture_get_octree", "capture"), &RenderingServer::lightmap_capture_get_octree); - ClassDB::bind_method(D_METHOD("lightmap_capture_set_energy", "capture", "energy"), &RenderingServer::lightmap_capture_set_energy); - ClassDB::bind_method(D_METHOD("lightmap_capture_get_energy", "capture"), &RenderingServer::lightmap_capture_get_energy); -*/ + BIND_ENUM_CONSTANT(REFLECTION_PROBE_UPDATE_ONCE); + BIND_ENUM_CONSTANT(REFLECTION_PROBE_UPDATE_ALWAYS); - ClassDB::bind_method(D_METHOD("occluder_create"), &RenderingServer::occluder_create); - ClassDB::bind_method(D_METHOD("occluder_set_mesh"), &RenderingServer::occluder_set_mesh); + BIND_ENUM_CONSTANT(REFLECTION_PROBE_AMBIENT_DISABLED); + BIND_ENUM_CONSTANT(REFLECTION_PROBE_AMBIENT_ENVIRONMENT); + BIND_ENUM_CONSTANT(REFLECTION_PROBE_AMBIENT_COLOR); + + /* DECAL */ + + ClassDB::bind_method(D_METHOD("decal_create"), &RenderingServer::decal_create); + ClassDB::bind_method(D_METHOD("decal_set_extents", "decal", "extents"), &RenderingServer::decal_set_extents); + ClassDB::bind_method(D_METHOD("decal_set_texture", "decal", "type", "texture"), &RenderingServer::decal_set_texture); + ClassDB::bind_method(D_METHOD("decal_set_emission_energy", "decal", "energy"), &RenderingServer::decal_set_emission_energy); + ClassDB::bind_method(D_METHOD("decal_set_albedo_mix", "decal", "albedo_mix"), &RenderingServer::decal_set_albedo_mix); + ClassDB::bind_method(D_METHOD("decal_set_modulate", "decal", "color"), &RenderingServer::decal_set_modulate); + ClassDB::bind_method(D_METHOD("decal_set_cull_mask", "decal", "mask"), &RenderingServer::decal_set_cull_mask); + ClassDB::bind_method(D_METHOD("decal_set_distance_fade", "decal", "enabled", "begin", "length"), &RenderingServer::decal_set_distance_fade); + ClassDB::bind_method(D_METHOD("decal_set_fade", "decal", "above", "below"), &RenderingServer::decal_set_fade); + ClassDB::bind_method(D_METHOD("decal_set_normal_fade", "decal", "fade"), &RenderingServer::decal_set_normal_fade); + + BIND_ENUM_CONSTANT(DECAL_TEXTURE_ALBEDO); + BIND_ENUM_CONSTANT(DECAL_TEXTURE_NORMAL); + BIND_ENUM_CONSTANT(DECAL_TEXTURE_ORM); + BIND_ENUM_CONSTANT(DECAL_TEXTURE_EMISSION); + BIND_ENUM_CONSTANT(DECAL_TEXTURE_MAX); + + /* VOXEL GI API */ + + ClassDB::bind_method(D_METHOD("voxel_gi_create"), &RenderingServer::voxel_gi_create); + ClassDB::bind_method(D_METHOD("voxel_gi_allocate_data", "voxel_gi", "to_cell_xform", "aabb", "octree_size", "octree_cells", "data_cells", "distance_field", "level_counts"), &RenderingServer::voxel_gi_allocate_data); + ClassDB::bind_method(D_METHOD("voxel_gi_get_octree_size", "voxel_gi"), &RenderingServer::voxel_gi_get_octree_size); + ClassDB::bind_method(D_METHOD("voxel_gi_get_octree_cells", "voxel_gi"), &RenderingServer::voxel_gi_get_octree_cells); + ClassDB::bind_method(D_METHOD("voxel_gi_get_data_cells", "voxel_gi"), &RenderingServer::voxel_gi_get_data_cells); + ClassDB::bind_method(D_METHOD("voxel_gi_get_distance_field", "voxel_gi"), &RenderingServer::voxel_gi_get_distance_field); + ClassDB::bind_method(D_METHOD("voxel_gi_get_level_counts", "voxel_gi"), &RenderingServer::voxel_gi_get_level_counts); + ClassDB::bind_method(D_METHOD("voxel_gi_get_to_cell_xform", "voxel_gi"), &RenderingServer::voxel_gi_get_to_cell_xform); + + ClassDB::bind_method(D_METHOD("voxel_gi_set_dynamic_range", "voxel_gi", "range"), &RenderingServer::voxel_gi_set_dynamic_range); + ClassDB::bind_method(D_METHOD("voxel_gi_set_propagation", "voxel_gi", "amount"), &RenderingServer::voxel_gi_set_propagation); + ClassDB::bind_method(D_METHOD("voxel_gi_set_energy", "voxel_gi", "energy"), &RenderingServer::voxel_gi_set_energy); + ClassDB::bind_method(D_METHOD("voxel_gi_set_bias", "voxel_gi", "bias"), &RenderingServer::voxel_gi_set_bias); + ClassDB::bind_method(D_METHOD("voxel_gi_set_normal_bias", "voxel_gi", "bias"), &RenderingServer::voxel_gi_set_normal_bias); + ClassDB::bind_method(D_METHOD("voxel_gi_set_interior", "voxel_gi", "enable"), &RenderingServer::voxel_gi_set_interior); + ClassDB::bind_method(D_METHOD("voxel_gi_set_use_two_bounces", "voxel_gi", "enable"), &RenderingServer::voxel_gi_set_use_two_bounces); + + ClassDB::bind_method(D_METHOD("voxel_gi_set_quality", "quality"), &RenderingServer::voxel_gi_set_quality); + + BIND_ENUM_CONSTANT(VOXEL_GI_QUALITY_LOW); + BIND_ENUM_CONSTANT(VOXEL_GI_QUALITY_HIGH); + + /* LIGHTMAP */ + + ClassDB::bind_method(D_METHOD("lightmap_create"), &RenderingServer::lightmap_create); + ClassDB::bind_method(D_METHOD("lightmap_set_textures", "lightmap", "light", "uses_sh"), &RenderingServer::lightmap_set_textures); + ClassDB::bind_method(D_METHOD("lightmap_set_probe_bounds", "lightmap", "bounds"), &RenderingServer::lightmap_set_probe_bounds); + ClassDB::bind_method(D_METHOD("lightmap_set_probe_interior", "lightmap", "interior"), &RenderingServer::lightmap_set_probe_interior); + ClassDB::bind_method(D_METHOD("lightmap_set_probe_capture_data", "lightmap", "points", "point_sh", "tetrahedra", "bsp_tree"), &RenderingServer::lightmap_set_probe_capture_data); + ClassDB::bind_method(D_METHOD("lightmap_get_probe_capture_points", "lightmap"), &RenderingServer::lightmap_get_probe_capture_points); + ClassDB::bind_method(D_METHOD("lightmap_get_probe_capture_sh", "lightmap"), &RenderingServer::lightmap_get_probe_capture_sh); + ClassDB::bind_method(D_METHOD("lightmap_get_probe_capture_tetrahedra", "lightmap"), &RenderingServer::lightmap_get_probe_capture_tetrahedra); + ClassDB::bind_method(D_METHOD("lightmap_get_probe_capture_bsp_tree", "lightmap"), &RenderingServer::lightmap_get_probe_capture_bsp_tree); + + ClassDB::bind_method(D_METHOD("lightmap_set_probe_capture_update_speed", "speed"), &RenderingServer::lightmap_set_probe_capture_update_speed); + + /* PARTICLES API */ -#endif ClassDB::bind_method(D_METHOD("particles_create"), &RenderingServer::particles_create); + ClassDB::bind_method(D_METHOD("particles_set_mode", "particles", "mode"), &RenderingServer::particles_set_mode); ClassDB::bind_method(D_METHOD("particles_set_emitting", "particles", "emitting"), &RenderingServer::particles_set_emitting); ClassDB::bind_method(D_METHOD("particles_get_emitting", "particles"), &RenderingServer::particles_get_emitting); ClassDB::bind_method(D_METHOD("particles_set_amount", "particles", "amount"), &RenderingServer::particles_set_amount); @@ -1615,25 +2002,101 @@ void RenderingServer::_bind_methods() { ClassDB::bind_method(D_METHOD("particles_set_use_local_coordinates", "particles", "enable"), &RenderingServer::particles_set_use_local_coordinates); ClassDB::bind_method(D_METHOD("particles_set_process_material", "particles", "material"), &RenderingServer::particles_set_process_material); ClassDB::bind_method(D_METHOD("particles_set_fixed_fps", "particles", "fps"), &RenderingServer::particles_set_fixed_fps); + ClassDB::bind_method(D_METHOD("particles_set_interpolate", "particles", "enable"), &RenderingServer::particles_set_interpolate); ClassDB::bind_method(D_METHOD("particles_set_fractional_delta", "particles", "enable"), &RenderingServer::particles_set_fractional_delta); + ClassDB::bind_method(D_METHOD("particles_set_collision_base_size", "particles", "size"), &RenderingServer::particles_set_collision_base_size); + ClassDB::bind_method(D_METHOD("particles_set_transform_align", "particles", "align"), &RenderingServer::particles_set_transform_align); + ClassDB::bind_method(D_METHOD("particles_set_trails", "particles", "enable", "length_sec"), &RenderingServer::particles_set_trails); + ClassDB::bind_method(D_METHOD("particles_set_trail_bind_poses", "particles", "bind_poses"), &RenderingServer::_particles_set_trail_bind_poses); + ClassDB::bind_method(D_METHOD("particles_is_inactive", "particles"), &RenderingServer::particles_is_inactive); ClassDB::bind_method(D_METHOD("particles_request_process", "particles"), &RenderingServer::particles_request_process); ClassDB::bind_method(D_METHOD("particles_restart", "particles"), &RenderingServer::particles_restart); + + ClassDB::bind_method(D_METHOD("particles_set_subemitter", "particles", "subemitter_particles"), &RenderingServer::particles_set_subemitter); + ClassDB::bind_method(D_METHOD("particles_emit", "particles", "transform", "velocity", "color", "custom", "emit_flags"), &RenderingServer::particles_emit); + ClassDB::bind_method(D_METHOD("particles_set_draw_order", "particles", "order"), &RenderingServer::particles_set_draw_order); ClassDB::bind_method(D_METHOD("particles_set_draw_passes", "particles", "count"), &RenderingServer::particles_set_draw_passes); ClassDB::bind_method(D_METHOD("particles_set_draw_pass_mesh", "particles", "pass", "mesh"), &RenderingServer::particles_set_draw_pass_mesh); ClassDB::bind_method(D_METHOD("particles_get_current_aabb", "particles"), &RenderingServer::particles_get_current_aabb); ClassDB::bind_method(D_METHOD("particles_set_emission_transform", "particles", "transform"), &RenderingServer::particles_set_emission_transform); - ClassDB::bind_method(D_METHOD("camera_create"), &RenderingServer::camera_create); - ClassDB::bind_method(D_METHOD("camera_set_perspective", "camera", "fovy_degrees", "z_near", "z_far"), &RenderingServer::camera_set_perspective); - ClassDB::bind_method(D_METHOD("camera_set_orthogonal", "camera", "size", "z_near", "z_far"), &RenderingServer::camera_set_orthogonal); - ClassDB::bind_method(D_METHOD("camera_set_frustum", "camera", "size", "offset", "z_near", "z_far"), &RenderingServer::camera_set_frustum); - ClassDB::bind_method(D_METHOD("camera_set_transform", "camera", "transform"), &RenderingServer::camera_set_transform); - ClassDB::bind_method(D_METHOD("camera_set_cull_mask", "camera", "layers"), &RenderingServer::camera_set_cull_mask); + BIND_ENUM_CONSTANT(PARTICLES_MODE_2D); + BIND_ENUM_CONSTANT(PARTICLES_MODE_3D); + + BIND_ENUM_CONSTANT(PARTICLES_TRANSFORM_ALIGN_DISABLED); + BIND_ENUM_CONSTANT(PARTICLES_TRANSFORM_ALIGN_Z_BILLBOARD); + BIND_ENUM_CONSTANT(PARTICLES_TRANSFORM_ALIGN_Y_TO_VELOCITY); + BIND_ENUM_CONSTANT(PARTICLES_TRANSFORM_ALIGN_Z_BILLBOARD_Y_TO_VELOCITY); + + BIND_CONSTANT(PARTICLES_EMIT_FLAG_POSITION); + BIND_CONSTANT(PARTICLES_EMIT_FLAG_ROTATION_SCALE); + BIND_CONSTANT(PARTICLES_EMIT_FLAG_VELOCITY); + BIND_CONSTANT(PARTICLES_EMIT_FLAG_COLOR); + BIND_CONSTANT(PARTICLES_EMIT_FLAG_CUSTOM); + + BIND_ENUM_CONSTANT(PARTICLES_DRAW_ORDER_INDEX); + BIND_ENUM_CONSTANT(PARTICLES_DRAW_ORDER_LIFETIME); + BIND_ENUM_CONSTANT(PARTICLES_DRAW_ORDER_REVERSE_LIFETIME); + BIND_ENUM_CONSTANT(PARTICLES_DRAW_ORDER_VIEW_DEPTH); + + /* PARTICLES COLLISION */ + + ClassDB::bind_method(D_METHOD("particles_collision_create"), &RenderingServer::particles_collision_create); + ClassDB::bind_method(D_METHOD("particles_collision_set_collision_type", "particles_collision", "type"), &RenderingServer::particles_collision_set_collision_type); + ClassDB::bind_method(D_METHOD("particles_collision_set_cull_mask", "particles_collision", "mask"), &RenderingServer::particles_collision_set_cull_mask); + ClassDB::bind_method(D_METHOD("particles_collision_set_sphere_radius", "particles_collision", "radius"), &RenderingServer::particles_collision_set_sphere_radius); + ClassDB::bind_method(D_METHOD("particles_collision_set_box_extents", "particles_collision", "extents"), &RenderingServer::particles_collision_set_box_extents); + ClassDB::bind_method(D_METHOD("particles_collision_set_attractor_strength", "particles_collision", "setrngth"), &RenderingServer::particles_collision_set_attractor_strength); + ClassDB::bind_method(D_METHOD("particles_collision_set_attractor_directionality", "particles_collision", "amount"), &RenderingServer::particles_collision_set_attractor_directionality); + ClassDB::bind_method(D_METHOD("particles_collision_set_attractor_attenuation", "particles_collision", "curve"), &RenderingServer::particles_collision_set_attractor_attenuation); + ClassDB::bind_method(D_METHOD("particles_collision_set_field_texture", "particles_collision", "texture"), &RenderingServer::particles_collision_set_field_texture); + + ClassDB::bind_method(D_METHOD("particles_collision_height_field_update", "particles_collision"), &RenderingServer::particles_collision_height_field_update); + ClassDB::bind_method(D_METHOD("particles_collision_set_height_field_resolution", "particles_collision", "resolution"), &RenderingServer::particles_collision_set_height_field_resolution); + + BIND_ENUM_CONSTANT(PARTICLES_COLLISION_TYPE_SPHERE_ATTRACT); + BIND_ENUM_CONSTANT(PARTICLES_COLLISION_TYPE_BOX_ATTRACT); + BIND_ENUM_CONSTANT(PARTICLES_COLLISION_TYPE_VECTOR_FIELD_ATTRACT); + BIND_ENUM_CONSTANT(PARTICLES_COLLISION_TYPE_SPHERE_COLLIDE); + BIND_ENUM_CONSTANT(PARTICLES_COLLISION_TYPE_BOX_COLLIDE); + BIND_ENUM_CONSTANT(PARTICLES_COLLISION_TYPE_SDF_COLLIDE); + BIND_ENUM_CONSTANT(PARTICLES_COLLISION_TYPE_HEIGHTFIELD_COLLIDE); + + BIND_ENUM_CONSTANT(PARTICLES_COLLISION_HEIGHTFIELD_RESOLUTION_256); + BIND_ENUM_CONSTANT(PARTICLES_COLLISION_HEIGHTFIELD_RESOLUTION_512); + BIND_ENUM_CONSTANT(PARTICLES_COLLISION_HEIGHTFIELD_RESOLUTION_1024); + BIND_ENUM_CONSTANT(PARTICLES_COLLISION_HEIGHTFIELD_RESOLUTION_2048); + BIND_ENUM_CONSTANT(PARTICLES_COLLISION_HEIGHTFIELD_RESOLUTION_4096); + BIND_ENUM_CONSTANT(PARTICLES_COLLISION_HEIGHTFIELD_RESOLUTION_8192); + BIND_ENUM_CONSTANT(PARTICLES_COLLISION_HEIGHTFIELD_RESOLUTION_MAX); + + /* VISIBILITY NOTIFIER */ + + ClassDB::bind_method(D_METHOD("visibility_notifier_create"), &RenderingServer::visibility_notifier_create); + ClassDB::bind_method(D_METHOD("visibility_notifier_set_aabb", "notifier", "aabb"), &RenderingServer::visibility_notifier_set_aabb); + ClassDB::bind_method(D_METHOD("visibility_notifier_set_callbacks", "notifier", "enter_callable", "exit_callable"), &RenderingServer::visibility_notifier_set_callbacks); + + /* OCCLUDER */ + + ClassDB::bind_method(D_METHOD("occluder_create"), &RenderingServer::occluder_create); + ClassDB::bind_method(D_METHOD("occluder_set_mesh", "occluder", "vertices", "indices"), &RenderingServer::occluder_set_mesh); + + /* CAMERA */ + + ClassDB::bind_method(D_METHOD("camera_create"), &RenderingServer::camera_create); + ClassDB::bind_method(D_METHOD("camera_set_perspective", "camera", "fovy_degrees", "z_near", "z_far"), &RenderingServer::camera_set_perspective); + ClassDB::bind_method(D_METHOD("camera_set_orthogonal", "camera", "size", "z_near", "z_far"), &RenderingServer::camera_set_orthogonal); + ClassDB::bind_method(D_METHOD("camera_set_frustum", "camera", "size", "offset", "z_near", "z_far"), &RenderingServer::camera_set_frustum); + ClassDB::bind_method(D_METHOD("camera_set_transform", "camera", "transform"), &RenderingServer::camera_set_transform); + ClassDB::bind_method(D_METHOD("camera_set_cull_mask", "camera", "layers"), &RenderingServer::camera_set_cull_mask); ClassDB::bind_method(D_METHOD("camera_set_environment", "camera", "env"), &RenderingServer::camera_set_environment); + ClassDB::bind_method(D_METHOD("camera_set_camera_effects", "camera", "effects"), &RenderingServer::camera_set_camera_effects); ClassDB::bind_method(D_METHOD("camera_set_use_vertical_aspect", "camera", "enable"), &RenderingServer::camera_set_use_vertical_aspect); + /* VIEWPORT */ + ClassDB::bind_method(D_METHOD("viewport_create"), &RenderingServer::viewport_create); ClassDB::bind_method(D_METHOD("viewport_set_use_xr", "viewport", "use_xr"), &RenderingServer::viewport_set_use_xr); ClassDB::bind_method(D_METHOD("viewport_set_size", "viewport", "width", "height"), &RenderingServer::viewport_set_size); @@ -1645,20 +2108,31 @@ void RenderingServer::_bind_methods() { ClassDB::bind_method(D_METHOD("viewport_set_update_mode", "viewport", "update_mode"), &RenderingServer::viewport_set_update_mode); ClassDB::bind_method(D_METHOD("viewport_set_clear_mode", "viewport", "clear_mode"), &RenderingServer::viewport_set_clear_mode); ClassDB::bind_method(D_METHOD("viewport_get_texture", "viewport"), &RenderingServer::viewport_get_texture); - ClassDB::bind_method(D_METHOD("viewport_set_hide_scenario", "viewport", "hidden"), &RenderingServer::viewport_set_hide_scenario); - ClassDB::bind_method(D_METHOD("viewport_set_hide_canvas", "viewport", "hidden"), &RenderingServer::viewport_set_hide_canvas); + ClassDB::bind_method(D_METHOD("viewport_set_disable_3d", "viewport", "disable"), &RenderingServer::viewport_set_disable_3d); + ClassDB::bind_method(D_METHOD("viewport_set_disable_2d", "viewport", "disable"), &RenderingServer::viewport_set_disable_2d); ClassDB::bind_method(D_METHOD("viewport_set_disable_environment", "viewport", "disabled"), &RenderingServer::viewport_set_disable_environment); ClassDB::bind_method(D_METHOD("viewport_attach_camera", "viewport", "camera"), &RenderingServer::viewport_attach_camera); ClassDB::bind_method(D_METHOD("viewport_set_scenario", "viewport", "scenario"), &RenderingServer::viewport_set_scenario); ClassDB::bind_method(D_METHOD("viewport_attach_canvas", "viewport", "canvas"), &RenderingServer::viewport_attach_canvas); ClassDB::bind_method(D_METHOD("viewport_remove_canvas", "viewport", "canvas"), &RenderingServer::viewport_remove_canvas); + ClassDB::bind_method(D_METHOD("viewport_set_snap_2d_transforms_to_pixel", "viewport", "enabled"), &RenderingServer::viewport_set_snap_2d_transforms_to_pixel); + ClassDB::bind_method(D_METHOD("viewport_set_snap_2d_vertices_to_pixel", "viewport", "enabled"), &RenderingServer::viewport_set_snap_2d_vertices_to_pixel); + + ClassDB::bind_method(D_METHOD("viewport_set_default_canvas_item_texture_filter", "viewport", "filter"), &RenderingServer::viewport_set_default_canvas_item_texture_filter); + ClassDB::bind_method(D_METHOD("viewport_set_default_canvas_item_texture_repeat", "viewport", "repeat"), &RenderingServer::viewport_set_default_canvas_item_texture_repeat); + ClassDB::bind_method(D_METHOD("viewport_set_canvas_transform", "viewport", "canvas", "offset"), &RenderingServer::viewport_set_canvas_transform); + ClassDB::bind_method(D_METHOD("viewport_set_canvas_stacking", "viewport", "canvas", "layer", "sublayer"), &RenderingServer::viewport_set_canvas_stacking); + ClassDB::bind_method(D_METHOD("viewport_set_transparent_background", "viewport", "enabled"), &RenderingServer::viewport_set_transparent_background); ClassDB::bind_method(D_METHOD("viewport_set_global_canvas_transform", "viewport", "transform"), &RenderingServer::viewport_set_global_canvas_transform); - ClassDB::bind_method(D_METHOD("viewport_set_canvas_stacking", "viewport", "canvas", "layer", "sublayer"), &RenderingServer::viewport_set_canvas_stacking); + + ClassDB::bind_method(D_METHOD("viewport_set_sdf_oversize_and_scale", "viewport", "oversize", "scale"), &RenderingServer::viewport_set_sdf_oversize_and_scale); + ClassDB::bind_method(D_METHOD("viewport_set_shadow_atlas_size", "viewport", "size", "use_16_bits"), &RenderingServer::viewport_set_shadow_atlas_size, DEFVAL(false)); ClassDB::bind_method(D_METHOD("viewport_set_shadow_atlas_quadrant_subdivision", "viewport", "quadrant", "subdivision"), &RenderingServer::viewport_set_shadow_atlas_quadrant_subdivision); ClassDB::bind_method(D_METHOD("viewport_set_msaa", "viewport", "msaa"), &RenderingServer::viewport_set_msaa); + ClassDB::bind_method(D_METHOD("viewport_set_screen_space_aa", "viewport", "mode"), &RenderingServer::viewport_set_screen_space_aa); ClassDB::bind_method(D_METHOD("viewport_set_use_debanding", "viewport", "enable"), &RenderingServer::viewport_set_use_debanding); ClassDB::bind_method(D_METHOD("viewport_set_use_occlusion_culling", "viewport", "enable"), &RenderingServer::viewport_set_use_occlusion_culling); ClassDB::bind_method(D_METHOD("viewport_set_occlusion_rays_per_thread", "rays_per_thread"), &RenderingServer::viewport_set_occlusion_rays_per_thread); @@ -1669,314 +2143,12 @@ void RenderingServer::_bind_methods() { ClassDB::bind_method(D_METHOD("viewport_set_measure_render_time", "viewport", "enable"), &RenderingServer::viewport_set_measure_render_time); ClassDB::bind_method(D_METHOD("viewport_get_measured_render_time_cpu", "viewport"), &RenderingServer::viewport_get_measured_render_time_cpu); - ClassDB::bind_method(D_METHOD("viewport_get_measured_render_time_gpu", "viewport"), &RenderingServer::viewport_get_measured_render_time_gpu); - - ClassDB::bind_method(D_METHOD("environment_create"), &RenderingServer::environment_create); - ClassDB::bind_method(D_METHOD("environment_set_background", "env", "bg"), &RenderingServer::environment_set_background); - ClassDB::bind_method(D_METHOD("environment_set_sky", "env", "sky"), &RenderingServer::environment_set_sky); - ClassDB::bind_method(D_METHOD("environment_set_sky_custom_fov", "env", "scale"), &RenderingServer::environment_set_sky_custom_fov); - ClassDB::bind_method(D_METHOD("environment_set_sky_orientation", "env", "orientation"), &RenderingServer::environment_set_sky_orientation); - ClassDB::bind_method(D_METHOD("environment_set_bg_color", "env", "color"), &RenderingServer::environment_set_bg_color); - ClassDB::bind_method(D_METHOD("environment_set_bg_energy", "env", "energy"), &RenderingServer::environment_set_bg_energy); - ClassDB::bind_method(D_METHOD("environment_set_canvas_max_layer", "env", "max_layer"), &RenderingServer::environment_set_canvas_max_layer); - ClassDB::bind_method(D_METHOD("environment_set_ambient_light", "env", "color", "ambient", "energy", "sky_contibution", "reflection_source", "ao_color"), &RenderingServer::environment_set_ambient_light, DEFVAL(RS::ENV_AMBIENT_SOURCE_BG), DEFVAL(1.0), DEFVAL(0.0), DEFVAL(RS::ENV_REFLECTION_SOURCE_BG), DEFVAL(Color())); - ClassDB::bind_method(D_METHOD("environment_set_glow", "env", "enable", "levels", "intensity", "strength", "mix", "bloom_threshold", "blend_mode", "hdr_bleed_threshold", "hdr_bleed_scale", "hdr_luminance_cap"), &RenderingServer::environment_set_glow); - ClassDB::bind_method(D_METHOD("environment_set_tonemap", "env", "tone_mapper", "exposure", "white", "auto_exposure", "min_luminance", "max_luminance", "auto_exp_speed", "auto_exp_grey"), &RenderingServer::environment_set_tonemap); - ClassDB::bind_method(D_METHOD("environment_set_adjustment", "env", "enable", "brightness", "contrast", "saturation", "use_1d_color_correction", "color_correction"), &RenderingServer::environment_set_adjustment); - ClassDB::bind_method(D_METHOD("environment_set_ssr", "env", "enable", "max_steps", "fade_in", "fade_out", "depth_tolerance"), &RenderingServer::environment_set_ssr); - ClassDB::bind_method(D_METHOD("environment_set_ssao", "env", "enable", "radius", "intensity", "power", "detail", "horizon", "sharpness", "light_affect", "ao_channel_affect"), &RenderingServer::environment_set_ssao); - ClassDB::bind_method(D_METHOD("environment_set_fog", "env", "enable", "light_color", "light_energy", "sun_scatter", "density", "height", "height_density", "aerial_perspective"), &RenderingServer::environment_set_fog); - - ClassDB::bind_method(D_METHOD("scenario_create"), &RenderingServer::scenario_create); - ClassDB::bind_method(D_METHOD("scenario_set_debug", "scenario", "debug_mode"), &RenderingServer::scenario_set_debug); - ClassDB::bind_method(D_METHOD("scenario_set_environment", "scenario", "environment"), &RenderingServer::scenario_set_environment); - ClassDB::bind_method(D_METHOD("scenario_set_camera_effects", "scenario", "effects"), &RenderingServer::scenario_set_camera_effects); - ClassDB::bind_method(D_METHOD("scenario_set_fallback_environment", "scenario", "environment"), &RenderingServer::scenario_set_fallback_environment); - -#ifndef _3D_DISABLED - - ClassDB::bind_method(D_METHOD("instance_create2", "base", "scenario"), &RenderingServer::instance_create2); - ClassDB::bind_method(D_METHOD("instance_create"), &RenderingServer::instance_create); - ClassDB::bind_method(D_METHOD("instance_set_base", "instance", "base"), &RenderingServer::instance_set_base); - ClassDB::bind_method(D_METHOD("instance_set_scenario", "instance", "scenario"), &RenderingServer::instance_set_scenario); - ClassDB::bind_method(D_METHOD("instance_set_layer_mask", "instance", "mask"), &RenderingServer::instance_set_layer_mask); - ClassDB::bind_method(D_METHOD("instance_set_transform", "instance", "transform"), &RenderingServer::instance_set_transform); - ClassDB::bind_method(D_METHOD("instance_attach_object_instance_id", "instance", "id"), &RenderingServer::instance_attach_object_instance_id); - ClassDB::bind_method(D_METHOD("instance_set_blend_shape_weight", "instance", "shape", "weight"), &RenderingServer::instance_set_blend_shape_weight); - ClassDB::bind_method(D_METHOD("instance_set_surface_override_material", "instance", "surface", "material"), &RenderingServer::instance_set_surface_override_material); - ClassDB::bind_method(D_METHOD("instance_set_visible", "instance", "visible"), &RenderingServer::instance_set_visible); - // ClassDB::bind_method(D_METHOD("instance_set_use_lightmap", "instance", "lightmap_instance", "lightmap"), &RenderingServer::instance_set_use_lightmap); - ClassDB::bind_method(D_METHOD("instance_set_custom_aabb", "instance", "aabb"), &RenderingServer::instance_set_custom_aabb); - ClassDB::bind_method(D_METHOD("instance_attach_skeleton", "instance", "skeleton"), &RenderingServer::instance_attach_skeleton); - ClassDB::bind_method(D_METHOD("instance_set_exterior", "instance", "enabled"), &RenderingServer::instance_set_exterior); - ClassDB::bind_method(D_METHOD("instance_set_extra_visibility_margin", "instance", "margin"), &RenderingServer::instance_set_extra_visibility_margin); - ClassDB::bind_method(D_METHOD("instance_set_visibility_parent", "instance", "parent"), &RenderingServer::instance_set_visibility_parent); - ClassDB::bind_method(D_METHOD("instance_geometry_set_flag", "instance", "flag", "enabled"), &RenderingServer::instance_geometry_set_flag); - ClassDB::bind_method(D_METHOD("instance_geometry_set_cast_shadows_setting", "instance", "shadow_casting_setting"), &RenderingServer::instance_geometry_set_cast_shadows_setting); - ClassDB::bind_method(D_METHOD("instance_geometry_set_material_override", "instance", "material"), &RenderingServer::instance_geometry_set_material_override); - ClassDB::bind_method(D_METHOD("instance_geometry_set_visibility_range", "instance", "min", "max", "min_margin", "max_margin"), &RenderingServer::instance_geometry_set_visibility_range); - - ClassDB::bind_method(D_METHOD("instances_cull_aabb", "aabb", "scenario"), &RenderingServer::_instances_cull_aabb_bind, DEFVAL(RID())); - ClassDB::bind_method(D_METHOD("instances_cull_ray", "from", "to", "scenario"), &RenderingServer::_instances_cull_ray_bind, DEFVAL(RID())); - ClassDB::bind_method(D_METHOD("instances_cull_convex", "convex", "scenario"), &RenderingServer::_instances_cull_convex_bind, DEFVAL(RID())); -#endif - ClassDB::bind_method(D_METHOD("canvas_create"), &RenderingServer::canvas_create); - ClassDB::bind_method(D_METHOD("canvas_set_item_mirroring", "canvas", "item", "mirroring"), &RenderingServer::canvas_set_item_mirroring); - ClassDB::bind_method(D_METHOD("canvas_set_modulate", "canvas", "color"), &RenderingServer::canvas_set_modulate); -#ifndef _MSC_VER -#warning TODO method bindings need to be fixed -#endif -#if 0 - - ClassDB::bind_method(D_METHOD("canvas_item_create"), &RenderingServer::canvas_item_create); - ClassDB::bind_method(D_METHOD("canvas_item_set_parent", "item", "parent"), &RenderingServer::canvas_item_set_parent); - ClassDB::bind_method(D_METHOD("canvas_item_set_visible", "item", "visible"), &RenderingServer::canvas_item_set_visible); - ClassDB::bind_method(D_METHOD("canvas_item_set_light_mask", "item", "mask"), &RenderingServer::canvas_item_set_light_mask); - ClassDB::bind_method(D_METHOD("canvas_item_set_transform", "item", "transform"), &RenderingServer::canvas_item_set_transform); - ClassDB::bind_method(D_METHOD("canvas_item_set_clip", "item", "clip"), &RenderingServer::canvas_item_set_clip); - ClassDB::bind_method(D_METHOD("canvas_item_set_distance_field_mode", "item", "enabled"), &RenderingServer::canvas_item_set_distance_field_mode); - ClassDB::bind_method(D_METHOD("canvas_item_set_custom_rect", "item", "use_custom_rect", "rect"), &RenderingServer::canvas_item_set_custom_rect, DEFVAL(Rect2())); - ClassDB::bind_method(D_METHOD("canvas_item_set_modulate", "item", "color"), &RenderingServer::canvas_item_set_modulate); - ClassDB::bind_method(D_METHOD("canvas_item_set_self_modulate", "item", "color"), &RenderingServer::canvas_item_set_self_modulate); - ClassDB::bind_method(D_METHOD("canvas_item_set_draw_behind_parent", "item", "enabled"), &RenderingServer::canvas_item_set_draw_behind_parent); - ClassDB::bind_method(D_METHOD("canvas_item_add_line", "item", "from", "to", "color", "width", "antialiased"), &RenderingServer::canvas_item_add_line, DEFVAL(1.0), DEFVAL(false)); - ClassDB::bind_method(D_METHOD("canvas_item_add_polyline", "item", "points", "colors", "width", "antialiased"), &RenderingServer::canvas_item_add_polyline, DEFVAL(1.0), DEFVAL(false)); - ClassDB::bind_method(D_METHOD("canvas_item_add_rect", "item", "rect", "color"), &RenderingServer::canvas_item_add_rect); - ClassDB::bind_method(D_METHOD("canvas_item_add_circle", "item", "pos", "radius", "color"), &RenderingServer::canvas_item_add_circle); - ClassDB::bind_method(D_METHOD("canvas_item_add_texture_rect", "item", "rect", "texture", "tile", "modulate", "transpose", "normal_map"), &RenderingServer::canvas_item_add_texture_rect, DEFVAL(false), DEFVAL(Color(1, 1, 1)), DEFVAL(false), DEFVAL(RID())); - ClassDB::bind_method(D_METHOD("canvas_item_add_texture_rect_region", "item", "rect", "texture", "src_rect", "modulate", "transpose", "normal_map", "clip_uv"), &RenderingServer::canvas_item_add_texture_rect_region, DEFVAL(Color(1, 1, 1)), DEFVAL(false), DEFVAL(RID()), DEFVAL(true)); - ClassDB::bind_method(D_METHOD("canvas_item_add_nine_patch", "item", "rect", "source", "texture", "topleft", "bottomright", "x_axis_mode", "y_axis_mode", "draw_center", "modulate", "normal_map"), &RenderingServer::canvas_item_add_nine_patch, DEFVAL(NINE_PATCH_STRETCH), DEFVAL(NINE_PATCH_STRETCH), DEFVAL(true), DEFVAL(Color(1, 1, 1)), DEFVAL(RID())); - ClassDB::bind_method(D_METHOD("canvas_item_add_primitive", "item", "points", "colors", "uvs", "texture", "width", "normal_map"), &RenderingServer::canvas_item_add_primitive, DEFVAL(1.0), DEFVAL(RID())); - ClassDB::bind_method(D_METHOD("canvas_item_add_polygon", "item", "points", "colors", "uvs", "texture", "normal_map", "antialiased"), &RenderingServer::canvas_item_add_polygon, DEFVAL(Vector()), DEFVAL(RID()), DEFVAL(RID()), DEFVAL(false)); - ClassDB::bind_method(D_METHOD("canvas_item_add_triangle_array", "item", "indices", "points", "colors", "uvs", "bones", "weights", "texture", "count", "normal_map", "antialiased"), &RenderingServer::canvas_item_add_triangle_array, DEFVAL(Vector()), DEFVAL(Vector()), DEFVAL(Vector()), DEFVAL(RID()), DEFVAL(-1), DEFVAL(RID()), DEFVAL(false)); - ClassDB::bind_method(D_METHOD("canvas_item_add_mesh", "item", "mesh", "transform", "modulate", "texture", "normal_map"), &RenderingServer::canvas_item_add_mesh, DEFVAL(Transform2D()), DEFVAL(Color(1, 1, 1)), DEFVAL(RID()), DEFVAL(RID())); - ClassDB::bind_method(D_METHOD("canvas_item_add_multimesh", "item", "mesh", "texture", "normal_map"), &RenderingServer::canvas_item_add_multimesh, DEFVAL(RID())); - ClassDB::bind_method(D_METHOD("canvas_item_add_particles", "item", "particles", "texture", "normal_map"), &RenderingServer::canvas_item_add_particles); - ClassDB::bind_method(D_METHOD("canvas_item_add_set_transform", "item", "transform"), &RenderingServer::canvas_item_add_set_transform); - ClassDB::bind_method(D_METHOD("canvas_item_add_clip_ignore", "item", "ignore"), &RenderingServer::canvas_item_add_clip_ignore); - ClassDB::bind_method(D_METHOD("canvas_item_set_sort_children_by_y", "item", "enabled"), &RenderingServer::canvas_item_set_sort_children_by_y); -#endif - ClassDB::bind_method(D_METHOD("canvas_item_set_z_index", "item", "z_index"), &RenderingServer::canvas_item_set_z_index); - ClassDB::bind_method(D_METHOD("canvas_item_set_z_as_relative_to_parent", "item", "enabled"), &RenderingServer::canvas_item_set_z_as_relative_to_parent); - ClassDB::bind_method(D_METHOD("canvas_item_set_copy_to_backbuffer", "item", "enabled", "rect"), &RenderingServer::canvas_item_set_copy_to_backbuffer); - ClassDB::bind_method(D_METHOD("canvas_item_clear", "item"), &RenderingServer::canvas_item_clear); - ClassDB::bind_method(D_METHOD("canvas_item_set_draw_index", "item", "index"), &RenderingServer::canvas_item_set_draw_index); - ClassDB::bind_method(D_METHOD("canvas_item_set_material", "item", "material"), &RenderingServer::canvas_item_set_material); - ClassDB::bind_method(D_METHOD("canvas_item_set_use_parent_material", "item", "enabled"), &RenderingServer::canvas_item_set_use_parent_material); - ClassDB::bind_method(D_METHOD("canvas_light_create"), &RenderingServer::canvas_light_create); - ClassDB::bind_method(D_METHOD("canvas_light_attach_to_canvas", "light", "canvas"), &RenderingServer::canvas_light_attach_to_canvas); - ClassDB::bind_method(D_METHOD("canvas_light_set_enabled", "light", "enabled"), &RenderingServer::canvas_light_set_enabled); - ClassDB::bind_method(D_METHOD("canvas_light_set_texture_scale", "light", "scale"), &RenderingServer::canvas_light_set_texture_scale); - ClassDB::bind_method(D_METHOD("canvas_light_set_transform", "light", "transform"), &RenderingServer::canvas_light_set_transform); - ClassDB::bind_method(D_METHOD("canvas_light_set_texture", "light", "texture"), &RenderingServer::canvas_light_set_texture); - ClassDB::bind_method(D_METHOD("canvas_light_set_texture_offset", "light", "offset"), &RenderingServer::canvas_light_set_texture_offset); - ClassDB::bind_method(D_METHOD("canvas_light_set_color", "light", "color"), &RenderingServer::canvas_light_set_color); - ClassDB::bind_method(D_METHOD("canvas_light_set_height", "light", "height"), &RenderingServer::canvas_light_set_height); - ClassDB::bind_method(D_METHOD("canvas_light_set_energy", "light", "energy"), &RenderingServer::canvas_light_set_energy); - ClassDB::bind_method(D_METHOD("canvas_light_set_z_range", "light", "min_z", "max_z"), &RenderingServer::canvas_light_set_z_range); - ClassDB::bind_method(D_METHOD("canvas_light_set_layer_range", "light", "min_layer", "max_layer"), &RenderingServer::canvas_light_set_layer_range); - ClassDB::bind_method(D_METHOD("canvas_light_set_item_cull_mask", "light", "mask"), &RenderingServer::canvas_light_set_item_cull_mask); - ClassDB::bind_method(D_METHOD("canvas_light_set_item_shadow_cull_mask", "light", "mask"), &RenderingServer::canvas_light_set_item_shadow_cull_mask); - ClassDB::bind_method(D_METHOD("canvas_light_set_mode", "light", "mode"), &RenderingServer::canvas_light_set_mode); - ClassDB::bind_method(D_METHOD("canvas_light_set_shadow_enabled", "light", "enabled"), &RenderingServer::canvas_light_set_shadow_enabled); - ClassDB::bind_method(D_METHOD("canvas_light_set_shadow_filter", "light", "filter"), &RenderingServer::canvas_light_set_shadow_filter); - ClassDB::bind_method(D_METHOD("canvas_light_set_shadow_color", "light", "color"), &RenderingServer::canvas_light_set_shadow_color); - ClassDB::bind_method(D_METHOD("canvas_light_set_shadow_smooth", "light", "smooth"), &RenderingServer::canvas_light_set_shadow_smooth); - - ClassDB::bind_method(D_METHOD("canvas_light_occluder_create"), &RenderingServer::canvas_light_occluder_create); - ClassDB::bind_method(D_METHOD("canvas_light_occluder_attach_to_canvas", "occluder", "canvas"), &RenderingServer::canvas_light_occluder_attach_to_canvas); - ClassDB::bind_method(D_METHOD("canvas_light_occluder_set_enabled", "occluder", "enabled"), &RenderingServer::canvas_light_occluder_set_enabled); - ClassDB::bind_method(D_METHOD("canvas_light_occluder_set_polygon", "occluder", "polygon"), &RenderingServer::canvas_light_occluder_set_polygon); - ClassDB::bind_method(D_METHOD("canvas_light_occluder_set_transform", "occluder", "transform"), &RenderingServer::canvas_light_occluder_set_transform); - ClassDB::bind_method(D_METHOD("canvas_light_occluder_set_light_mask", "occluder", "mask"), &RenderingServer::canvas_light_occluder_set_light_mask); - - ClassDB::bind_method(D_METHOD("canvas_occluder_polygon_create"), &RenderingServer::canvas_occluder_polygon_create); - ClassDB::bind_method(D_METHOD("canvas_occluder_polygon_set_shape", "occluder_polygon", "shape", "closed"), &RenderingServer::canvas_occluder_polygon_set_shape); - ClassDB::bind_method(D_METHOD("canvas_occluder_polygon_set_cull_mode", "occluder_polygon", "mode"), &RenderingServer::canvas_occluder_polygon_set_cull_mode); - - ClassDB::bind_method(D_METHOD("global_variable_add", "name", "type", "default_value"), &RenderingServer::global_variable_add); - ClassDB::bind_method(D_METHOD("global_variable_remove", "name"), &RenderingServer::global_variable_remove); - ClassDB::bind_method(D_METHOD("global_variable_get_list"), &RenderingServer::global_variable_get_list); - ClassDB::bind_method(D_METHOD("global_variable_set", "name", "value"), &RenderingServer::global_variable_set); - ClassDB::bind_method(D_METHOD("global_variable_get", "name"), &RenderingServer::global_variable_get); - ClassDB::bind_method(D_METHOD("global_variable_get_type", "name"), &RenderingServer::global_variable_get_type); - - ClassDB::bind_method(D_METHOD("black_bars_set_margins", "left", "top", "right", "bottom"), &RenderingServer::black_bars_set_margins); - ClassDB::bind_method(D_METHOD("black_bars_set_images", "left", "top", "right", "bottom"), &RenderingServer::black_bars_set_images); - - ClassDB::bind_method(D_METHOD("free_rid", "rid"), &RenderingServer::free); // shouldn't conflict with Object::free() - - ClassDB::bind_method(D_METHOD("request_frame_drawn_callback", "where", "method", "userdata"), &RenderingServer::request_frame_drawn_callback); - ClassDB::bind_method(D_METHOD("has_changed"), &RenderingServer::has_changed); - ClassDB::bind_method(D_METHOD("init"), &RenderingServer::init); - ClassDB::bind_method(D_METHOD("finish"), &RenderingServer::finish); - ClassDB::bind_method(D_METHOD("get_render_info", "info"), &RenderingServer::get_render_info); - ClassDB::bind_method(D_METHOD("get_video_adapter_name"), &RenderingServer::get_video_adapter_name); - ClassDB::bind_method(D_METHOD("get_video_adapter_vendor"), &RenderingServer::get_video_adapter_vendor); -#ifndef _3D_DISABLED - - ClassDB::bind_method(D_METHOD("make_sphere_mesh", "latitudes", "longitudes", "radius"), &RenderingServer::make_sphere_mesh); - ClassDB::bind_method(D_METHOD("get_test_cube"), &RenderingServer::get_test_cube); -#endif - ClassDB::bind_method(D_METHOD("get_test_texture"), &RenderingServer::get_test_texture); - ClassDB::bind_method(D_METHOD("get_white_texture"), &RenderingServer::get_white_texture); - - ClassDB::bind_method(D_METHOD("set_boot_image", "image", "color", "scale", "use_filter"), &RenderingServer::set_boot_image, DEFVAL(true)); - ClassDB::bind_method(D_METHOD("set_default_clear_color", "color"), &RenderingServer::set_default_clear_color); - - ClassDB::bind_method(D_METHOD("has_feature", "feature"), &RenderingServer::has_feature); - ClassDB::bind_method(D_METHOD("has_os_feature", "feature"), &RenderingServer::has_os_feature); - ClassDB::bind_method(D_METHOD("set_debug_generate_wireframes", "generate"), &RenderingServer::set_debug_generate_wireframes); - - ClassDB::bind_method(D_METHOD("is_render_loop_enabled"), &RenderingServer::is_render_loop_enabled); - ClassDB::bind_method(D_METHOD("set_render_loop_enabled", "enabled"), &RenderingServer::set_render_loop_enabled); - - ClassDB::bind_method(D_METHOD("get_frame_setup_time_cpu"), &RenderingServer::get_frame_setup_time_cpu); - - ADD_PROPERTY(PropertyInfo(Variant::BOOL, "render_loop_enabled"), "set_render_loop_enabled", "is_render_loop_enabled"); - - BIND_CONSTANT(NO_INDEX_ARRAY); - BIND_CONSTANT(ARRAY_WEIGHTS_SIZE); - BIND_CONSTANT(CANVAS_ITEM_Z_MIN); - BIND_CONSTANT(CANVAS_ITEM_Z_MAX); - BIND_CONSTANT(MAX_GLOW_LEVELS); - BIND_CONSTANT(MAX_CURSORS); - - BIND_ENUM_CONSTANT(TEXTURE_LAYERED_2D_ARRAY); - BIND_ENUM_CONSTANT(TEXTURE_LAYERED_CUBEMAP); - BIND_ENUM_CONSTANT(TEXTURE_LAYERED_CUBEMAP_ARRAY); - - BIND_ENUM_CONSTANT(CUBEMAP_LAYER_LEFT); - BIND_ENUM_CONSTANT(CUBEMAP_LAYER_RIGHT); - BIND_ENUM_CONSTANT(CUBEMAP_LAYER_BOTTOM); - BIND_ENUM_CONSTANT(CUBEMAP_LAYER_TOP); - BIND_ENUM_CONSTANT(CUBEMAP_LAYER_FRONT); - BIND_ENUM_CONSTANT(CUBEMAP_LAYER_BACK); - BIND_ENUM_CONSTANT(SHADER_SPATIAL); - BIND_ENUM_CONSTANT(SHADER_CANVAS_ITEM); - BIND_ENUM_CONSTANT(SHADER_PARTICLES); - BIND_ENUM_CONSTANT(SHADER_SKY); - BIND_ENUM_CONSTANT(SHADER_MAX); - - BIND_CONSTANT(MATERIAL_RENDER_PRIORITY_MIN); - BIND_CONSTANT(MATERIAL_RENDER_PRIORITY_MAX); - - BIND_ENUM_CONSTANT(ARRAY_VERTEX); - BIND_ENUM_CONSTANT(ARRAY_NORMAL); - BIND_ENUM_CONSTANT(ARRAY_TANGENT); - BIND_ENUM_CONSTANT(ARRAY_COLOR); - BIND_ENUM_CONSTANT(ARRAY_TEX_UV); - BIND_ENUM_CONSTANT(ARRAY_TEX_UV2); - BIND_ENUM_CONSTANT(ARRAY_CUSTOM0); - BIND_ENUM_CONSTANT(ARRAY_CUSTOM1); - BIND_ENUM_CONSTANT(ARRAY_CUSTOM2); - BIND_ENUM_CONSTANT(ARRAY_CUSTOM3); - BIND_ENUM_CONSTANT(ARRAY_BONES); - BIND_ENUM_CONSTANT(ARRAY_WEIGHTS); - BIND_ENUM_CONSTANT(ARRAY_INDEX); - BIND_ENUM_CONSTANT(ARRAY_MAX); - - BIND_ENUM_CONSTANT(ARRAY_FORMAT_VERTEX); - BIND_ENUM_CONSTANT(ARRAY_FORMAT_NORMAL); - BIND_ENUM_CONSTANT(ARRAY_FORMAT_TANGENT); - BIND_ENUM_CONSTANT(ARRAY_FORMAT_COLOR); - BIND_ENUM_CONSTANT(ARRAY_FORMAT_TEX_UV); - BIND_ENUM_CONSTANT(ARRAY_FORMAT_TEX_UV2); - BIND_ENUM_CONSTANT(ARRAY_FORMAT_CUSTOM0); - BIND_ENUM_CONSTANT(ARRAY_FORMAT_CUSTOM1); - BIND_ENUM_CONSTANT(ARRAY_FORMAT_CUSTOM2); - BIND_ENUM_CONSTANT(ARRAY_FORMAT_CUSTOM3); - BIND_ENUM_CONSTANT(ARRAY_FORMAT_BONES); - BIND_ENUM_CONSTANT(ARRAY_FORMAT_WEIGHTS); - BIND_ENUM_CONSTANT(ARRAY_FORMAT_INDEX); - - BIND_ENUM_CONSTANT(ARRAY_FORMAT_BLEND_SHAPE_MASK); - - BIND_ENUM_CONSTANT(ARRAY_FORMAT_CUSTOM_BASE); - BIND_ENUM_CONSTANT(ARRAY_FORMAT_CUSTOM0_SHIFT); - BIND_ENUM_CONSTANT(ARRAY_FORMAT_CUSTOM1_SHIFT); - BIND_ENUM_CONSTANT(ARRAY_FORMAT_CUSTOM2_SHIFT); - BIND_ENUM_CONSTANT(ARRAY_FORMAT_CUSTOM3_SHIFT); - - BIND_ENUM_CONSTANT(ARRAY_FORMAT_CUSTOM_MASK); - BIND_ENUM_CONSTANT(ARRAY_COMPRESS_FLAGS_BASE); - - BIND_ENUM_CONSTANT(ARRAY_FLAG_USE_2D_VERTICES); - BIND_ENUM_CONSTANT(ARRAY_FLAG_USE_DYNAMIC_UPDATE); - BIND_ENUM_CONSTANT(ARRAY_FLAG_USE_8_BONE_WEIGHTS); - - BIND_ENUM_CONSTANT(PRIMITIVE_POINTS); - BIND_ENUM_CONSTANT(PRIMITIVE_LINES); - BIND_ENUM_CONSTANT(PRIMITIVE_LINE_STRIP); - BIND_ENUM_CONSTANT(PRIMITIVE_TRIANGLES); - BIND_ENUM_CONSTANT(PRIMITIVE_TRIANGLE_STRIP); - BIND_ENUM_CONSTANT(PRIMITIVE_MAX); - - BIND_ENUM_CONSTANT(BLEND_SHAPE_MODE_NORMALIZED); - BIND_ENUM_CONSTANT(BLEND_SHAPE_MODE_RELATIVE); - - BIND_ENUM_CONSTANT(MULTIMESH_TRANSFORM_2D); - BIND_ENUM_CONSTANT(MULTIMESH_TRANSFORM_3D); - - BIND_ENUM_CONSTANT(LIGHT_DIRECTIONAL); - BIND_ENUM_CONSTANT(LIGHT_OMNI); - BIND_ENUM_CONSTANT(LIGHT_SPOT); - - BIND_ENUM_CONSTANT(LIGHT_PARAM_ENERGY); - BIND_ENUM_CONSTANT(LIGHT_PARAM_INDIRECT_ENERGY); - BIND_ENUM_CONSTANT(LIGHT_PARAM_SPECULAR); - BIND_ENUM_CONSTANT(LIGHT_PARAM_RANGE); - BIND_ENUM_CONSTANT(LIGHT_PARAM_SIZE); - BIND_ENUM_CONSTANT(LIGHT_PARAM_ATTENUATION); - BIND_ENUM_CONSTANT(LIGHT_PARAM_SPOT_ANGLE); - BIND_ENUM_CONSTANT(LIGHT_PARAM_SPOT_ATTENUATION); - BIND_ENUM_CONSTANT(LIGHT_PARAM_SHADOW_MAX_DISTANCE); - BIND_ENUM_CONSTANT(LIGHT_PARAM_SHADOW_SPLIT_1_OFFSET); - BIND_ENUM_CONSTANT(LIGHT_PARAM_SHADOW_SPLIT_2_OFFSET); - BIND_ENUM_CONSTANT(LIGHT_PARAM_SHADOW_SPLIT_3_OFFSET); - BIND_ENUM_CONSTANT(LIGHT_PARAM_SHADOW_FADE_START); - BIND_ENUM_CONSTANT(LIGHT_PARAM_SHADOW_NORMAL_BIAS); - BIND_ENUM_CONSTANT(LIGHT_PARAM_SHADOW_BIAS); - BIND_ENUM_CONSTANT(LIGHT_PARAM_SHADOW_PANCAKE_SIZE); - BIND_ENUM_CONSTANT(LIGHT_PARAM_SHADOW_BLUR); - BIND_ENUM_CONSTANT(LIGHT_PARAM_TRANSMITTANCE_BIAS); - BIND_ENUM_CONSTANT(LIGHT_PARAM_MAX); - - BIND_ENUM_CONSTANT(LIGHT_BAKE_DISABLED); - BIND_ENUM_CONSTANT(LIGHT_BAKE_DYNAMIC); - BIND_ENUM_CONSTANT(LIGHT_BAKE_STATIC); - - BIND_ENUM_CONSTANT(LIGHT_OMNI_SHADOW_DUAL_PARABOLOID); - BIND_ENUM_CONSTANT(LIGHT_OMNI_SHADOW_CUBE); - - BIND_ENUM_CONSTANT(LIGHT_DIRECTIONAL_SHADOW_ORTHOGONAL); - BIND_ENUM_CONSTANT(LIGHT_DIRECTIONAL_SHADOW_PARALLEL_2_SPLITS); - BIND_ENUM_CONSTANT(LIGHT_DIRECTIONAL_SHADOW_PARALLEL_4_SPLITS); - - BIND_ENUM_CONSTANT(LIGHT_DIRECTIONAL_SHADOW_DEPTH_RANGE_STABLE); - BIND_ENUM_CONSTANT(LIGHT_DIRECTIONAL_SHADOW_DEPTH_RANGE_OPTIMIZED); - - BIND_ENUM_CONSTANT(REFLECTION_PROBE_UPDATE_ONCE); - BIND_ENUM_CONSTANT(REFLECTION_PROBE_UPDATE_ALWAYS); - - BIND_ENUM_CONSTANT(REFLECTION_PROBE_AMBIENT_DISABLED); - BIND_ENUM_CONSTANT(REFLECTION_PROBE_AMBIENT_ENVIRONMENT); - BIND_ENUM_CONSTANT(REFLECTION_PROBE_AMBIENT_COLOR); - - BIND_ENUM_CONSTANT(DECAL_TEXTURE_ALBEDO); - BIND_ENUM_CONSTANT(DECAL_TEXTURE_NORMAL); - BIND_ENUM_CONSTANT(DECAL_TEXTURE_ORM); - BIND_ENUM_CONSTANT(DECAL_TEXTURE_EMISSION); - BIND_ENUM_CONSTANT(DECAL_TEXTURE_MAX); - - BIND_ENUM_CONSTANT(PARTICLES_DRAW_ORDER_INDEX); - BIND_ENUM_CONSTANT(PARTICLES_DRAW_ORDER_LIFETIME); - BIND_ENUM_CONSTANT(PARTICLES_DRAW_ORDER_VIEW_DEPTH); + ClassDB::bind_method(D_METHOD("viewport_get_measured_render_time_gpu", "viewport"), &RenderingServer::viewport_get_measured_render_time_gpu); BIND_ENUM_CONSTANT(VIEWPORT_UPDATE_DISABLED); - BIND_ENUM_CONSTANT(VIEWPORT_UPDATE_ONCE); - BIND_ENUM_CONSTANT(VIEWPORT_UPDATE_WHEN_VISIBLE); + BIND_ENUM_CONSTANT(VIEWPORT_UPDATE_ONCE); //then goes to disabled); must be manually updated + BIND_ENUM_CONSTANT(VIEWPORT_UPDATE_WHEN_VISIBLE); // default BIND_ENUM_CONSTANT(VIEWPORT_UPDATE_WHEN_PARENT_VISIBLE); BIND_ENUM_CONSTANT(VIEWPORT_UPDATE_ALWAYS); @@ -1984,6 +2156,17 @@ void RenderingServer::_bind_methods() { BIND_ENUM_CONSTANT(VIEWPORT_CLEAR_NEVER); BIND_ENUM_CONSTANT(VIEWPORT_CLEAR_ONLY_NEXT_FRAME); + BIND_ENUM_CONSTANT(VIEWPORT_SDF_OVERSIZE_100_PERCENT); + BIND_ENUM_CONSTANT(VIEWPORT_SDF_OVERSIZE_120_PERCENT); + BIND_ENUM_CONSTANT(VIEWPORT_SDF_OVERSIZE_150_PERCENT); + BIND_ENUM_CONSTANT(VIEWPORT_SDF_OVERSIZE_200_PERCENT); + BIND_ENUM_CONSTANT(VIEWPORT_SDF_OVERSIZE_MAX); + + BIND_ENUM_CONSTANT(VIEWPORT_SDF_SCALE_100_PERCENT); + BIND_ENUM_CONSTANT(VIEWPORT_SDF_SCALE_50_PERCENT); + BIND_ENUM_CONSTANT(VIEWPORT_SDF_SCALE_25_PERCENT); + BIND_ENUM_CONSTANT(VIEWPORT_SDF_SCALE_MAX); + BIND_ENUM_CONSTANT(VIEWPORT_MSAA_DISABLED); BIND_ENUM_CONSTANT(VIEWPORT_MSAA_2X); BIND_ENUM_CONSTANT(VIEWPORT_MSAA_4X); @@ -1995,6 +2178,10 @@ void RenderingServer::_bind_methods() { BIND_ENUM_CONSTANT(VIEWPORT_SCREEN_SPACE_AA_FXAA); BIND_ENUM_CONSTANT(VIEWPORT_SCREEN_SPACE_AA_MAX); + BIND_ENUM_CONSTANT(VIEWPORT_OCCLUSION_BUILD_QUALITY_LOW); + BIND_ENUM_CONSTANT(VIEWPORT_OCCLUSION_BUILD_QUALITY_MEDIUM); + BIND_ENUM_CONSTANT(VIEWPORT_OCCLUSION_BUILD_QUALITY_HIGH); + BIND_ENUM_CONSTANT(VIEWPORT_RENDER_INFO_OBJECTS_IN_FRAME); BIND_ENUM_CONSTANT(VIEWPORT_RENDER_INFO_VERTICES_IN_FRAME); BIND_ENUM_CONSTANT(VIEWPORT_RENDER_INFO_MATERIAL_CHANGES_IN_FRAME); @@ -2021,11 +2208,62 @@ void RenderingServer::_bind_methods() { BIND_ENUM_CONSTANT(VIEWPORT_DEBUG_DRAW_SDFGI); BIND_ENUM_CONSTANT(VIEWPORT_DEBUG_DRAW_SDFGI_PROBES); BIND_ENUM_CONSTANT(VIEWPORT_DEBUG_DRAW_GI_BUFFER); + BIND_ENUM_CONSTANT(VIEWPORT_DEBUG_DRAW_DISABLE_LOD); + BIND_ENUM_CONSTANT(VIEWPORT_DEBUG_DRAW_CLUSTER_OMNI_LIGHTS); + BIND_ENUM_CONSTANT(VIEWPORT_DEBUG_DRAW_CLUSTER_SPOT_LIGHTS); + BIND_ENUM_CONSTANT(VIEWPORT_DEBUG_DRAW_CLUSTER_DECALS); + BIND_ENUM_CONSTANT(VIEWPORT_DEBUG_DRAW_CLUSTER_REFLECTION_PROBES); BIND_ENUM_CONSTANT(VIEWPORT_DEBUG_DRAW_OCCLUDERS); + /* SKY API */ + + ClassDB::bind_method(D_METHOD("sky_create"), &RenderingServer::sky_create); + ClassDB::bind_method(D_METHOD("sky_set_radiance_size", "sky", "radiance_size"), &RenderingServer::sky_set_radiance_size); + ClassDB::bind_method(D_METHOD("sky_set_mode", "sky", "mode"), &RenderingServer::sky_set_mode); + ClassDB::bind_method(D_METHOD("sky_set_material", "sky", "material"), &RenderingServer::sky_set_material); + ClassDB::bind_method(D_METHOD("sky_bake_panorama", "sky", "energy", "bake_irradiance", "size"), &RenderingServer::sky_bake_panorama); + + BIND_ENUM_CONSTANT(SKY_MODE_AUTOMATIC); BIND_ENUM_CONSTANT(SKY_MODE_QUALITY); + BIND_ENUM_CONSTANT(SKY_MODE_INCREMENTAL); BIND_ENUM_CONSTANT(SKY_MODE_REALTIME); + /* ENVIRONMENT */ + + ClassDB::bind_method(D_METHOD("environment_create"), &RenderingServer::environment_create); + ClassDB::bind_method(D_METHOD("environment_set_background", "env", "bg"), &RenderingServer::environment_set_background); + ClassDB::bind_method(D_METHOD("environment_set_sky", "env", "sky"), &RenderingServer::environment_set_sky); + ClassDB::bind_method(D_METHOD("environment_set_sky_custom_fov", "env", "scale"), &RenderingServer::environment_set_sky_custom_fov); + ClassDB::bind_method(D_METHOD("environment_set_sky_orientation", "env", "orientation"), &RenderingServer::environment_set_sky_orientation); + ClassDB::bind_method(D_METHOD("environment_set_bg_color", "env", "color"), &RenderingServer::environment_set_bg_color); + ClassDB::bind_method(D_METHOD("environment_set_bg_energy", "env", "energy"), &RenderingServer::environment_set_bg_energy); + ClassDB::bind_method(D_METHOD("environment_set_canvas_max_layer", "env", "max_layer"), &RenderingServer::environment_set_canvas_max_layer); + ClassDB::bind_method(D_METHOD("environment_set_ambient_light", "env", "color", "ambient", "energy", "sky_contibution", "reflection_source", "ao_color"), &RenderingServer::environment_set_ambient_light, DEFVAL(RS::ENV_AMBIENT_SOURCE_BG), DEFVAL(1.0), DEFVAL(0.0), DEFVAL(RS::ENV_REFLECTION_SOURCE_BG), DEFVAL(Color())); + ClassDB::bind_method(D_METHOD("environment_set_glow", "env", "enable", "levels", "intensity", "strength", "mix", "bloom_threshold", "blend_mode", "hdr_bleed_threshold", "hdr_bleed_scale", "hdr_luminance_cap"), &RenderingServer::environment_set_glow); + ClassDB::bind_method(D_METHOD("environment_set_tonemap", "env", "tone_mapper", "exposure", "white", "auto_exposure", "min_luminance", "max_luminance", "auto_exp_speed", "auto_exp_grey"), &RenderingServer::environment_set_tonemap); + ClassDB::bind_method(D_METHOD("environment_set_adjustment", "env", "enable", "brightness", "contrast", "saturation", "use_1d_color_correction", "color_correction"), &RenderingServer::environment_set_adjustment); + ClassDB::bind_method(D_METHOD("environment_set_ssr", "env", "enable", "max_steps", "fade_in", "fade_out", "depth_tolerance"), &RenderingServer::environment_set_ssr); + ClassDB::bind_method(D_METHOD("environment_set_ssao", "env", "enable", "radius", "intensity", "power", "detail", "horizon", "sharpness", "light_affect", "ao_channel_affect"), &RenderingServer::environment_set_ssao); + ClassDB::bind_method(D_METHOD("environment_set_fog", "env", "enable", "light_color", "light_energy", "sun_scatter", "density", "height", "height_density", "aerial_perspective"), &RenderingServer::environment_set_fog); + ClassDB::bind_method(D_METHOD("environment_set_sdfgi", "env", "enable", "cascades", "min_cell_size", "y_scale", "use_occlusion", "bounce_feedback", "read_sky", "energy", "normal_bias", "probe_bias"), &RenderingServer::environment_set_sdfgi); + ClassDB::bind_method(D_METHOD("environment_set_volumetric_fog", "env", "enable", "density", "light", "light_energy", "length", "p_detail_spread", "gi_inject", "temporal_reprojection", "temporal_reprojection_amount"), &RenderingServer::environment_set_volumetric_fog); + + ClassDB::bind_method(D_METHOD("environment_glow_set_use_bicubic_upscale", "enable"), &RenderingServer::environment_glow_set_use_bicubic_upscale); + ClassDB::bind_method(D_METHOD("environment_glow_set_use_high_quality", "enable"), &RenderingServer::environment_glow_set_use_high_quality); + ClassDB::bind_method(D_METHOD("environment_set_ssr_roughness_quality", "quality"), &RenderingServer::environment_set_ssr_roughness_quality); + ClassDB::bind_method(D_METHOD("environment_set_ssao_quality", "quality", "half_size", "adaptive_target", "blur_passes", "fadeout_from", "fadeout_to"), &RenderingServer::environment_set_ssao_quality); + ClassDB::bind_method(D_METHOD("environment_set_sdfgi_ray_count", "ray_count"), &RenderingServer::environment_set_sdfgi_ray_count); + ClassDB::bind_method(D_METHOD("environment_set_sdfgi_frames_to_converge", "frames"), &RenderingServer::environment_set_sdfgi_frames_to_converge); + ClassDB::bind_method(D_METHOD("environment_set_sdfgi_frames_to_update_light", "frames"), &RenderingServer::environment_set_sdfgi_frames_to_update_light); + ClassDB::bind_method(D_METHOD("environment_set_volumetric_fog_volume_size", "size", "depth"), &RenderingServer::environment_set_volumetric_fog_volume_size); + ClassDB::bind_method(D_METHOD("environment_set_volumetric_fog_filter_active", "active"), &RenderingServer::environment_set_volumetric_fog_filter_active); + + ClassDB::bind_method(D_METHOD("environment_bake_panorama", "environment", "bake_irradiance", "size"), &RenderingServer::environment_bake_panorama); + + ClassDB::bind_method(D_METHOD("screen_space_roughness_limiter_set_active", "enable", "amount", "limit"), &RenderingServer::screen_space_roughness_limiter_set_active); + ClassDB::bind_method(D_METHOD("sub_surface_scattering_set_quality", "quality"), &RenderingServer::sub_surface_scattering_set_quality); + ClassDB::bind_method(D_METHOD("sub_surface_scattering_set_scale", "scale", "depth_scale"), &RenderingServer::sub_surface_scattering_set_scale); + BIND_ENUM_CONSTANT(ENV_BG_CLEAR_COLOR); BIND_ENUM_CONSTANT(ENV_BG_COLOR); BIND_ENUM_CONSTANT(ENV_BG_SKY); @@ -2065,35 +2303,103 @@ void RenderingServer::_bind_methods() { BIND_ENUM_CONSTANT(ENV_SSAO_QUALITY_HIGH); BIND_ENUM_CONSTANT(ENV_SSAO_QUALITY_ULTRA); + BIND_ENUM_CONSTANT(ENV_SDFGI_CASCADES_4); + BIND_ENUM_CONSTANT(ENV_SDFGI_CASCADES_6); + BIND_ENUM_CONSTANT(ENV_SDFGI_CASCADES_8); + + BIND_ENUM_CONSTANT(ENV_SDFGI_Y_SCALE_DISABLED); + BIND_ENUM_CONSTANT(ENV_SDFGI_Y_SCALE_75_PERCENT); + BIND_ENUM_CONSTANT(ENV_SDFGI_Y_SCALE_50_PERCENT); + + BIND_ENUM_CONSTANT(ENV_SDFGI_RAY_COUNT_4); + BIND_ENUM_CONSTANT(ENV_SDFGI_RAY_COUNT_8); + BIND_ENUM_CONSTANT(ENV_SDFGI_RAY_COUNT_16); + BIND_ENUM_CONSTANT(ENV_SDFGI_RAY_COUNT_32); + BIND_ENUM_CONSTANT(ENV_SDFGI_RAY_COUNT_64); + BIND_ENUM_CONSTANT(ENV_SDFGI_RAY_COUNT_96); + BIND_ENUM_CONSTANT(ENV_SDFGI_RAY_COUNT_128); + BIND_ENUM_CONSTANT(ENV_SDFGI_RAY_COUNT_MAX); + + BIND_ENUM_CONSTANT(ENV_SDFGI_CONVERGE_IN_5_FRAMES); + BIND_ENUM_CONSTANT(ENV_SDFGI_CONVERGE_IN_10_FRAMES); + BIND_ENUM_CONSTANT(ENV_SDFGI_CONVERGE_IN_15_FRAMES); + BIND_ENUM_CONSTANT(ENV_SDFGI_CONVERGE_IN_20_FRAMES); + BIND_ENUM_CONSTANT(ENV_SDFGI_CONVERGE_IN_25_FRAMES); + BIND_ENUM_CONSTANT(ENV_SDFGI_CONVERGE_IN_30_FRAMES); + BIND_ENUM_CONSTANT(ENV_SDFGI_CONVERGE_MAX); + + BIND_ENUM_CONSTANT(ENV_SDFGI_UPDATE_LIGHT_IN_1_FRAME); + BIND_ENUM_CONSTANT(ENV_SDFGI_UPDATE_LIGHT_IN_2_FRAMES); + BIND_ENUM_CONSTANT(ENV_SDFGI_UPDATE_LIGHT_IN_4_FRAMES); + BIND_ENUM_CONSTANT(ENV_SDFGI_UPDATE_LIGHT_IN_8_FRAMES); + BIND_ENUM_CONSTANT(ENV_SDFGI_UPDATE_LIGHT_IN_16_FRAMES); + BIND_ENUM_CONSTANT(ENV_SDFGI_UPDATE_LIGHT_MAX); + BIND_ENUM_CONSTANT(SUB_SURFACE_SCATTERING_QUALITY_DISABLED); BIND_ENUM_CONSTANT(SUB_SURFACE_SCATTERING_QUALITY_LOW); BIND_ENUM_CONSTANT(SUB_SURFACE_SCATTERING_QUALITY_MEDIUM); BIND_ENUM_CONSTANT(SUB_SURFACE_SCATTERING_QUALITY_HIGH); + /* CAMERA EFFECTS */ + + ClassDB::bind_method(D_METHOD("camera_effects_create"), &RenderingServer::camera_effects_create); + + ClassDB::bind_method(D_METHOD("camera_effects_set_dof_blur_quality", "quality", "use_jitter"), &RenderingServer::camera_effects_set_dof_blur_quality); + ClassDB::bind_method(D_METHOD("camera_effects_set_dof_blur_bokeh_shape", "shape"), &RenderingServer::camera_effects_set_dof_blur_bokeh_shape); + + ClassDB::bind_method(D_METHOD("camera_effects_set_dof_blur", "camera_effects", "far_enable", "far_distance", "far_transition", "near_enable", "near_distance", "near_transition", "amount"), &RenderingServer::camera_effects_set_dof_blur); + ClassDB::bind_method(D_METHOD("camera_effects_set_custom_exposure", "camera_effects", "enable", "exposure"), &RenderingServer::camera_effects_set_custom_exposure); + + BIND_ENUM_CONSTANT(DOF_BOKEH_BOX); + BIND_ENUM_CONSTANT(DOF_BOKEH_HEXAGON); + BIND_ENUM_CONSTANT(DOF_BOKEH_CIRCLE); + BIND_ENUM_CONSTANT(DOF_BLUR_QUALITY_VERY_LOW); BIND_ENUM_CONSTANT(DOF_BLUR_QUALITY_LOW); BIND_ENUM_CONSTANT(DOF_BLUR_QUALITY_MEDIUM); BIND_ENUM_CONSTANT(DOF_BLUR_QUALITY_HIGH); - BIND_ENUM_CONSTANT(DOF_BOKEH_BOX); - BIND_ENUM_CONSTANT(DOF_BOKEH_HEXAGON); - BIND_ENUM_CONSTANT(DOF_BOKEH_CIRCLE); + /* SCENARIO */ - BIND_ENUM_CONSTANT(SHADOW_QUALITY_HARD); - BIND_ENUM_CONSTANT(SHADOW_QUALITY_SOFT_LOW); - BIND_ENUM_CONSTANT(SHADOW_QUALITY_SOFT_MEDIUM); - BIND_ENUM_CONSTANT(SHADOW_QUALITY_SOFT_HIGH); - BIND_ENUM_CONSTANT(SHADOW_QUALITY_SOFT_ULTRA); - BIND_ENUM_CONSTANT(SHADOW_QUALITY_MAX); + ClassDB::bind_method(D_METHOD("scenario_create"), &RenderingServer::scenario_create); + ClassDB::bind_method(D_METHOD("scenario_set_environment", "scenario", "environment"), &RenderingServer::scenario_set_environment); + ClassDB::bind_method(D_METHOD("scenario_set_fallback_environment", "scenario", "environment"), &RenderingServer::scenario_set_fallback_environment); + ClassDB::bind_method(D_METHOD("scenario_set_camera_effects", "scenario", "effects"), &RenderingServer::scenario_set_camera_effects); - BIND_ENUM_CONSTANT(SCENARIO_DEBUG_DISABLED); - BIND_ENUM_CONSTANT(SCENARIO_DEBUG_WIREFRAME); - BIND_ENUM_CONSTANT(SCENARIO_DEBUG_OVERDRAW); - BIND_ENUM_CONSTANT(SCENARIO_DEBUG_SHADELESS); + /* INSTANCE */ - BIND_ENUM_CONSTANT(VIEWPORT_OCCLUSION_BUILD_QUALITY_LOW); - BIND_ENUM_CONSTANT(VIEWPORT_OCCLUSION_BUILD_QUALITY_MEDIUM); - BIND_ENUM_CONSTANT(VIEWPORT_OCCLUSION_BUILD_QUALITY_HIGH); + ClassDB::bind_method(D_METHOD("instance_create2", "base", "scenario"), &RenderingServer::instance_create2); + ClassDB::bind_method(D_METHOD("instance_create"), &RenderingServer::instance_create); + ClassDB::bind_method(D_METHOD("instance_set_base", "instance", "base"), &RenderingServer::instance_set_base); + ClassDB::bind_method(D_METHOD("instance_set_scenario", "instance", "scenario"), &RenderingServer::instance_set_scenario); + ClassDB::bind_method(D_METHOD("instance_set_layer_mask", "instance", "mask"), &RenderingServer::instance_set_layer_mask); + ClassDB::bind_method(D_METHOD("instance_set_transform", "instance", "transform"), &RenderingServer::instance_set_transform); + ClassDB::bind_method(D_METHOD("instance_attach_object_instance_id", "instance", "id"), &RenderingServer::instance_attach_object_instance_id); + ClassDB::bind_method(D_METHOD("instance_set_blend_shape_weight", "instance", "shape", "weight"), &RenderingServer::instance_set_blend_shape_weight); + ClassDB::bind_method(D_METHOD("instance_set_surface_override_material", "instance", "surface", "material"), &RenderingServer::instance_set_surface_override_material); + ClassDB::bind_method(D_METHOD("instance_set_visible", "instance", "visible"), &RenderingServer::instance_set_visible); + + ClassDB::bind_method(D_METHOD("instance_set_custom_aabb", "instance", "aabb"), &RenderingServer::instance_set_custom_aabb); + + ClassDB::bind_method(D_METHOD("instance_attach_skeleton", "instance", "skeleton"), &RenderingServer::instance_attach_skeleton); + ClassDB::bind_method(D_METHOD("instance_set_extra_visibility_margin", "instance", "margin"), &RenderingServer::instance_set_extra_visibility_margin); + ClassDB::bind_method(D_METHOD("instance_set_visibility_parent", "instance", "parent"), &RenderingServer::instance_set_visibility_parent); + + ClassDB::bind_method(D_METHOD("instance_geometry_set_flag", "instance", "flag", "enabled"), &RenderingServer::instance_geometry_set_flag); + ClassDB::bind_method(D_METHOD("instance_geometry_set_cast_shadows_setting", "instance", "shadow_casting_setting"), &RenderingServer::instance_geometry_set_cast_shadows_setting); + ClassDB::bind_method(D_METHOD("instance_geometry_set_material_override", "instance", "material"), &RenderingServer::instance_geometry_set_material_override); + ClassDB::bind_method(D_METHOD("instance_geometry_set_visibility_range", "instance", "min", "max", "min_margin", "max_margin"), &RenderingServer::instance_geometry_set_visibility_range); + ClassDB::bind_method(D_METHOD("instance_geometry_set_lightmap", "instance", "lightmap", "lightmap_uv_scale", "lightmap_slice"), &RenderingServer::instance_geometry_set_lightmap); + ClassDB::bind_method(D_METHOD("instance_geometry_set_lod_bias", "instance", "lod_bias"), &RenderingServer::instance_geometry_set_lod_bias); + + ClassDB::bind_method(D_METHOD("instance_geometry_set_shader_parameter", "instance", "parameter", "value"), &RenderingServer::instance_geometry_set_shader_parameter); + ClassDB::bind_method(D_METHOD("instance_geometry_get_shader_parameter", "instance", "parameter"), &RenderingServer::instance_geometry_get_shader_parameter); + ClassDB::bind_method(D_METHOD("instance_geometry_get_shader_parameter_default_value", "instance", "parameter"), &RenderingServer::instance_geometry_get_shader_parameter_default_value); + ClassDB::bind_method(D_METHOD("instance_geometry_get_shader_parameter_list", "instance"), &RenderingServer::_instance_geometry_get_shader_parameter_list); + + ClassDB::bind_method(D_METHOD("instances_cull_aabb", "aabb", "scenario"), &RenderingServer::_instances_cull_aabb_bind, DEFVAL(RID())); + ClassDB::bind_method(D_METHOD("instances_cull_ray", "from", "to", "scenario"), &RenderingServer::_instances_cull_ray_bind, DEFVAL(RID())); + ClassDB::bind_method(D_METHOD("instances_cull_convex", "convex", "scenario"), &RenderingServer::_instances_cull_convex_bind, DEFVAL(RID())); BIND_ENUM_CONSTANT(INSTANCE_NONE); BIND_ENUM_CONSTANT(INSTANCE_MESH); @@ -2106,7 +2412,9 @@ void RenderingServer::_bind_methods() { BIND_ENUM_CONSTANT(INSTANCE_VOXEL_GI); BIND_ENUM_CONSTANT(INSTANCE_LIGHTMAP); BIND_ENUM_CONSTANT(INSTANCE_OCCLUDER); + BIND_ENUM_CONSTANT(INSTANCE_VISIBLITY_NOTIFIER); BIND_ENUM_CONSTANT(INSTANCE_MAX); + BIND_ENUM_CONSTANT(INSTANCE_GEOMETRY_MASK); BIND_ENUM_CONSTANT(INSTANCE_FLAG_USE_BAKED_LIGHT); @@ -2120,6 +2428,80 @@ void RenderingServer::_bind_methods() { BIND_ENUM_CONSTANT(SHADOW_CASTING_SETTING_DOUBLE_SIDED); BIND_ENUM_CONSTANT(SHADOW_CASTING_SETTING_SHADOWS_ONLY); + /* Bake 3D Object */ + + ClassDB::bind_method(D_METHOD("bake_render_uv2", "base", "material_overrides", "image_size"), &RenderingServer::bake_render_uv2); + + BIND_ENUM_CONSTANT(BAKE_CHANNEL_ALBEDO_ALPHA); + BIND_ENUM_CONSTANT(BAKE_CHANNEL_NORMAL); + BIND_ENUM_CONSTANT(BAKE_CHANNEL_ORM); + BIND_ENUM_CONSTANT(BAKE_CHANNEL_EMISSION); + + /* CANVAS (2D) */ + + ClassDB::bind_method(D_METHOD("canvas_create"), &RenderingServer::canvas_create); + ClassDB::bind_method(D_METHOD("canvas_set_item_mirroring", "canvas", "item", "mirroring"), &RenderingServer::canvas_set_item_mirroring); + ClassDB::bind_method(D_METHOD("canvas_set_modulate", "canvas", "color"), &RenderingServer::canvas_set_modulate); + ClassDB::bind_method(D_METHOD("canvas_set_disable_scale", "disable"), &RenderingServer::canvas_set_disable_scale); + + /* CANVAS TEXTURE */ + + ClassDB::bind_method(D_METHOD("canvas_texture_create"), &RenderingServer::canvas_texture_create); + ClassDB::bind_method(D_METHOD("canvas_texture_set_channel", "canvas_texture", "channel", "texture"), &RenderingServer::canvas_texture_set_channel); + ClassDB::bind_method(D_METHOD("canvas_texture_set_shading_parameters", "canvas_texture", "base_color", "shininess"), &RenderingServer::canvas_texture_set_shading_parameters); + + ClassDB::bind_method(D_METHOD("canvas_texture_set_texture_filter", "canvas_texture", "filter"), &RenderingServer::canvas_texture_set_texture_filter); + ClassDB::bind_method(D_METHOD("canvas_texture_set_texture_repeat", "canvas_texture", "repeat"), &RenderingServer::canvas_texture_set_texture_repeat); + + BIND_ENUM_CONSTANT(CANVAS_TEXTURE_CHANNEL_DIFFUSE); + BIND_ENUM_CONSTANT(CANVAS_TEXTURE_CHANNEL_NORMAL); + BIND_ENUM_CONSTANT(CANVAS_TEXTURE_CHANNEL_SPECULAR); + + /* CANVAS ITEM */ + + ClassDB::bind_method(D_METHOD("canvas_item_create"), &RenderingServer::canvas_item_create); + ClassDB::bind_method(D_METHOD("canvas_item_set_parent", "item", "parent"), &RenderingServer::canvas_item_set_parent); + ClassDB::bind_method(D_METHOD("canvas_item_set_default_texture_filter", "item", "filter"), &RenderingServer::canvas_item_set_default_texture_filter); + ClassDB::bind_method(D_METHOD("canvas_item_set_default_texture_repeat", "item", "repeat"), &RenderingServer::canvas_item_set_default_texture_repeat); + ClassDB::bind_method(D_METHOD("canvas_item_set_visible", "item", "visible"), &RenderingServer::canvas_item_set_visible); + ClassDB::bind_method(D_METHOD("canvas_item_set_light_mask", "item", "mask"), &RenderingServer::canvas_item_set_light_mask); + ClassDB::bind_method(D_METHOD("canvas_item_set_transform", "item", "transform"), &RenderingServer::canvas_item_set_transform); + ClassDB::bind_method(D_METHOD("canvas_item_set_clip", "item", "clip"), &RenderingServer::canvas_item_set_clip); + ClassDB::bind_method(D_METHOD("canvas_item_set_distance_field_mode", "item", "enabled"), &RenderingServer::canvas_item_set_distance_field_mode); + ClassDB::bind_method(D_METHOD("canvas_item_set_custom_rect", "item", "use_custom_rect", "rect"), &RenderingServer::canvas_item_set_custom_rect, DEFVAL(Rect2())); + ClassDB::bind_method(D_METHOD("canvas_item_set_modulate", "item", "color"), &RenderingServer::canvas_item_set_modulate); + ClassDB::bind_method(D_METHOD("canvas_item_set_self_modulate", "item", "color"), &RenderingServer::canvas_item_set_self_modulate); + ClassDB::bind_method(D_METHOD("canvas_item_set_draw_behind_parent", "item", "enabled"), &RenderingServer::canvas_item_set_draw_behind_parent); + //primitives + + ClassDB::bind_method(D_METHOD("canvas_item_add_line", "item", "from", "to", "color", "width"), &RenderingServer::canvas_item_add_line, DEFVAL(1.0)); + ClassDB::bind_method(D_METHOD("canvas_item_add_polyline", "item", "points", "colors", "width", "antialiased"), &RenderingServer::canvas_item_add_polyline, DEFVAL(1.0), DEFVAL(false)); + ClassDB::bind_method(D_METHOD("canvas_item_add_rect", "item", "rect", "color"), &RenderingServer::canvas_item_add_rect); + ClassDB::bind_method(D_METHOD("canvas_item_add_circle", "item", "pos", "radius", "color"), &RenderingServer::canvas_item_add_circle); + ClassDB::bind_method(D_METHOD("canvas_item_add_texture_rect", "item", "rect", "texture", "tile", "modulate", "transpose"), &RenderingServer::canvas_item_add_texture_rect, DEFVAL(false), DEFVAL(Color(1, 1, 1)), DEFVAL(false)); + ClassDB::bind_method(D_METHOD("canvas_item_add_texture_rect_region", "item", "rect", "texture", "src_rect", "modulate", "transpose", "clip_uv"), &RenderingServer::canvas_item_add_texture_rect_region, DEFVAL(Color(1, 1, 1)), DEFVAL(false), DEFVAL(true)); + ClassDB::bind_method(D_METHOD("canvas_item_add_nine_patch", "item", "rect", "source", "texture", "topleft", "bottomright", "x_axis_mode", "y_axis_mode", "draw_center", "modulate"), &RenderingServer::canvas_item_add_nine_patch, DEFVAL(NINE_PATCH_STRETCH), DEFVAL(NINE_PATCH_STRETCH), DEFVAL(true), DEFVAL(Color(1, 1, 1))); + ClassDB::bind_method(D_METHOD("canvas_item_add_primitive", "item", "points", "colors", "uvs", "texture", "width"), &RenderingServer::canvas_item_add_primitive, DEFVAL(1.0)); + ClassDB::bind_method(D_METHOD("canvas_item_add_polygon", "item", "points", "colors", "uvs", "texture"), &RenderingServer::canvas_item_add_polygon, DEFVAL(Vector()), DEFVAL(RID())); + ClassDB::bind_method(D_METHOD("canvas_item_add_triangle_array", "item", "indices", "points", "colors", "uvs", "bones", "weights", "texture", "count"), &RenderingServer::canvas_item_add_triangle_array, DEFVAL(Vector()), DEFVAL(Vector()), DEFVAL(Vector()), DEFVAL(RID()), DEFVAL(-1)); + ClassDB::bind_method(D_METHOD("canvas_item_add_mesh", "item", "mesh", "transform", "modulate", "texture"), &RenderingServer::canvas_item_add_mesh, DEFVAL(Transform2D()), DEFVAL(Color(1, 1, 1)), DEFVAL(RID())); + ClassDB::bind_method(D_METHOD("canvas_item_add_multimesh", "item", "mesh", "texture"), &RenderingServer::canvas_item_add_multimesh, DEFVAL(RID())); + ClassDB::bind_method(D_METHOD("canvas_item_add_particles", "item", "particles", "texture"), &RenderingServer::canvas_item_add_particles); + ClassDB::bind_method(D_METHOD("canvas_item_add_set_transform", "item", "transform"), &RenderingServer::canvas_item_add_set_transform); + ClassDB::bind_method(D_METHOD("canvas_item_add_clip_ignore", "item", "ignore"), &RenderingServer::canvas_item_add_clip_ignore); + ClassDB::bind_method(D_METHOD("canvas_item_set_sort_children_by_y", "item", "enabled"), &RenderingServer::canvas_item_set_sort_children_by_y); + ClassDB::bind_method(D_METHOD("canvas_item_set_z_index", "item", "z_index"), &RenderingServer::canvas_item_set_z_index); + ClassDB::bind_method(D_METHOD("canvas_item_set_z_as_relative_to_parent", "item", "enabled"), &RenderingServer::canvas_item_set_z_as_relative_to_parent); + ClassDB::bind_method(D_METHOD("canvas_item_set_copy_to_backbuffer", "item", "enabled", "rect"), &RenderingServer::canvas_item_set_copy_to_backbuffer); + + ClassDB::bind_method(D_METHOD("canvas_item_clear", "item"), &RenderingServer::canvas_item_clear); + ClassDB::bind_method(D_METHOD("canvas_item_set_draw_index", "item", "index"), &RenderingServer::canvas_item_set_draw_index); + ClassDB::bind_method(D_METHOD("canvas_item_set_material", "item", "material"), &RenderingServer::canvas_item_set_material); + ClassDB::bind_method(D_METHOD("canvas_item_set_use_parent_material", "item", "enabled"), &RenderingServer::canvas_item_set_use_parent_material); + + ClassDB::bind_method(D_METHOD("canvas_item_set_visibility_notifier", "item", "enable", "area", "enter_callable", "exit_callable"), &RenderingServer::canvas_item_set_visibility_notifier); + ClassDB::bind_method(D_METHOD("canvas_item_set_canvas_group_mode", "item", "mode", "clear_margin", "fit_empty", "fit_margin", "blur_mipmaps"), &RenderingServer::canvas_item_set_canvas_group_mode, DEFVAL(5.0), DEFVAL(false), DEFVAL(0.0), DEFVAL(false)); + BIND_ENUM_CONSTANT(NINE_PATCH_STRETCH); BIND_ENUM_CONSTANT(NINE_PATCH_TILE); BIND_ENUM_CONSTANT(NINE_PATCH_TILE_FIT); @@ -2143,6 +2525,28 @@ void RenderingServer::_bind_methods() { BIND_ENUM_CONSTANT(CANVAS_GROUP_MODE_OPAQUE); BIND_ENUM_CONSTANT(CANVAS_GROUP_MODE_TRANSPARENT); + /* CANVAS LIGHT */ + + ClassDB::bind_method(D_METHOD("canvas_light_create"), &RenderingServer::canvas_light_create); + ClassDB::bind_method(D_METHOD("canvas_light_attach_to_canvas", "light", "canvas"), &RenderingServer::canvas_light_attach_to_canvas); + ClassDB::bind_method(D_METHOD("canvas_light_set_enabled", "light", "enabled"), &RenderingServer::canvas_light_set_enabled); + ClassDB::bind_method(D_METHOD("canvas_light_set_texture_scale", "light", "scale"), &RenderingServer::canvas_light_set_texture_scale); + ClassDB::bind_method(D_METHOD("canvas_light_set_transform", "light", "transform"), &RenderingServer::canvas_light_set_transform); + ClassDB::bind_method(D_METHOD("canvas_light_set_texture", "light", "texture"), &RenderingServer::canvas_light_set_texture); + ClassDB::bind_method(D_METHOD("canvas_light_set_texture_offset", "light", "offset"), &RenderingServer::canvas_light_set_texture_offset); + ClassDB::bind_method(D_METHOD("canvas_light_set_color", "light", "color"), &RenderingServer::canvas_light_set_color); + ClassDB::bind_method(D_METHOD("canvas_light_set_height", "light", "height"), &RenderingServer::canvas_light_set_height); + ClassDB::bind_method(D_METHOD("canvas_light_set_energy", "light", "energy"), &RenderingServer::canvas_light_set_energy); + ClassDB::bind_method(D_METHOD("canvas_light_set_z_range", "light", "min_z", "max_z"), &RenderingServer::canvas_light_set_z_range); + ClassDB::bind_method(D_METHOD("canvas_light_set_layer_range", "light", "min_layer", "max_layer"), &RenderingServer::canvas_light_set_layer_range); + ClassDB::bind_method(D_METHOD("canvas_light_set_item_cull_mask", "light", "mask"), &RenderingServer::canvas_light_set_item_cull_mask); + ClassDB::bind_method(D_METHOD("canvas_light_set_item_shadow_cull_mask", "light", "mask"), &RenderingServer::canvas_light_set_item_shadow_cull_mask); + ClassDB::bind_method(D_METHOD("canvas_light_set_mode", "light", "mode"), &RenderingServer::canvas_light_set_mode); + ClassDB::bind_method(D_METHOD("canvas_light_set_shadow_enabled", "light", "enabled"), &RenderingServer::canvas_light_set_shadow_enabled); + ClassDB::bind_method(D_METHOD("canvas_light_set_shadow_filter", "light", "filter"), &RenderingServer::canvas_light_set_shadow_filter); + ClassDB::bind_method(D_METHOD("canvas_light_set_shadow_color", "light", "color"), &RenderingServer::canvas_light_set_shadow_color); + ClassDB::bind_method(D_METHOD("canvas_light_set_shadow_smooth", "light", "smooth"), &RenderingServer::canvas_light_set_shadow_smooth); + BIND_ENUM_CONSTANT(CANVAS_LIGHT_MODE_POINT); BIND_ENUM_CONSTANT(CANVAS_LIGHT_MODE_DIRECTIONAL); @@ -2155,10 +2559,38 @@ void RenderingServer::_bind_methods() { BIND_ENUM_CONSTANT(CANVAS_LIGHT_FILTER_PCF13); BIND_ENUM_CONSTANT(CANVAS_LIGHT_FILTER_MAX); + /* CANVAS OCCLUDER */ + + ClassDB::bind_method(D_METHOD("canvas_light_occluder_create"), &RenderingServer::canvas_light_occluder_create); + ClassDB::bind_method(D_METHOD("canvas_light_occluder_attach_to_canvas", "occluder", "canvas"), &RenderingServer::canvas_light_occluder_attach_to_canvas); + ClassDB::bind_method(D_METHOD("canvas_light_occluder_set_enabled", "occluder", "enabled"), &RenderingServer::canvas_light_occluder_set_enabled); + ClassDB::bind_method(D_METHOD("canvas_light_occluder_set_polygon", "occluder", "polygon"), &RenderingServer::canvas_light_occluder_set_polygon); + ClassDB::bind_method(D_METHOD("canvas_light_occluder_set_as_sdf_collision", "occluder", "enable"), &RenderingServer::canvas_light_occluder_set_as_sdf_collision); + ClassDB::bind_method(D_METHOD("canvas_light_occluder_set_transform", "occluder", "transform"), &RenderingServer::canvas_light_occluder_set_transform); + ClassDB::bind_method(D_METHOD("canvas_light_occluder_set_light_mask", "occluder", "mask"), &RenderingServer::canvas_light_occluder_set_light_mask); + + /* CANVAS LIGHT OCCLUDER POLYGON */ + + ClassDB::bind_method(D_METHOD("canvas_occluder_polygon_create"), &RenderingServer::canvas_occluder_polygon_create); + ClassDB::bind_method(D_METHOD("canvas_occluder_polygon_set_shape", "occluder_polygon", "shape", "closed"), &RenderingServer::canvas_occluder_polygon_set_shape); + ClassDB::bind_method(D_METHOD("canvas_occluder_polygon_set_cull_mode", "occluder_polygon", "mode"), &RenderingServer::canvas_occluder_polygon_set_cull_mode); + + ClassDB::bind_method(D_METHOD("canvas_set_shadow_texture_size", "size"), &RenderingServer::canvas_set_shadow_texture_size); + BIND_ENUM_CONSTANT(CANVAS_OCCLUDER_POLYGON_CULL_DISABLED); BIND_ENUM_CONSTANT(CANVAS_OCCLUDER_POLYGON_CULL_CLOCKWISE); BIND_ENUM_CONSTANT(CANVAS_OCCLUDER_POLYGON_CULL_COUNTER_CLOCKWISE); + /* GLOBAL VARIABLES */ + + ClassDB::bind_method(D_METHOD("global_variable_add", "name", "type", "default_value"), &RenderingServer::global_variable_add); + ClassDB::bind_method(D_METHOD("global_variable_remove", "name"), &RenderingServer::global_variable_remove); + ClassDB::bind_method(D_METHOD("global_variable_get_list"), &RenderingServer::global_variable_get_list); + ClassDB::bind_method(D_METHOD("global_variable_set", "name", "value"), &RenderingServer::global_variable_set); + ClassDB::bind_method(D_METHOD("global_variable_set_override", "name", "value"), &RenderingServer::global_variable_set_override); + ClassDB::bind_method(D_METHOD("global_variable_get", "name"), &RenderingServer::global_variable_get); + ClassDB::bind_method(D_METHOD("global_variable_get_type", "name"), &RenderingServer::global_variable_get_type); + BIND_ENUM_CONSTANT(GLOBAL_VAR_TYPE_BOOL); BIND_ENUM_CONSTANT(GLOBAL_VAR_TYPE_BVEC2); BIND_ENUM_CONSTANT(GLOBAL_VAR_TYPE_BVEC3); @@ -2189,6 +2621,37 @@ void RenderingServer::_bind_methods() { BIND_ENUM_CONSTANT(GLOBAL_VAR_TYPE_SAMPLERCUBE); BIND_ENUM_CONSTANT(GLOBAL_VAR_TYPE_MAX); + /* Free */ + ClassDB::bind_method(D_METHOD("free_rid", "rid"), &RenderingServer::free); // shouldn't conflict with Object::free() + + /* Misc */ + + ClassDB::bind_method(D_METHOD("request_frame_drawn_callback", "where", "method", "userdata"), &RenderingServer::request_frame_drawn_callback); + ClassDB::bind_method(D_METHOD("has_changed"), &RenderingServer::has_changed); + ClassDB::bind_method(D_METHOD("get_render_info", "info"), &RenderingServer::get_render_info); + ClassDB::bind_method(D_METHOD("get_video_adapter_name"), &RenderingServer::get_video_adapter_name); + ClassDB::bind_method(D_METHOD("get_video_adapter_vendor"), &RenderingServer::get_video_adapter_vendor); + + ClassDB::bind_method(D_METHOD("make_sphere_mesh", "latitudes", "longitudes", "radius"), &RenderingServer::make_sphere_mesh); + ClassDB::bind_method(D_METHOD("get_test_cube"), &RenderingServer::get_test_cube); + + ClassDB::bind_method(D_METHOD("get_test_texture"), &RenderingServer::get_test_texture); + ClassDB::bind_method(D_METHOD("get_white_texture"), &RenderingServer::get_white_texture); + + ClassDB::bind_method(D_METHOD("set_boot_image", "image", "color", "scale", "use_filter"), &RenderingServer::set_boot_image, DEFVAL(true)); + ClassDB::bind_method(D_METHOD("set_default_clear_color", "color"), &RenderingServer::set_default_clear_color); + + ClassDB::bind_method(D_METHOD("has_feature", "feature"), &RenderingServer::has_feature); + ClassDB::bind_method(D_METHOD("has_os_feature", "feature"), &RenderingServer::has_os_feature); + ClassDB::bind_method(D_METHOD("set_debug_generate_wireframes", "generate"), &RenderingServer::set_debug_generate_wireframes); + + ClassDB::bind_method(D_METHOD("is_render_loop_enabled"), &RenderingServer::is_render_loop_enabled); + ClassDB::bind_method(D_METHOD("set_render_loop_enabled", "enabled"), &RenderingServer::set_render_loop_enabled); + + ClassDB::bind_method(D_METHOD("get_frame_setup_time_cpu"), &RenderingServer::get_frame_setup_time_cpu); + + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "render_loop_enabled"), "set_render_loop_enabled", "is_render_loop_enabled"); + BIND_ENUM_CONSTANT(INFO_OBJECTS_IN_FRAME); BIND_ENUM_CONSTANT(INFO_VERTICES_IN_FRAME); BIND_ENUM_CONSTANT(INFO_MATERIAL_CHANGES_IN_FRAME); @@ -2205,6 +2668,10 @@ void RenderingServer::_bind_methods() { ADD_SIGNAL(MethodInfo("frame_pre_draw")); ADD_SIGNAL(MethodInfo("frame_post_draw")); + + ClassDB::bind_method(D_METHOD("force_sync"), &RenderingServer::sync); + ClassDB::bind_method(D_METHOD("force_draw", "swap_buffers", "frame_step"), &RenderingServer::draw, DEFVAL(true), DEFVAL(0.0)); + ClassDB::bind_method(D_METHOD("create_local_rendering_device"), &RenderingServer::create_local_rendering_device); } void RenderingServer::mesh_add_surface_from_mesh_data(RID p_mesh, const Geometry3D::MeshData &p_mesh_data) { diff --git a/servers/rendering_server.h b/servers/rendering_server.h index 431d1a827c..93fc628976 100644 --- a/servers/rendering_server.h +++ b/servers/rendering_server.h @@ -103,7 +103,6 @@ public: virtual RID texture_3d_create(Image::Format, int p_width, int p_height, int p_depth, bool p_mipmaps, const Vector> &p_data) = 0; //all slices, then all the mipmaps, must be coherent virtual RID texture_proxy_create(RID p_base) = 0; - virtual void texture_2d_update_immediate(RID p_texture, const Ref &p_image, int p_layer = 0) = 0; //mostly used for video and streaming virtual void texture_2d_update(RID p_texture, const Ref &p_image, int p_layer = 0) = 0; virtual void texture_3d_update(RID p_texture, const Vector> &p_data) = 0; virtual void texture_proxy_update(RID p_texture, RID p_proxy_to) = 0; @@ -119,10 +118,6 @@ public: virtual void texture_replace(RID p_texture, RID p_by_texture) = 0; virtual void texture_set_size_override(RID p_texture, int p_width, int p_height) = 0; -// FIXME: Disabled during Vulkan refactoring, should be ported. -#if 0 - virtual void texture_bind(RID p_texture, uint32_t p_texture_no) = 0; -#endif virtual void texture_set_path(RID p_texture, const String &p_path) = 0; virtual String texture_get_path(RID p_texture) const = 0; @@ -173,7 +168,6 @@ public: virtual void shader_set_code(RID p_shader, const String &p_code) = 0; virtual String shader_get_code(RID p_shader) const = 0; virtual void shader_get_param_list(RID p_shader, List *p_param_list) const = 0; - Array _shader_get_param_list_bind(RID p_shader) const; virtual Variant shader_get_param_default(RID p_shader, const StringName &p_param) const = 0; virtual void shader_set_default_texture_param(RID p_shader, const StringName &p_name, RID p_texture) = 0; @@ -214,9 +208,9 @@ public: enum ArrayType { ARRAY_VERTEX = 0, // RG32F or RGB32F (depending on 2D bit) - ARRAY_NORMAL = 1, // A2B10G10R10 + ARRAY_NORMAL = 1, // A2B10G10R10, A is ignored ARRAY_TANGENT = 2, // A2B10G10R10, A flips sign of binormal - ARRAY_COLOR = 3, // RGBA16F + ARRAY_COLOR = 3, // RGBA8 ARRAY_TEX_UV = 4, // RG32F ARRAY_TEX_UV2 = 5, // RG32F ARRAY_CUSTOM0 = 6, // depends on ArrayCustomFormat @@ -482,6 +476,19 @@ public: virtual void light_directional_set_shadow_depth_range_mode(RID p_light, LightDirectionalShadowDepthRangeMode p_range_mode) = 0; + virtual void directional_shadow_atlas_set_size(int p_size, bool p_16_bits = false) = 0; + + enum ShadowQuality { + SHADOW_QUALITY_HARD, + SHADOW_QUALITY_SOFT_LOW, + SHADOW_QUALITY_SOFT_MEDIUM, + SHADOW_QUALITY_SOFT_HIGH, + SHADOW_QUALITY_SOFT_ULTRA, + SHADOW_QUALITY_MAX + }; + + virtual void shadows_quality_set(ShadowQuality p_quality) = 0; + virtual void directional_shadow_quality_set(ShadowQuality p_quality) = 0; /* PROBE API */ virtual RID reflection_probe_create() = 0; @@ -549,34 +556,12 @@ public: virtual Transform3D voxel_gi_get_to_cell_xform(RID p_voxel_gi) const = 0; virtual void voxel_gi_set_dynamic_range(RID p_voxel_gi, float p_range) = 0; - virtual float voxel_gi_get_dynamic_range(RID p_voxel_gi) const = 0; - virtual void voxel_gi_set_propagation(RID p_voxel_gi, float p_range) = 0; - virtual float voxel_gi_get_propagation(RID p_voxel_gi) const = 0; - virtual void voxel_gi_set_energy(RID p_voxel_gi, float p_energy) = 0; - virtual float voxel_gi_get_energy(RID p_voxel_gi) const = 0; - - virtual void voxel_gi_set_ao(RID p_voxel_gi, float p_ao) = 0; - virtual float voxel_gi_get_ao(RID p_voxel_gi) const = 0; - - virtual void voxel_gi_set_ao_size(RID p_voxel_gi, float p_strength) = 0; - virtual float voxel_gi_get_ao_size(RID p_voxel_gi) const = 0; - virtual void voxel_gi_set_bias(RID p_voxel_gi, float p_bias) = 0; - virtual float voxel_gi_get_bias(RID p_voxel_gi) const = 0; - virtual void voxel_gi_set_normal_bias(RID p_voxel_gi, float p_range) = 0; - virtual float voxel_gi_get_normal_bias(RID p_voxel_gi) const = 0; - virtual void voxel_gi_set_interior(RID p_voxel_gi, bool p_enable) = 0; - virtual bool voxel_gi_is_interior(RID p_voxel_gi) const = 0; - virtual void voxel_gi_set_use_two_bounces(RID p_voxel_gi, bool p_enable) = 0; - virtual bool voxel_gi_is_using_two_bounces(RID p_voxel_gi) const = 0; - - virtual void voxel_gi_set_anisotropy_strength(RID p_voxel_gi, float p_strength) = 0; - virtual float voxel_gi_get_anisotropy_strength(RID p_voxel_gi) const = 0; enum VoxelGIQuality { VOXEL_GI_QUALITY_LOW, @@ -731,7 +716,7 @@ public: virtual void camera_set_camera_effects(RID p_camera, RID p_camera_effects) = 0; virtual void camera_set_use_vertical_aspect(RID p_camera, bool p_enable) = 0; - /* VIEWPORT TARGET API */ + /* VIEWPORT API */ enum CanvasItemTextureFilter { CANVAS_ITEM_TEXTURE_FILTER_DEFAULT, //uses canvas item setting for draw command, uses global setting for canvas item @@ -782,10 +767,9 @@ public: virtual RID viewport_get_texture(RID p_viewport) const = 0; - virtual void viewport_set_hide_scenario(RID p_viewport, bool p_hide) = 0; - virtual void viewport_set_hide_canvas(RID p_viewport, bool p_hide) = 0; virtual void viewport_set_disable_environment(RID p_viewport, bool p_disable) = 0; virtual void viewport_set_disable_3d(RID p_viewport, bool p_disable) = 0; + virtual void viewport_set_disable_2d(RID p_viewport, bool p_disable) = 0; virtual void viewport_attach_camera(RID p_viewport, RID p_camera) = 0; virtual void viewport_set_scenario(RID p_viewport, RID p_scenario) = 0; @@ -901,8 +885,6 @@ public: virtual float viewport_get_measured_render_time_cpu(RID p_viewport) const = 0; virtual float viewport_get_measured_render_time_gpu(RID p_viewport) const = 0; - virtual void directional_shadow_atlas_set_size(int p_size, bool p_16_bits = false) = 0; - /* SKY API */ enum SkyMode { @@ -953,10 +935,6 @@ public: virtual void environment_set_bg_energy(RID p_env, float p_energy) = 0; virtual void environment_set_canvas_max_layer(RID p_env, int p_max_layer) = 0; virtual void environment_set_ambient_light(RID p_env, const Color &p_color, EnvironmentAmbientSource p_ambient = ENV_AMBIENT_SOURCE_BG, float p_energy = 1.0, float p_sky_contribution = 0.0, EnvironmentReflectionSource p_reflection_source = ENV_REFLECTION_SOURCE_BG, const Color &p_ao_color = Color()) = 0; -// FIXME: Disabled during Vulkan refactoring, should be ported. -#if 0 - virtual void environment_set_camera_feed_id(RID p_env, int p_camera_feed_id) = 0; -#endif enum EnvironmentGlowBlendMode { ENV_GLOW_BLEND_MODE_ADDITIVE, @@ -1098,30 +1076,10 @@ public: virtual void camera_effects_set_dof_blur(RID p_camera_effects, bool p_far_enable, float p_far_distance, float p_far_transition, bool p_near_enable, float p_near_distance, float p_near_transition, float p_amount) = 0; virtual void camera_effects_set_custom_exposure(RID p_camera_effects, bool p_enable, float p_exposure) = 0; - enum ShadowQuality { - SHADOW_QUALITY_HARD, - SHADOW_QUALITY_SOFT_LOW, - SHADOW_QUALITY_SOFT_MEDIUM, - SHADOW_QUALITY_SOFT_HIGH, - SHADOW_QUALITY_SOFT_ULTRA, - SHADOW_QUALITY_MAX - }; - - virtual void shadows_quality_set(ShadowQuality p_quality) = 0; - virtual void directional_shadow_quality_set(ShadowQuality p_quality) = 0; - /* SCENARIO API */ virtual RID scenario_create() = 0; - enum ScenarioDebugMode { - SCENARIO_DEBUG_DISABLED, - SCENARIO_DEBUG_WIREFRAME, - SCENARIO_DEBUG_OVERDRAW, - SCENARIO_DEBUG_SHADELESS, - }; - - virtual void scenario_set_debug(RID p_scenario, ScenarioDebugMode p_debug_mode) = 0; virtual void scenario_set_environment(RID p_scenario, RID p_environment) = 0; virtual void scenario_set_fallback_environment(RID p_scenario, RID p_environment) = 0; virtual void scenario_set_camera_effects(RID p_scenario, RID p_camera_effects) = 0; @@ -1162,7 +1120,6 @@ public: virtual void instance_set_custom_aabb(RID p_instance, AABB aabb) = 0; virtual void instance_attach_skeleton(RID p_instance, RID p_skeleton) = 0; - virtual void instance_set_exterior(RID p_instance, bool p_enabled) = 0; virtual void instance_set_extra_visibility_margin(RID p_instance, real_t p_margin) = 0; virtual void instance_set_visibility_parent(RID p_instance, RID p_parent_instance) = 0; @@ -1194,7 +1151,6 @@ public: virtual void instance_geometry_set_flag(RID p_instance, InstanceFlags p_flags, bool p_enabled) = 0; virtual void instance_geometry_set_cast_shadows_setting(RID p_instance, ShadowCastingSetting p_shadow_casting_setting) = 0; virtual void instance_geometry_set_material_override(RID p_instance, RID p_material) = 0; - virtual void instance_geometry_set_visibility_range(RID p_instance, float p_min, float p_max, float p_min_margin, float p_max_margin) = 0; virtual void instance_geometry_set_lightmap(RID p_instance, RID p_lightmap, const Rect2 &p_lightmap_uv_scale, int p_lightmap_slice) = 0; virtual void instance_geometry_set_lod_bias(RID p_instance, float p_lod_bias) = 0; @@ -1224,6 +1180,7 @@ public: virtual void canvas_set_disable_scale(bool p_disable) = 0; + /* CANVAS TEXTURE */ virtual RID canvas_texture_create() = 0; enum CanvasTextureChannel { @@ -1238,6 +1195,8 @@ public: virtual void canvas_texture_set_texture_filter(RID p_canvas_texture, CanvasItemTextureFilter p_filter) = 0; virtual void canvas_texture_set_texture_repeat(RID p_canvas_texture, CanvasItemTextureRepeat p_repeat) = 0; + /* CANVAS ITEM */ + virtual RID canvas_item_create() = 0; virtual void canvas_item_set_parent(RID p_item, RID p_parent) = 0; @@ -1281,6 +1240,7 @@ public: virtual void canvas_item_add_set_transform(RID p_item, const Transform2D &p_transform) = 0; virtual void canvas_item_add_clip_ignore(RID p_item, bool p_ignore) = 0; virtual void canvas_item_add_animation_slice(RID p_item, double p_animation_length, double p_slice_begin, double p_slice_end, double p_offset) = 0; + virtual void canvas_item_set_sort_children_by_y(RID p_item, bool p_enable) = 0; virtual void canvas_item_set_z_index(RID p_item, int p_z) = 0; virtual void canvas_item_set_z_as_relative_to_parent(RID p_item, bool p_enable) = 0; @@ -1305,6 +1265,7 @@ public: virtual void canvas_item_set_canvas_group_mode(RID p_item, CanvasGroupMode p_mode, float p_clear_margin = 5.0, bool p_fit_empty = false, float p_fit_margin = 0.0, bool p_blur_mipmaps = false) = 0; + /* CANVAS LIGHT */ virtual RID canvas_light_create() = 0; enum CanvasLightMode { @@ -1351,6 +1312,8 @@ public: virtual void canvas_light_set_shadow_color(RID p_light, const Color &p_color) = 0; virtual void canvas_light_set_shadow_smooth(RID p_light, float p_smooth) = 0; + /* CANVAS LIGHT OCCLUDER */ + virtual RID canvas_light_occluder_create() = 0; virtual void canvas_light_occluder_attach_to_canvas(RID p_occluder, RID p_canvas) = 0; virtual void canvas_light_occluder_set_enabled(RID p_occluder, bool p_enabled) = 0; @@ -1359,6 +1322,8 @@ public: virtual void canvas_light_occluder_set_transform(RID p_occluder, const Transform2D &p_xform) = 0; virtual void canvas_light_occluder_set_light_mask(RID p_occluder, int p_mask) = 0; + /* CANVAS LIGHT OCCLUDER POLYGON */ + virtual RID canvas_occluder_polygon_create() = 0; virtual void canvas_occluder_polygon_set_shape(RID p_occluder_polygon, const Vector &p_shape, bool p_closed) = 0; @@ -1421,11 +1386,6 @@ public: static ShaderLanguage::DataType global_variable_type_get_shader_datatype(GlobalVariableType p_type); - /* BLACK BARS */ - - virtual void black_bars_set_margins(int p_left, int p_top, int p_right, int p_bottom) = 0; - virtual void black_bars_set_images(RID p_left, RID p_top, RID p_right, RID p_bottom) = 0; - /* FREE */ virtual void free(RID p_rid) = 0; ///< free RIDs associated with the visual server @@ -1514,6 +1474,20 @@ public: RenderingServer(); virtual ~RenderingServer(); + +private: + //binder helpers + RID _texture_2d_layered_create(const TypedArray &p_layers, TextureLayeredType p_layered_type); + RID _texture_3d_create(Image::Format p_format, int p_width, int p_height, int p_depth, bool p_mipmaps, const TypedArray &p_data); + void _texture_3d_update(RID p_texture, const TypedArray &p_data); + TypedArray _texture_3d_get(RID p_texture) const; + TypedArray _shader_get_param_list(RID p_shader) const; + RID _mesh_create_from_surfaces(const TypedArray &p_surfaces, int p_blend_shape_count); + void _mesh_add_surface(RID p_mesh, const Dictionary &p_surface); + Dictionary _mesh_get_surface(RID p_mesh, int p_idx); + Array _instance_geometry_get_shader_parameter_list(RID p_instance) const; + TypedArray _bake_render_uv2(RID p_base, const TypedArray &p_material_overrides, const Size2i &p_image_size); + void _particles_set_trail_bind_poses(RID p_particles, const TypedArray &p_bind_poses); }; // make variant understand the enums @@ -1522,6 +1496,7 @@ VARIANT_ENUM_CAST(RenderingServer::CubeMapLayer); VARIANT_ENUM_CAST(RenderingServer::ShaderMode); VARIANT_ENUM_CAST(RenderingServer::ArrayType); VARIANT_ENUM_CAST(RenderingServer::ArrayFormat); +VARIANT_ENUM_CAST(RenderingServer::ArrayCustomFormat); VARIANT_ENUM_CAST(RenderingServer::PrimitiveType); VARIANT_ENUM_CAST(RenderingServer::BlendShapeMode); VARIANT_ENUM_CAST(RenderingServer::MultimeshTransformFormat); @@ -1533,8 +1508,14 @@ VARIANT_ENUM_CAST(RenderingServer::LightDirectionalShadowMode); VARIANT_ENUM_CAST(RenderingServer::LightDirectionalShadowDepthRangeMode); VARIANT_ENUM_CAST(RenderingServer::ReflectionProbeUpdateMode); VARIANT_ENUM_CAST(RenderingServer::ReflectionProbeAmbientMode); +VARIANT_ENUM_CAST(RenderingServer::VoxelGIQuality); VARIANT_ENUM_CAST(RenderingServer::DecalTexture); +VARIANT_ENUM_CAST(RenderingServer::ParticlesMode); +VARIANT_ENUM_CAST(RenderingServer::ParticlesTransformAlign); VARIANT_ENUM_CAST(RenderingServer::ParticlesDrawOrder); +VARIANT_ENUM_CAST(RenderingServer::ParticlesEmitFlags); +VARIANT_ENUM_CAST(RenderingServer::ParticlesCollisionType); +VARIANT_ENUM_CAST(RenderingServer::ParticlesCollisionHeightfieldResolution); VARIANT_ENUM_CAST(RenderingServer::ViewportUpdateMode); VARIANT_ENUM_CAST(RenderingServer::ViewportClearMode); VARIANT_ENUM_CAST(RenderingServer::ViewportMSAA); @@ -1542,6 +1523,8 @@ VARIANT_ENUM_CAST(RenderingServer::ViewportScreenSpaceAA); VARIANT_ENUM_CAST(RenderingServer::ViewportRenderInfo); VARIANT_ENUM_CAST(RenderingServer::ViewportDebugDraw); VARIANT_ENUM_CAST(RenderingServer::ViewportOcclusionCullingBuildQuality); +VARIANT_ENUM_CAST(RenderingServer::ViewportSDFOversize); +VARIANT_ENUM_CAST(RenderingServer::ViewportSDFScale); VARIANT_ENUM_CAST(RenderingServer::SkyMode); VARIANT_ENUM_CAST(RenderingServer::EnvironmentBG); VARIANT_ENUM_CAST(RenderingServer::EnvironmentAmbientSource); @@ -1550,11 +1533,15 @@ VARIANT_ENUM_CAST(RenderingServer::EnvironmentGlowBlendMode); VARIANT_ENUM_CAST(RenderingServer::EnvironmentToneMapper); VARIANT_ENUM_CAST(RenderingServer::EnvironmentSSRRoughnessQuality); VARIANT_ENUM_CAST(RenderingServer::EnvironmentSSAOQuality); +VARIANT_ENUM_CAST(RenderingServer::EnvironmentSDFGICascades); +VARIANT_ENUM_CAST(RenderingServer::EnvironmentSDFGIFramesToConverge); +VARIANT_ENUM_CAST(RenderingServer::EnvironmentSDFGIRayCount); +VARIANT_ENUM_CAST(RenderingServer::EnvironmentSDFGIFramesToUpdateLight); +VARIANT_ENUM_CAST(RenderingServer::EnvironmentSDFGIYScale); VARIANT_ENUM_CAST(RenderingServer::SubSurfaceScatteringQuality); VARIANT_ENUM_CAST(RenderingServer::DOFBlurQuality); VARIANT_ENUM_CAST(RenderingServer::DOFBokehShape); VARIANT_ENUM_CAST(RenderingServer::ShadowQuality); -VARIANT_ENUM_CAST(RenderingServer::ScenarioDebugMode); VARIANT_ENUM_CAST(RenderingServer::InstanceType); VARIANT_ENUM_CAST(RenderingServer::InstanceFlags); VARIANT_ENUM_CAST(RenderingServer::ShadowCastingSetting); @@ -1569,6 +1556,8 @@ VARIANT_ENUM_CAST(RenderingServer::CanvasOccluderPolygonCullMode); VARIANT_ENUM_CAST(RenderingServer::GlobalVariableType); VARIANT_ENUM_CAST(RenderingServer::RenderInfo); VARIANT_ENUM_CAST(RenderingServer::Features); +VARIANT_ENUM_CAST(RenderingServer::CanvasTextureChannel); +VARIANT_ENUM_CAST(RenderingServer::BakeChannels); // Alias to make it easier to use. #define RS RenderingServer -- cgit v1.2.3