Search Unity

LWRP Priority Not Working For Opaque?

Discussion in 'Universal Render Pipeline' started by tbg10101_, Aug 18, 2019.

  1. tbg10101_

    tbg10101_

    Joined:
    Mar 13, 2011
    Posts:
    192
    I'm using the LWRP (now Universal RP) in 2019.3.0a12.

    I'm trying to create an effect that utilizes different Priority values on different materials. This works if I make both materials' Surface Type Transparent (one draws on top of the other) but this does not work when both are set to Opaque. (the objects draw as if they have the same Priority)

    Is this expected or a bug?
     
  2. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,339
    Opaque objects are sorted per pixel by their z depth so that their render order / priority has no affect on the look of the final image. That is in fact the only real differentiator between opaque and transparent materials. If you don’t want them to sort per pixel depth, don’t use opaque.
     
  3. tbg10101_

    tbg10101_

    Joined:
    Mar 13, 2011
    Posts:
    192
    So, should the priority slider be hidden for opaque? (since it appears to have no effect)
     
  4. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,339
    No, it still does has an affect. It changes the order the object is rendered in, which can be important for certain types of effects and rendering optimizations. It just won't affect the final appearance of the opaque rendering using the default shaders.