Search Unity

What is the rendering/draw order of objects (ignoring render queue)

Discussion in 'General Graphics' started by suluco, May 24, 2018.

  1. suluco

    suluco

    Joined:
    May 24, 2018
    Posts:
    1
    Question:
    What is the default rendering order of the objects in the scene (when render queue is the same for all the objects). Does Unity follow Painter's algorithm in which objects at the farthest distance from camera are rendered first or Unity renders objects closest to the camera first?

    What I tried:
    I tested rendering order of few objects in the scene using scene debugger and the draw order for opaque objects was unpredictable. Some times one object rendered first and some time other but for the transparent objects it was always farthest to closest.
     
    Last edited: May 25, 2018
  2. aleksandrk

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    3,026
    Hi!
    Transparent objects are always sorted back-to-front. Opaques are sorted roughly front-to-back, but there are other factors that try, for example, to improve batching.
     
    suluco likes this.