WebGPU 3.3. Coordinate Systems

  • Y-axis is up in normalized device coordinate (NDC): point(-1.0, -1.0) in NDC is located at the bottom-left corner of NDC. In addition, x and y in NDC should be between -1.0 and 1.0 inclusive, while z in NDC should be between 0.0 and 1.0 inclusive. Vertices out of this range in NDC will not introduce any errors, but they will be clipped.

  • Y-axis is down in framebuffer coordinate, viewport coordinate and fragment/pixel coordinate: origin(0, 0) is located at the top-left corner in these coordinate systems.

  • Window/present coordinate matches framebuffer coordinate.

  • UV of origin(0, 0) in texture coordinate represents the first texel (the lowest byte) in texture memory.

  • Y轴在归一化设备坐标(NDC)中向上:NDC中的点(-1.0,-1.0)位于NDC的左下角。此外,NDC中的x和y应介于-1.0和1.0之间,而NDC中的z应介于0.0和1.0之间。NDC中超出此范围的顶点不会引入任何错误,但它们将被剪裁。

  • Y轴在帧缓冲区坐标、视口坐标和片段/像素坐标中向下:原点(0,0)位于这些坐标系的左上角。

  • 窗口/当前坐标与帧缓冲区坐标匹配。

  • 纹理坐标中的UV原点(0,0)表示纹理内存中的第一个texel(最低字节)。

Note: WebGPU’s coordinate systems match DirectX and Metal’s coordinate systems in a graphics pipeline.

注:WebGPU的坐标系在图形管道中与DirectX和Metal的坐标系匹配。