Search Unity

Using camera normal buffer in graph, just like depth and color?

Discussion in 'Visual Effect Graph' started by CSatUNSW, May 25, 2020.

  1. CSatUNSW

    CSatUNSW

    Joined:
    Sep 13, 2017
    Posts:
    1
    Hi,

    I'd like to access a world normal buffer in the vfx graph, so you'd have the surface normals 'under' the depth buffer positions (so eg you could easily spawn and radiate out particles from camera-visible surfaces).

    Quite new to most aspects of Unity, may well be missing obvious things.

    Thankyou!
     
  2. JulienF_Unity

    JulienF_Unity

    Unity Technologies

    Joined:
    Dec 17, 2015
    Posts:
    326
    Hi, camera normal buffer is something we could expose in the future.

    In the meantime, the geometric normal can be retrieved by sampling the depth buffer gradients (with possible well known issues where there is depth discontinuities)

    Another way to do it, would be to pass yourself the normal buffer to the vfx graph via an exposed property.
     
  3. Slaktarkuno

    Slaktarkuno

    Joined:
    Dec 3, 2021
    Posts:
    10
    Hi. Interested in feeding normal buffer via an exposed property - would you please care to shine any light on that process?