Search Unity

Removing Unnecessary Shaders

Discussion in 'Shaders' started by MGGDev, Feb 10, 2019.

  1. MGGDev

    MGGDev

    Joined:
    Nov 6, 2018
    Posts:
    27
    Hello,

    I am using the new Memory Profiler, and it shows there is 90Mb of Shaders loaded in memory. I am not using most of them. How can I remove the unused?

    memory.png

    Thanks a lot.
     
    ZenUnity likes this.
  2. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,620
    Did you profile in the editor or a build?
     
  3. MGGDev

    MGGDev

    Joined:
    Nov 6, 2018
    Posts:
    27
    In Editor. Will they be stripped in the build?
     
  4. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,352
    Yes.
     
    MGGDev likes this.
  5. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,633
    Id love a way to find unused shaders in a scene!.. actually may not be that difficult to write a script to do it, may give it a go.
     
    M_R_M likes this.
  6. Modafuka

    Modafuka

    Joined:
    Nov 21, 2019
    Posts:
    45
    Hi every one, do you know how to remove build in shaders, i just want to clean broken and unused shaders from my project.
     
  7. gio_987654321

    gio_987654321

    Joined:
    Jan 25, 2017
    Posts:
    39
    darkAbacus247 and Alvarezmd90 like this.
  8. Modafuka

    Modafuka

    Joined:
    Nov 21, 2019
    Posts:
    45
    Thanks, i ll try it later.
     
  9. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,797
    AFAIK the standard shader will not get stripped from the build, wish I could delete it.
     
    R0man likes this.
  10. Modafuka

    Modafuka

    Joined:
    Nov 21, 2019
    Posts:
    45
    Ye, me too, those standard shaders is annoying.
     
    Alvarezmd90 likes this.
  11. Alvarezmd90

    Alvarezmd90

    Joined:
    Jul 21, 2016
    Posts:
    151
    Yeah, I'm using vertex colour shaders without per pixel lighting so I don't need pbr and ugly standard shaders. Might look into this tomorrow. :)
     
  12. darkAbacus247

    darkAbacus247

    Joined:
    Sep 7, 2010
    Posts:
    251
  13. Deleted User

    Deleted User

    Guest

    I have profiled in mobile not in editor , but still getting this shader in use (particles/standard surface shader).
     
    Some_Indie_Dev likes this.