Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question How to get rid of unused shaders and textures from build

Discussion in 'Universal Render Pipeline' started by Tom-Atom, Feb 18, 2022.

  1. Tom-Atom

    Tom-Atom

    Joined:
    Jun 29, 2014
    Posts:
    153
    Hi,
    my game id 2D and I do not use lights nor shadows. I hope, I switched it off anywhere possible. But still some shaders and textures from URP are getting into final build. I concern mostly about this texture:

    1.0 mb    0.8% Packages/com.unity.render-pipelines.universal/Runtime/2D/Data/Textures/FalloffLookupTexture.png


    It is big and as I do not use lights, I do not need it - it would save 1 mb of space, which is not small amount.
    After digging deeper I found, that this texture is included if shader feature like "USE_SHAPE_LIGHT_TYPE_0" is in shader. And this feature is for example in Sprite-Lit-Default shader ... but I do not use this shader anywhere in my game and it is also included into build:

    14.9 kb    0.0% Packages/com.unity.render-pipelines.universal/Shaders/2D/Sprite-Lit-Default.shader


    So, how can I prevent unused shaders from getting it into final build and I believe, it will also prevent that big texture from the same thing?

    (I also tried to make Falloff texture small (like 128x1 instead of original 2048x16), but Unity immediately recognized it and reimported original big texture :-( )

    (I also found, that 2D Renderer asset has some hidden properties which reference some default URP shaders. But as it is hidden, you can't change or delete it in ispector)
     
  2. Hassaan-XD

    Hassaan-XD

    Joined:
    Jul 18, 2015
    Posts:
    14
    did you find any solution? because I have same issue, this file: `
    FalloffLookupTexture.png
    ` is crazy
     
  3. damelin

    damelin

    Joined:
    Jul 3, 2012
    Posts:
    64
    I'm still having this big FalloffLookupTexture.png exported in the game uselessly. Using URP v 12.1.10
     
  4. kennyy_

    kennyy_

    Unity Technologies

    Joined:
    Apr 7, 2021
    Posts:
    94
    Hi @damelin, the FalloffLookupTexture is one of the default textures when using Renderer2D and cannot be removed unfortunately. I understand your concern that the texture is taking up a lot of space, we will look into compressing the texture.
     
    Kirsche and damelin like this.
  5. MaximPP

    MaximPP

    Joined:
    Jan 26, 2019
    Posts:
    72
    Unity 2022.3.4 URP v14

    I have the same problem. APK build size when switching to URP increases from 60Mb to 73Mb. Not only because of the FalloffLookupTexture file, but also because of the files in the Textures/FilmGrain/*.png directory and others.

    Question: Is the URP the recommended render pipeline for mobile platforms, or is it better to stay on the Build-in render pipeline for now?

    Screenshot 2023-06-30 at 11.20.20.png