Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions COPYRIGHT.txt
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,16 @@ Copyright: 2013, Jorge Jimenez
2013, Diego Gutierrez
License: Expat

Files: servers/rendering/renderer_rd/shaders/effects/motion_blur_blur.glsl
servers/rendering/renderer_rd/shaders/effects/motion_blur_preprocess.glsl
servers/rendering/renderer_rd/shaders/effects/motion_blur_tile_max_x.glsl
servers/rendering/renderer_rd/shaders/effects/motion_blur_tile_max_y.glsl
servers/rendering/renderer_rd/shaders/effects/motion_blur_neighbor_max.glsl
Comment: sphynx-owner's motion blur effect
Copyright: 2025, sphynx-owner
License: MIT
Comment on lines +201 to +208
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

License identifier mismatch: “MIT” not defined in file.

The file includes an “Expat” license text but no explicit “MIT” license block. In Debian copyright format, the license identifier should correspond to a license text in the file. Consider switching to “Expat” (MIT/Expat equivalent) or adding a “License: MIT” section.

✅ Suggested fix (align with existing Expat license text)
-Files: servers/rendering/renderer_rd/shaders/effects/motion_blur_blur.glsl
-  servers/rendering/renderer_rd/shaders/effects/motion_blur_preprocess.glsl
-  servers/rendering/renderer_rd/shaders/effects/motion_blur_tile_max_x.glsl
-  servers/rendering/renderer_rd/shaders/effects/motion_blur_tile_max_y.glsl
-  servers/rendering/renderer_rd/shaders/effects/motion_blur_neighbor_max.glsl
-Comment: sphynx-owner's motion blur effect
-Copyright: 2025, sphynx-owner
-License: MIT
+Files: servers/rendering/renderer_rd/shaders/effects/motion_blur_blur.glsl
+  servers/rendering/renderer_rd/shaders/effects/motion_blur_preprocess.glsl
+  servers/rendering/renderer_rd/shaders/effects/motion_blur_tile_max_x.glsl
+  servers/rendering/renderer_rd/shaders/effects/motion_blur_tile_max_y.glsl
+  servers/rendering/renderer_rd/shaders/effects/motion_blur_neighbor_max.glsl
+Comment: sphynx-owner's motion blur effect
+Copyright: 2025, sphynx-owner
+License: Expat
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
Files: servers/rendering/renderer_rd/shaders/effects/motion_blur_blur.glsl
servers/rendering/renderer_rd/shaders/effects/motion_blur_preprocess.glsl
servers/rendering/renderer_rd/shaders/effects/motion_blur_tile_max_x.glsl
servers/rendering/renderer_rd/shaders/effects/motion_blur_tile_max_y.glsl
servers/rendering/renderer_rd/shaders/effects/motion_blur_neighbor_max.glsl
Comment: sphynx-owner's motion blur effect
Copyright: 2025, sphynx-owner
License: MIT
Files: servers/rendering/renderer_rd/shaders/effects/motion_blur_blur.glsl
servers/rendering/renderer_rd/shaders/effects/motion_blur_preprocess.glsl
servers/rendering/renderer_rd/shaders/effects/motion_blur_tile_max_x.glsl
servers/rendering/renderer_rd/shaders/effects/motion_blur_tile_max_y.glsl
servers/rendering/renderer_rd/shaders/effects/motion_blur_neighbor_max.glsl
Comment: sphynx-owner's motion blur effect
Copyright: 2025, sphynx-owner
License: Expat
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@COPYRIGHT.txt` around lines 201 - 208, The COPYRIGHT.txt currently labels the
files with "License: MIT" but the included text is the Expat (MIT/Expat)
wording; update the identifier to match the license text by replacing "License:
MIT" with "License: Expat" (or alternatively add a full MIT license block named
"MIT" to match the identifier). Locate the top-level license metadata in
COPYRIGHT.txt and change the License line for the listed shader files
(servers/rendering/renderer_rd/shaders/effects/motion_blur_*) to "Expat", and
ensure the license text block is labeled "Expat" so the identifier and text are
consistent.



Files: thirdparty/accesskit/*
Comment: AccessKit
Copyright: 2023, The AccessKit Authors.
Expand Down
27 changes: 27 additions & 0 deletions doc/classes/CameraAttributesPractical.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,33 @@
</member>
<member name="dof_blur_near_transition" type="float" setter="set_dof_blur_near_transition" getter="get_dof_blur_near_transition" default="1.0">
When positive, distance over which blur effect will scale from 0 to [member dof_blur_amount], ending at [member dof_blur_near_distance]. When negative, uses physically-based scaling so depth of field effect will scale from 0 at [member dof_blur_near_distance] and will increase in a physically accurate way as objects get closer to the [Camera3D].
</member>
<member name="motion_blur_clamp_velocities_to_tile" type="bool" setter="set_motion_blur_clamp_velocities_to_tile" getter="is_motion_blur_clamp_velocities_to_tile" default="true">
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Inconsistent indentation on motion_blur_clamp_velocities_to_tile member tag.

This <member> tag uses extra indentation (\t\t\t\t) compared to sibling <member> elements which use \t\t. This will cause XML formatting inconsistencies in the documentation.

-			<member name="motion_blur_clamp_velocities_to_tile" type="bool" setter="set_motion_blur_clamp_velocities_to_tile" getter="is_motion_blur_clamp_velocities_to_tile" default="true">
+		<member name="motion_blur_clamp_velocities_to_tile" type="bool" setter="set_motion_blur_clamp_velocities_to_tile" getter="is_motion_blur_clamp_velocities_to_tile" default="true">
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<member name="motion_blur_clamp_velocities_to_tile" type="bool" setter="set_motion_blur_clamp_velocities_to_tile" getter="is_motion_blur_clamp_velocities_to_tile" default="true">
<member name="motion_blur_clamp_velocities_to_tile" type="bool" setter="set_motion_blur_clamp_velocities_to_tile" getter="is_motion_blur_clamp_velocities_to_tile" default="true">
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@doc/classes/CameraAttributesPractical.xml` at line 44, The <member> tag for
motion_blur_clamp_velocities_to_tile has extra indentation; locate the tag with
name="motion_blur_clamp_velocities_to_tile" and change its leading whitespace to
match sibling <member> entries (use the same two-tab indentation as other
members) so the XML formatting is consistent.

