Coder Social home page Coder Social logo

Comments (6)

vpenades avatar vpenades commented on June 12, 2024

I'ts hard to tell without knowing more about what you're doing.

could you provide a reproducible example?

from sharpgltf.

Smartkin avatar Smartkin commented on June 12, 2024

I'ts hard to tell without knowing more about what you're doing.

could you provide a reproducible example?

Looking at the raw model file it seems like at some meshes the delta on all vertexes is 0. I assume then the library just clears the morph targets list if none of them change anything in the mesh?

from sharpgltf.

vpenades avatar vpenades commented on June 12, 2024

I assume then the library just clears the morph targets list if none of them change anything in the mesh?

Yes, that is the case, see

// if delta is all 0s, and it's not required, then do not use the accessor
return accessor.Data.All(b => b == 0) ? null : accessor;

Now, I am wondering whether this is right or not. From the data perspective, it's a waste of resources to add an effect-less morph target, but not adding it changes the morph targets sequence indexing so it can result in incorrect morph target assignment and animation...

But it also depends on how are you using this...

from sharpgltf.

Smartkin avatar Smartkin commented on June 12, 2024

I assume then the library just clears the morph targets list if none of them change anything in the mesh?

Yes, that is the case, see

// if delta is all 0s, and it's not required, then do not use the accessor
return accessor.Data.All(b => b == 0) ? null : accessor;

Now, I am wondering whether this is right or not. From the data perspective, it's a waste of resources to add an effect-less morph target, but not adding it changes the morph targets sequence indexing so it can result in incorrect morph target assignment and animation...

But it also depends on how are you using this...

The model format of the game requires that all meshes have the same amount of morph targets. It's not too hard to work around it by just adding zeroed out morphs though

from sharpgltf.

Smartkin avatar Smartkin commented on June 12, 2024

I assume then the library just clears the morph targets list if none of them change anything in the mesh?

Yes, that is the case, see

// if delta is all 0s, and it's not required, then do not use the accessor
return accessor.Data.All(b => b == 0) ? null : accessor;

Now, I am wondering whether this is right or not. From the data perspective, it's a waste of resources to add an effect-less morph target, but not adding it changes the morph targets sequence indexing so it can result in incorrect morph target assignment and animation...

But it also depends on how are you using this...

Maybe it could potentially be an optional flag? As I said it's not too hard to work around if such behavior is expected but it's also not really mentioned anywhere that this would happen. Don't know how GLTF standard dictates this though

from sharpgltf.

vpenades avatar vpenades commented on June 12, 2024

Don't know how GLTF standard dictates this though

Well, generally speaking, glTF specification does not like adding stuff that has "no effect" into the rendering... in fact, the gltf validator issues warnings if you do stuff like adding a mesh that is never used in the scene and so on

from sharpgltf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.