Search Unity

Question How to use Position (Depth)

Discussion in 'Visual Effect Graph' started by skoteskote, Mar 28, 2021.

  1. skoteskote

    skoteskote

    Joined:
    Feb 15, 2017
    Posts:
    87
    Hi, I am trying to recreate this awesome example by Vlad, basically rendering everything with particles. I can't seem to get the Position (Depth) node to work, whatever I do particles are instantiated on a flat plane in front of the camera. I'm probably missing something basic?

    Screenshot 2021-03-29 at 00.18.09.png
     
  2. VladVNeykov

    VladVNeykov

    Unity Technologies

    Joined:
    Sep 16, 2016
    Posts:
    550
    Hi @skoteskote ,

    Are you using HDRP or URP?
    VFX Camera buffer access for URP is still being worked on (part of this task on our roadmap)
     
    skoteskote likes this.
  3. skoteskote

    skoteskote

    Joined:
    Feb 15, 2017
    Posts:
    87
    Thanks for the quick response @VladVNeykov, I am on HDRP, but now I tried it on my PC and there all works as expected. My laptop (mbp) still renders the particles on a flat plane... But that's prob due to it being an old laptop, and it's not a problem for me as it's not my main workstation. All good!
     
  4. VladVNeykov

    VladVNeykov

    Unity Technologies

    Joined:
    Sep 16, 2016
    Posts:
    550
    We had an issue with the camera buffers on OSX, you might be in an earlier version where it still reproduced.
    Glad it works on your PC! :)
     
  5. skoteskote

    skoteskote

    Joined:
    Feb 15, 2017
    Posts:
    87
    Yes, that is it! I am on 2020.3 on my laptop

    Now I just need to figure out how to not render the objects I'm using for the depth buffer... But that's another story :)
     
  6. andybak

    andybak

    Joined:
    Jan 14, 2017
    Posts:
    569
    @VladVNeykov any chance of uploading the project from that tweet? or at least the .vfx file?
     
  7. VladVNeykov

    VladVNeykov

    Unity Technologies

    Joined:
    Sep 16, 2016
    Posts:
    550
    Hey @andybak , sure thing, I've updated it to vanilla 2020.3 / 10.4 (as the original was using some custom stuff) and cleaned it up a bit. It is set up for HDRP as URP doesn't have camera buffer access at the moment (that's planned for 2021.2). You can grab it here.
     

    Attached Files:

    Last edited: Apr 1, 2021
    skoteskote likes this.
  8. andybak

    andybak

    Joined:
    Jan 14, 2017
    Posts:
    569
    That's brilliant. Thanks!

    Mind if I put it up on Github so it's easier for other people to find (with proper credit of course)?
     
    VladVNeykov likes this.
  9. VladVNeykov

    VladVNeykov

    Unity Technologies

    Joined:
    Sep 16, 2016
    Posts:
    550
    Sure thing! Only bit I'm not 100% sure about is the mixamo dance animation (I put a *.txt in the package saying it came from there and from what I could tell from their FAQ it should be ok, but... mentioning it just in case ¯\_(ツ)_/¯ )
     
    skoteskote likes this.
  10. andybak

    andybak

    Joined:
    Jan 14, 2017
    Posts:
    569
    Maybe I'll swap it out for an animation from the CMU mocap library.

    Thanks!
     
    VladVNeykov likes this.
  11. lucas_martinic

    lucas_martinic

    Joined:
    Jun 13, 2018
    Posts:
    5
    Hi Vlad, was this implemented in URP?
     
  12. OrsonFavrel

    OrsonFavrel

    Unity Technologies

    Joined:
    Jul 25, 2022
    Posts:
    194
    Hello.
    Access to URP Camera Depth and Color Buffers landed in 2023.3.0a16 and above.
    Have a lovely day.