When true, object blur will be clamped to the motion blur tile size (configurable in project settings) as to not reveal the edges of motion blur tiles.
</member>
<member name="motion_blur_enabled" type="bool" setter="set_motion_blur_enabled" getter="is_motion_blur_enabled" default="false">
</member>
Comment on lines +49 to +50
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

motion_blur_enabled has no description.

All other new motion blur members have descriptive documentation, but this one is empty. Please add a description, e.g., noting that motion blur is only supported in the Forward+ renderer and referencing the related intensity/multiplier controls.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@doc/classes/CameraAttributesPractical.xml` around lines 47 - 48, Add a
descriptive docstring for the member "motion_blur_enabled" (member
name="motion_blur_enabled", setter="set_motion_blur_enabled",
getter="is_motion_blur_enabled") inside the CameraAttributesPractical XML entry:
state that this flag enables/disables motion blur, note that motion blur is
supported only in the Forward+ renderer, and reference the related motion blur
intensity/multiplier controls (mention the corresponding intensity/multiplier
camera attributes so readers can find them); keep the description concise and
consistent with the style of the other motion blur members.

<member name="motion_blur_intensity" type="float" setter="set_motion_blur_intensity" getter="get_motion_blur_intensity" default="1.0">
Defines the amount of motion blur to apply given the object's velocity. At 1.0, the object's velocity will be blurred verbatim. An intensity of 0.5 can be interpreted as a 180 degrees shutter.
</member>
<member name="motion_blur_movement_velocity_multiplier" type="float" setter="set_motion_blur_movement_velocity_multiplier" getter="get_motion_blur_movement_velocity_multiplier" default="1.0">
Defines the intensity of blur similar to [member motion_blur_intensity], but only for the part of the motion caused by camera movement.
</member>
<member name="motion_blur_object_velocity_multiplier" type="float" setter="set_motion_blur_object_velocity_multiplier" getter="get_motion_blur_object_velocity_multiplier" default="1.0">
Defines the intensity of blur similar to [member motion_blur_intensity], but only for the part of the motion caused by object movement.
</member>
<member name="motion_blur_rotation_velocity_multiplier" type="float" setter="set_motion_blur_rotation_velocity_multiplier" getter="get_motion_blur_rotation_velocity_multiplier" default="1.0">
Defines the intensity of blur similar to [member motion_blur_intensity], but only for the part of the motion caused by camera rotation.
</member>
<member name="motion_blur_velocity_lower_threshold" type="float" setter="set_motion_blur_velocity_lower_threshold" getter="get_motion_blur_velocity_lower_threshold" default="0.0">
Defines a magnitude of motion that beyond which motion would start getting blurred. Works in tandem with [member motion_blur_velocity_upper_threshold] to define a seamless transition between non-blurred motion, and a fully blurred motion given the motion's magnitude.
The value is treated in terms of screen portion.
You can use these thresholds to create a less intrusive motion blur effect, where below certain movement speeds details stay crisp.
</member>
<member name="motion_blur_velocity_upper_threshold" type="float" setter="set_motion_blur_velocity_upper_threshold" getter="get_motion_blur_velocity_upper_threshold" default="0.0">
Defines a magnitude of motion that beyond which motion will be blurred in full. Works in tandem with [member motion_blur_velocity_lower_threshold] to define a seamless transition between non-blurred motion, and a fully blurred motion given the motion's magnitude.
The value is treated in terms of screen portion.
You can use these thresholds to create a less intrusive motion blur effect, where below certain movement speeds details stay crisp.
</member>
</members>
</class>
24 changes: 24 additions & 0 deletions doc/classes/ProjectSettings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2802,6 +2802,30 @@
</member>
<member name="rendering/camera/depth_of_field/depth_of_field_use_jitter" type="bool" setter="" getter="" default="false">
If [code]true[/code], jitters DOF samples to make effect slightly blurrier and hide lines created from low sample rates. This can result in a slightly grainy appearance when used with a low number of samples.
</member>
<member name="rendering/camera/motion_blur/motion_blur_framerate_mode" type="int" setter="" getter="" default="1">
Defines framerate-based behavior of the motion blur. Uses [member motion_blur_reference_framerate] as the reference framerate for the different modes.
MOTION_BLUR_FRAMERATE_MODE_NATIVE applies the blur based on the game's framerate as is, and does not use the reference framerate.
MOTION_BLUR_FRAMERATE_MODE_CAPPED applies the blur based on the game's framerate, but below a certain framerate (which means larger time gap and thus larger blur) it will cap the blur to emulate the blur that will be generated at the reference framerate. This is the default value, and it means that if the game lags, the blur will be kept under control.
MOTION_BLUR_FRAMERATE_MODE_FIXED enforces the reference framerate blur regardless of the game's framerate. This can lead to overblurring when the game's framerate is higher than the reference framerate.
</member>
<member name="rendering/camera/motion_blur/motion_blur_quality" type="int" setter="" getter="" default="1">
Controls the quality of the motion blur. The motion blur uses noise to smoothen the transition between samples to prevent banding, but it can only do so much. Larger sample counts will mitigate the perceivable noise, at the cost of performance. The sample counts are as follows:
MOTION_BLUR_QUALITY_LOW = 4 samples
MOTION_BLUR_QUALITY_MEDIUM = 8 samples
MOTION_BLUR_QUALITY_HIGH = 16 samples
</member>
<member name="rendering/camera/motion_blur/motion_blur_reference_framerate" type="int" setter="" getter="" default="30">
Defines a framerate to be used as reference by [member motion_blur_framerate_mode].
</member>
<member name="rendering/camera/motion_blur/motion_blur_show_in_editor" type="bool" setter="" getter="" default="true">
</member>
Comment on lines +2821 to +2822
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Add a brief description for motion_blur_show_in_editor.

This new setting is undocumented, which makes it unclear what toggling it does.

📝 Suggested doc text
 		<member name="rendering/camera/motion_blur/motion_blur_show_in_editor" type="bool" setter="" getter="" default="true">
+			If [code]true[/code], motion blur settings are visible in the editor.
 		</member>
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<member name="rendering/camera/motion_blur/motion_blur_show_in_editor" type="bool" setter="" getter="" default="true">
</member>
<member name="rendering/camera/motion_blur/motion_blur_show_in_editor" type="bool" setter="" getter="" default="true">
If [code]true[/code], motion blur settings are visible in the editor.
</member>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@doc/classes/ProjectSettings.xml` around lines 2821 - 2822, Add a brief
descriptive summary for the ProjectSettings member
rendering/camera/motion_blur/motion_blur_show_in_editor explaining what the
setting controls and the effect of toggling it (e.g., whether motion blur is
visible in the editor viewport, if it affects rendered output, and any scope
such as editor-only or both editor and runtime); update the <member> node for
rendering/camera/motion_blur/motion_blur_show_in_editor in ProjectSettings.xml
to include that description text so the setting is no longer undocumented.

