Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Wrong render order in scene

Discussion in 'Project Tiny' started by Seaqqull, Oct 21, 2020.

  1. Seaqqull

    Seaqqull

    Joined:
    Aug 3, 2018
    Posts:
    24
    Hello.
    I have an issue with the proper rendering of text (sometimes entity-sprite also renders in the wrong order).
    For instance (Wrong order with sprite):
    - Pause entity (Only transform component - has z: -8)
    - Child entity -> PauseBackground (has z: 0.1)
    - Child entity -> RotationIcon (has z: -0.1)

    For instance (Wrong order with text):
    In connection with "Pause" entity "Debug" entity - has z: -9. But somehow it renderers only after "Pause" entity (So I don't see "Debug" if there is also "Pause" entity).

    But somehow "RotationIcon" doesn't renderer before the "PauseBackground" but after. In addition, all sprites have default [sorting layer] and default [order in layer], I align them only by z coordinate.

    Additional question: Is there a way to set "TextRenderer" (Tiny component) to be "SpriteRenderer" not "MeshRenderer", so I would be able to sort entities not by z, but by [sorting layer] and [order in layer].
     
  2. Ted_Wikman

    Ted_Wikman

    Unity Technologies

    Joined:
    Oct 7, 2019
    Posts:
    916
    Hello @Seaqqull,
    In your first example, are all your renderers SpriteRenderers? I gave your example a go and could not reproduce the sorting issue you are experiencing.

    As for sorting different renderers together, we have different passes which the renderers are using depending on the type of renderer, and its content. In Tiny 0.29, the passes and their order is the following:
    1. Clear
    2. Opaque
    3. Transparent
    4. Sprite
    5. UI
    Where SpriteRenderers are using the Sprite pass and TextRenderer is using the Transparent pass. This means that the SpriteRenderers will always render on top of the TextRenderer. This is something we will fix in a future release of Tiny.
     
  3. Seaqqull

    Seaqqull

    Joined:
    Aug 3, 2018
    Posts:
    24
    Thank you, that's really helped. Excited to see it ^_^.
    Regarding the child order problem, I found the solution (had some code mistakes).
     
  4. Fotal

    Fotal

    Joined:
    Apr 9, 2019
    Posts:
    38
    Thanks for the answer. Сan we know when roughly this will be fixed, when the next release is planned, we would like to use the renderer text when working with sprites)
     
  5. Ted_Wikman

    Ted_Wikman

    Unity Technologies

    Joined:
    Oct 7, 2019
    Posts:
    916
    @Seaqqull great to hear!

    @Fotal we are adding this fix in the next release, which is scheduled in the coming days, if everything goes according to plan.
     
    Fotal and V_i_T like this.
  6. Fotal

    Fotal

    Joined:
    Apr 9, 2019
    Posts:
    38
    We are glad to hear)
     
  7. Ted_Wikman

    Ted_Wikman

    Unity Technologies

    Joined:
    Oct 7, 2019
    Posts:
    916
    In Tiny 0.31, text should now render on top of all 2D content
     
    Seaqqull likes this.