Search Unity

alpha diffuse vs two pass

Discussion in 'Shaders' started by pete, May 13, 2007.

  1. pete

    pete

    Joined:
    Jul 21, 2005
    Posts:
    1,647
    just looking for thoughts...

    we're experiencing a fair slow down using the two pass vege shader compared to the simple alpha/diffuse on a pretty complex scene. we understand why but we have several transparent objects that overlap and the simple shader doesn't handle sorting. i haven't looked at the two pass very close. we don't need the backface renedered. we just need it to sort. would changing the two pass to not bother with the backface help us get some speed back (or telling the simple to sort)? or is sorting the bottleneck? tia!
     
  2. Aras

    Aras

    Unity Technologies

    Joined:
    Nov 7, 2005
    Posts:
    4,770
    The sorting is certainly not an issue (with alpha shaders, Unity sorts by distance; and with other shaders it sorts by something else). The two-pass shader draws objects in two passes, so it's almost the same thing as having twice as many objects.

    Do you need partially transparent stuff? The two pass shader could be turned into a single pass one, with fully opaque parts and fully transparent parts (but no partially transparent ones).
     
  3. pete

    pete

    Joined:
    Jul 21, 2005
    Posts:
    1,647
    Thanks Aras! Exactly what I was hoping to learn. Don't need partial transparency. Someone found an alpha/diffuseZ on the wiki. I'll take a look at that or changing the two pass. Thanks!