<member name="rendering/camera/motion_blur/motion_blur_tile_size" type="int" setter="" getter="" default="1">
Defines, in pixels, the size of velocity dilation tiles to be used by the motion blur. These tiles collect dominant velocities from neighboring tiles so that fast moving objects can be blurred beyond their original silhouettes. Changing the tile size has little performance cost, rather the cost and effect come in the form of detail vs range. Large tile sizes can blur objects further, but will do so in less detail. The sizes are:
MOTION_BLUR_TILE_SIZE_SMALL = 20 pixels
MOTION_BLUR_TILE_SIZE_MEDIUM = 40 pixels
MOTION_BLUR_TILE_SIZE_LARGE = 60 pixels
MOTION_BLUR_TILE_SIZE_EXTRA_LARGE = 80 pixels
</member>
<member name="rendering/driver/depth_prepass/disable_for_vendors" type="String" setter="" getter="" default="&quot;PowerVR,Mali,Adreno,Apple&quot;">
Disables [member rendering/driver/depth_prepass/enable] conditionally for certain vendors. By default, disables the depth prepass for mobile devices as mobile devices do not benefit from the depth prepass due to their unique architecture.
Expand Down
53 changes: 53 additions & 0 deletions doc/classes/RenderingServer.xml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,45 @@
return log((aperture * aperture) / shutter_speed * (100.0 / sensitivity)) / log(2)
[/codeblock]
</description>
</method>
<method name="camera_attributes_set_motion_blur">
<return type="void" />
<param index="0" name="camera_attributes" type="RID" />
<param index="1" name="enabled" type="bool" />
<param index="2" name="intensity" type="float" />
<param index="3" name="clamp_velocities_to_tile" type="bool" />
<param index="4" name="object_velocity_multiplier" type="float" />
<param index="5" name="movement_velocity_multiplier" type="float" />
<param index="6" name="rotation_velocity_multiplier" type="float" />
<param index="7" name="velocity_lower_threshold" type="float" />
<param index="8" name="velocity_upper_threshold" type="float" />
<description>
</description>
</method>
<method name="camera_attributes_set_motion_blur_framerate_mode">
<return type="void" />
<param index="0" name="mode" type="int" enum="RenderingServer.MotionBlurFramerateMode" />
<param index="1" name="reference_framerate" type="int" />
<description>
</description>
</method>
<method name="camera_attributes_set_motion_blur_quality">
<return type="void" />
<param index="0" name="quality" type="int" enum="RenderingServer.MotionBlurQuality" />
<description>
</description>
</method>
<method name="camera_attributes_set_motion_blur_show_in_editor">
<return type="void" />
<param index="0" name="enabled" type="bool" />
<description>
</description>
</method>
<method name="camera_attributes_set_motion_blur_tile_size">
<return type="void" />
<param index="0" name="tile_size" type="int" enum="RenderingServer.MotionBlurTileSize" />
<description>
</description>
Comment on lines +105 to +142
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Add brief descriptions for the new motion blur APIs.

