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.

Sprite Packer does not work correctly with linear color space

Discussion in '2D' started by MarcAudouy2, Oct 2, 2017.

  1. MarcAudouy2

    MarcAudouy2

    Joined:
    Aug 9, 2017
    Posts:
    6
    Hi,

    I have been trying to use the sprite packer for our HUD elements but it does not seem to work properly: all the sprites appear desaturated, which does not happen when using them directly without the sprite packer.

    After investigation I finally found out that the problem is using linear color space in the player rendering settings.
    Without sprite packer, or with gamma space, everything works fine, but using linear space with the sprite packer makes everything faded out.

    We would like to use linear space (the game is 3D) and the sprite packer for UI performance reasons.
    Is that a bug, or am I missing some setting somewhere?
     

    Attached Files:

  2. Deleted User

    Deleted User

    Guest

    I'm guessing you mean the sprite atlas, if you go into debug mode by right clicking the inspector while the sprite atlas is selected, there should be an option to change the color space, try switching it to gamma in just the sprite atlas.
     

    Attached Files:

  3. MarcAudouy2

    MarcAudouy2

    Joined:
    Aug 9, 2017
    Posts:
    6
    Works as expected, thank you!

    This option should probably be available in normal mode, it doesn't generally occur to me to check the debug mode for extra options.
     
  4. Deleted User

    Deleted User

    Guest

    I have no idea why it's set up like that, seems counterintuitive. I'd be interested in knowing why that works.
     
  5. Sluggy

    Sluggy

    Joined:
    Nov 27, 2012
    Posts:
    855
    Thanks for the tip! Wish I had found this a couple hours ago while I still had hair left on my head. Considering virtually all image editing software exports in gamma space I really don't see why atlases don't have a 'Bypass sRGB' checkbox that is unchecked by default (or appropriately set to gamma or whatever needs doing). That way rendering in linear space won't screw everything up.

    While I'm on the rant rampage let me complain to no one in particular that the whole sprite atlas thing in general just seems like a clunky workflow. Lots of people say they like it but for me it just ruins all the automation systems I had in place and I don't appear to be getting anything in return for it.
     
  6. NatsumeKita

    NatsumeKita

    Joined:
    Feb 19, 2017
    Posts:
    7
    I re
    I realize that this is an older thread, however I stumbled across the same problem. I figured out all I had to do was select the srgb option in the atlas settings, bam full color was back.