Exporting GLTF with big texture is super slow #68822
Labels
No Label
Interest
Animation & Rigging
Interest
Blender Cloud
Interest
Collada
Interest
Core
Interest
Documentation
Interest
Eevee & Viewport
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
Import and Export
Interest
Modeling
Interest
Modifiers
Interest
Nodes & Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds, Tests & Devices
Interest
Python API
Interest
Rendering & Cycles
Interest
Sculpt, Paint & Texture
Interest
Translations
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Meta
Good First Issue
Meta
Papercut
Module
Add-ons (BF-Blender)
Module
Add-ons (Community)
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
5 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender-addons#68822
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
System Information
Operating system: MacOS Catalina beta
Graphics card: Radeon Pro 555 2 GB
Blender Version
Broken: 2.81 alpha
Worked: (optional)
Short description of error
Exporting GLTF with big texture is super slow
Exact steps for others to reproduce the error
Based on the default startup or an attached .blend file (as simple as possible).
I tried this many times with Blender 2.80 and also 2.81... exporting GLTF + Texture with large texture like 8000 x 8000 is superslow, not sure why... Maybe time it takes to copy? But it's weird.
Added subscriber: @BlenderSushiGuy
Added subscribers: @UX3D-becher, @MikeErwin
Is the texture packed into the blend file, or in a separate png / jpeg file on disk?
If packed, Blender has to encode the image to a file. More expensive than a simple file copy.
Maybe @UX3D-becher knows more?
I tested both with Texture separate from GLTF and with GLTF with texture included as one... but both are still performing really, slow. With smaller textures, the export is super fast.
Added subscriber: @TommiHyppanen
How long is superslow exactly? I tried a simple Suzanne head with a generated 8k texture (color grid). It took me 39.5 seconds. The extern_draco.dll was found and used. All of this information can be found on the Blender console output.
The export process also eats all of my computer memory (16GB) very quickly, which might also be why it's so slow. It doesn't seem to take a good advantage of multi-core. Mostly a single core process.
Exporting 4k takes 4x less time, 9.8 seconds, which suggests that texture size is the major component in how fast the export process works. 2k is 4x less time than 4k, 2.5 seconds. Which makes sense.
If you were to try exporting 16k textures with it, it would probably take at least 160 seconds if you had memory and completely kill low memory systems, I'm guessing.
All of these tests were exporting .glb binary.
I did some profiling:
Numpy.array seems to be the culprit. At a close look it's not the array transformation itself, but the really painfully slow way that Blender transfers image data to arrays.
Which has been a known issue for a while. https://devtalk.blender.org/t/bpy-data-images-perf-issues/6459
...which means that here's a simple diff to make it at least twice at fast:
Note : I created an issue on the upstream repository : https://github.com/KhronosGroup/glTF-Blender-IO/issues/626
This issue was referenced by
a9283e526f
Changed status from 'Open' to: 'Resolved'
I committed the proposed fix.
If more speed is needed, we will have to check in API if something is possible