DoF or Blur Sprites

Is there a way to add DoF or Blur to sprites? High quality blur, art controllable.

You know, like Limbo. Blur affects sprites based on depth. They also have a vignette blur… The vignette blur or masking a blur post pass was trivial to implement in Unity. I haven’t tried DoF. But generally speaking, blurred background sprites are common in platformers… I guess usually blurred in Photoshop? There are a few games out there that use blur as a post process though. Like Limbo and Hollow Knight.

All I managed to do in Unreal so far is a total mess… blurring the translucent model based on depth seems to be imposible. So I tried changing the lighting model to Opaque or anything else… Nothing. I can blur either all sprites, or none, but not based on depth. If I bring a cube in the scene all works well on 3D geometry.

So I thought of using a blur shader, like a piece of glass I could place in front of sprites. And something I’d be able to mask, with gradients for example. One solution seems to be using TemporalAA, which is incompatible with 2D sprites. Also very slow to render. Another one was using some render to texture I think… which was forcing re-rendering the whole scene. So also inefficient. Someone mentioned using a shder that forces low mipmaps… only that’s low quality blur, and not art directable.

I’m using a perspective camera btw, and I was hoping that most things that apply to 3D could also apply to 2D… I mean can’t we DoF smoke and foliage in the backgroud? Why would 2D sprites be different from any textured billboard?

Anyway, can this be done in Unreal?

OK… nevermind… Looks like Paper 2D is barebones, poorly integrated in Unreal, no team working on it, no changes have been made in a long time. Dead, just like this forum… why am I writing here and where be those Unreal devs hiding I wonder? It’s not the first time I’m asking something here and… nobody, nothing, silence. O o

I would try creating a duplicate particle system which looks blurrier. Maybe even create a few different variations, and then write a blueprint that swaps the particles out based on distance. Similar to the way LOD by distance works.

Particles do read depth. Sprites [for 2D games] don’t. Although strangely… transparency is using depth to sort them. I will have to blur things in Krita I guess, to have artistic control. But I was hoping there’d be a way to force sprites to read depth anyway. I can do that in Unity, with a custom sprite shader, and force ZWrite. Can this be done in Unreal?.. I find it unreal that particles and billboards work fine with DoF, but Sprites nope.

Hey man, maybe you found the answer but just make a Flipbook out of your sprite and you got what you need :slight_smile:

Nope. First of all, you can’t build an entire world from flipbooks. Ideally we should be able to merge sprites, if it was not bugged and behaving like all hell. Secondly, flipbooks have the same issue with DoF.
The half baked, temporary solution, is to use Masked blending mode. This is not really a good option for me tho, since I don’t do pixel art and I need Translucent for soft edges. But for blurred objects far into the distance, Masked is OKish. Apparently something happens and the edges become soft. I have no idea what’s going on tho, as close to the camera the edges stay sharp, not affected by blur. I’m also forced to use Translucent blending override in the Shader Instance, no idea why that kind of works, while directly using translucent in the shader… nope. So… it’s a complete mess, barely usable.

I know it’s been 4 years since the last reply, but the answer is to adjust the default sprite material so that “Render After DOF” is unchecked (You will have to switch to translucent temporarily to uncheck it and then set it back to masked). This will switch the order in which Depth of Field is calculated for translucent materials.