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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Unpredictable Issues When Changing Texture Resolution in RunTime

Discussion in 'General Graphics' started by Treasureman, Feb 15, 2020.

  1. Treasureman

    Treasureman

    Joined:
    Jul 5, 2014
    Posts:
    563
    Hello. I've posted about this previously, but got no responses. In my game, I have 5 quality settings that the player can change between, but I'm having an issue with changing between them in my game's build. When changing quality settings, there are almost always unpredictable texture issues: textures turning black and white, textures turning completely black, UI disappearing, textures darkening... I did some troubleshooting and narrowed down that the issue was occurring when changing the texture resolution from full res to any other resolution and vice versa. Everything also works perfectly fine in the editor. Does anybody know what's causing this?

    Here's what the lighting and textures should about look like:
    Screenshot (14).png


    And here's what's been happening:
    Screenshot (64).png
    Screenshot (6).png
    Screenshot (9).png
     

    Attached Files:

  2. mcmount

    mcmount

    Joined:
    Nov 15, 2015
    Posts:
    82
    Just a shoot into dark; Could be a matter of the script execution order.
     
  3. Treasureman

    Treasureman

    Joined:
    Jul 5, 2014
    Posts:
    563
    What do you mean by that?
     
  4. mcmount

    mcmount

    Joined:
    Nov 15, 2015
    Posts:
    82
    Quite often when something works in editor, but not with the build, adding the script to the execution order helps. If your script should be run after some other script effects it, that should be defined by setting them in right order.
     
  5. Treasureman

    Treasureman

    Joined:
    Jul 5, 2014
    Posts:
    563
    I just tried it out. Didn't fix anything. I'm really at a loss here.
     
  6. mcmount

    mcmount

    Joined:
    Nov 15, 2015
    Posts:
    82
    I suppose you have different resolution of your textures? If so, and those are not anywhere in your scenes, they won't go to the compile. Compiling takes only what's active. If you want to include textures to your build which are driven by scripts, you MUST create invisible dummies having those materials/ textures.

    However, I think you will only make your build bigger having different resolutions, as Unity makes the optimization for you anyway.
     
  7. mouurusai

    mouurusai

    Joined:
    Dec 2, 2011
    Posts:
    349
  8. Spikeng

    Spikeng

    Joined:
    May 31, 2017
    Posts:
    1
  9. aleksandrk

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    2,864
    @Treasureman Which settings do you modify when switching between quality levels?
     
  10. Treasureman

    Treasureman

    Joined:
    Jul 5, 2014
    Posts:
    563
    I'm currently only editing texture resolution and shadow resolution at the moment.
     
  11. aleksandrk

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    2,864
    Texture resolution - where exactly do you change it? :)
    I suppose shadow resolution you're referring to is in QualitySettings.
     
  12. Treasureman

    Treasureman

    Joined:
    Jul 5, 2014
    Posts:
    563
    Yeah, I'm just changing it under QualitySettings. Any idea what could be the issue?
     
  13. aleksandrk

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    2,864
    Are you changing texture quality setting there?
    Full res to something else?
     
  14. Treasureman

    Treasureman

    Joined:
    Jul 5, 2014
    Posts:
    563
    Yes. I'm using 5 Quality Settings: "Highest," "High," "Medium," "Fast," and "Fastest." Highest and High both use Full Res Textures. The other settings decrease the texture size (1/2 res, 1/4 res, and 1/8 res respectively).
     
  15. aleksandrk

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    2,864
    Alright :)
    From the code it looks like it should work.
    Can you please file a bug report?
     
  16. Treasureman

    Treasureman

    Joined:
    Jul 5, 2014
    Posts:
    563
    I'm sorry, but I'm running into another issue. I'm trying to compress my project in order to send a bug report, but it won't let me. I even tried compressing the folder into my own .zip file, but it won't let me. It says my disk space is full, but I have about a terabyte of free space.
    EDIT: Nevermind. I think I've got it figured out :)
     
    Last edited: Feb 27, 2020