Ok, it looks like GL_LINEAR does trilinear interp. on 3d textures. Am I wrong? The one below looks like it is trilinear, what do you think? (All corners are assigned different colors, again a 2x2x2 texture)
And I don’t understand why the colors fall to black on the corners.
Ehm… how can you create mipmaps for 3D textures? And is it possible to do trilinear interp. without using mipmaps? I don’t want level of detail for now.
“trilinear” basically means “a bilinear between two bilinear lerps from adjacent mips”. So, you must have mipmaps.
glGenerateMipmap(target); // the driver could generate them for you.
“trilinear” basically means “a bilinear between two bilinear lerps from adjacent mips”. So, you must have mipmaps.
No. There’s a reason why OpenGL doesn’t have a GL_TRILINEAR blend mode. That’s because blending between mip levels is different from blending on a single mip level.
Using GL_LINEAR means that the texture operation will pick a mip level, and linearly blend between the adjacent texels. In a 1D texture, this means blending between 2 pixels (linear). In a 2D texture, this means blending between 4 pixels (bilinear). In a 3D texture, this means blending between 8 pixels (trilinear).
Trilinear is an overloaded term. In the vernacular, it means 2D bilinear filtering with mipmap filtering. However, when talking about 3D texturing, it means what was said above: linear filtering for a 3D texel within a single mip layer. Applying GL_LINEAR_MIPMAP_LINEAR to a 3D texture is called, in the vernacular, “quadrilinear” filtering.
I don’t see what’s wrong with it.
You generated the mipmaps before you actually put the texture data in it.
Also, you have a 2x2x2 texture. Why do you need mipmaps to begin with? All you’ll get is a 1x1x1 mip level, which is just a single color.