Search Unity

  1. We are looking for your feedback about Templates! Tell us about your experiences by taking our survey.
    Dismiss Notice
  2. Curious about what's going to be in 2021.1? Have a look at the 2021.1 beta blog post.
    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:
    23
    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:
    300
    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:
    23
    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:
    33
    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:
    300
    @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 VitDev like this.
  6. Fotal

    Fotal

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

    Ted_Wikman

    Unity Technologies

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