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
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 on lines +46 to +49

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 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>
<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>
<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 @@ -101,6 +101,50 @@
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>
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>
</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>
Comment on lines +105 to +147

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 @@ -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 @@
scene_root->propagate_notification(Control::NOTIFICATION_LAYOUT_DIRECTION_CHANGED);
}

RSE::MotionBlurFramerateMode motion_blur_framerate_mode = RSE::MotionBlurFramerateMode(int(GLOBAL_GET("rendering/camera/motion_blur/motion_blur_framerate_mode")));

Check failure on line 473 in editor/editor_node.cpp

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with ThreadSanitizer (target=editor, dev_build=yes, use_tsan=yes, use_llvm=yes, linker=lld)

use of undeclared identifier 'RSE'

Check failure on line 473 in editor/editor_node.cpp

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with ThreadSanitizer (target=editor, dev_build=yes, use_tsan=yes, use_llvm=yes, linker=lld)

use of undeclared identifier 'RSE'

Check failure on line 473 in editor/editor_node.cpp

View workflow job for this annotation

GitHub Actions / 🏁 Windows / Editor (target=editor)

'MotionBlurFramerateMode': identifier not found

Check failure on line 473 in editor/editor_node.cpp

View workflow job for this annotation

GitHub Actions / 🏁 Windows / Editor (target=editor)

'RSE': is not a class or namespace name

Check failure on line 473 in editor/editor_node.cpp

View workflow job for this annotation

GitHub Actions / 🏁 Windows / Editor (target=editor)

'motion_blur_framerate_mode': undeclared identifier

Check failure on line 473 in editor/editor_node.cpp

View workflow job for this annotation

GitHub Actions / 🏁 Windows / Editor (target=editor)

syntax error: missing ';' before identifier 'motion_blur_framerate_mode'

Check failure on line 473 in editor/editor_node.cpp

View workflow job for this annotation

GitHub Actions / 🏁 Windows / Editor (target=editor)

'MotionBlurFramerateMode': undeclared identifier

Check failure on line 473 in editor/editor_node.cpp

View workflow job for this annotation

GitHub Actions / 🏁 Windows / Editor (target=editor)

'RSE': is not a class or namespace name
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);

Check failure on line 475 in editor/editor_node.cpp

View workflow job for this annotation

GitHub Actions / 🏁 Windows / Editor (target=editor)

'motion_blur_framerate_mode': undeclared identifier
RSE::MotionBlurQuality motion_blur_quality = RSE::MotionBlurQuality(int(GLOBAL_GET("rendering/camera/motion_blur/motion_blur_quality")));

Check failure on line 476 in editor/editor_node.cpp

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with ThreadSanitizer (target=editor, dev_build=yes, use_tsan=yes, use_llvm=yes, linker=lld)

use of undeclared identifier 'RSE'

Check failure on line 476 in editor/editor_node.cpp

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with ThreadSanitizer (target=editor, dev_build=yes, use_tsan=yes, use_llvm=yes, linker=lld)

use of undeclared identifier 'RSE'

Check failure on line 476 in editor/editor_node.cpp

View workflow job for this annotation

GitHub Actions / 🏁 Windows / Editor (target=editor)

syntax error: missing ';' before identifier 'motion_blur_quality'

Check failure on line 476 in editor/editor_node.cpp

View workflow job for this annotation

GitHub Actions / 🏁 Windows / Editor (target=editor)

'MotionBlurQuality': undeclared identifier

Check failure on line 476 in editor/editor_node.cpp

View workflow job for this annotation

GitHub Actions / 🏁 Windows / Editor (target=editor)

'RSE': is not a class or namespace name
RS::get_singleton()->camera_attributes_set_motion_blur_quality(motion_blur_quality);
RSE::MotionBlurTileSize motion_blur_tile_size = RSE::MotionBlurTileSize(int(GLOBAL_GET("rendering/camera/motion_blur/motion_blur_tile_size")));

Check failure on line 478 in editor/editor_node.cpp

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with ThreadSanitizer (target=editor, dev_build=yes, use_tsan=yes, use_llvm=yes, linker=lld)

use of undeclared identifier 'RSE'

Check failure on line 478 in editor/editor_node.cpp

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with ThreadSanitizer (target=editor, dev_build=yes, use_tsan=yes, use_llvm=yes, linker=lld)

use of undeclared identifier 'RSE'
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