Code Monkey home page Code Monkey logo

Comments (14)

lexaknyazev avatar lexaknyazev commented on August 23, 2024 3

@McNopper @zellski
Could you please go through ISSUES.md and point out all warnings that you find questionable?

I'm going to extend Severity enum to Error, Warning, Information, Hint (to match VSCode diagnostics levels).

/cc @emackey

from gltf-validator.

lexaknyazev avatar lexaknyazev commented on August 23, 2024 2

@zellski @emackey
Initially, I was considering only "muting" some checks, but now I think that full control is more useful.
How about this (example with js interface):

// max of 100 messages, mute empty nodes
validator.validateString(name, json, loadExternalResourceCallback, 100, {"NODE_EMPTY": -1});

// unlim messages, treat npot dimensions as errors
validator.validateString(name, json, loadExternalResourceCallback, 0, {"IMAGE_NPOT_DIMENSIONS": 0});

from gltf-validator.

zellski avatar zellski commented on August 23, 2024 1

from gltf-validator.

zellski avatar zellski commented on August 23, 2024 1

I think that's great. Would this entirely replace support through command line switches? (I think that's fine; if you're interested in this level of control, encoding your requirements in a little JS script is probably preferable to a mammoth command-line invocation.)

from gltf-validator.

lexaknyazev avatar lexaknyazev commented on August 23, 2024 1

@zellski

Would this entirely replace support through command line switches?

With #28 we have both options. Cmd-line app supports YAML config with ignored/overridden issues, while JS API accepts them as arguments.

from gltf-validator.

zellski avatar zellski commented on August 23, 2024 1

Fantastic work @lexaknyazev, I already use this tool daily.

from gltf-validator.

lexaknyazev avatar lexaknyazev commented on August 23, 2024

Warning isn't an error in validation or conformance sense.
It just means that there's something in the asset that could be a source of other issues (e.g., a node is empty because a mesh wasn't attached to it by mistake).

Here's a list of all currently recognized warnings:

  • Image has non power of two dimensions
  • JSON object has unknown property
  • xmag or ymag of orthographic camera are zeros
  • Mesh has TANGENT attribute but no NORMAL
  • Points-based mesh has TANGENT data
  • Node explicitly defines default matrix transform
  • Node is empty (current definition of non-empty node is: has children, camera, mesh, extras, or extensions defined or is referred from skin.joints)
  • Buffer or Image URI is non-relative
  • Number of vertices isn't aligned with used primitive mode (e.g., 5 vertices when mode is TRIANGLES)
  • Asset contains unsupported extension
  • GLB container contains unknown chunk

from gltf-validator.

McNopper avatar McNopper commented on August 23, 2024

Hmmm, okay I got it but e.g. if I have a warning in C/C++, I normally fix this.

With the glTF 2.0 validator, I would expect somehow a similar behaviour. But I can't fix this empty node, as I really want it.

The feature is good, but I would not name the output - for all of the above - as warning.

from gltf-validator.

zellski avatar zellski commented on August 23, 2024

This threw me a bit, too. When I see a "warning" from something like a validator, I really want it to be an actionable item. While I agree it's really useful to call attention to potential problem areas, I think a label like "note" might be more appropriate?

from gltf-validator.

zellski avatar zellski commented on August 23, 2024

I'll try to take a pass soon.

from gltf-validator.

emackey avatar emackey commented on August 23, 2024

Just trying to take a best guess here, but, I think:

  • Error - Means a direct violation of official schema, and/or means that a full-featured, conformant glTF viewer would be reasonably expected to fail to render all or part of this asset based on this finding.
  • Warning - The validator found something that isn't a guarantee of failure, but isn't good, and perhaps the validator can't reasonably predict whether this asset will render correctly or not.
  • Info - The validator found something that should be optimized or removed, but will not cause any harm to the rendered asset if left intact.
  • Hint - Best practices, bad smells, etc. Option to turn these off completely, or maybe this validator doesn't need to produce any of these.

Of the list you have now, I think most severity levels are fine. Here are some potential changes to consider:

  • NODE_EMPTY - The subject of this issue originally, this should almost certainly be info instead of warning.

  • NODE_MATRIX_DEFAULT - This should probably be info, not warning.

  • UNUSED_EXTENSION_REQUIRED - This is currently error, it could perhaps come down to warning.

  • ACCESSOR_INDEX_TRIANGLE_DEGENERATE - Currently warning, I personally think this should be info. This is likely the artist, not the glTF exporter, doing this.

  • IMAGE_NPOT_DIMENSIONS - Currently warning. Demote to info? The spec permits these explicitly.

from gltf-validator.

emackey avatar emackey commented on August 23, 2024

Also, I hesitate to even suggest this, but I think there are some compilers/validators out there that allow individual types/codes to be configured to custom severities. For example, "Treat all degenerate triangles as errors!" or "Don't talk to me about empty nodes", etc.

from gltf-validator.

lexaknyazev avatar lexaknyazev commented on August 23, 2024

Mostly agree, couple comments:

There were certain concerns about indecomposable matrices and related precision issues. I'll follow up with proposal.

Runtime severity reassignment shouldn't be that difficult but we'll have to come up with robust API (and cmd-line syntax) for such things.

from gltf-validator.

lexaknyazev avatar lexaknyazev commented on August 23, 2024

Before putting this in production, we need to close #24 and agree on existing error codes #5, so people can rely on them. I'll think more about command-line interface for this.

from gltf-validator.

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.