vulkan 中的灰度纹理格式
Greyscale texture format in vulkan
OpenGL 具有灰度纹理格式:GL_LUMINANCE。什么相当于 Vulkan 中的内部格式?或者我们如何在 vulkan 中指定灰度纹理?
采用任何单通道格式,例如 VK_FORMAT_R8_UNORM
用于 8 位灰度,VK_FORMAT_R16_SFLOAT
用于半精度浮点灰度或 VK_FORMAT_R32_SFLOAT
用于单精度浮点灰度。
选择适合您需要的支持。
Ratchet Freak 正确回答了问题。但是,如果您想知道为什么亮度消失了,Khronos here in EXT_texture_rg 提供了一些理由,说明为什么现代图形 API 中的亮度和亮度-Alpha 格式已被红色和红-绿格式取代。
Historically one- and two-component textures have been specified in OpenGL ES using the luminance or luminance-alpha (L/LA) formats. With the advent of programmable shaders and render-to-texture capabilities these legacy formats carry some historical artifacts which are no longer useful.
For example, when sampling from such textures, the luminance values are replicated across the color components. This is no longer necessary with programmable shaders.
It is also desirable to be able to render to one- and two-component format textures using capabilities such as framebuffer objects (FBO), but rendering to L/LA formats is under-specified (specifically how to map R/G/B/A values to L/A texture channels).
OpenGL 具有灰度纹理格式:GL_LUMINANCE。什么相当于 Vulkan 中的内部格式?或者我们如何在 vulkan 中指定灰度纹理?
采用任何单通道格式,例如 VK_FORMAT_R8_UNORM
用于 8 位灰度,VK_FORMAT_R16_SFLOAT
用于半精度浮点灰度或 VK_FORMAT_R32_SFLOAT
用于单精度浮点灰度。
选择适合您需要的支持。
Ratchet Freak 正确回答了问题。但是,如果您想知道为什么亮度消失了,Khronos here in EXT_texture_rg 提供了一些理由,说明为什么现代图形 API 中的亮度和亮度-Alpha 格式已被红色和红-绿格式取代。
Historically one- and two-component textures have been specified in OpenGL ES using the luminance or luminance-alpha (L/LA) formats. With the advent of programmable shaders and render-to-texture capabilities these legacy formats carry some historical artifacts which are no longer useful.
For example, when sampling from such textures, the luminance values are replicated across the color components. This is no longer necessary with programmable shaders.
It is also desirable to be able to render to one- and two-component format textures using capabilities such as framebuffer objects (FBO), but rendering to L/LA formats is under-specified (specifically how to map R/G/B/A values to L/A texture channels).