public static GLTexture2DArray CreateUncompressedTexture(int width, int height, int arrayCount, int mipCount, PixelInternalFormat pixelInternalFormat = PixelInternalFormat.Rgba8, PixelFormat pixelFormat = PixelFormat.Rgba, PixelType pixelType = PixelType.UnsignedByte) { GLTexture2DArray texture = new GLTexture2DArray(); texture.PixelFormat = pixelFormat; texture.PixelType = pixelType; texture.PixelInternalFormat = pixelInternalFormat; texture.Width = width; texture.Height = height; texture.Target = TextureTarget.Texture2DArray; texture.MinFilter = TextureMinFilter.LinearMipmapLinear; texture.MagFilter = TextureMagFilter.Linear; texture.MipCount = mipCount; texture.ArrayCount = arrayCount; texture.Bind(); //Allocate mip data if (texture.MipCount > 1) { texture.GenerateMipmaps(); } for (int mip = 0; mip < texture.MipCount; mip++) { int mipWidth = (int)(texture.Width * Math.Pow(0.5, mip)); int mipHeight = (int)(texture.Height * Math.Pow(0.5, mip)); GL.TexImage3D(texture.Target, 0, texture.PixelInternalFormat, mipWidth, mipHeight, texture.ArrayCount, mip, texture.PixelFormat, texture.PixelType, IntPtr.Zero); } texture.UpdateParameters(); texture.Unbind(); return(texture); }