mik14a / VOX4U

MagicaVoxel VOX Format import plugin for Unreal Engine 5

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

UE5 Rendering Issue

gedden opened this issue · comments

The Issue

After importing to UE5, models will flicker when viewed from above in the editor. (In game or in the static mesh previewer)

Notes

  • Compiling for UE5 functions perfectly.

  • The import process works for files created under MagicaVoxel 99.6.4

    • // Does not currently work for 99.7 (beta)
  • This will occur with all models that are imported using Vox4u. (does not appear to be a specific model causing the problem)

    • used magica voxel default model "chr_knight" as a test
  • Flickering appears to only occur from certain angles -- usually from above

  • converting the static mesh to nanaite solves the issue

  • exporting the model as OBJ (from magica) and then importing to the engine functions properly (tho its not nearly as nice as this great plugin!)

  • exporting the static mesh to FBX from within the engine and reimporting solves the issue

    • When this happens, the following messages appear

    EXPORT_StaticChar_Knight has degenerate tangent bases which will result in incorrect shading. MikkTSpace relies on tangent bases and may result in mesh corruption, consider disabling this option.

    EXPORT_StaticChar_Knight has some nearly zero bi-normals which can create some issues. (Tolerance of 1E-4)

commented

Thanks for the report.
I was looking for a solution to the same problem.
I think this is a UE5 issue with scaled static mesh builds.
If you want to see the details of the problem, you can view the Bounds in the mesh preview and see that they do not work with the scale of the mesh.

Try applying Build Scale 1x in the Details panel of the mesh preview while displaying Bounds.
Or, try importing voxels with the scale set to 1x.

I will try to until the engine is fixed, the scale option on import will be fixed at 1.0.

That is good to know. If I get a chance, I believe the mesh optimizer inside Unreal re-calculates bounds. I may give that a try as a post-import step now that you identified the issue!

I really appreciate you're work here, thank you.

I confirm that this fix ⬆️ works for me. It needs to be added to the repo.