From 1728f80e7cd6d8ed4dd5068f7bd5da64b9c6edfa Mon Sep 17 00:00:00 2001 From: Ricardo Buring Date: Sat, 11 May 2024 01:22:50 +0200 Subject: Fixed Timestep Interpolation: MultiMesh Adds fixed timestep interpolation to multimeshes. Co-authored-by: lawnjelly --- doc/classes/MultiMesh.xml | 29 ++++++++++++++++++++++++++++ doc/classes/RenderingServer.xml | 42 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 71 insertions(+) (limited to 'doc') diff --git a/doc/classes/MultiMesh.xml b/doc/classes/MultiMesh.xml index 529912171c..e99694c3f0 100644 --- a/doc/classes/MultiMesh.xml +++ b/doc/classes/MultiMesh.xml @@ -51,6 +51,24 @@ Returns the [Transform2D] of a specific instance. + + + + + When using [i]physics interpolation[/i], this function allows you to prevent interpolation on an instance in the current physics tick. + This allows you to move instances instantaneously, and should usually be used when initially placing an instance such as a bullet to prevent graphical glitches. + + + + + + + + An alternative to setting the [member buffer] property, which can be used with [i]physics interpolation[/i]. This method takes two arrays, and can set the data for the current and previous tick in one go. The renderer will automatically interpolate the data at each frame. + This is useful for situations where the order of instances may change from physics tick to tick, such as particle systems. + When the order of instances is coherent, the simpler alternative of setting [member buffer] can still be used with interpolation. + + @@ -109,6 +127,11 @@ [Mesh] resource to be instanced. The looks of the individual instances can be modified using [method set_instance_color] and [method set_instance_custom_data]. + + Choose whether to use an interpolation method that favors speed or quality. + When using low physics tick rates (typically below 20) or high rates of object rotation, you may get better results from the high quality setting. + [b]Note:[/b] Fast quality does not equate to low quality. Except in the special cases mentioned above, the quality should be comparable to high quality. + Array containing each [Transform2D] value used by all instances of this mesh, as a [PackedVector2Array]. Each transform is divided into 3 [Vector2] values corresponding to the transforms' [code]x[/code], [code]y[/code], and [code]origin[/code]. @@ -135,5 +158,11 @@ Use this when using 3D transforms. + + Always interpolate using Basis lerping, which can produce warping artifacts in some situations. + + + Attempt to interpolate using Basis slerping (spherical linear interpolation) where possible, otherwise fall back to lerping. + diff --git a/doc/classes/RenderingServer.xml b/doc/classes/RenderingServer.xml index d86b82b72a..9fc0aa20fb 100644 --- a/doc/classes/RenderingServer.xml +++ b/doc/classes/RenderingServer.xml @@ -2558,6 +2558,15 @@ Returns the [Transform2D] of the specified instance. For use when the multimesh is set to use 2D transforms. + + + + + + Prevents physics interpolation for the specified instance during the current physics tick. + This is useful when moving an instance to a new location, to give an instantaneous change rather than interpolation from the previous location. + + @@ -2615,6 +2624,16 @@ [/codeblock] + + + + + + + Alternative version of [method multimesh_set_buffer] for use with physics interpolation. + Takes both an array of current data and an array of data for the previous physics tick. + + @@ -2631,6 +2650,23 @@ Sets the mesh to be drawn by the multimesh. Equivalent to [member MultiMesh.mesh]. + + + + + + Turns on and off physics interpolation for this MultiMesh resource. + + + + + + + + Sets the physics interpolation quality for the [MultiMesh]. + A value of [constant MULTIMESH_INTERP_QUALITY_FAST] gives fast but low quality interpolation, a value of [constant MULTIMESH_INTERP_QUALITY_HIGH] gives slower but higher quality interpolation. + + @@ -4500,6 +4536,12 @@ Use [Transform3D] to store MultiMesh transform. + + MultiMesh physics interpolation favors speed over quality. + + + MultiMesh physics interpolation favors quality over speed. + Nearest-neighbor filter for light projectors (use for pixel art light projectors). No mipmaps are used for rendering, which means light projectors at a distance will look sharp but grainy. This has roughly the same performance cost as using mipmaps. -- cgit v1.2.3