Search Unity

Feature Request vertexId and instanceId nodes to allow reading from custom buffers [moved from wrong subforum]

Discussion in 'Shader Graph' started by andrea_i, Mar 10, 2020.

  1. andrea_i

    andrea_i

    Joined:
    Nov 18, 2012
    Posts:
    32
    This is a simple request and yet one that is probably blocking many custom shaders that rely on a StructuredBuffer to read per-vertex and per-instance data that was generated from a ComputeShader.

    Having custom nodes already allows us to easily inject hlsl code in the graph, and that's great, these two simple nodes are the only missing part.

    I managed to get around this by writing my own shader, but in HDRP/URP this is definitely not the way to go, and my impression is that this is not the advised way to do things from now on.
     
    fct509, Dinamytes and Deleted User like this.
  2. fct509

    fct509

    Joined:
    Aug 15, 2018
    Posts:
    108
    I too would find it useful to be able to get the VertexID, PrimitiveID, and InstanceID. The fact that I've been unable to get them for HDRP has actually halted the approval for funding in a project I was working on. That said, I've started looking at the docs for hand-written shaders for Post Processing Effects and Custom Render Passes, and these have some promise.
     
    Last edited: Jun 3, 2021
  3. andybak

    andybak

    Joined:
    Jan 14, 2017
    Posts:
    569