In Unity 2022.3.5 and 2022.3.6 the grass renders in the editor, but in a built application only a single pink triangle is drawn. If you move the camera close to the triangle the framerate drops significantly. The triangle can only be seen from one side.
Editor:
Standalone build:
The same issues occurs on:
Windows Direct 11
Windows Vulkan
Android Vulkan
iOS Metal
Note: Dynamic Resolution is broken in Unity 2022 so disable it on the camera before testing.
However, I was able to get the sample code in Graphics.DrawMeshInstancedIndirect to render a mesh such as a plane or cube in both the editor and a built application. The mesh wasn't pink like the grass, but they were rendered in the same position so it appeared like a single object. The example script is supposed to assign random positions to each instance but this doesn't seem to be working.
In Unity 2022.3.5 and 2022.3.6 the grass renders in the editor, but in a built application only a single pink triangle is drawn. If you move the camera close to the triangle the framerate drops significantly. The triangle can only be seen from one side.
Editor:
Standalone build:
The same issues occurs on:
Note: Dynamic Resolution is broken in Unity 2022 so disable it on the camera before testing.
In the documentation for Graphics.DrawMeshInstancedIndirect, it says: This function is now obsolete. Use Graphics.RenderMeshIndirect instead. Draws the same mesh multiple times using GPU instancing.
However, I was able to get the sample code in Graphics.DrawMeshInstancedIndirect to render a mesh such as a plane or cube in both the editor and a built application. The mesh wasn't pink like the grass, but they were rendered in the same position so it appeared like a single object. The example script is supposed to assign random positions to each instance but this doesn't seem to be working.