【Question】About Render 2 shader programs with default renderOrder

I created a topic a couple days ago,the previous question can be found in this link below

About two shader program renderOrder.
Thanks to looeee and Mugen87

I know how to change the render order.
So i got curious , what happends to THREEJS if there’s more than one shader programs?What does THREEJS do,If they all use the default render order( which is 0).

Opaque, transparent and transmissive objects are sorted in separate render lists.

The sort depends on the type of objects. I suggest you study painterSortStable() and painterSortStable() for more details.

Assuming you have multiple opaque 3D meshes in your scene with different materials producing different shader programs then the depth value determines the render order.

2 Likes

Much appreciate ! Im definitely gonna read this section !