KhronosGroup / KhronosGroup/UnityGLTF

Allocates More Texture Memory than Required for Samplers

Open
#501 0 comments 0 reactions 1 assignee Claimed by @hybridherbst View on GitHub
Dominant language
C#
Stars
2.2k
Forks
536
PR merge metrics
No merged PRs in 30d

Description

Wanted to highlight and issue in texture sampler creation. The hierarchy of glTF is Material -> Textures -> (Sampler, Image)

Currently UnityGLTF creates Texture2D at the image creation level which necessitates a CPU copy of the texture in order to create different samples at the texture layer.

This can be improved by making it so that ConstructImage simply creates a CPU buffer (byte array or memorystream) and then ConstructTexture simply uses that to instantiate textures. This will make it so that the Texture2D can by default be marked as GPU only, reducing resulting memory footprint by 1/2 (though peak will be having an additional CPU copy still.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.