Search Unity

GraphicsBuffer, Mesh vertices and Compute shaders

Discussion in 'General Graphics' started by Ignifex, Nov 14, 2019.

  1. Aras

    Aras

    Unity Technologies

    Joined:
    Nov 7, 2005
    Posts:
    4,770
    So you have a custom vertex shader that writes out vertex inputs into your own compute buffer, right? I guess in HDRP you'd have to somehow make that same shader also execute somehow. Does it execute? (Frame Debugger or RenderDoc capture might answer all this)

    Anyway, (soon) in 2021.2a18 or later you'll be able to just access mesh buffers via compute without gross hacks like that.
     
  2. ignarmezh

    ignarmezh

    Joined:
    Mar 23, 2017
    Posts:
    56
    Yes, I have a rather primitive shader that only displaces vertices from the texture. In the shader I indicated the filling of the buffer after displacement (visually, the shader works). But in the code, in the previous post, I'm not getting information from the shader, the buffer is returned empty. It's on the HDRP.
     
  3. Aras

    Aras

    Unity Technologies

    Joined:
    Nov 7, 2005
    Posts:
    4,770
  4. ignarmezh

    ignarmezh

    Joined:
    Mar 23, 2017
    Posts:
    56
    In RenderDoc I see that in my case information is copied from an empty buffer "SSGetData-Standing-36036" to EID (Event) 4220. Why is this happening? The name of my shader is "New Shader", the rendering can be seen on EID (Event) 2798.
    You can donwolad the capture file in link https://drive.google.com/file/d/1f5seu4tMRQl5Tbo_9zo8yaRTk5Fa5t9F/view?usp=sharing.
    Through in RenderDoc, I cannot also see what happens in the vertex shader itself, it only displays information:
    Code (CSharp):
    1. OutputStruct EditedShaderVS(in InputStruct IN)
    2. {
    3.     OutputStruct OUT = (OutputStruct)0;
    4.     // ...
    5.     return OUT;
    6. }
    Mb because I can only choose the type of compilation for HLSL Built-in.
     
  5. Rickmc3280

    Rickmc3280

    Joined:
    Jun 28, 2014
    Posts:
    189
    Is there a way to use a GraphicsBuffer to render colorized vector points? ( buffer of Vectors and buffer of Colors)?

    I am currently using the Computer Shader, but it does some very weird stuff when UI enters into the scene. Example in the video. (VR Single Pass). Have tried it on all UI , if the canvas has nothing on it, it wont do it. Cant figure out what is going on, but wanted to see if using this method might fix it.