Search Unity

How to manually make instanced shaders built?

Discussion in 'World Building' started by NathanJSmith, Jun 4, 2019.

  1. NathanJSmith

    NathanJSmith

    Joined:
    May 11, 2018
    Posts:
    57
    I'm trying to set drawInstanced at runtime. But when I run the game in release mode, the terrain disappear. It's weird that instead of turning pink like other missing shader case, the terrain disappear.
    According to this post:
    I try making a dummy Terrain in the scene and set the drawInstanced of this dummy Terrain to true, and as expected, it works.
    In case of missing shader, I can just add needed shader to a ScriptableObject, which is in my scene, to make Unity built the shader in release mode. So is there anyway I can tell Unity to build instanced shaders without having to include a dummy Terrain in my scene? (I'd like to include the instanced shaders to a ScriptableObject, but if the built is controlled by multi_compile, then I should find another way)
     
  2. NathanJSmith

    NathanJSmith

    Joined:
    May 11, 2018
    Posts:
    57
    I manage to make the drawInstanced Terrain appear by adding the Terrain GPU Instancing material into the scene.

    But the color of the terrain become darker in release mode. I need to figure out why it become darker...