Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Expose RenderingSceneBuffers through ClassDB
- Loading branch information
1 parent
f8dbed4
commit 781a118
Showing
13 changed files
with
408 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<class name="RenderSceneBuffers" inherits="RefCounted" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> | ||
<brief_description> | ||
A scene buffers object is created for each viewport for which 3D rendering is done. | ||
</brief_description> | ||
<description> | ||
A scene buffers object is created for each viewport for which 3D rendering is done. It manages any additional buffers used during rendering and will discard buffers when the viewport is resized. | ||
[b]Note:[/b] this is an internal rendering server object only exposed for GDExtension plugins. | ||
</description> | ||
<tutorials> | ||
</tutorials> | ||
<methods> | ||
<method name="configure"> | ||
<return type="void" /> | ||
<param index="0" name="render_target" type="RID" /> | ||
<param index="1" name="internal_size" type="Vector2i" /> | ||
<param index="2" name="target_size" type="Vector2i" /> | ||
<param index="3" name="scaling_3d_mode" type="int" enum="RenderingServer.ViewportScaling3DMode" /> | ||
<param index="4" name="fsr_sharpness" type="float" /> | ||
<param index="5" name="texture_mipmap_bias" type="float" /> | ||
<param index="6" name="msaa" type="int" enum="RenderingServer.ViewportMSAA" /> | ||
<param index="7" name="screen_space_aa" type="int" enum="RenderingServer.ViewportScreenSpaceAA" /> | ||
<param index="8" name="use_taa" type="bool" /> | ||
<param index="9" name="use_debanding" type="bool" /> | ||
<param index="10" name="view_count" type="int" /> | ||
<description> | ||
This method is called by the rendering server when the associated viewports configuration is changed. It will discard the old buffers and recreate the internal buffers used. | ||
</description> | ||
</method> | ||
</methods> | ||
</class> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<class name="RenderSceneBuffersExtension" inherits="RenderSceneBuffers" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> | ||
<brief_description> | ||
This class allows for a RenderSceneBuffer implementation to be made in GDExtension. | ||
</brief_description> | ||
<description> | ||
This class allows for a RenderSceneBuffer implementation to be made in GDExtension. | ||
</description> | ||
<tutorials> | ||
</tutorials> | ||
<methods> | ||
<method name="_configure" qualifiers="virtual"> | ||
<return type="void" /> | ||
<param index="0" name="render_target" type="RID" /> | ||
<param index="1" name="internal_size" type="Vector2i" /> | ||
<param index="2" name="target_size" type="Vector2i" /> | ||
<param index="3" name="scaling_3d_mode" type="int" enum="RenderingServer.ViewportScaling3DMode" /> | ||
<param index="4" name="fsr_sharpness" type="float" /> | ||
<param index="5" name="texture_mipmap_bias" type="float" /> | ||
<param index="6" name="msaa" type="int" enum="RenderingServer.ViewportMSAA" /> | ||
<param index="7" name="screen_space_aa" type="int" enum="RenderingServer.ViewportScreenSpaceAA" /> | ||
<param index="8" name="use_taa" type="bool" /> | ||
<param index="9" name="use_debanding" type="bool" /> | ||
<param index="10" name="view_count" type="int" /> | ||
<description> | ||
Implement this in GDExtension to handle the (re)sizing of a viewport. | ||
</description> | ||
</method> | ||
<method name="_set_fsr_sharpness" qualifiers="virtual"> | ||
<return type="void" /> | ||
<param index="0" name="fsr_sharpness" type="float" /> | ||
<description> | ||
Implement this in GDExtension to record a new FSR sharpness value. | ||
</description> | ||
</method> | ||
<method name="_set_texture_mipmap_bias" qualifiers="virtual"> | ||
<return type="void" /> | ||
<param index="0" name="texture_mipmap_bias" type="float" /> | ||
<description> | ||
Implement this in GDExtension to change the texture mipmap bias. | ||
</description> | ||
</method> | ||
<method name="_set_use_debanding" qualifiers="virtual"> | ||
<return type="void" /> | ||
<param index="0" name="use_debanding" type="bool" /> | ||
<description> | ||
Implement this in GDExtension to react to the debanding flag changing. | ||
</description> | ||
</method> | ||
</methods> | ||
</class> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,128 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<class name="RenderSceneBuffersRD" inherits="RenderSceneBuffers" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> | ||
<brief_description> | ||
This is the render scene buffer implementation for the rendering device based renderers. | ||
</brief_description> | ||
<description> | ||
This object manages all 3D rendering buffers for the rendering device based renderers. An instance of this object is created for every viewport that has 3D rendering enabled. | ||
All buffers are organised in [b]contexts[/b]. The default context is called [b]render_buffers[/b] and can contain amongst others the color buffer, depth buffer, velocity buffers, VRS density map and MSAA variants of these buffers. | ||
Buffers are only guaranteed to exist during rendering of the viewport. | ||
[b]Note:[/b] this is an internal rendering server object only exposed for GDExtension plugins. | ||
</description> | ||
<tutorials> | ||
</tutorials> | ||
<methods> | ||
<method name="clear_context"> | ||
<return type="void" /> | ||
<param index="0" name="context" type="StringName" /> | ||
<description> | ||
Frees all buffers related to this context. | ||
</description> | ||
</method> | ||
<method name="create_texture"> | ||
<return type="RID" /> | ||
<param index="0" name="context" type="StringName" /> | ||
<param index="1" name="name" type="StringName" /> | ||
<param index="2" name="data_format" type="int" enum="RenderingDevice.DataFormat" /> | ||
<param index="3" name="usage_bits" type="int" /> | ||
<param index="4" name="texture_samples" type="int" enum="RenderingDevice.TextureSamples" /> | ||
<param index="5" name="size" type="Vector2i" /> | ||
<param index="6" name="layers" type="int" /> | ||
<param index="7" name="mipmaps" type="int" /> | ||
<param index="8" name="unique" type="bool" /> | ||
<description> | ||
Create a new texture with the given definition and cache this under the given name. Will return the existing texture if it already exists. | ||
</description> | ||
</method> | ||
<method name="create_texture_from_format"> | ||
<return type="RID" /> | ||
<param index="0" name="context" type="StringName" /> | ||
<param index="1" name="name" type="StringName" /> | ||
<param index="2" name="format" type="RDTextureFormat" /> | ||
<param index="3" name="view" type="RDTextureView" /> | ||
<param index="4" name="unique" type="bool" /> | ||
<description> | ||
Create a new texture using the given format and view and cache this under the given name. Will return the existing texture if it already exists. | ||
</description> | ||
</method> | ||
<method name="create_texture_view"> | ||
<return type="RID" /> | ||
<param index="0" name="context" type="StringName" /> | ||
<param index="1" name="name" type="StringName" /> | ||
<param index="2" name="view_name" type="StringName" /> | ||
<param index="3" name="view" type="RDTextureView" /> | ||
<description> | ||
Create a new texture view for an existing texture and cache this under the given view_name. Will return the existing teture view if it already exists. Will error if the source texture doesn't exist. | ||
</description> | ||
</method> | ||
<method name="get_internal_size" qualifiers="const"> | ||
<return type="Vector2i" /> | ||
<description> | ||
Returns the internal size of the render buffer (size before upscaling) with which textures are created by default. | ||
</description> | ||
</method> | ||
<method name="get_render_target" qualifiers="const"> | ||
<return type="RID" /> | ||
<description> | ||
Returns the render target associated with this buffers object. | ||
</description> | ||
</method> | ||
<method name="get_texture" qualifiers="const"> | ||
<return type="RID" /> | ||
<param index="0" name="context" type="StringName" /> | ||
<param index="1" name="name" type="StringName" /> | ||
<description> | ||
Returns a cached texture with this name. | ||
</description> | ||
</method> | ||
<method name="get_texture_format" qualifiers="const"> | ||
<return type="RDTextureFormat" /> | ||
<param index="0" name="context" type="StringName" /> | ||
<param index="1" name="name" type="StringName" /> | ||
<description> | ||
Returns the texture format information with which a cached texture was created. | ||
</description> | ||
</method> | ||
<method name="get_texture_slice"> | ||
<return type="RID" /> | ||
<param index="0" name="context" type="StringName" /> | ||
<param index="1" name="name" type="StringName" /> | ||
<param index="2" name="layer" type="int" /> | ||
<param index="3" name="mipmap" type="int" /> | ||
<param index="4" name="layers" type="int" /> | ||
<param index="5" name="mipmaps" type="int" /> | ||
<description> | ||
Returns a specific slice (layer or mipmap) for a cached texture. | ||
</description> | ||
</method> | ||
<method name="get_texture_slice_size"> | ||
<return type="Vector2i" /> | ||
<param index="0" name="context" type="StringName" /> | ||
<param index="1" name="name" type="StringName" /> | ||
<param index="2" name="mipmap" type="int" /> | ||
<description> | ||
Returns the texture size of a given slice of a cached texture. | ||
</description> | ||
</method> | ||
<method name="get_use_taa" qualifiers="const"> | ||
<return type="bool" /> | ||
<description> | ||
Returns [b]true[/b] if TAA is enabled. | ||
</description> | ||
</method> | ||
<method name="get_view_count" qualifiers="const"> | ||
<return type="int" /> | ||
<description> | ||
Returns the view count for the associated viewport. | ||
</description> | ||
</method> | ||
<method name="has_texture" qualifiers="const"> | ||
<return type="bool" /> | ||
<param index="0" name="context" type="StringName" /> | ||
<param index="1" name="name" type="StringName" /> | ||
<description> | ||
Returns [b]true[/b] if a cached texture exists for this name. | ||
</description> | ||
</method> | ||
</methods> | ||
</class> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.