KhronosGroup / glTF-Sample-Viewer

Physically-Based Rendering in glTF 2.0 using WebGL
Apache License 2.0
1.29k stars 238 forks source link

Draft for handling ignored validation warnings #591

Open javagl opened 1 week ago

javagl commented 1 week ago

There has been some feedback saying that the scary, yellow "Validation warnings" indicator, and the message "Number of warnings: 123" could be confusing, and raise questions for end users:

Khronos Sample Viewer Warnings

Dramatization via emoji by me

A specific aspect that raised concerns here was that many of the official sample models do generate warnings. And without further context, this could give users the impression that ~"The sample models are not really valid, somehow...". But this is not the case. The sample models are valid. And there are some models that even are intended for testing cases that generate warnings.

However, most of the warnings that had been generated for the "Showcase" models had been MESH_PRIMITIVE_GENERATED_TANGENT_SPACE which is described as

Material requires a tangent space but the mesh primitive does not provide it. Runtime-generated tangent space may be non-portable across implementations.

Leaving out the tangent space information can be a conscious decision by the creator of the model (to reduce the size). But it can limit portability in cases where the renderer/viewer does not generate proper tangent space information.


Different options for addressing this have been discussed in the 3D Formats Tooling Working Group. A previous pull request simply disabled this warning on the level of the validator. An undesirable side-effect of this was that

  1. the official sample viewer and the official validator (drag-and-drop tools) behaved differently and generated different reports
  2. there was no indication of this warning any more (meaning that users could think their asset was warning-free, although it isn't)

Another option is drafted (!) here:

When there are "infos", then the number of infos is displayed in a white circle:

Khronos Sample Viewer Info

When there are "errors", then the number of errors is displayed in a red circle:

Khronos Sample Viewer Error

When there are warnings, the special handling kicks in:

When there is any warning that is not one of the "ignored" MESH_PRIMITIVE_GENERATED_TANGENT_SPACE warnings, then the total number of warnings is displayed in a yellow circle:

Khronos Sample Viewer Warning

When all the warnings are the "ignored" MESH_PRIMITIVE_GENERATED_TANGENT_SPACE ones, then it shows an innocent, calming, "i" (for "info") in a Pale Blue Dot.

If there have been "ignored" warnings, then the validator tab will show an elaborate message, saying how many warnings have been "ignored", and explaining the reason why this is OK for the sample viewer. (Wording TBD)

Khronos Sample Viewer Warnings New


The current state of this PR is a DRAFT, to illustrate what this may look like for the end user.

The implementation will have to be cleaned up. And whenever I have to do anything that even remotely involves CSS, I'm reminded why I am not (and will never be) a web frontend developer. But I can do some cleanups, at least (e.g. the change from the previous PR is just commented out here).

@DRx3D @emackey @lexaknyazev

CLAassistant commented 1 week ago

CLA assistant check
All committers have signed the CLA.