Search Issue Tracker
Feature Request
Votes
0
Found in
2022.3.19f1
Issue ID
UUM-63499
Regression
No
Texture3D:GetPixels32 doesn't account for padding
Steps to reproduce:
The following sequence of commands cannot be used to copy a 3D texture's pixel data from one 3D texture to another. Although relevant code is omitted here, the reason we want to do this is e.g. to stream a texture to RealityKit as a binary blob, or over a socket to the PolySpatial Play-to-Device Host:
{{Texture3D tex3d; // A block-compressed texture}}
{{Texture3D uncompressedTexture = new(tex3d.width, tex3d.height, tex3d.depth, TextureFormat.BGRA32, false, true);}}
{{tex3d.SetAllowReadingInEditor(true);}}
{{uncompressedTexture .SetPixels32(tex3d.GetPixels32());}}
Actual results:
The current code passes control to a generalized 2D method to obtain pixel data (treating the 3D data as a 2D image with a height of height * depth).
Expected results:
The code accounts for per-slice extra padding on block-compressed 3D textures.
Reproducible with versions: 2022.3 LTS
Tested on (OS): MacOS
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Unity CIL Linker fails on Player build when persistent listeners have "<" and ">" in their XML attribute names
- ”Lighting data asset ‘LightingData’ is incompatible with the current Unity version…” warnings are thrown when saving Indoors (URP) and Outdoors (URP) Scenes as Scene Templates
- [iOS] The screen blinks when transitioning from custom to Unity splash screen
- [macOS] ”Ignoring depth surface load action as it is memoryless” warnings are thrown when taking Game View Snapshot
- UI Builder Inspector scrolls back up when changes on an expanded but not fully displayed Inspector tab are saved
Resolution Note:
request for Better Texture3D APIs to read pixels equivalent of Texture2D.GetRawTextureData