Search Unity

DOF with Orthographic Camera similar to the one in Magicavoxel

Discussion in 'Image Effects' started by tr0ma, Sep 8, 2017.

  1. tr0ma

    tr0ma

    Joined:
    Dec 4, 2012
    Posts:
    19
    Hi there,

    During a rendering in Magicavoxel, it is possible to point at any voxel in the scene, and get a Depth of Field effect from there. This works great for both Perspective and Orthographic camera.

    military_room.JPG military_room_ortho.JPG

    In Unity, it's possible to get a similar effect (or almost) using the new Post-Processing Stack when the camera is set to Perspective. But not in orthographic.

    What would be the best alternative way to obtain similar result using an orthographic camera?

    Thanks!
     
  2. Johannski

    Johannski

    Joined:
    Jan 25, 2014
    Posts:
    826
    The post processing stack should support DoF with an orthographic camera. If you are using the focus puller of keijiro, that one does not support it. The distance calculation has to be done different for orthographic cameras.
    If you just need a fixed distance play around with max culling distance (in the camera) and the focus distance.
     
    sadzanenyama, Kokowolo and tr0ma like this.
  3. tr0ma

    tr0ma

    Joined:
    Dec 4, 2012
    Posts:
    19
    Thank you very much for your answer. You are absolutely right, changing the Far distance of the camera does the trick. If it's too far, changing the f-stop value, or focus distance will only change the whole effect uniformly on the scene.
    The Far value has to be much much closer in order to see a Focus plane appearing. Something that is less apparent in Perspective mode.

    Good job!
     
    Kokowolo likes this.
  4. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,874
    Try legacy cinematic effects with much more settings for DOF
     
  5. Kokowolo

    Kokowolo

    Joined:
    Mar 26, 2020
    Posts:
    60
    I honestly could not figure this out for URP, I know this thread is dead, but has there been any development for an orthographic DOF effect?

    EDIT: it's been a few years since I wrote this lol but here is a solution I found that worked for me.
     
    Last edited: Mar 31, 2024