From 6f92ce210153bb74f2c47145bbb9b3298002effd Mon Sep 17 00:00:00 2001 From: Kai Ninomiya Date: Tue, 28 May 2024 11:45:24 -0700 Subject: [PATCH] Spec orientation of each cube face, using a diagram (#4675) --- spec/img/cubemap.svg | 45 ++++++++++++++++++++++++++++++++++++++++++++ spec/index.bs | 25 +++++++++++++++++++----- 2 files changed, 65 insertions(+), 5 deletions(-) create mode 100644 spec/img/cubemap.svg diff --git a/spec/img/cubemap.svg b/spec/img/cubemap.svg new file mode 100644 index 0000000000..19c8d99915 --- /dev/null +++ b/spec/img/cubemap.svg @@ -0,0 +1,45 @@ + + + + + + + + + +U+V + + + + + + + + [0]+X + [1]-X + [2]+Y + [3]-Y + [4]+Z + [5]-Z + + + diff --git a/spec/index.bs b/spec/index.bs index c8dfea72dd..63b4b34441 100644 --- a/spec/index.bs +++ b/spec/index.bs @@ -157,7 +157,7 @@ p, ul, ol, dl { color: var(--note-editorial-color); } -/* Our SVGs aren't responsive to light/dark mode, so they're opaque with a +/* Some of our SVGs aren't responsive to light/dark mode, so they're opaque with a * white or black background. Rounded corners make them a bit less jarring. */ object[type="image/svg+xml"] { border-radius: .5em; @@ -4292,7 +4292,22 @@ enum GPUTextureViewDimension { : "cube" :: The texture is viewed as a cubemap. - The view has 6 array layers, corresponding to the [+X, -X, +Y, -Y, +Z, -Z] faces of the cube. + + The view has 6 array layers, each corresponding to a face of the cube in the order + `[+X, -X, +Y, -Y, +Z, -Z]` and the following orientations: + +
+
+ Cubemap faces. + The +U/+V axes indicate the individual faces' texture coordinates, + and thus the [=image copy=] memory layout of each face. +
+ +
+ + Note: When viewed from the inside, this results in a left-handed coordinate system + where +X is right, +Y is up, and +Z is forward. + Sampling is done seamlessly across the faces of the cubemap. Corresponding WGSL types: @@ -4302,9 +4317,9 @@ enum GPUTextureViewDimension { : "cube-array" :: - The texture is viewed as a packed array of `n` cubemaps, - each with 6 array layers corresponding to the [+X, -X, +Y, -Y, +Z, -Z] faces of the cube. - Sampling is done seamlessly across the faces of the cubemaps. + The texture is viewed as a packed array of |n| cubemaps, + each with 6 array layers behaving like one {{GPUTextureViewDimension/"cube"}} view, + for 6|n| array layers in total. Corresponding WGSL types: