Possible to replicate accumulation motion blur?

I am curious, is it possible to replicate an accumulation motion blur effect? (NOT a dynamic blur where a blur effect is amplified based on camera speed), I am making an scp containment breach type game and am interested in recreating the blur used in that game, but is it possible with roblox? Here is an example:

Notice the blur effect that increases the more the character bleeds out, that is what I want to recreate.

3 Likes

from what i learnt is that this is only possible through viewportframes
however viewportframes dont render dynamic lighting, terrain, particles

1 Like

Its essentially capturing a frame, saving it to memory and giving it transparency overtime until it is fully transparent in which it is then released from memory (to save up memory), in which it does this for every frame (sometimes also set with a delay of frame capture to reduce the blur effect)
It’d be real nice if someone were to actually replicate that on Roblox as I really want to use it for a horror game I’m making. Though Im pretty sure it does not exist despite current technologies making it very possible, I think its the niche use of it that makes it not a feature on Roblox

1 Like

im not sure if you found a solution but using the CaptureScreenshot method from the new Capture Service API this may be possible. I’ve tried it my self and the effect looks pretty great, but the effect last only temporarily. After a while it stops screenshotting which is required for the effect even though no error or warning shows up which could be a problem when you want the effect to last until the player dies/heals himself.

1 Like

Does stopping the capture service before it ends then starting again allow it to continue

I’ve tried, but i don’t think it worked. The last time I’ve tested this was a long time ago so it could be different now. The only way that made it work again is when I disabled and re-enabled the script again. Could possibly be some memory related issue or be some kind of bug.

2 Likes

sorry for bumping,
but can you please share the script here?

Oooof. I don’t have the original script from months ago, but I decided to try to recreate if from memory. I’ve tested it, but like I’ve said in my previous posts, it isn’t very consistent.

--Services
local tweenService = game:GetService("TweenService")
local debris = game:GetService("Debris")
local captureService = game:GetService("CaptureService")

--Settings
local config = {
	fade_in = 0.001, --The time it takes for the screenshot/image to fade in (high values aren't recommend)
	fade_in_easingStyle = Enum.EasingStyle.Cubic,
	fade_in_easingDirection = Enum.EasingDirection.Out,
	
	fade_out = 1, --The time it takes for the screenshot/image to fade out. High values make the image blurier
	fade_out_easingStyle = Enum.EasingStyle.Quad,
	fade_out_easingDirection = Enum.EasingDirection.In,
	
	starting_transparency = .97, --The starting imageTransparency of the image
	images_per_seconds = 60, --the amount of new screenshots to create per second. The higher the value, the better the image quality, but the more likely it is to fail.
}

local screenGui = script.Parent.Screenshots --Change directory to where you want the motion blur to appear. Ideally, if you set it to a UIObject or Folder, you would want it to cover the entire screen.
--[[
the ScreenGui must have these properties enabled/disabled

> ClipToDeviceSafeArea = false
> SafeAreaCompatibility = None
> ScreenInsets = None

> IgnoreGuiInset = false

]]

local imageLabel_template = Instance.new("ImageLabel")
imageLabel_template.Position = UDim2.fromScale(.5,.5)
imageLabel_template.AnchorPoint = Vector2.one*.5
imageLabel_template.BackgroundTransparency = 1
imageLabel_template.Size = UDim2.fromScale(1,1)
imageLabel_template.ScaleType = Enum.ScaleType.Fit
imageLabel_template.ImageTransparency = 1





local fade_In_tweenInfo = TweenInfo.new(config.fade_in, config.fade_in_easingStyle, config.fade_in_easingDirection, 0, false, 0)
local fade_Out_tweenInfo = TweenInfo.new(config.fade_out, config.fade_out_easingStyle, config.fade_out_easingDirection, 0, false, 0)

--Create a new image label with the specified imageId, animates the fade out.
local function CreateNewUI(imageId: string): ImageLabel
	local imageLabel = imageLabel_template:Clone()
	imageLabel.Image = imageId
	imageLabel.Parent = screenGui
	
	tweenService:Create(imageLabel, fade_In_tweenInfo, {ImageTransparency = config.starting_transparency}):Play()
	task.wait(fade_In_tweenInfo.Time+fade_In_tweenInfo.DelayTime)
	tweenService:Create(imageLabel, fade_Out_tweenInfo, {ImageTransparency = 1}):Play()
	
	debris:AddItem(imageLabel, fade_Out_tweenInfo.Time+fade_In_tweenInfo.DelayTime)
	
	return imageLabel --If needed for some reason
end





local enabled = false --Enable or disable it

task.delay(5, function() --Enable the motion blur after 5 seconds for demonstration
	enabled = true 
end)


--Motion blur loop
while true do
	task.wait(1/config.images_per_seconds)
	if not enabled then
		continue --If the motion blur isn't enabled, then skip the following code.
	end
	
	task.spawn(function()
		print("attempt screenshot")
		captureService:CaptureScreenshot(CreateNewUI)
	end)
end

Make sure to put this into a local script, and create a screengui so that the blur effect can be displayed

EDIT: You should also probably disable any ui before screenshotting so that it doesn’t leave any blur of the ui in the screen.

5 Likes