All Oculus Quest developers MUST PASS the concept review prior to gaining publishing access to the Quest Store and additional resources. Submit a concept document for review as early in your Quest application development cycle as possible:

For additional information and context, please see "Submitting Your App to the Oculus Quest Store".
Welcome to the Oculus Developer Forums!

Your participation on the forum is subject to the Oculus Code of Conduct.

In general, please be respectful and kind. If you violate the Oculus Code of Conduct, your access to the developer forums may be revoked at the discretion of Oculus staff.

Unity DrawMeshInstanced not working on Quest

For some reason DrawMeshInstanced doesn't work for me on Quest.
I tried both Graphics.DrawMeshInstanced and CommandBuffer.DrawMeshInstanced  and they both don't work.
DrawMesh does work with no problem.
DrawMeshInstanced works on PC running in the Editor or in a build on Rift.
The shader that I'm using is placed in a resources folder so it should be included in the build, but to make sure I also tried placing it in the mush include shaders list and even to place an object in the scene with a material that uses it. All of this didn't help.
I also checked the SystemInfo.supportsInstancing and it returns true on the Quest.
Here is the shader that I'm using:
Shader "Unlit_Mesh_Instance" {
    Properties {
        _Color ("Color", Color) = (1,1,1,1)

    SubShader {
        Tags {

        Pass {
            Name "FORWARD"
            Tags {
            Blend SrcAlpha OneMinusSrcAlpha
            ZTest Always
			//Offset -100, -100
			Cull Off

            #pragma vertex vert
            #pragma fragment frag
            #include "UnityCG.cginc"
            #include "AutoLight.cginc"
			#pragma multi_compile_fwdbase
			#pragma multi_compile_instancing
            #pragma only_renderers d3d9 d3d11 glcore gles gles3 metal 
            #pragma target 3.0
                UNITY_DEFINE_INSTANCED_PROP(float4, _Color)
			struct VertexInput {
                float4 vertex : POSITION;
			struct VertexOutput {
                float4 pos : SV_POSITION;
			VertexOutput vert (VertexInput v) {
                VertexOutput o = (VertexOutput)0;
				o.pos = UnityObjectToClipPos(v.vertex); 
                return o;
			float4 frag(VertexOutput i) : COLOR {
                return UNITY_ACCESS_INSTANCED_PROP(Props, _Color);
Am I missing something here?


  • tzmtntzmtn Posts: 8
    Found a solution,
    Turns out it doesn't work when you dynamically create the material and set it to support instancing by code. If you create the material in advance and place it in your resources folder, everything works. Probably a bug, but I can work around that.
Sign In or Register to comment.