Search Unity

Graphics.DrawMeshInstanced draws meshes blinking

Discussion in 'General Graphics' started by Micz84, May 23, 2018.

  1. Micz84

    Micz84

    Joined:
    Jul 21, 2012
    Posts:
    451
    I am using Graphics.DrawMeshInstanced and it does not work for me meshes are blinking:


    Graphics.DrawMeshInstanced(mesh, 0, playerMaterial, matrixList);

    What can I do to fix that?
     
  2. aleksandrk

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    3,028
    Hi!
    Please submit a bug report.
     
  3. FMark92

    FMark92

    Joined:
    May 18, 2017
    Posts:
    1,243
    Are you doing this in Update, FixedUpdate, LateUpdate?
    Edit: maybe in a co-routine?
     
  4. Micz84

    Micz84

    Joined:
    Jul 21, 2012
    Posts:
    451
    I have some bug in my shader. Will check if it is the case if not I will send a bug report.
    I am using ECS in this project and it is done in OnUpdate
     
  5. FMark92

    FMark92

    Joined:
    May 18, 2017
    Posts:
    1,243
    Is ECS supposed to be work with rendering?.
     
  6. Micz84

    Micz84

    Joined:
    Jul 21, 2012
    Posts:
    451
    Why not? You have to render your content somehow. It was shader issue, I forgot to declare some variables but now it works very well. I can render like 150-200 characters and maintain 25-28 fps on Android (xiaomi redmi note 4), and most of the cost is from colliders because each NavMeshAgent has capsule collider.
     
    FMark92 likes this.
  7. officialfonee

    officialfonee

    Joined:
    May 22, 2018
    Posts:
    44
    I am having the same issue, could you tell me when variables you declared or added that stopped it from blinking.
     
  8. radiatoryang

    radiatoryang

    Joined:
    Jul 7, 2014
    Posts:
    19