Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Working repository: https://github.com/takahirox/EXT_mesh_lod
I would like to propose
EXT_mesh_lod
extension that allows LODs formesh
in glTF.I know already
MSFT_lod
extension exists for LOD. The new extension is less flexible but simpler thanMSFT_lod
so it should be easier for the handlers (implementations) to handle.JSON structure and examples
EXT_mesh_lod
can be defined at thenode
level.Difficulty of handling
MSFT_lod
While I was writing a handler for
MSFT_lod
I realized thatMSFT_lod
has some difficulties to handle.node
andmaterial
can define LOD. The behavior is unstated in the specification ifmaterial
containing LOD is referred bynode
containing LOD.node
can specify othernode
s so LODnode
can form nest or even infinity loop. And the behavior for them is unstated in the specification.node
s.node
can have multiple type objects;mesh
,camera
,light
(with the extension). The behavior is unstated in the specification if LODs have different type objects ex: High LOD has onlymesh
and Low LOD has onlycamera
or even doesn't have any objects.extra
as optional. Unclear how to switch LOD for applications/viewers/engines if it is undefined because they don't know the qualities of LODs.Even the behaviors are stated in the specification, the implementations can be complex because they need to check a lot of definitions.
Simplification ideas
I would like to suggest to simplify the specification. It will lose some flexibilities but be simpler for the handlers to handle.
mesh
. This change can avoid the case where both node and material have LOD. Material LOD capability is still covered by LOD meshes refer to the same geometry attributes and refer to different materials. And the change can clarify what LOD can be defined for.Additional notes
node
, notmesh
, is to avoid nest acrossmesh
es caused by refering amesh
from another (or self)mesh
. And also to allowskin
andweights
properties for LOD. If LOD is defined atmesh
, lower LODmesh
es must have the same bones/morphs with the highest LODmesh
, it may be a bit too limited.EXT_
prefix) rather than a vendor extension.Discussions
I'm still thinking how threshold values should be, screen coverage, distance from camera, or others. In the current PR, I chose screen coverage for now. Probably compatibility is important so we may need to choose the one that can be handled consistently across applications/viewers/engines.
takahirox/EXT_mesh_lod#1
Related threads