restructure of compositor and fix inconsistencies

This commit is contained in:
sphynx-owner
2024-08-25 18:50:52 +03:00
parent e7ebdac09e
commit 96886a7b13
7 changed files with 82 additions and 30 deletions

View 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

View File

@ -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