bevy icon indicating copy to clipboard operation
bevy copied to clipboard

Improve gltf loader message about missing tangents

Open torsteingrindvik opened this issue 1 year ago • 2 comments

What problem does this solve or what need does it fill?

When having many GLTF models in an app, if debug log level is turned on messages about missing vertex tangets might appear. However it doesn't say which model, so it's hard to take action.

What solution would you like?

  1. Inform which model is missing tangents
  2. Also, if not too opiniated, mention that Blender is able to bake them (which I think it can during gltf export). This would allow the user to know not only the problematic model, but a way to fix it too

What alternative(s) have you considered?

Using a debugger to find out which model is problematic.

Additional context

2024-02-12T07:33:22.774925Z DEBUG bevy_gltf::loader: Missing vertex tangents, computing them using the mikktspace algorithm
2024-02-12T07:33:22.812107Z DEBUG bevy_gltf::loader: Missing vertex tangents, computing them using the mikktspace algorithm
2024-02-12T07:33:22.833721Z DEBUG bevy_gltf::loader: Missing vertex tangents, computing them using the mikktspace algorithm
2024-02-12T07:33:22.852133Z DEBUG bevy_gltf::loader: Missing vertex tangents, computing them using the mikktspace algorithm
2024-02-12T07:33:23.302680Z DEBUG bevy_gltf::loader: Missing vertex tangents, computing them using the mikktspace algorithm
2024-02-12T07:33:23.303184Z DEBUG bevy_gltf::loader: Missing vertex tangents, computing them using the mikktspace algorithm
2024-02-12T07:33:23.304056Z DEBUG bevy_gltf::loader: Missing vertex tangents, computing them using the mikktspace algorithm
2024-02-12T07:33:23.304817Z DEBUG bevy_gltf::loader: Missing vertex tangents, computing them using the mikktspace algorithm
2024-02-12T07:33:23.309710Z DEBUG bevy_gltf::loader: Missing vertex tangents, computing them using the mikktspace algorithm
2024-02-12T07:33:23.312120Z DEBUG bevy_gltf::loader: Missing vertex tangents, computing them using the mikktspace algorithm
2024-02-12T07:33:23.318036Z DEBUG bevy_gltf::loader: Missing vertex tangents, computing them using the mikktspace algorithm
2024-02-12T07:33:23.320884Z DEBUG bevy_gltf::loader: Missing vertex tangents, computing them using the mikktspace algorithm
2024-02-12T07:33:23.326357Z DEBUG bevy_gltf::loader: Missing vertex tangents, computing them using the mikktspace algorithm
2024-02-12T07:33:23.328809Z DEBUG bevy_gltf::loader: Missing vertex tangents, computing them using the mikktspace algorithm
2024-02-12T07:33:23.336656Z DEBUG bevy_gltf::loader: Missing vertex tangents, computing them using the mikktspace algorithm
2024-02-12T07:33:23.351425Z DEBUG bevy_gltf::loader: Missing vertex tangents, computing them using the mikktspace algorithm
2024-02-12T07:33:23.366192Z DEBUG bevy_gltf::loader: Missing vertex tangents, computing them using the mikktspace algorithm
2024-02-12T07:33:23.463666Z DEBUG bevy_gltf::loader: Missing vertex tangents, computing them using the mikktspace algorithm
2024-02-12T07:33:23.468243Z DEBUG bevy_gltf::loader: Missing vertex tangents, computing them using the mikktspace algorithm
2024-02-12T07:33:23.505040Z DEBUG bevy_gltf::loader: Missing vertex tangents, computing them using the mikktspace algorithm
2024-02-12T07:33:23.527992Z DEBUG bevy_gltf::loader: Missing vertex tangents, computing them using the mikktspace algorithm
2024-02-12T07:33:23.555847Z DEBUG bevy_gltf::loader: Missing vertex tangents, computing them using the mikktspace algorithm
2024-02-12T07:33:23.560282Z DEBUG bevy_gltf::loader: Missing vertex tangents, computing them using the mikktspace algorithm
2024-02-12T07:33:23.602515Z DEBUG bevy_gltf::loader: Missing vertex tangents, computing them using the mikktspace algorithm
2024-02-12T07:33:23.683227Z DEBUG bevy_gltf::loader: Missing vertex tangents, computing them using the mikktspace algorithm
2024-02-12T07:33:23.687447Z DEBUG bevy_gltf::loader: Missing vertex tangents, computing them using the mikktspace algorithm
2024-02-12T07:33:23.723583Z DEBUG bevy_gltf::loader: Missing vertex tangents, computing them using the mikktspace algorithm
2024-02-12T07:33:23.746370Z DEBUG bevy_gltf::loader: Missing vertex tangents, computing them using the mikktspace algorithm
2024-02-12T07:33:23.772947Z DEBUG bevy_gltf::loader: Missing vertex tangents, computing them using the mikktspace algorithm
2024-02-12T07:33:23.777070Z DEBUG bevy_gltf::loader: Missing vertex tangents, computing them using the mikktspace algorithm
2024-02-12T07:33:23.816259Z DEBUG bevy_gltf::loader: Missing vertex tangents, computing them using the mikktspace algorithm
2024-02-12T07:33:23.899092Z DEBUG bevy_gltf::loader: Missing vertex tangents, computing them using the mikktspace algorithm
2024-02-12T07:33:23.904600Z DEBUG bevy_gltf::loader: Missing vertex tangents, computing them using the mikktspace algorithm
2024-02-12T07:33:23.936691Z DEBUG bevy_gltf::loader: Missing vertex tangents, computing them using the mikktspace algorithm
2024-02-12T07:33:23.970883Z DEBUG bevy_gltf::loader: Missing vertex tangents, computing them using the mikktspace algorithm
2024-02-12T07:33:24.002366Z DEBUG bevy_gltf::loader: Missing vertex tangents, computing them using the mikktspace algorithm
2024-02-12T07:33:24.025267Z DEBUG bevy_gltf::loader: Missing vertex tangents, computing them using the mikktspace algorithm
2024-02-12T07:33:24.113704Z DEBUG bevy_gltf::loader: Missing vertex tangents, computing them using the mikktspace algorithm
2024-02-12T07:33:24.118518Z DEBUG bevy_gltf::loader: Missing vertex tangents, computing them using the mikktspace algorithm
2024-02-12T07:33:24.163051Z DEBUG bevy_gltf::loader: Missing vertex tangents, computing them using the mikktspace algorithm
2024-02-12T07:33:24.197286Z DEBUG bevy_gltf::loader: Missing vertex tangents, computing them using the mikktspace algorithm
2024-02-12T07:33:24.232813Z DEBUG bevy_gltf::loader: Missing vertex tangents, computing them using the mikktspace algorithm
2024-02-12T07:33:24.267934Z DEBUG bevy_gltf::loader: Missing vertex tangents, computing them using the mikktspace algorithm
2024-02-12T07:33:24.350247Z DEBUG bevy_gltf::loader: Missing vertex tangents, computing them using the mikktspace algorithm
2024-02-12T07:33:24.353601Z DEBUG bevy_gltf::loader: Missing vertex tangents, computing them using the mikktspace algorithm
2024-02-12T07:33:24.392365Z DEBUG bevy_gltf::loader: Missing vertex tangents, computing them using the mikktspace algorithm
2024-02-12T07:33:24.425674Z DEBUG bevy_gltf::loader: Missing vertex tangents, computing them using the mikktspace algorithm
2024-02-12T07:33:24.461521Z DEBUG bevy_gltf::loader: Missing vertex tangents, computing them using the mikktspace algorithm
2024-02-12T07:33:24.496562Z DEBUG bevy_gltf::loader: Missing vertex tangents, computing them using the mikktspace algorithm
2024-02-12T07:33:24.575401Z DEBUG bevy_gltf::loader: Missing vertex tangents, computing them using the mikktspace algorithm
2024-02-12T07:33:24.589792Z DEBUG bevy_gltf::loader: Missing vertex tangents, computing them using the mikktspace algorithm
2024-02-12T07:33:24.593798Z DEBUG bevy_gltf::loader: Missing vertex tangents, computing them using the mikktspace algorithm
2024-02-12T07:33:24.630627Z DEBUG bevy_gltf::loader: Missing vertex tangents, computing them using the mikktspace algorithm
2024-02-12T07:33:24.651874Z DEBUG bevy_gltf::loader: Missing vertex tangents, computing them using the mikktspace algorithm
2024-02-12T07:33:24.668495Z DEBUG bevy_gltf::loader: Missing vertex tangents, computing them using the mikktspace algorithm

torsteingrindvik avatar Feb 12 '24 07:02 torsteingrindvik

On another note: These messages are displayed over many seconds, which might indicate that these steps take quite a bit of time.

If so perhaps something like this could be considerered:

WARN bevy_gltf::loader: Asset "foo.gltf" took 8.6s to load, 8.0s was spent computing tangents which could be pre-baked

in order to improve discoverability of the problem for users.

torsteingrindvik avatar Feb 12 '24 08:02 torsteingrindvik

I will begin working on this if no objections.

andristarr avatar Feb 12 '24 17:02 andristarr