Skip to content
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

Draco exports have wrong mesh bounds at export #692

Open
anonymous2585 opened this issue Apr 26, 2024 · 2 comments
Open

Draco exports have wrong mesh bounds at export #692

anonymous2585 opened this issue Apr 26, 2024 · 2 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@anonymous2585
Copy link

anonymous2585 commented Apr 26, 2024

Describe the bug
When exporting a mesh using draco compression, the mesh bounds written in the file is inverted on the X axis.

File
OffsetCube.zip

To Reproduce

  • Export a mesh that has its pivot far from the verticies on the x axis
  • Import the mesh at runtime (do not call Mesh.RecalculateBounds on the mesh after importing)
  • Move the camera in 3D space

See the object been culled by Unity even when still in view.

Expected behavior
The bounding box is correct and user doesn't need to use Mesh.RecalculateBounds to fix the mesh bounds.

Proposed fix
We fixed this issue locally by adding a - here:

center.x-extents.x,
(changed to -center.x-extents.x,)

And here:

center.x+extents.x,
(changed to -center.x+extents.x,)

If you look at the legacy export, there is the - sign on X axis:

accessor.max = new[] { -min.x, max.y, max.z };
so we think it has been forgotten in the draco code.

Setup

  • glTFast version 6.3.0
  • Unity Editor version 2023.2.20f1
  • Render Pipeline: build-in
  • Platform: Windows editor
@anonymous2585 anonymous2585 added the bug Something isn't working label Apr 26, 2024
@anonymous2585
Copy link
Author

anonymous2585 commented Jun 24, 2024

@atteneder Can you please take a look at this issue? It affects people using draco exports, and the fix seems pretty easy.

@atteneder
Copy link
Owner

@anonymous2585 Great find and excellent report! The fix will land in one of the upcoming updates.

@atteneder atteneder self-assigned this Jun 24, 2024
@atteneder atteneder added this to To do in glTFast development via automation Jun 24, 2024
@atteneder atteneder added this to the 6.7.0 milestone Jun 24, 2024
@atteneder atteneder moved this from To do to In progress in glTFast development Jun 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: In progress
Development

No branches or pull requests

2 participants