5
$\begingroup$

I'm generalizing my texturing code, and have become confused by the frankly contradictory information about textures' pieces. Specifically, I'm looking to understand what exactly the terms "face", "layer", "layer-face", and "mipmap chain" refer to.


I've put together an !ASCII-art diagram of what I think I understand for the example of a mipmapped cubemap array texture containing two cubemaps (from my site, reproduced poorly here):

                                                                                   "Mipmap" /
                                                         "Layer-Face"            "Mipmap Chain"
                                                         (or "Image")              ┌────┴────┐
┌─ "Texture" (2D Cubemap Array) ──────────────────────────────┼────────────────────┼─────────┼──────────────────────────────────────────────┐
│ ┌─ "Image Array" / "Layered Image" / "Mipmap Level" ────────┼────────────────────┼─────────┼────────────────────────────────────────────┐ │
│ │ ┌─ "Layer" of Array ──────────────────────────────────────┼───────┐            │         │                                            │ │
│ │ │                                                    ┌────┴────┐  │            │         │                                            │ │
│ │ │   ╔═╦═╦═╦═╗ ╔═╦═╦═╦═╗ ╔═╦═╦═╦═╗ ╔═╦═╦═╦═╗ ╔═╦═╦═╦═╗│╔═╦═╦═╦═╗│  │   ╔═╦═╦═╦═╗│╔═╦═╦═╦═╗│╔═╦═╦═╦═╗ ╔═╦═╦═╦═╗ ╔═╦═╦═╦═╗ ╔═╦═╦═╦═╗     │ │
│ │ │   ╠═╬═╬═╬═╣ ╠═╬═╬═╬═╣ ╠═╬═╬═╬═╣ ╠═╬═╬═╬═╣ ╠═╬═╬═╬═╣│╠═╬═╬═╬═╣│  │   ╠═╬═╬═╬═╣│╠═╬═╬═╬═╣│╠═╬═╬═╬═╣ ╠═╬═╬═╬═╣ ╠═╬═╬═╬═╣ ╠═╬═╬═╬═╣     │ │
│ │ │   ╠═╬═╬═╬═╣ ╠═╬═╬═╬═╣ ╠═╬═╬═╬═╣ ╠═╬═╬═╬═╣ ╠═╬═╬═╬═╣│╠═╬═╬═╬═╣│  │   ╠═╬═╬═╬═╣│╠═╬═╬═╬═╣│╠═╬═╬═╬═╣ ╠═╬═╬═╬═╣ ╠═╬═╬═╬═╣ ╠═╬═╬═╬═╣     │ │
│ │ │   ╠═╬═╬═╬═╣ ╠═╬═╬═╬═╣ ╠═╬═╬═╬═╣ ╠═╬═╬═╬═╣ ╠═╬═╬═╬═╣│╠═╬═╬═╬═╣│  │   ╠═╬═╬═╬═╣│╠═╬═╬═╬═╣│╠═╬═╬═╬═╣ ╠═╬═╬═╬═╣ ╠═╬═╬═╬═╣ ╠═╬═╬═╬═╣     │ │
│ │ │   ╚═╩═╩═╩═╝ ╚═╩═╩═╩═╝ ╚═╩═╩═╩═╝ ╚═╩═╩═╩═╝ ╚═╩═╩═╩═╝│╚═╩═╩═╩═╝│  │   ╚═╩═╩═╩═╝│╚═╩═╩═╩═╝│╚═╩═╩═╩═╝ ╚═╩═╩═╩═╝ ╚═╩═╩═╩═╝ ╚═╩═╩═╩═╝     │ │
│ │ │                                                    └─────────┘  │            │         │                                            │ │
│ │ └─────────────────────────────────────────────────────────────────┘            │         │                                            │ │
│ └────────────────────────────────────────────────────────────────────────────────┼─────────┼────────────────────────────────────────────┘ │
│         ╔═╦═╗     ╔═╦═╗     ╔═╦═╗     ╔═╦═╗     ╔═╦═╗     ╔═╦═╗           ╔═╦═╗  │  ╔═╦═╗  │  ╔═╦═╗     ╔═╦═╗     ╔═╦═╗     ╔═╦═╗         │
│         ╠═╬═╣     ╠═╬═╣     ╠═╬═╣     ╠═╬═╣     ╠═╬═╣     ╠═╬═╣           ╠═╬═╣  │  ╠═╬═╣  │  ╠═╬═╣     ╠═╬═╣     ╠═╬═╣     ╠═╬═╣         │
│         ╚═╩═╝     ╚═╩═╝     ╚═╩═╝     ╚═╩═╝     ╚═╩═╝     ╚═╩═╝           ╚═╩═╝  │  ╚═╩═╝  │  ╚═╩═╝     ╚═╩═╝     ╚═╩═╝     ╚═╩═╝         │
│                                                                                  │         │                                              │
│                                                                                  │         │                                              │
│                                                                                  │         │                                              │
│          ╔═╗       ╔═╗       ╔═╗       ╔═╗       ╔═╗       ╔═╗             ╔═╗   │   ╔═╗   │   ╔═╗       ╔═╗       ╔═╗       ╔═╗          │
│          ╚═╝       ╚═╝       ╚═╝       ╚═╝       ╚═╝       ╚═╝             ╚═╝   │   ╚═╝   │   ╚═╝       ╚═╝       ╚═╝       ╚═╝          │
│                                                                                  └─────────┘                                              │
└───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘

Basically, I'd like corrections and additions to the above diagram, but if phrased as my key questions:

  1. Where does "face" fit in?
  2. Is my "layer-face" description correct? Or maybe it refers to all mip levels instead?
  3. Is my description of a "layer" correct?
  4. Similarly, does a "mipmap chain" refer to all mip levels of a single face, or to all mip levels of the layer?
$\endgroup$
  • 1
    $\begingroup$ Your ASCII diagram is cool $\endgroup$ – GroverManheim Aug 8 '16 at 4:23
3
$\begingroup$
  1. A "face" simply specifies one of the six images at a level in a cubemap (and its optional mip pyramid).

    It is helpful to think of level L of your mipmapped cube array texture as consisting of a 2D array of images, with exactly six columns comprising the six faces of the logical cube, and the N rows corresponding to the N layers of the array (some APIs call these "slices"). This is because non-array Cube textures are already structured like 2D arrays with exactly 6 layers.

  2. This is correct with the exception that it would refer to the entire mip pyramid for that layer-face. Regarding the 2D array of faces and layers i just mentioned, OpenGL uses a single index for this 2d array, "unrolls" it, and calls this 1D index a "layer-face".

  3. Yes, but again, encompasses the mip pyramids for each layer-face image in that layer

  4. Depends on the context, could be either.

$\endgroup$
  • $\begingroup$ I've updated the diagram; can you check it? Also, perhaps you could elaborate on the "context" for "mipmap chain"? $\endgroup$ – imallett Aug 8 '16 at 5:56
  • $\begingroup$ Yeah, so by context, i mean that the 'mipmap chain' could refer just to the image pyramid for a single layer-face, or for all faces in a layer, or for the whole thing. Which is meant will depend on what is being discussed. So, for the purposes of your ASCII chart, where you have "mipmap / mipmap chain" grouped, I'd qualify that as the "layer-face mipmap chain" $\endgroup$ – GroverManheim Aug 8 '16 at 22:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.