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 use custom DirectionalShadowLight into CascadeShadowMap #104

Closed dar-dev closed 1 year ago

dar-dev commented 1 year ago

We miss the possibility to create a custom DirectionalShadowLight when creating lights for cascading into CascadeShadowMap class.

https://github.com/mgsx-dev/gdx-gltf/blob/ccfc8af6815746760be8f55298a29956b3702fb0/gltf/src/net/mgsx/gltf/scene3d/scene/CascadeShadowMap.java#L60

https://github.com/mgsx-dev/gdx-gltf/blob/ccfc8af6815746760be8f55298a29956b3702fb0/gltf/src/net/mgsx/gltf/scene3d/scene/CascadeShadowMap.java#L63

This is a quick implementation:

protected DirectionalShadowLight createDirectionalShadowLight(int shadowMapWidth, int shadowMapHeight)
{
 return new DirectionalShadowLight(shadowMapWidth, shadowMapHeight);
}