Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question GPU instancing on Fixed Function Shaders?

Discussion in 'Shaders' started by FE-Games, Jul 1, 2020.

  1. FE-Games

    FE-Games

    Joined:
    Jul 1, 2020
    Posts:
    15
    Hello,

    iam new here and use unity since 1 year. iam read about fixed function shaders are more simply and performants better, is this correct?

    i only need one basic shader for 2d sprites, without light, fog, shadows, ambients or something else..

    is it possible to add gpu instancing to fixed function shaders?

    Thanks
    from Germany
     
  2. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,329
    No.

    No.

    It's also moot, as Unity doesn't support fixed function shaders anymore.

    I mean you can use shader files written as fixed function shaders, but Unity converts these into normal vertex fragment shaders behind the scenes, so there's no benefit to using them even if there was a performance benefit, which there isn't.

    Fixed function shaders were better at one time, in that some GPUs only supported fixed function shaders. Unity hasn't supported those GPUs for over 5 years now. The features needed to support instancing didn't show up until long after those GPUs disappeared. That said, instancing may not actually be faster. Instancing comes with some additional GPU side costs, and on mobile devices, it's often faster to construct a single merged mesh on the CPU and render than instead of using instancing, which is how Unity's sprite system already works.