Skip to content
Open
Show file tree
Hide file tree
Changes from 8 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
4 changes: 4 additions & 0 deletions core/config/engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,10 @@ double Engine::get_time_scale() const {
return freeze_time_scale ? 0 : _time_scale;
}

double Engine::get_effective_time_scale() const {
return freeze_time_scale ? 0.0 : _time_scale;
}
Comment thread
coderabbitai[bot] marked this conversation as resolved.

double Engine::get_unfrozen_time_scale() const {
return _time_scale;
}
Expand Down
1 change: 1 addition & 0 deletions core/config/engine.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ class Engine {

void set_time_scale(double p_scale);
double get_time_scale() const;
double get_effective_time_scale() const;
double get_unfrozen_time_scale() const;

void set_print_to_stdout(bool p_enabled);
Expand Down
26 changes: 26 additions & 0 deletions doc/classes/CameraAttributesPractical.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,31 @@
<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_enabled" type="bool" setter="set_motion_blur_enabled" getter="is_motion_blur_enabled" default="false">
If [code]true[/code], enables a motion blur effect when the camera moves, rotates, or when an object on screen moves. This has a moderate performance impact.
[b]Note:[/b] Motion blur can result in motion sickness among some players. When implementing motion blur in a game, consider exposing an option to reduce its intensity or turn it off.
</member>
Comment thread
Arctis-Fireblight marked this conversation as resolved.
<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 in full (blur fills in the motion step fully). An intensity of 0.5 can be interpreted as a 180 degrees shutter.
</member>
<member name="motion_blur_velocity_multiplier_camera_movement" 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_velocity_multiplier_camera_rotation" 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_multiplier_object" 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_velocity_threshold_lower" type="float" setter="set_motion_blur_velocity_lower_threshold" getter="get_motion_blur_velocity_lower_threshold" default="0.0">
Defines a magnitude of motion beyond which motion would start getting blurred. Works in tandem with [member motion_blur_velocity_threshold_upper] 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 percentage. Setting it to 50 means that blurring starts at motion that spans more than half the screen in one frame.
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_threshold_upper" type="float" setter="set_motion_blur_velocity_upper_threshold" getter="get_motion_blur_velocity_upper_threshold" default="0.0">
Defines a magnitude of motion beyond which motion will be blurred fully. Works in tandem with [member motion_blur_velocity_threshold_lower] 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 percentage. Setting it to 50 means that motion that spans more than half the screen in one frame is blurred in full.
You can use these thresholds to create a less intrusive motion blur effect, where below certain movement speeds details stay crisp.
</member>
</members>
</class>
3 changes: 3 additions & 0 deletions doc/classes/EditorSettings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,9 @@
<member name="editors/3d/selection_box_color" type="Color" setter="" getter="">
The color to use for the selection box that surrounds selected nodes in the 3D editor viewport. The color's alpha channel influences the selection box's opacity.
</member>
<member name="editors/3d/viewport_visuals/show_motion_blur_in_editor" type="bool" setter="" getter="">
If [code]true[/code], when a scene has a camera that has motion blur enabled, it will be be applied in the editor scene view as well. When [code]false[/code], the motion blur will only be applied at runtime.
</member>
Comment on lines +438 to +440

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Fix the duplicated word in the setting description.

Line 439 says “will be be applied”.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@doc/classes/EditorSettings.xml` around lines 438 - 440, Fix the duplicated
word in the description for the show_motion_blur_in_editor setting under
EditorSettings.xml. Update the text in the member entry for
editors/3d/viewport_visuals/show_motion_blur_in_editor so it reads naturally by
removing the extra repeated word in the sentence about motion blur being applied
in the editor scene view.

<member name="editors/3d_gizmos/gizmo_colors/aabb" type="Color" setter="" getter="">
The color to use for the AABB gizmo that displays the [GeometryInstance3D]'s custom [AABB].
</member>
Expand Down
22 changes: 22 additions & 0 deletions doc/classes/ProjectSettings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2803,6 +2803,28 @@
<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 the framerate-based behavior of the motion blur. Uses [member rendering/camera/motion_blur/motion_blur_reference_framerate] as the reference framerate for the different modes.
- [code]MOTION_BLUR_FRAMERATE_MODE_NATIVE[/code] applies the blur based on the game's framerate as is, and does not use the reference framerate.
- [code]MOTION_BLUR_FRAMERATE_MODE_CAPPED[/code] applies the blur based on the game's framerate, but below a certain framerate (which means larger time gap and thus more intense blurring) 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.
- [code]MOTION_BLUR_FRAMERATE_MODE_FIXED[/code] 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:
- [b]Low:[/b] 4 samples
- [b]Medium:[/b] 8 samples
- [b]High:[/b] 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 a reference by [member rendering/camera/motion_blur/motion_blur_framerate_mode].
</member>
<member name="rendering/camera/motion_blur/motion_blur_tile_size" type="int" setter="" getter="" default="1">
Defines, in pixels, the size of the 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:
- [b]Small:[/b] 20 pixels
- [b]Medium:[/b] 40 pixels
- [b]Large:[/b] 60 pixels
- [b]Extra Large:[/b] 80 pixels
</member>
Comment thread
Shakai-Dev marked this conversation as resolved.
<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.
</member>
Expand Down
74 changes: 74 additions & 0 deletions doc/classes/RenderingServer.xml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,50 @@
[/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>
Configures the motion blur effect on the specified [param camera_attributes] resource. See properties in [CameraAttributesPractical] starting from [member CameraAttributesPractical.motion_blur_enabled] for details on each parameter.
</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 the framerate-based behavior of the motion blur effect. See also [member ProjectSettings.rendering/camera/motion_blur/motion_blur_framerate_mode].
</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 for the motion blur effect. See also [member ProjectSettings.rendering/camera/motion_blur/motion_blur_quality].
</description>
</method>
<method name="camera_attributes_set_motion_blur_show_in_editor">
<return type="void" />
<param index="0" name="enabled" type="bool" />
<description>
If [code]true[/code], and motion blur is enabled,, it will be be applied in the editor scene view as well. When [code]false[/code], the motion blur will only be applied at runtime. See also [member EditorSettings.editors/3d/viewport_visuals/show_motion_blur_in_editor]
</description>
Comment thread
Shakai-Dev marked this conversation as resolved.
</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 for the motion blur effect. See also [member ProjectSettings.rendering/camera/motion_blur/motion_blur_tile_size].
</description>
</method>
<method name="camera_create">
<return type="RID" />
<description>
Expand Down Expand Up @@ -5610,6 +5654,36 @@
<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">
Low quality for the motion blur effect (cheaper on the GPU).
</constant>
<constant name="MOTION_BLUR_QUALITY_MEDIUM" value="1" enum="MotionBlurQuality">
Medium quality for the motion blur effect.
</constant>
<constant name="MOTION_BLUR_QUALITY_HIGH" value="2" enum="MotionBlurQuality">
High quality for the motion blur effect (more expensive on the GPU).
</constant>
<constant name="MOTION_BLUR_TILE_SIZE_SMALL" value="0" enum="MotionBlurTileSize">
Tile size of 20×20 pixels for the motion blur effect. Lowest blurring potential for fast-moving objects, highest level of detail.
</constant>
<constant name="MOTION_BLUR_TILE_SIZE_MEDIUM" value="1" enum="MotionBlurTileSize">
Tile size of 40×40 pixels for the motion blur effect. Low blurring potential for fast-moving objects, high level of detail.
</constant>
<constant name="MOTION_BLUR_TILE_SIZE_LARGE" value="2" enum="MotionBlurTileSize">
Tile size of 60×60 pixels for the motion blur effect. High blurring potential for fast-moving objects, low level of detail.
</constant>
<constant name="MOTION_BLUR_TILE_SIZE_EXTRA_LARGE" value="3" enum="MotionBlurTileSize">
Tile size of 80×80 pixels for the motion blur effect. Highest blurring potential for fast-moving objects, lowest level of detail.
</constant>
<constant name="MOTION_BLUR_FRAMERATE_MODE_NATIVE" value="0" enum="MotionBlurFramerateMode">
Applies the blur based on the game's framerate as is, and does not use the reference framerate.
</constant>
<constant name="MOTION_BLUR_FRAMERATE_MODE_CAPPED" value="1" enum="MotionBlurFramerateMode">
Applies the blur based on the game's framerate, but below a certain framerate (which means larger time gap and thus more intense blurring) 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.
</constant>
<constant name="MOTION_BLUR_FRAMERATE_MODE_FIXED" value="2" enum="MotionBlurFramerateMode">
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.
</constant>
<constant name="INSTANCE_NONE" value="0" enum="InstanceType">
The instance does not have a type.
</constant>
Expand Down
8 changes: 8 additions & 0 deletions editor/editor_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,14 @@ 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);
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
8 changes: 8 additions & 0 deletions editor/scene/3d/node_3d_editor_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8569,6 +8569,10 @@ void Node3DEditor::_notification(int p_what) {
active_selection_box_mat_xray->set_albedo(active_selection_box_color * Color(1, 1, 1, 0.15));
}

// Update the internal setting that controls whether motion blur effect is enabled in editor viewport.
const bool motion_blur_show_in_editor = EDITOR_GET("editors/3d/viewport_visuals/show_motion_blur_in_editor");
RS::get_singleton()->camera_attributes_set_motion_blur_show_in_editor(motion_blur_show_in_editor);

// Update grid color by rebuilding grid.
_finish_grid();
_init_grid();
Expand Down Expand Up @@ -9290,6 +9294,10 @@ Node3DEditor::Node3DEditor() {
gizmo.visible = true;
gizmo.scale = 1.0;

// Init motion blow show in editor setting
const bool motion_blur_show_in_editor = EDITOR_GET("editors/3d/viewport_visuals/show_motion_blur_in_editor");
RS::get_singleton()->camera_attributes_set_motion_blur_show_in_editor(motion_blur_show_in_editor);

viewport_environment.instantiate();
VBoxContainer *vbc = this;

Expand Down
3 changes: 3 additions & 0 deletions editor/settings/editor_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -926,6 +926,9 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {
EDITOR_SETTING_BASIC(Variant::FLOAT, PROPERTY_HINT_RANGE, "editors/3d/default_z_near", 0.05, "0.01,10,0.01,or_greater,suffix:m")
EDITOR_SETTING_BASIC(Variant::FLOAT, PROPERTY_HINT_RANGE, "editors/3d/default_z_far", 4000.0, "0.1,4000,0.1,or_greater,suffix:m")

// 3D: Viewport visuals
_initial_set("editors/3d/viewport_visuals/show_motion_blur_in_editor", true);

// 3D: Navigation
_initial_set("editors/3d/navigation/invert_x_axis", false, true);
_initial_set("editors/3d/navigation/invert_y_axis", false, true);
Expand Down
Loading
Loading