Search Issue Tracker
Graphics.DrawMeshInstanced doesn't draw anything in build
1. Open the project, attached by the user (TestInstancing.zip)
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
Apr 28, 2020 05:45
Go to Roku page https://sites.google.com/site/rokuactivationn/ record enter Roku com activation code appeared on Roku TV. My Roku com activate not working use new Roku code.
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.
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
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
Sep 29, 2018 04:49
not fixed in Unity-2018.2.10f1
Sep 22, 2018 01:13
Bug still appears in Unity-2018.2.9f1
Sep 16, 2018 01:13
Will this bug also remain us to build standalone regularly...
Sep 15, 2018 18:49
This is affecting our shipping game, any ETA on a fix?
Sep 14, 2018 02:47
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
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
- Input Field ignores first keyboard input when calling Focus() from code
- GC Alloc when using Graphics.RenderMeshInstanced
- [VFX Graph][URP] VFX crashes on URP when dragging VFX asset to the Hierarchy window
- InvalidOperationException when using AsyncGPUReadback.RequestIntoNativeArray
- Generated Entities look different when Depth Priming Mode is changed
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