I want to use and interpolated 4D texture in OpenGL, i.e. a texture that is accessed with a texture coordinate vector
(s, t, p, q) and interpolated linearly in every texture coordinate.
The extension GL_SGIS_texture4D does exactly this. However, it is unsupported on literally every GPU I have access to.
If the was a
GL_TEXTURE_3D_ARRAY, I guess I could sample the appropriate 2 layers of a 3D array texture with the
(s, t, p) coordinates and then manually interpolate in the
q coordinate. However, there are only "ordinary"
GL_TEXTURE_2D_ARRAY texture arrays. A possible solution is to treat the texture array as 2D array of 2D texture, sample the appropriate 4 layers with
(s, t) and then manually interpolate in
q. This method is somewhat constrained by
GL_MAX_ARRAY_TEXTURE_LAYERS. I am also afraid of the relatively large number of 2D texture fetches required to fetch a single 4D texture value.
Is there a simpler way of achieving 4D interpolated textures?