Lines 116-141 have empty <description> blocks, so the generated docs will be blank for these public methods.

📝 Suggested doc fill
 		<method name="camera_attributes_set_motion_blur">
 			<return type="void" />
 			<param index="0" name="camera_attributes" type="RID" />
 			<param index="1" name="enabled" type="bool" />
 			<param index="2" name="intensity" type="float" />
 			<param index="3" name="clamp_velocities_to_tile" type="bool" />
 			<param index="4" name="object_velocity_multiplier" type="float" />
 			<param index="5" name="movement_velocity_multiplier" type="float" />
 			<param index="6" name="rotation_velocity_multiplier" type="float" />
 			<param index="7" name="velocity_lower_threshold" type="float" />
 			<param index="8" name="velocity_upper_threshold" type="float" />
 			<description>
+				Sets the motion blur parameters for the given camera attributes.
 			</description>
 		</method>
 		<method name="camera_attributes_set_motion_blur_framerate_mode">
 			<return type="void" />
 			<param index="0" name="mode" type="int" enum="RenderingServer.MotionBlurFramerateMode" />
 			<param index="1" name="reference_framerate" type="int" />
 			<description>
+				Sets how motion blur scales with framerate, using [param reference_framerate] when applicable.
 			</description>
 		</method>
 		<method name="camera_attributes_set_motion_blur_quality">
 			<return type="void" />
 			<param index="0" name="quality" type="int" enum="RenderingServer.MotionBlurQuality" />
 			<description>
+				Sets the quality level used for motion blur.
 			</description>
 		</method>
 		<method name="camera_attributes_set_motion_blur_show_in_editor">
 			<return type="void" />
 			<param index="0" name="enabled" type="bool" />
 			<description>
+				Toggles motion blur visibility in the editor viewports.
 			</description>
 		</method>
 		<method name="camera_attributes_set_motion_blur_tile_size">
 			<return type="void" />
 			<param index="0" name="tile_size" type="int" enum="RenderingServer.MotionBlurTileSize" />
 			<description>
