defold icon indicating copy to clipboard operation
defold copied to clipboard

Allow sorting front-to-back

Open JCash opened this issue 5 years ago • 4 comments

It's currently not possible to render meshes front-to-back.

  • it is also be beneficial to skip sorting (fair performance boost) for e.g. alpha blended particles. See exploration-particle-no-sort

  • Another useful sort is the y-sort, allowing for objects hiding behind other objects the higher the Y value is.

I think that a material property is the most frequent use case, but I wonder if it's also useful to have it as a render script override as well? We need to find a use case for that before adding it to the render script api.

JCash avatar Sep 05 '20 13:09 JCash

but I wonder if it's also useful to have it as a render script override as well? We need to find a use case for that before adding it to the render script api.

There are scenarios where you have sprites with several different materials, but all of them should be y-sorted. Possibly also mixed with labels and maybe particle effects. Setting the sort order on each material might be ok though? It's not like the sort order will be changed all the time.

Having it as a render script override is not an MVP I think.

britzl avatar Aug 03 '22 19:08 britzl

Since a render.draw(predicate) will produce batches with different types of renderables, I no longer think the sorting should be set on the material(s). Instead, it feels more like it should be an option to the render.draw(predicate, options={...}) function.

JCash avatar Sep 12 '22 09:09 JCash

But then again, I don't think it's relevent to "not sort" e.g. a mix of sprites, models and particles 🤔

JCash avatar Sep 14 '22 07:09 JCash