Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

RWStructuredBuffer access in a HDRP shader

Discussion in 'Shaders' started by Tracecat, Apr 9, 2019.

  1. Tracecat

    Tracecat

    Joined:
    Mar 20, 2014
    Posts:
    23
    Hi all!
    Though I tried hard for a long time now I couldn't get a RWStructureBuffer working in a HDRP shader (Version 4.10 Unity 2018.3).
    In particular, I could neither read the RWStructureBuffer in the shader, nor could I download the (modified) contents back from gpu. Regardless of what I am trying, it seems to be always empty and Unity does not even throw an error. I am pretty sure, that the core problem lies in binding the ComputeBuffer to the right target with Graphics.SetRandomWriteTarget() method, but I just cannot figure it out.

    Therefore I would really really appreciate ANY working example of a HDRP shader accessing a RWStructureBuffer.

    Thank you folks!
     
    relativegames likes this.
  2. relativegames

    relativegames

    Joined:
    Nov 22, 2013
    Posts:
    32
    I have the same problem, is Graphics.SetRandomWriteTarget even working with HDRP/LWRP ? Material.SetBuffer doesn't work either
     
  3. cert

    cert

    Joined:
    Feb 10, 2013
    Posts:
    24
    Did someone solve this problem?