Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Is skinmesh rendered twice per a material?

Discussion in 'General Graphics' started by poM2, Dec 16, 2015.

  1. poM2

    poM2

    Joined:
    Jul 13, 2015
    Posts:
    8
    Hello.

    I am seenning GPU Usage profile contents added manually in Unity Profiler window.

    I am really curious why there is 2 drawcalls each material not 1 drawcall.
    The profiler shows my skinned submeshes is rendered twice by DrawCalls field.
    I attached the screenshot.

    The materials I am using are just setted opaque with unity standard shader.

    I am using Unity5.3 and forward rendering pass.

    I beg a any advices.

    Thx.
     

    Attached Files:

  2. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,248
    I can't tell you definitively what the cause is, but I can make a guess. Usually skeletal meshes have a limit to the number of bones or polys, so an animated mesh with a high number of bones or polygons will be split up into sub meshes. This might be what's happening here.
     
  3. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    If it has a shadow, it'll have an extra draw call.
     
  4. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,248
    Actually it'll have at least 3 draw calls if there are shadows (and you're using the forward renderer and a directional light). Once for the depth buffer (used for shadow receiving with the first directional light), one for shadow casting (or more if you have cascades, one for each cascade), and the last one for rendering to the screen. But all of those will appear listed as separate events in the profiler which is what he's looking at. He's seeing a single Mesh.DrawVBO under RenderForwardOpaque taking two calls. I assume if you dig down into Shadows.RenderJob you'll find another Mesh.DrawVBO that also does 2 passes per material.
     
  5. poM2

    poM2

    Joined:
    Jul 13, 2015
    Posts:
    8
    Thanks, everyone for a reply.
     
  6. Jonas_Sid

    Jonas_Sid

    Mobile Graphics Developer Unity Technologies

    Joined:
    May 13, 2015
    Posts:
    44
    Do you have both Game and Scene view opened? If so, it's pretty apparent, that the object is rendered twice :)