0
\$\begingroup\$

Usually, one would want to upload texture data to OpenGL with GL_SRGB* for the internalformat of a texture, and GL_RGB* (or some other linear format) for normal data or specular highlight maps. We can minimize context switches by using a texture array, but that forces all textures to have the same internalformat. Is there a way to store all needed textures in a single texture array, but preserve colour spaces? Or should I convert from SRGB to linear space when uploading texture data?

\$\endgroup\$
0
\$\begingroup\$

I think the only way to achieve this is by building a texture array and then using a view into the array, casting into a different internalformat.

\$\endgroup\$
  • \$\begingroup\$ How is that any better than just using separate textures for sRGB and linear data? You need to bind the view texture to a separate TIU, so you're not saving anything there. While the original and view share the same data, each one will only be used to access an exclusive subset of it. All I see this doing is requiring support for GL 4.3 and requiring that the diffuse map shares the same resolution as the normal/specular/etc maps (eliminating a possible performance improvement on low-powered systems). \$\endgroup\$ – bcrist Jan 6 '15 at 5:57
  • \$\begingroup\$ @bcrist Yes, it's not any better - it's a disappointing result :) \$\endgroup\$ – ocharles Jan 6 '15 at 10:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.