+				Sets the tile size used by the motion blur passes.
 			</description>
 		</method>
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<method name="camera_attributes_set_motion_blur">
<return type="void" />
<param index="0" name="camera_attributes" type="RID" />
<param index="1" name="enabled" type="bool" />
<param index="2" name="intensity" type="float" />
<param index="3" name="clamp_velocities_to_tile" type="bool" />
<param index="4" name="object_velocity_multiplier" type="float" />
<param index="5" name="movement_velocity_multiplier" type="float" />
<param index="6" name="rotation_velocity_multiplier" type="float" />
<param index="7" name="velocity_lower_threshold" type="float" />
<param index="8" name="velocity_upper_threshold" type="float" />
<description>
</description>
</method>
<method name="camera_attributes_set_motion_blur_framerate_mode">
<return type="void" />
<param index="0" name="mode" type="int" enum="RenderingServer.MotionBlurFramerateMode" />
<param index="1" name="reference_framerate" type="int" />
<description>
</description>
</method>
<method name="camera_attributes_set_motion_blur_quality">
<return type="void" />
<param index="0" name="quality" type="int" enum="RenderingServer.MotionBlurQuality" />
<description>
</description>
</method>
<method name="camera_attributes_set_motion_blur_show_in_editor">
<return type="void" />
<param index="0" name="enabled" type="bool" />
<description>
</description>
</method>
<method name="camera_attributes_set_motion_blur_tile_size">
<return type="void" />
<param index="0" name="tile_size" type="int" enum="RenderingServer.MotionBlurTileSize" />
<description>
</description>
<method name="camera_attributes_set_motion_blur">
<return type="void" />
<param index="0" name="camera_attributes" type="RID" />
<param index="1" name="enabled" type="bool" />
<param index="2" name="intensity" type="float" />
<param index="3" name="clamp_velocities_to_tile" type="bool" />
<param index="4" name="object_velocity_multiplier" type="float" />
<param index="5" name="movement_velocity_multiplier" type="float" />
<param index="6" name="rotation_velocity_multiplier" type="float" />
<param index="7" name="velocity_lower_threshold" type="float" />
<param index="8" name="velocity_upper_threshold" type="float" />
<description>
Sets the motion blur parameters for the given camera attributes.
</description>
</method>
<method name="camera_attributes_set_motion_blur_framerate_mode">
<return type="void" />
<param index="0" name="mode" type="int" enum="RenderingServer.MotionBlurFramerateMode" />
<param index="1" name="reference_framerate" type="int" />
<description>
Sets how motion blur scales with framerate, using [param reference_framerate] when applicable.
</description>
</method>
<method name="camera_attributes_set_motion_blur_quality">
<return type="void" />
<param index="0" name="quality" type="int" enum="RenderingServer.MotionBlurQuality" />
<description>
Sets the quality level used for motion blur.
</description>
</method>
<method name="camera_attributes_set_motion_blur_show_in_editor">
<return type="void" />
<param index="0" name="enabled" type="bool" />
<description>
Toggles motion blur visibility in the editor viewports.
</description>
</method>
<method name="camera_attributes_set_motion_blur_tile_size">
<return type="void" />
<param index="0" name="tile_size" type="int" enum="RenderingServer.MotionBlurTileSize" />
<description>
Sets the tile size used by the motion blur passes.
</description>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@doc/classes/RenderingServer.xml` around lines 105 - 142, Add concise
descriptions to each empty <description> for the new motion blur API methods so
generated docs are informative: for camera_attributes_set_motion_blur explain
parameters (enabled toggles motion blur, intensity controls strength,
clamp_velocities_to_tile limits velocity influence, and the three
multipliers/thresholds adjust how object/movement/rotation velocities affect
blur); for camera_attributes_set_motion_blur_framerate_mode state what the mode
enum does and what reference_framerate is used for; for
camera_attributes_set_motion_blur_quality describe the quality enum effect on
result vs performance; for camera_attributes_set_motion_blur_show_in_editor note
it toggles editor preview; and for camera_attributes_set_motion_blur_tile_size
describe how tile size enum affects quality/performance. Use the method names
above to locate each <description>.

</method>
<method name="camera_create">
<return type="RID" />
Expand Down Expand Up @@ -5609,6 +5648,20 @@
</constant>
<constant name="DOF_BLUR_QUALITY_HIGH" value="3" enum="DOFBlurQuality">
Highest quality DOF blur. Results in the smoothest looking blur by taking the most samples, but is also significantly slower.
</constant>
<constant name="MOTION_BLUR_QUALITY_LOW" value="0" enum="MotionBlurQuality">
</constant>
<constant name="MOTION_BLUR_QUALITY_MEDIUM" value="1" enum="MotionBlurQuality">
</constant>
<constant name="MOTION_BLUR_QUALITY_HIGH" value="2" enum="MotionBlurQuality">
</constant>
<constant name="MOTION_BLUR_TILE_SIZE_SMALL" value="0" enum="MotionBlurTileSize">
</constant>
<constant name="MOTION_BLUR_TILE_SIZE_MEDIUM" value="1" enum="MotionBlurTileSize">
</constant>
<constant name="MOTION_BLUR_TILE_SIZE_LARGE" value="2" enum="MotionBlurTileSize">
</constant>
<constant name="MOTION_BLUR_TILE_SIZE_EXTRA_LARGE" value="3" enum="MotionBlurTileSize">
Comment on lines +5652 to +5664
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Document the new MotionBlur constants.*

Lines 5652-5664 add new enum values without any descriptions, which leaves the API reference incomplete.

📝 Suggested doc fill
 		<constant name="MOTION_BLUR_QUALITY_LOW" value="0" enum="MotionBlurQuality">
+			Low motion blur quality.
 		</constant>
 		<constant name="MOTION_BLUR_QUALITY_MEDIUM" value="1" enum="MotionBlurQuality">
+			Medium motion blur quality.
 		</constant>
 		<constant name="MOTION_BLUR_QUALITY_HIGH" value="2" enum="MotionBlurQuality">
+			High motion blur quality.
 		</constant>
 		<constant name="MOTION_BLUR_TILE_SIZE_SMALL" value="0" enum="MotionBlurTileSize">
+			Small tile size for motion blur processing.
 		</constant>
 		<constant name="MOTION_BLUR_TILE_SIZE_MEDIUM" value="1" enum="MotionBlurTileSize">
+			Medium tile size for motion blur processing.
 		</constant>
 		<constant name="MOTION_BLUR_TILE_SIZE_LARGE" value="2" enum="MotionBlurTileSize">
+			Large tile size for motion blur processing.
 		</constant>
 		<constant name="MOTION_BLUR_TILE_SIZE_EXTRA_LARGE" value="3" enum="MotionBlurTileSize">
+			Extra-large tile size for motion blur processing.
 		</constant>
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<constant name="MOTION_BLUR_QUALITY_LOW" value="0" enum="MotionBlurQuality">
</constant>
<constant name="MOTION_BLUR_QUALITY_MEDIUM" value="1" enum="MotionBlurQuality">
</constant>
<constant name="MOTION_BLUR_QUALITY_HIGH" value="2" enum="MotionBlurQuality">
</constant>
<constant name="MOTION_BLUR_TILE_SIZE_SMALL" value="0" enum="MotionBlurTileSize">
</constant>
<constant name="MOTION_BLUR_TILE_SIZE_MEDIUM" value="1" enum="MotionBlurTileSize">
</constant>
<constant name="MOTION_BLUR_TILE_SIZE_LARGE" value="2" enum="MotionBlurTileSize">
</constant>
<constant name="MOTION_BLUR_TILE_SIZE_EXTRA_LARGE" value="3" enum="MotionBlurTileSize">
<constant name="MOTION_BLUR_QUALITY_LOW" value="0" enum="MotionBlurQuality">
Low motion blur quality.
</constant>
<constant name="MOTION_BLUR_QUALITY_MEDIUM" value="1" enum="MotionBlurQuality">
Medium motion blur quality.
</constant>
<constant name="MOTION_BLUR_QUALITY_HIGH" value="2" enum="MotionBlurQuality">
High motion blur quality.
</constant>
<constant name="MOTION_BLUR_TILE_SIZE_SMALL" value="0" enum="MotionBlurTileSize">
Small tile size for motion blur processing.
</constant>
<constant name="MOTION_BLUR_TILE_SIZE_MEDIUM" value="1" enum="MotionBlurTileSize">
Medium tile size for motion blur processing.
</constant>
<constant name="MOTION_BLUR_TILE_SIZE_LARGE" value="2" enum="MotionBlurTileSize">
Large tile size for motion blur processing.
</constant>
<constant name="MOTION_BLUR_TILE_SIZE_EXTRA_LARGE" value="3" enum="MotionBlurTileSize">
Extra-large tile size for motion blur processing.
</constant>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@doc/classes/RenderingServer.xml` around lines 5652 - 5664, Add descriptive
documentation entries for the newly introduced enum constants
MOTION_BLUR_QUALITY_LOW, MOTION_BLUR_QUALITY_MEDIUM, MOTION_BLUR_QUALITY_HIGH
(enum: MotionBlurQuality) and MOTION_BLUR_TILE_SIZE_SMALL,
MOTION_BLUR_TILE_SIZE_MEDIUM, MOTION_BLUR_TILE_SIZE_LARGE,
MOTION_BLUR_TILE_SIZE_EXTRA_LARGE (enum: MotionBlurTileSize) in the
RenderingServer XML so the API reference is complete; for each constant add a
one-line description explaining what it controls (e.g., blur sample quality
levels for MotionBlurQuality and tile size/resolution trade-offs for
MotionBlurTileSize), mention default or recommended use where applicable, and
ensure the descriptions follow the same wording/style and tag format as
surrounding constant entries in this file.

