Announcement

Collapse
No announcement yet.

Any disadvantages of MaterialInstanceDynamic?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Any disadvantages of MaterialInstanceDynamic?

    Hello all! I was just wondering, is there any disadvantage that comes with using MaterialInstanceDynamic? Does it impact performance a lot? Thanks!

    #2
    I dont see any massive impact, in some scenes I am using 2000+ MaterialInstanceDynamic (I create a unique one for every object in my scene at runtime at this time). And am still running at 120+ fps.
    FluidSurface Plugin: https://github.com/Ehamloptiran/UnrealEngine/releases
    TextureMovie Plugin: https://github.com/Ehamloptiran/TextureMoviePlugin

    Comment


      #3
      Use them all the time! I even made a macro to make their creation easier and quicker

      Comment


        #4
        There's some cost every time you update parameters (once per frame), and some constant cost to the rendering if you use a different one on every mesh because it prevents the state sorting and sharing that happens on the rendering thread. Measure your game with 'stat unit' and 'stat dumpframe -ms=.1' and see the before/after.

        Comment


          #5
          Ah it seems I did infact lie above. I create MID's for each asset, which are used multiple times in my scene. So hopefully not completely destroying the state sorting and sharing.
          FluidSurface Plugin: https://github.com/Ehamloptiran/UnrealEngine/releases
          TextureMovie Plugin: https://github.com/Ehamloptiran/TextureMoviePlugin

          Comment

          Working...
          X