11-09-2020 08:40 PM
Graphics.DrawProcedural
in a shader that uses SV_VertexID
to fetch elements from a StructuredBuffer
, things work perfectly fine in standalone builds, but on Quest everything goes crazy. All the vertices end up with bizarre positions, normals, etc, resulting in huge triangles going everywhere. Even stranger, vertices that aren't part of my system, such as the default Avatar hands, also have their vertices corrupted! I've experienced similar problems in the past using Graphics.DrawMeshInstancedIndirect
Graphics.DrawMeshInstancedIndirect
on the Unity forum over a year ago, which you can view here
10-01-2021 08:30 AM
@mptp I am experiencing the same issue and I was wondering if you fixed it already?
10-02-2021 04:14 AM
Hi! Yeah I did in the end, thanks to some help from Unity - as it turns out it was all my fault haha.
You can read about the solution to this here:
Long story short, the vertex shader needs to completely initialize its vertex output, and if it doesn't, but has 'inout' rather than 'out' in the function declaration, this error results. So either make sure you fully initialize the vertex or, preferably, just use the 'out' keyword.