/// <summary> /// Creates a new TextureCubemapArray instance with faces compatible to the given bitmap. /// </summary> /// <param name="bitmap">Specifies the bitmap to which the new texture will be compatible.</param> /// <param name="layers">Specifies the number of array layers the texture will contain.</param> /// <param name="texture">Outputs the newly created texture.</param> /// <param name="levels">Specifies the number of mipmap levels.</param> public static void CreateCompatible(Bitmap bitmap, out TextureCubemapArray texture, int layers, int levels = 0) { if (bitmap.Width != bitmap.Height) { throw new ArgumentException("The faces of cube map textures must be square."); } texture = new TextureCubemapArray(BitmapFormat.Get(bitmap).InternalFormat, bitmap.Width, layers, levels); }
/// <summary> /// Attaches a single face of the given cube map array texture level to an attachment point. /// </summary> /// <param name="target">The framebuffer target to bind to.</param> /// <param name="attachment">The attachment point to attach to.</param> /// <param name="texture">The texture to attach.</param> /// <param name="arrayLayer">The layer of the texture to attach.</param> /// <param name="face">The cube map face of the texture to attach.</param> /// <param name="level">The level of the texture to attach.</param> public void Attach(FramebufferTarget target, FramebufferAttachment attachment, TextureCubemapArray texture, int arrayLayer, int face, int level = 0) { Attach(target, attachment, (LayeredTexture)texture, 6 * arrayLayer + face, level); }