Simple RenderQueue patch

So it doesn’t get lost in the shuffle and since I’m reasonably sure I don’t have access to commit this and I’m definitely sure I don’t know how… :wink:

Here is a small patch to RenderQueue that allows callers to customize the transparent comparator:


public void setTransparentComparator( GeometryComparator c ) {

this.transparentList = new GeometryList©;



This could also be generalized to any bucket but the transparent bucket is the one I needed and is the one with the easiest justification. (From a pure ‘flexibility’ standpoint it probably makes sense to allow overriding any of them.)

Justification for the transparent bucket:

There is no right way to sort for transparency by mesh. There just isn’t. Whatever method is used there are half a dozen trivial use-cases that break it visually. However, sometimes, the application knows best or can implement its own specific trickery to do a better job with it’s particular data model.

In Mythruna’s particular case, my meshes all overlap to the point where distance based sorting will always fail to do anything useful. The nature of my particular transparent materials means that I can always render by material (leaves, water, then glass) and get visually more appealing results 99% of the time. It looks great!

The small bonus is that since I’m sorting the transparent bin purely by material, I get better state transition and eliminate a whole bunch of useless (for me) distance checks. A tiny frame boost but a frame boost just the same.

Hey nice idea. In combination of this we could have several types of comparators to plug in…