Force loading as linear RGB #488
-
Hi, I have a ktx2 texture that is marked as sRGB. However, I would like to upload it to OpenGL as linear RGB. In ktx1 I was able to do it by modifying the typedef struct ktxTexture1 {
KTXTEXTURECLASSDEFN
ktx_uint32_t glFormat; /*!< Format of the texture data, e.g., GL_RGB. */
ktx_uint32_t glInternalformat; /*!< Internal format of the texture data,
e.g., GL_RGB8. */
ktx_uint32_t glBaseInternalformat; /*!< Base format of the texture data,
e.g., GL_RGB. */
ktx_uint32_t glType; /*!< Type of the texture data, e.g, GL_UNSIGNED_BYTE.*/
struct ktxTexture1_private* _private; /*!< Private data. */
} ktxTexture1; But now, with ktx2, I down't know how to do it. typedef struct ktxTexture2 {
KTXTEXTURECLASSDEFN
ktx_uint32_t vkFormat;
ktx_uint32_t* pDfd;
ktxSupercmpScheme supercompressionScheme;
ktx_bool_t isVideo;
ktx_uint32_t duration;
ktx_uint32_t timescale;
ktx_uint32_t loopcount;
struct ktxTexture2_private* _private; /*!< Private data. */
} ktxTexture2; Cheers. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
You will have to modify the vkFormat. Looking at the enum names it is easy to see what to change. Working with the numeric values it is harder. If you look up the vkFormat value in the Vulkan VkFormat enum list you will find its name has Why do you want to do this? Is the texture incorrectly marked as sRGB? |
Beta Was this translation helpful? Give feedback.
You will have to modify the vkFormat. Looking at the enum names it is easy to see what to change. Working with the numeric values it is harder. If you look up the vkFormat value in the Vulkan VkFormat enum list you will find its name has
SRGB
in it. The matching non-sRGB format will haveUNORM
in place ofSRGB
in its name.Why do you want to do this? Is the texture incorrectly marked as sRGB?