Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question A question about spritesheets inside Spriteatlases

Discussion in '2D' started by mrdaljama, Nov 22, 2023.

  1. mrdaljama

    mrdaljama

    Joined:
    Sep 27, 2019
    Posts:
    10
    Why do some spritesheets that are part of spriteatlases appears as a separate object in my memory profile which in this case (due to NDA, I can't provide actual screenshots):

    Sprite A is a part of Spriteatlas A.

    In the memory profiler, I can see both Spriteatlas A and Sprite A taking up memory.

    Sprite A - 16.0MB
    sactx-#-# - 16.0MB (this is the spriteatlas A)


    In my understanding, Sprite A should not be showing up anymore right?

    By the way, this is in build.

    Sprite A settings are:

    Texture Type: Sprite (2D and UI)
    Sprite Mode: Multiple
    Mesh Type: Full Rect
    Extrude Edges: 0
    sRGB: Checked
    Alpha Source: Input Texture Alpha
    Alpha is Transparency: Checked
    Read/Write: Unchecked
    Generate Mip Maps: Unchecked
    Wrap Mode: Clamp
    Filter Mode: Point (no filter) //because this is a pixel art
    Max Size: 2048
    Resize Algorithm: Mitchell
    Format: Automatic
    Compression: None

    Spriteatlas A settings are:

    Type: Master
    Include in Build: Checked
    Padding: 2
    Read/Write: Unchecked
    Generate Mip Maps: Unchecked
    sRGB: Checked
    Filter Mode: Point
    Max Texture Size: 2048
    Format: Automatic
    Compression: High Quality
     
  2. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    2,406
    Are you per chance profiling the Editor instead of a Player build?
     
  3. mrdaljama

    mrdaljama

    Joined:
    Sep 27, 2019
    Posts:
    10
    Hello sir, no I am not profiling the editor, i am in Build. This is a screenshot of the references for that spritesheet in question.

    upload_2023-11-23_17-51-6.png

    I am fairly lost on how to read these 'Reference By" in the memory profiler for Unity. Any idea of what does this branch of references mean?
     
  4. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    2,406
    Which Unity version is this?
    Also, are you using AssetBundles/Addressables?
    I might have to look into the reporting side of this.

    Also I have a pending batch of improvements for the references view that I plan to land for version 1.1.1 of the package that will hopefully clarify it a bit, if still not entirely. Long way of saying that we're aware it's not 100% where we'd want it to be at.

    That said it looks like your CustomAnimator is referencing a List of sprites where this is in it. That Custom Animator is referenced by a CustomAnimatorDictionary which is referenced by a VFXPlayer MonoBehaviour on a GameObject that's named "Cloth". How relevant that is to the Sprite being there along with the Atlas and taking up the same amount of memory, I can't yet determine without digging a bit into the implementation side, but before I do that, I just want to confirm the Unity version you're on, as the implementation is likely to have changed for 2022 LTS
     
  5. mrdaljama

    mrdaljama

    Joined:
    Sep 27, 2019
    Posts:
    10
    We are using Unity 2021.3.21f1. Also we are not using AssetBundles/Addressables for this project.