-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GLTF export invalid in 3.4 beta 2 #51132
Comments
Progress update.
<- should be an easy fix.
<- the line to assign
<- Same error as above caused by empty Now this is where things start getting strange:
<- The
Digging into https://github.com/godotengine/godot/pull/46800/files#diff-833822f7ca153a64d1cd65f155a808a571f5c2b6149f5bcecd8be66c56d3ce63R1492-R1515 (you must scroll to visual_server.cpp and click 'Load Full Diff' for this link anchor to work) That data is then passed to the export, which attempts to export these corrupt tangents. I'm going to go ping @The-O-King to see if they have ideas how to reconstruct the w components in VisualServer when ARRAY_TANGENT is requested. I haven't yet learned which (if any) of these are making the resulting glTF files unreadable in windows 3D Viewer, but fixing these is a good first step. |
@lyuma you are right there was a bug in the implementation that you pointed out where I should be multiplying j by 4 rather than 3 in order to decode the tangent vector, and the sign of the tangent vector should already by taken into account, I just wasn't writing into the vector properly! Here's a PR with an initial fix for it #51258 |
thanks @The-O-King, I've just downloaded and built the latest 3.x branch and still finding that the export bug is still occurring, hopefully your fix has made this another step closer to fixed :) |
Yeah awesome to see the fix to the octahedral compression in. that should cut down drastically on the validation errors. I'll be looking into this issue with fire next week along with issue 51292 and other 3.4 gltf bugs. |
I completely understand there are many competing priorities across the different aspects of Godot development currently underway. I've reached a point in my own development however where I need the ability to export GLTF files out to be able to continue on. I wish I understood the C backend to be able to help out but my coding knowledge is limited to GDScript. If anyone is able to put aside some time to see where this bug is at and potentially figure out a fixed I'd be so grateful. |
Need to verify |
I tested more files and the gltf validator seems to be good. |
Hi @fire , I'm just exporting models using the gdScript, and no textures are coming out of Godot with the .glb file. I can open the file in Blender and it only has the geometry. I went back to 3.4 beta 1 and the material is exported with the GLB. |
@MrJoshBowman Hi, thanks for letting us know there's still a problem. When I test on the latest builds of Godot's 3.x branch and also on 3.4rc2 exactly using your original test project ( I tested it in both Windows Viewer and in https://gltf-viewer.donmccurdy.com/ Would it be possible to list your exact reproduction steps, and confirm what test project + scene you are using to generate your GLB? Possibly open a new bug if it requires a different project and different steps to reproduce. Thanks |
Ah! Thanks @lyuma for the website to check for errors, that'll help me to try and track things down on my end as well. Here are two models from the custom app I'm building, one is exported from Beta 1 and I can see the textures (although they're glitchy, which could be an issue with how I'm creating normals) and the other is from the same app exporting from RC2 which, when viewed in Blender, doesn't include the material at all (and says the material doesn't exist using the website checker). Both use exactly the same code to export, just from different versions of the in-development 3.x I'm using a triangle fan to create the initial ArrayMeshes Added: Added 2: Added 3: |
From your description it sounds like the override material is ignored. Will need to check. |
Indeed, it seems that GeometryInstance override material (the one per mesh) is being ignored, and MeshInstance material override (per-material) is also being ignored. So we should try and fix these. Also, another issue is that an empty material list should not be exported as That must have escaped testing because we tested roundtrip (import glb -> export same glb), which will always create materials in the mesh. Thanks for bringing this to my attention. |
@MrJoshBowman If you run into any more issues with GLTF export, please open a new issue, with a reproduction project showing the problem. |
Brilliant! Thanks so much @lyuma 👍🏻👍🏻 looking forward to testing it |
So I've tested the GLTF output with a standard material with some different flags on material and texture and these are the results. Taking the exported model into Blender, removing the Godot inserted material and simply re-applying a Principled BSDF with transparency and the same texture works. So there's something still a bit screwy with how Godot is applying materials to exported models out of Godot. I got the same broken result when viewing the original Godot exported model with its Godot exported material in both Blender and PowerPoint (the above screenshot was taken in PowerPoint with the various versions of the model with material I tweaked and exported), the Blender material version on the right is the one that works.
Here are the two models for reference: Added:
|
Godot does not handle filter modes correctly at all in import or export. Theres a bug for it. The other issues is gltf only has opaque, alpha scissors and blend. Theres a bug in transparency maybe. |
For the glTF filtering issue, see #45206. |
hmmm well it's really great that Lyuma was able to fix the GLTF export not being corrupted so that's definitely a great step forward, but the inability to set non-filtered textures still visually breaks GLTF exported models when transparencies are involved, but I can see how that is a separate issue to this so ✅✅ for being able to get the GLTF exporting models again, and onto hoping filters and alphas are able to be fixed soon! |
Also testing out the .gltf export and finding that the separated texture and mesh files aren't able to be imported. Many other applications create the .gltf file with embedded textures and meshes so that they're more compatible with a wider array of standard apps like PowerPoint. |
There are three modes gltf files can be:
Godot doesn't do 2. |
I would like it if we could move discussion onto separate issues. Everything written here is going to get lost and forgotten. (Especially, for any further discussion about transparency, it belongs in #45206.) @MrJoshBowman @fire Does it make sense to change the default to .glb? The embedded/separate question is not unique to glTF. most formats let you choose. For example .fbx allows both embedded and separate textures as well. Though it doesn't use a separate .bin file. |
Godot version
3.4 Beta 2 Official
System information
Macbook Pro 2019 16", AMD Radeon Pro 5500M
Issue description
Exporting a GLTF/GLB file in 3.4 Beta 2 causes errors in PowerPoint and Windows 3D Viewer.
I tested the same exact code in GDv4.0 and it exports just fine from GD4.0
Steps to reproduce
Open the minimal reproduction.
Run it.
Let it export the GLB file.
Try importing the file into PowerPoint or Windows 3D Viewer
Minimal reproduction project
20_GLTF_Export_GD3.4Beta2.zip
The text was updated successfully, but these errors were encountered: