How does PNG transform into KTX2 #559
-
I am an initiator. I would like to ask how the PNG can be successfully converted to KTX2. I refer to https://github.khronos.org/ktx-software/libktx/index.html#writektx |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 7 replies
-
@baiwenbo1997 the
|
Beta Was this translation helpful? Give feedback.
-
Thank you very much, I have read the PNG format to RGBA8 memory, I want to convert this memory into KTX2 file, the interface that should be used is ktxtexture_setimageFromMemory (), so I need to read the read PNG memory how to convert Can join the image to join the image
…------------------ 原始邮件 ------------------
发件人: "KhronosGroup/KTX-Software" ***@***.***>;
发送时间: 2022年4月17日(星期天) 下午5:16
***@***.***>;
***@***.******@***.***>;
主题: Re: [KhronosGroup/KTX-Software] How does PNG transform into KTX2 (Discussion #559)
@baiwenbo1997 the ktxTexture2_Write* functions write a ktxTexture2 object in memory to a file. That is they serialize existing KTX2 data. They do not do any conversion. Use toktx to create KTX2 files from PNG files. If you want to write your own software to do this, also look at toktx to see how to do it. The steps for a color texture are (some steps are different if handling normal maps)
Read PNG header
Select matching Vulkan format
Create ktxTexture2 object with that format
Read PNG data expanding bit-width if necessary
Add data to base level of the ktxTexture2 object
Generate mip levels or read an additional file per level, if desired, and add to ktxTexture2 object.
Write the ktxTexture2 object to a file
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
@baiwenbo1997 the
ktxTexture2_Write*
functions write a ktxTexture2 object in memory to a file. That is they serialize existing KTX2 data. They do not do any conversion. Usetoktx
to create KTX2 files from PNG files. If you want to write your own software to do this, also look attoktx
to see how to do it. The steps for a color texture are (some steps are different if handling normal maps)