Search Unity

Setpass?

Discussion in 'Scripting' started by tawdry, May 5, 2015.

  1. tawdry

    tawdry

    Joined:
    Sep 3, 2014
    Posts:
    1,357
    Hi folks
    So with Unity 5 came these things called Setpasses i notice with each material on a object i get a corresponding setpass. What exactly does a setpass entail. Does it redraw the object 200 times if u have 200 setpasses for instance?. Can a setpass be batched like drawcalls?.
    Thx
     
  2. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    AFAIK Setpass is an un-batchable state change / setup on GPU ie drawing to different render textures. You can optimise it by having less post fx. It's fairly expensive ish as it stops the GPU from getting on with things :)
     
  3. tawdry

    tawdry

    Joined:
    Sep 3, 2014
    Posts:
    1,357
    So less materials the better ? and even using all the same materials does not help as it cant batch?