-
Notifications
You must be signed in to change notification settings - Fork 291
Add motion blur support #1201
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Add motion blur support #1201
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -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"> | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Inconsistent indentation on This - <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
Suggested change
🤖 Prompt for AI Agents |
||||||
| 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
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
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 |
||||||
| <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> | ||||||
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -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
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 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
Suggested change
🤖 Prompt for AI Agents |
||||||||||||
| <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=""PowerVR,Mali,Adreno,Apple""> | ||||||||||||
| 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. | ||||||||||||
|
|
||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -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
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add brief descriptions for the new motion blur APIs. Lines 116-141 have empty 📝 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
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </method> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <method name="camera_create"> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <return type="RID" /> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -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
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 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
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </constant> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <constant name="INSTANCE_NONE" value="0" enum="InstanceType"> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| The instance does not have a type. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 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 -5Repository: 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.cppRepository: Redot-Engine/redot-engine Length of output: 5860 Missing 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 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 |
||
|
|
||
| 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(); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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; | ||
|
|
@@ -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
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bind new motion‑blur accessors in These new getters/setters won’t be scriptable or show up in the inspector unless they’re bound via 🤖 Prompt for AI Agents |
||
|
|
||
| // DOF blur | ||
| void set_dof_blur_far_enabled(bool p_enabled); | ||
| bool is_dof_blur_far_enabled() const; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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)
📝 Committable suggestion
🤖 Prompt for AI Agents