Skip to content

How to save 3D Texture? #598

Answered by MarkCallow
jfmilke asked this question in Q&A
Jul 19, 2022 · 1 comments · 6 replies
Discussion options

You must be logged in to vote

I want to use KTX (version 1) via libktx to save float data as a 3D image.

What version of libktx are you using?

I think you will find that ktxTexture_SetImageFromMemory is returning KTX_INVALID_OPERATION and so not setting any image data. The function is designed to set the data for a single image/depth slice. For 3D textures the third argument is the slice to set. The function checks the expected size of an image and, if srcSize is different, raises KTX_INVALID_OPERATION. For setting the all the images/slices at once, you should use the pData pointer as you are in your loader.

I have no idea why baseDepth is 1. I cannot reproduce that.

Nothing to do with your problem but why you want …

Replies: 1 comment 6 replies

Comment options

You must be logged in to vote
6 replies
@jfmilke
Comment options

@MarkCallow
Comment options

@jfmilke
Comment options

@MarkCallow
Comment options

@jfmilke
Comment options

Answer selected by jfmilke
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants