epdtry / rk-convert

.rk model converter
2 stars 1 forks source link

Windows 3D Viewer & Rendering Issue #1

Open g-l-i-t-c-h-o-r-s-e opened 1 year ago

g-l-i-t-c-h-o-r-s-e commented 1 year ago

Not a huge issue, but for quality of life purposes I'd like to point out that for some reason the glb model doesn't load in Windows 3D Viewer like any other glb normally would, however it loads fine in Blender. After Exporting a new glb from Blender, it loads properly in Windows 3D Viewer.

Another thing I noticed is you have to set the Blend mode to 'Opaque' for the model to render correctly in Windows 3D Viewer, as well as Blender, otherwise the "Show Backface" setting from the 'Alpha Blend' mode messes up texture rendering

g-l-i-t-c-h-o-r-s-e commented 1 year ago

I dropped one of the converted glb onto this site, got this report

epdtry commented 1 year ago

I've fixed most of the validation errors, though there are still a few left, specifically ACCESSOR_WEIGHTS_NON_NORMALIZED (non-normalized vertex/bone weights) and ACCESSOR_JOINTS_USED_ZERO_WEIGHT (a warning about zero bone weights on nonzero bones). The file I'm testing with now loads on the online viewer you linked, but doesn't render properly since the viewer doesn't seem to be doing backface culling.

g-l-i-t-c-h-o-r-s-e commented 1 year ago

Just confirmed those updates you just made, fixes the model not loading on Windows 3D Viewer now! As for the Opaque issue I mentioned above, I changed alpha_mode: Checked::Valid(AlphaMode::Blend), on line 598 in model-to-gltf.rs to alpha_mode: Checked::Valid(AlphaMode::Opaque),, which fixes a texture rendering issue. This does not seem to disable Backface Culling, as you can see is still enabled when the created glb is imported into Blender image