Search Unity

Resolved Multiple Render Queues contolled by texture on same material?

Discussion in 'Shaders' started by cosmologosaurusrex, May 30, 2021.

  1. cosmologosaurusrex

    cosmologosaurusrex

    Joined:
    Jul 1, 2015
    Posts:
    50
    Is it posible to have 2 or 4 different Render Queues for the same material, perhaps contolled by a texture. Lets say I want several sheets of glass where the most interior has render queue 3001 and the outher have render queue 3002.

    Currently I have 4 different material for glas on a character and this I think is pretty bad for performance since it seems to multiply all of the characters triangles by the amount of materials on it (?).

    Thx in advance :)
     
  2. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,352
    No. A material can only have one queue, and all shader passes rendered to the camera's main rendering pass use the same queue. Though some passes like the shadow caster pass may ignore the material queue entirely as those rendering passes don't use the queue.

    Shouldn't. A single mesh with one material vs two materials should have identical triangle & vertex counts, assuming the two materials aren't adding seam, otherwise the vertex count may increase slightly.

    I seem to remember some versions of Unity have a bug that has the stats window count the entire model's vertex count for each separate material added. But this is just a bug and it's not doing that.

    It is possibly increasing the number of set pass calls, which can affect performance to some degree. But unless you're adding several hundred (on mobile) to several thousand set pass calls it's not a big deal. For skinned meshes specifically you're probably going to have performance problems from the number of those you have before the number of set pass calls becomes the issue.
     
    cosmologosaurusrex likes this.
  3. cosmologosaurusrex

    cosmologosaurusrex

    Joined:
    Jul 1, 2015
    Posts:
    50
    Thx so much. Yea I feel like that was something shown in the stat window before in an earlier version and I assumed the high vert/tri count now was for the same issue but I found that its basically fade/transparent materials that causes it (but only for the triangles that had those materials) plus some other shadow projector I used.

    Hope you are getting payed by unity or something for holding up the unity shading community :)
     
  4. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,352
    Nope.