Over 11,000 five-star assets

Rated by 85,000+ customers

Supported by 100,000+ forum members

Every asset moderated by Unity

Active slide: 1 of 3
2D Depth of Field Shader

The Built-in Render Pipeline is Unity's default render pipeline. It is a general-purpose render pipeline that has limited options for customization. The Universal Render Pipeline (URP) is a Scriptable Render Pipeline that is quick and easy to customize, and lets you create optimized graphics across a wide range of platforms. The High Definition Render Pipeline (HDRP) is a Scriptable Render Pipeline that lets you create cutting-edge, high-fidelity graphics on high-end platforms.
Unity VersionBuilt-inURPHDRP
6000.0.24f1
Not compatible
Compatible
Not compatible

The 2D Depth of Field package simulates a 3D like depth of field in a 2D environment. It uses one shader to blur the edges of the screen like a vignette and another shader individually instanced on foreground and background sprites to increase the blur amount based on the distance of the z position from zero. The 2D Depth of Field package offers a visual effect that mimics the depth of field seen in 3D environments, but implemented within a 2D rendering pipeline. This is achieved through the strategic application of two distinct shaders.


The first shader operates by applying an adjustable radial blur towards the edges of the screen, similar to a vignette. This subtly draws the viewer's attention towards the center of the frame, contributing to the illusion of depth.


The second shader is designed to be instanced and applied individually to both foreground and background sprites within the 2D scene. This shader dynamically adjusts the amount of blur applied to each sprite based on its simulated distance from a conceptual focal plane, which is represented by a z-axis position with zero as the point of focus. Sprites positioned further away from this zero point, either in the positive or negative z-direction, receive a greater degree of blur. This varying blur intensity across different sprites is the core mechanism that creates the convincing depth of field effect. By carefully controlling the simulated z-positions of the sprites, developers can artfully guide the viewer's focus and create a heightened sense of dimensionality within their 2D projects. This technique can be particularly effective in drawing attention to key elements within the scene while subtly softening less important background or foreground details.


Included:

  • 2 Shader Graphs
  • 4 Sub Shaders
  • 2 Blur Materials
  • Sprites and Tilemaps
  • 4 Scripts
    • 2 to control shaders
    • 1 for player movement
    • 1 for a simple Parallaxing effect

Thanks For Considering!

https://tobaccolandstudios.my.canva.site/

2D Depth of Field

(not enough ratings)
7 users have favourite this asset
(7)
$15
Taxes/VAT calculated at checkout

Secure checkout:
Supported payment methods: Visa, Mastercard, Maestro, Paypal, Amex

License type

File size

1.1 MB

Latest version

1.0

Latest release date

Jun 16, 2025

Original Unity version

6000.0.24

Support

Visit site
Quality assets
Over 11,000 five-star assets
Trusted
Rated by 85,000+ customers
Community support
Supported by 100,000+ forum members
Unity logo

Language

Feedback

Partners Program

Partners
Copyright © 2025 Unity Technologies
All prices are exclusive of tax
2D Depth of Field
$15