Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Depth of field on 2D Sprites

Discussion in '2D' started by theghostronaut, Jul 12, 2019.

  1. theghostronaut

    theghostronaut

    Joined:
    Jul 27, 2018
    Posts:
    31
    Hi,
    I'm using the Post-Processing Depth of field effect. To get it working on my sprites, I got this shader:
    https://github.com/traggett/UnitySpriteShaders

    and ticked "Write to depth". Now, The depth is being written to the sprite, but it appears as just an outline. Any tips on what I'm doing wrong?

    Edit
    I fixed it, I had to set the Alpha and Shadow cutoff accordingly. I tried this before but it didn't work, must have something to do with a change I made in camera settings.
     
    Last edited: Jul 12, 2019
  2. WayneJP

    WayneJP

    Joined:
    Jun 28, 2019
    Posts:
    44
    Hi, could you please take a look at my post?
    Is this blue fog or light made by shader?
    I have no idea to implement this effect, should I write shader code?