</constant>
<constant name="INSTANCE_NONE" value="0" enum="InstanceType">
The instance does not have a type.
Expand Down
10 changes: 10 additions & 0 deletions editor/editor_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,16 @@ void EditorNode::_update_from_settings() {
scene_root->propagate_notification(Control::NOTIFICATION_LAYOUT_DIRECTION_CHANGED);
}

RS::MotionBlurFramerateMode motion_blur_framerate_mode = RS::MotionBlurFramerateMode(int(GLOBAL_GET("rendering/camera/motion_blur/motion_blur_framerate_mode")));
int motion_blur_reference_framerate = GLOBAL_GET("rendering/camera/motion_blur/motion_blur_reference_framerate");
RS::get_singleton()->camera_attributes_set_motion_blur_framerate_mode(motion_blur_framerate_mode, motion_blur_reference_framerate);
bool editor_mb_enabled = bool(GLOBAL_GET("rendering/camera/motion_blur/motion_blur_show_in_editor"));
RS::get_singleton()->camera_attributes_set_motion_blur_show_in_editor(editor_mb_enabled);
RS::MotionBlurQuality motion_blur_quality = RS::MotionBlurQuality(int(GLOBAL_GET("rendering/camera/motion_blur/motion_blur_quality")));
RS::get_singleton()->camera_attributes_set_motion_blur_quality(motion_blur_quality);
RS::MotionBlurTileSize motion_blur_tile_size = RS::MotionBlurTileSize(int(GLOBAL_GET("rendering/camera/motion_blur/motion_blur_tile_size")));
RS::get_singleton()->camera_attributes_set_motion_blur_tile_size(motion_blur_tile_size);

