mgsx-dev / gdx-gltf

GLTF 2.0 3D format support and PBR shader implementation for LibGDX
Apache License 2.0
214 stars 50 forks source link

Ability to pass a custom RenderableSorter to TransmissionSource batch #96

Closed MikOfClassX closed 1 year ago

MikOfClassX commented 1 year ago

It would be useful to modify the TransmissionSource class and add a new ctor in order to pass a custom sorter (just like what we can do with the SceneManager)

i.e.

TransmissionSource(ShaderProvider, RenderableSorter). This is useful for some specific situations.

This is a quick, zero impact implementation:

    public TransmissionSource(ShaderProvider shaderProvider) {
        this(shaderProvider, new SceneRenderableSorter());

    }

    public TransmissionSource(ShaderProvider shaderProvider, RenderableSorter sorter) {
        batch = new ModelBatch(shaderProvider, sorter);
        attribute.textureDescription.minFilter = TextureFilter.MipMap;
        attribute.textureDescription.magFilter = TextureFilter.Linear;

    }