Search Issue Tracker

Won't Fix



Found in


Issue ID




Graphics.DrawMeshInstanced doesn't draw anything in build



To reproduce:

1. Open the project, attached by the user (
2. Open the "SampleScene" scene
3. Enter Play mode
4. Observe that 3 red cubes are drawn
5. Build and run the project for PC standalone
6. Observe that in the build nothing is drawn

Expected: the cubes are drawn in the build as well

Reproduced in 2017.3.2f1, 2017.4.3f1, 2018.1.0f2, 2018.2.0b4, 2018.3.0a1

Reproduced on Windows, Mac and WebGL

  1. Resolution Note (2018.3.X):

    This happens because shader have instancing support but the material they use (with enabled instancing) is created at runtime, so the "instancing variants" are stripped on build. As a workaround it is enough to create material with this shader and instancing enabled and assign it to some public variable in script.
    But there might be better workarounds

Comments (11)

  1. mahis4799

    Apr 28, 2020 05:45

    Go to Roku page record enter Roku com activation code appeared on Roku TV. My Roku com activate not working use new Roku code.

  2. LightStriker

    Mar 07, 2019 17:22

    It's not a "bug", but a feature, as stripping unwanted shaders is very useful.

    What you want to do, is have a script on a GameObject in a scene you use, and have it a Material field. Create a material, apply your shader on it, and enable "Instancing" on it. Assign your material to your gameobject.

    This way, the compiler will see your shader being used and won't strip it.

  3. devil_is_god

    Dec 28, 2018 04:03

    I also having the same issue´╝îand i don't know how to fix it! I'm using Unity 2017.4.3.f

  4. fnaith

    Oct 01, 2018 08:04

    Solve by attaching materials with our shader to a GameObject, then us:


    to load shader and copy it to runtime generated material

  5. fnaith

    Sep 29, 2018 04:49

    not fixed in Unity-2018.2.10f1

  6. fnaith

    Sep 22, 2018 01:13

    Bug still appears in Unity-2018.2.9f1

  7. fnaith

    Sep 16, 2018 01:13

    Will this bug also remain us to build standalone regularly...

  8. petey123567

    Sep 15, 2018 18:49

    This is affecting our shipping game, any ETA on a fix?

  9. fnaith

    Sep 14, 2018 02:47


  10. fnaith

    Sep 12, 2018 08:46

    Dear all, this problem still exist in 2018.2.7f1.

    My scene is more complex but it works with on edit mode:

    But after building as standalone windows exe. The input still works, but I cannot see anything include ambient light color effect

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.