GLTEXIMAGE3DMULTISAM(3G)
π GLTEXIMAGE3DMULTISAM(3G) π
okay bestie, welcome to the glTexImage3DMultisample page β yes that's a whole mouthful, and yes it's from the 3G manual. Say it with me: gl-tex-image-three-dee-multi-sample. Iconic. Let's get into it π«Ά
β¨ NAME β¨
glTexImage3DMultisample β the glow-up that sets up the data storage, the format, the dimensions, and the number of samples for a multisample texture's image. it's giving "set the whole vibe of your texture in one call" π
π§ C SPECIFICATION π§
copy this exactly, no cap:
void glTexImage3DMultisample(GLenum target, GLsizei samples,
GLenum internalformat, GLsizei width,
GLsizei height, GLsizei depth,
GLboolean fixedsamplelocations);
πΈ PARAMETERS πΈ
targetβ which target we're doing the operation on. lowkey strict: it must beGL_TEXTURE_2D_MULTISAMPLE_ARRAYorGL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY. no other options, sorry bestie πsamplesβ the number of samples in the multisample texture's image. that's the whole point of the function, so yeah, it matters πinternalformatβ the internal format used to store the multisample texture's image. and heads up:internalformatmust specify a color-renderable, depth-renderable, or stencil-renderable format. those are the only three flavours allowed β¨widthβ the width of the multisample texture's image, measured in texels πheightβ the height of the multisample texture's image, also in texels πfixedsamplelocationsβ tells you whether the image is gonna use identical sample locations and the same number of samples for all texels in the image, and whether the sample locations won't depend on the internal format or the size of the image. that's a lot of words but it's exactly what it says π¦
π DESCRIPTION π
glTexImage3DMultisample establishes the data storage, the format, the dimensions and the number of samples of a multisample texture's image. it's the "let there be texture" moment π
target must be GL_TEXTURE_2D_MULTISAMPLE_ARRAY or GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY β it's a vibe check and you gotta pass it.
width and height are the dimensions in texels of the texture, and they must be in the range zero to the value of GL_MAX_TEXTURE_SIZE minus one. depth is the number of array slices in the array texture's image. samples specifies the number of samples in the image, and it must be in the range zero to the value of GL_MAX_SAMPLES minus one π
internalformat must be a color-renderable, depth-renderable, or stencil-renderable format. periodt.
if fixedsamplelocations is GL_TRUE, the image will use identical sample locations and the same number of samples for all texels in the image, and the sample locations will not depend on the internal format or the size of the image. so consistent. so reliable. main character energy π
when a multisample texture is accessed in a shader, the access takes one vector of integers describing which texel to fetch, plus an integer corresponding to the sample number describing which sample within the texel to fetch. and no standard sampling instructions are allowed on the multisample texture targets. like, none. don't even try it π
β NOTES β
glTexImage2DMultisample is available only if the GL version is 3.2 or greater. (yes, the note says glTexImage2DMultisample β that's literally what it says, don't come for me π)
π ERRORS π
here's the part where things go wrong, and there are a lot of ways:
GL_INVALID_OPERATIONis generated ifinternalformatis a depth- or stencil-renderable format andsamplesis greater than the value ofGL_MAX_DEPTH_TEXTURE_SAMPLES.GL_INVALID_OPERATIONis generated ifinternalformatis a color-renderable format andsamplesis greater than the value ofGL_MAX_COLOR_TEXTURE_SAMPLES.GL_INVALID_OPERATIONis generated ifinternalformatis a signed or unsigned integer format andsamplesis greater than the value ofGL_MAX_INTEGER_SAMPLES.GL_INVALID_VALUEis generated if eitherwidthorheightnegative or is greater thanGL_MAX_TEXTURE_SIZE.GL_INVALID_VALUEis generated ifdepthis negative or is greater thanGL_MAX_ARRAY_TEXTURE_LAYERS.GL_INVALID_VALUEis generated ifsamplesis zero.GL_INVALID_OPERATIONis generated ifsamplesis greater than the maximum number of samples supported for thistargetandinternalformat.
bestie the sample limits are different per format type and there's also a per-target+internalformatmax on top of that. read the room (and the spec) before you pass a number π€
π VERSION SUPPORT π
the original ships this as a big grid, so let's translate: rows are Function / Feature Name, columns are OpenGL Version, and the checkmarks say where glTexImage3DMultisample exists. here's the tea π
2.0β-(nope)2.1β-(still nope)3.0β-(nope again)3.1β-(nope, keep waiting)3.2ββ(THERE she is π₯)3.3ββ4.0ββ4.1ββ4.2ββ4.3ββ4.4ββ4.5ββ
so: glTexImage3DMultisample shows up from 3.2 onward and slays through 4.5, and it's absent for 2.0, 2.1, 3.0 and 3.1. iykyk π
π¦ SEE ALSO π¦
go read these next, they're literally in the same friend group:
glTexImage3D()glTexImage2DMultisample()
πΈ COPYRIGHT πΈ
Copyright Β© 2010-2014 Khronos Group. This material may be distributed subject to the terms and conditions set forth in the Open Publication License, v 1.0, 8 June 1999. http://opencontent.org/openpub/.
Copyright Β© 2010-2014 Khronos Group
okay that's the whole page!! this came from [FIXME: source] and it's dated 08/09/2021, and yeah the manual name up top is GLTEXIMAGE3DMULTISAM(3G) in case you forgot π go forth and multisample responsibly, bestie π§β¨
π¦ where this page comes from
- centos-stream 9: gl-manpages 1.1-24.20190306.el9 Β· MIT and Open Publication
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms