mirror of
https://github.com/sphynx-owner/JFA_driven_motion_blur_addon.git
synced 2025-09-19 12:16:16 +08:00
restructure of compositor and fix inconsistencies
This commit is contained in:
49
addons/SphynxMotionBlurToolkit/BaseClasses/mb_compositor.gd
Normal file
49
addons/SphynxMotionBlurToolkit/BaseClasses/mb_compositor.gd
Normal file
@ -0,0 +1,49 @@
|
||||
extends Compositor
|
||||
class_name MotionBlurCompositor
|
||||
|
||||
@export_group("Motion Blur")
|
||||
# diminishing returns over 16
|
||||
@export_range(4, 64) var samples: int = 16 :
|
||||
set(value):
|
||||
for effect in compositor_effects:
|
||||
effect.set("samples", value)
|
||||
samples = value
|
||||
# you really don't want this over 0.5, but you can if you want to try
|
||||
@export_range(0, 0.5, 0.001, "or_greater") var intensity: float = 1 :
|
||||
set(value):
|
||||
for effect in compositor_effects:
|
||||
effect.set("intensity", value)
|
||||
intensity = value
|
||||
@export_range(0, 1) var center_fade: float = 0.0 :
|
||||
set(value):
|
||||
for effect in compositor_effects:
|
||||
effect.set("center_fade", value)
|
||||
center_fade = value
|
||||
|
||||
## wether this motion blur stays the same intensity below
|
||||
## target_constant_framerate
|
||||
@export var framerate_independent : bool = true :
|
||||
set(value):
|
||||
for effect in compositor_effects:
|
||||
effect.set("framerate_independent", value)
|
||||
framerate_independent = value
|
||||
|
||||
## Description: Removes clamping on motion blur scale to allow framerate independent motion
|
||||
## blur to scale longer than realistically possible when render framerate is higher
|
||||
## than target framerate.[br][br]
|
||||
## [color=yellow]Warning:[/color] Turning this on would allow over-blurring of pixels, which
|
||||
## produces inaccurate results, and would likely cause nausea in players over
|
||||
## long exposure durations, use with caution and out of artistic intent
|
||||
@export var uncapped_independence : bool = false :
|
||||
set(value):
|
||||
for effect in compositor_effects:
|
||||
effect.set("uncapped_independence", value)
|
||||
uncapped_independence = value
|
||||
|
||||
## if framerate_independent is enabled, the blur would simulate
|
||||
## sutter speeds at that framerate, and up.
|
||||
@export var target_constant_framerate : float = 30 :
|
||||
set(value):
|
||||
for effect in compositor_effects:
|
||||
effect.set("target_constant_framerate", value)
|
||||
target_constant_framerate = value
|
@ -1,15 +1,14 @@
|
||||
extends "res://addons/SphynxMotionBlurToolkit/BaseClasses/enhanced_compositor_effect.gd"
|
||||
|
||||
@export_group("Motion Blur")
|
||||
# diminishing returns over 16
|
||||
@export_range(4, 64) var samples: int = 16
|
||||
var samples: int = 16
|
||||
# you really don't want this over 0.5, but you can if you want to try
|
||||
@export_range(0, 0.5, 0.001, "or_greater") var intensity: float = 1
|
||||
@export_range(0, 1) var center_fade: float = 0.0
|
||||
var intensity: float = 1
|
||||
var center_fade: float = 0.0
|
||||
|
||||
## wether this motion blur stays the same intensity below
|
||||
## target_constant_framerate
|
||||
@export var framerate_independent : bool = true
|
||||
var framerate_independent : bool = true
|
||||
|
||||
## Description: Removes clamping on motion blur scale to allow framerate independent motion
|
||||
## blur to scale longer than realistically possible when render framerate is higher
|
||||
@ -17,15 +16,13 @@ extends "res://addons/SphynxMotionBlurToolkit/BaseClasses/enhanced_compositor_ef
|
||||
## [color=yellow]Warning:[/color] Turning this on would allow over-blurring of pixels, which
|
||||
## produces inaccurate results, and would likely cause nausea in players over
|
||||
## long exposure durations, use with caution and out of artistic intent
|
||||
@export var uncapped_independence : bool = false
|
||||
var uncapped_independence : bool = false
|
||||
|
||||
## if framerate_independent is enabled, the blur would simulate
|
||||
## sutter speeds at that framerate, and up.
|
||||
@export var target_constant_framerate : float = 30
|
||||
var target_constant_framerate : float = 30
|
||||
|
||||
func _init():
|
||||
needs_motion_vectors = true
|
||||
set_deferred("context", "MotionBlur")
|
||||
super()
|
||||
|
||||
func _get_max_dilation_range() -> float:
|
||||
return 0
|
||||
|
Reference in New Issue
Block a user