RS::DOFBokehShape dof_shape = RS::DOFBokehShape(int(GLOBAL_GET("rendering/camera/depth_of_field/depth_of_field_bokeh_shape")));
RS::get_singleton()->camera_attributes_set_dof_blur_bokeh_shape(dof_shape);
RS::DOFBlurQuality dof_quality = RS::DOFBlurQuality(int(GLOBAL_GET("rendering/camera/depth_of_field/depth_of_field_bokeh_quality")));
Expand Down
85 changes: 85 additions & 0 deletions scene/resources/camera_attributes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,91 @@ CameraAttributes::~CameraAttributes() {
//////////////////////////////////////////////////////
/* CameraAttributesPractical */

void CameraAttributesPractical::set_motion_blur_enabled(bool p_enabled) {
if (motion_blur_enabled == p_enabled) {
return;
}
motion_blur_enabled = p_enabled;
_update_motion_blur();
notify_property_list_changed();
}

bool CameraAttributesPractical::is_motion_blur_enabled() const {
return motion_blur_enabled;
}

void CameraAttributesPractical::set_motion_blur_intensity(float p_intensity) {
p_intensity = MAX(0.0f, p_intensity);
motion_blur_intensity = p_intensity;
_update_motion_blur();
}

float CameraAttributesPractical::get_motion_blur_intensity() const {
return motion_blur_intensity;
}

void CameraAttributesPractical::set_motion_blur_clamp_velocities_to_tile(bool p_clamp_velocities_to_tile) {
if (motion_blur_clamp_velocities_to_tile == p_clamp_velocities_to_tile) {
return;
}
motion_blur_clamp_velocities_to_tile = p_clamp_velocities_to_tile;
_update_motion_blur();
}

bool CameraAttributesPractical::is_motion_blur_clamp_velocities_to_tile() const {
return motion_blur_clamp_velocities_to_tile;
}

void CameraAttributesPractical::set_motion_blur_object_velocity_multiplier(float p_multiplier) {
p_multiplier = MAX(0.0f, p_multiplier);
motion_blur_object_velocity_multiplier = p_multiplier;
_update_motion_blur();
}

float CameraAttributesPractical::get_motion_blur_object_velocity_multiplier() const {
return motion_blur_object_velocity_multiplier;
}

void CameraAttributesPractical::set_motion_blur_movement_velocity_multiplier(float p_multiplier) {
p_multiplier = MAX(0.0f, p_multiplier);
motion_blur_movement_velocity_multiplier = p_multiplier;
_update_motion_blur();
}

float CameraAttributesPractical::get_motion_blur_movement_velocity_multiplier() const {
return motion_blur_movement_velocity_multiplier;
}

void CameraAttributesPractical::set_motion_blur_rotation_velocity_multiplier(float p_multiplier) {
p_multiplier = MAX(0.0f, p_multiplier);
motion_blur_rotation_velocity_multiplier = p_multiplier;
_update_motion_blur();
}

float CameraAttributesPractical::get_motion_blur_rotation_velocity_multiplier() const {
return motion_blur_rotation_velocity_multiplier;
}

void CameraAttributesPractical::set_motion_blur_velocity_lower_threshold(float p_threshold) {
p_threshold = MAX(0.0f, p_threshold);
motion_blur_velocity_lower_threshold = p_threshold;
_update_motion_blur();
}

float CameraAttributesPractical::get_motion_blur_velocity_lower_threshold() const {
return motion_blur_velocity_lower_threshold;
}

void CameraAttributesPractical::set_motion_blur_velocity_upper_threshold(float p_threshold) {
p_threshold = MAX(0.0f, p_threshold);
motion_blur_velocity_upper_threshold = p_threshold;
_update_motion_blur();
}
Comment on lines +150 to +229
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Search for _update_motion_blur implementation
echo "=== Searching for _update_motion_blur implementation ==="
rg -n "_update_motion_blur" --type-list | head -20
rg -n "_update_motion_blur"

echo ""
echo "=== Searching for RenderingServer motion blur API ==="
rg -n "camera_attributes_set_motion_blur|motion_blur" servers/rendering

echo ""
echo "=== Checking camera_attributes.cpp header declarations ==="
fd -e h | xargs rg -l "camera_attributes" | head -5

Repository: Redot-Engine/redot-engine

Length of output: 29621


🏁 Script executed:

#!/bin/bash
# Check camera_attributes.cpp size and read relevant sections
wc -l scene/resources/camera_attributes.cpp

echo "=== Looking for _update_motion_blur implementation ==="
rg -n "_update_motion_blur" -A 10 scene/resources/camera_attributes.cpp

echo ""
echo "=== Looking for _update_dof_blur as reference pattern ==="
rg -n "_update_dof_blur" -A 10 scene/resources/camera_attributes.cpp

Repository: Redot-Engine/redot-engine

Length of output: 5860


Missing _update_motion_blur() implementation (linker error).

The function is declared in the header and called in 9 setters (lines 155, 166, 178, 188, 198, 208, 218, 228) but has no implementation. This will fail at link time. Add the implementation following the _update_dof_blur() pattern:

void CameraAttributesPractical::_update_motion_blur() {
	RS::get_singleton()->camera_attributes_set_motion_blur(
			get_rid(),
			motion_blur_enabled,
			motion_blur_intensity,
			motion_blur_clamp_velocities_to_tile,
			motion_blur_object_velocity_multiplier,
			motion_blur_movement_velocity_multiplier,
			motion_blur_rotation_velocity_multiplier,
			motion_blur_velocity_lower_threshold,
			motion_blur_velocity_upper_threshold);
}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@scene/resources/camera_attributes.cpp` around lines 150 - 229, The linker is
failing because CameraAttributesPractical::_update_motion_blur() is declared and
called from multiple setters (set_motion_blur_enabled,
set_motion_blur_intensity, set_motion_blur_clamp_velocities_to_tile,
set_motion_blur_object_velocity_multiplier,
set_motion_blur_movement_velocity_multiplier,
set_motion_blur_rotation_velocity_multiplier,
set_motion_blur_velocity_lower_threshold,
set_motion_blur_velocity_upper_threshold) but has no implementation; implement
_update_motion_blur() following the existing _update_dof_blur() pattern so it
calls RS::get_singleton()->camera_attributes_set_motion_blur(...) with get_rid()
and the nine motion blur fields (motion_blur_enabled, motion_blur_intensity,
motion_blur_clamp_velocities_to_tile, motion_blur_object_velocity_multiplier,
motion_blur_movement_velocity_multiplier,
motion_blur_rotation_velocity_multiplier, motion_blur_velocity_lower_threshold,
motion_blur_velocity_upper_threshold).


float CameraAttributesPractical::get_motion_blur_velocity_upper_threshold() const {
return motion_blur_velocity_upper_threshold;
}

void CameraAttributesPractical::set_dof_blur_far_enabled(bool p_enabled) {
dof_blur_far_enabled = p_enabled;
_update_dof_blur();
Expand Down
29 changes: 29 additions & 0 deletions scene/resources/camera_attributes.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,17 @@ class CameraAttributesPractical : public CameraAttributes {
GDCLASS(CameraAttributesPractical, CameraAttributes);

private:
// Motion blur
bool motion_blur_enabled = false;
float motion_blur_intensity = 1.0;
bool motion_blur_clamp_velocities_to_tile = true;
float motion_blur_object_velocity_multiplier = 1.0;
float motion_blur_movement_velocity_multiplier = 1.0;
float motion_blur_rotation_velocity_multiplier = 1.0;
float motion_blur_velocity_lower_threshold = 0.0;
float motion_blur_velocity_upper_threshold = 0.0;
void _update_motion_blur();

// DOF blur
bool dof_blur_far_enabled = false;
float dof_blur_far_distance = 10.0;
Expand All @@ -99,6 +110,24 @@ class CameraAttributesPractical : public CameraAttributes {
void _validate_property(PropertyInfo &p_property) const;

public:
// Motion blur
void set_motion_blur_enabled(bool p_enabled);
bool is_motion_blur_enabled() const;
void set_motion_blur_intensity(float p_intensity);
float get_motion_blur_intensity() const;
void set_motion_blur_clamp_velocities_to_tile(bool p_clamp_velocities_to_tile);
bool is_motion_blur_clamp_velocities_to_tile() const;
void set_motion_blur_object_velocity_multiplier(float p_multiplier);
float get_motion_blur_object_velocity_multiplier() const;
void set_motion_blur_movement_velocity_multiplier(float p_multiplier);
float get_motion_blur_movement_velocity_multiplier() const;
void set_motion_blur_rotation_velocity_multiplier(float p_multiplier);
float get_motion_blur_rotation_velocity_multiplier() const;
void set_motion_blur_velocity_lower_threshold(float p_threshold);
float get_motion_blur_velocity_lower_threshold() const;
void set_motion_blur_velocity_upper_threshold(float p_threshold);
float get_motion_blur_velocity_upper_threshold() const;
Comment on lines +113 to +129
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Bind new motion‑blur accessors in _bind_methods() to expose them.

These new getters/setters won’t be scriptable or show up in the inspector unless they’re bound via ClassDB::bind_method and added as properties. Please add the bindings and ADD_PROPERTY entries in CameraAttributesPractical::_bind_methods().

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@scene/resources/camera_attributes.h` around lines 113 - 129, Bind the new
motion-blur setters/getters in CameraAttributesPractical::_bind_methods(): call
ClassDB::bind_method for each new symbol (set_motion_blur_enabled,
is_motion_blur_enabled, set_motion_blur_intensity, get_motion_blur_intensity,
set_motion_blur_clamp_velocities_to_tile,
is_motion_blur_clamp_velocities_to_tile,
set_motion_blur_object_velocity_multiplier,
get_motion_blur_object_velocity_multiplier,
set_motion_blur_movement_velocity_multiplier,
get_motion_blur_movement_velocity_multiplier,
set_motion_blur_rotation_velocity_multiplier,
get_motion_blur_rotation_velocity_multiplier,
set_motion_blur_velocity_lower_threshold,
get_motion_blur_velocity_lower_threshold,
set_motion_blur_velocity_upper_threshold,
get_motion_blur_velocity_upper_threshold) and add corresponding ADD_PROPERTY
entries so each pair is exposed as a property in the inspector (use appropriate
PROPERTY_HINT/usage for booleans and floats). Ensure method names match the
declarations in camera_attributes.h and add properties with readable names and
getter/setter bindings.


// DOF blur
void set_dof_blur_far_enabled(bool p_enabled);
bool is_dof_blur_far_enabled() const;
Expand Down
Loading
Loading