Metal is Apple's graphics and compute API. Its shader language is the Metal Shading Language (MSL).
The homogeneous coordinate, sometimes referred to as the w coordinate. It serves 3 primary purposes. 1. Perspective Division --- objects farther away appear smaller (screen_x = x /w, etc.) 2. Matrix Multiplications --- the w coordinate allows for elegant handling of affine transformations via matrix multiplications. 3. Clipping and Depth Buffering --- helps determine whether an object is visible and its depth relative to other objects. TODO: sounds like a moron wrote this
If the points are ordered counterclockwise, then the triangle is facing the camera. This incidentally aligns with historical conventions like the right-hand rule and Euler angles.
Yaw --- flatspin; use rudder to control. Pitch --- backflip; use elevator to control. Roll --- barrel roll; use ailerons to control.
Every pixel that ends up on your screen has associated to it at least one fragment. The fragment usually describes what color the pixel will be. Fragment shaders take as input vertices (which already have been processed by a vertex shader) and produce fragments as output.
It stores all the *unique* vertices of the triangles you're drawing. You'd then use an index buffer to identify specific vertices in the vertex buffer with specific vertices in your triangles.
Gamma encoding of images is used to optimize the usage of bits when encoding an image, or bandwidth used to transport an image, by taking advantage of the non-linear manner in which humans perceive light and color. The human perception of brightness (lightness), under common illumination conditions (neither pitch black nor blindingly bright), follows an approximate power function (which has no relation to the gamma function), with greater sensitivity to relative differences between darker tones than between lighter tones.
R = R_z(๐ผ) R_y(ฮฒ) R_x(๐พ)
matrix multiplication is not commutative so order matters
1-5 milliseconds
{{ s_x, 0, 0, 0}, { 0, s_y, 0, 0}, {0, 0, s_z, 0}, {0, 0, 0, s_w}}
R_z(๐ผ) = {{cos ๐ผ, -sin ๐ผ, 0}, {sin ๐ผ, cos ๐ผ, 0}, {0, 0, 1}}
{{ cos ฮธ, -sin ฮธ, 0}, {sin ฮธ, cos ฮธ, 0}, {0, 0, 1}}
A swapchain is a series of images presented to the display. It is handles buffering and synchronization between the display and the GPU to prevent artifacts like tearing. Related topics: double buffering, triple buffering, vsync
R_x(๐พ) = {{1, 0, 0}, {0, cos ๐พ, -sin ๐พ}, {0, sin ๐พ, cos ๐พ}}
A graphics API developed by Khronos Group. Its shader language is GLSL. Its successor is Vulkan.
Mipmaps (also MIP maps) or pyramids are pre-calculated, optimized sequences of images, each of which is a progressively lower resolution representation of the previous. The height and width of each image, or level, in the mipmap is a factor of two smaller than the previous level. They are intended to increase rendering speed and reduce aliasing artifacts. The letters MIP in the name are an acronym of the Latin phrase multum in parvo, meaning "much in little".
WGSL stands for WebGPU Shading Language. It is the shading language for WebGPU. It's development focuses on converting WGSL shaders to into the shader language corresponding to whatever backend you're using. For example, the backend for Vulkan is SPIR-V; for Metal it's MSL; for DX12 is HLSL; for OpenGL it's GLSL. Apparently SPIR-V is going to be replaced by WGSL.
It transforms your shapes/objects to look the way you want it (where it's positioned, how it's oriented, etc.).
It is used in conjuction with a vertex buffer --- the set of unique vertices in your triangles --- to associate specific vertices in your vertex buffer to specific vertices in your triangles.
Gamma correction, gamma, or the "transfer function" is a nonlinear operation used to encode and decode luminance or tristimulus values in video or still image systems. Gamma correction is, in the simplest cases, defined by the following power-law expression:
๐_out = ๐ด ๐_in ^๐พ
where the non-negative real input value ๐ in is raised to the power ๐พ and multiplied by the constant A to get the output value ๐ out . In the common case of A = 1, inputs and outputs are typically in the range 0โ1.
A BindGroup describes a set of resources and how they can be accessed by a shader. TODO: maybe this is a WGSL thing, not a wgpu thing.
The region of space of the modeled world that may appear on screen. Frustum etymology: Latin for "piece cut off"
column-major
sRGB is a standard RGB (red, green, blue) color space that HP and Microsoft created cooperatively in 1996 to use on monitors, printers, and the World Wide Web. Its IEC specification indicates a reference display with a nominal gamma of 2.2.
Shaders are mini-programs that you send to your GPU to perform operations on your data. There are three main types of shaders: vertex, fragment, and compute. Vertex shaders transform your shapes to look the way you want. Fragment shaders convert the transformed vertices into fragments. Each pixel that gets drawn on your screen has at least one fragment. Usually the fragment has a color that gets copied to the pixel.
a gamut, or color gamut, is a convex set containing the colors that can be accurately represented
International Electrotechnical Commission
R_y(ฮฒ) = {{cos ฮฒ, 0, sin ฮฒ}, {0, 1, 0}, {-sin ฮฒ, 0, cos ฮฒ}}
Normal mapping is a texture mapping technique used for faking the lighting of bumps and dents โ an implementation of bump mapping. It is used to add details without using more polygons. A common use of this technique is to greatly enhance the appearance and details of a low polygon model by generating a normal map from a high polygon model or height map.
{{1, 0, a}, {0, 1, b}, {0, 0, 1}}
A graphics API developed by Khronos Group. Its shader language is currently SPIR-V, but there are plans to replace it with WGSL.
DirectX 12, a graphics API developed by Microsoft and NVIDIA. Its shader language is the High-Level Shader Language (HLSL).
A system of coordinates used in projective geometry. 1. Formulas involving homogeneous coordinates are often simpler and more symmetric than their Cartesian counterparts; projective transformations are easily represented by a matrix. 2. Coordinates of points, including points at infinity, can be represented using finite coordinates. 3. Modern graphics APIs and graphics cards take advantage of homogeneous coordinate systems by using vector processors with 4-element registers (X, Y, Z, W).
width : height
Trans(a, b) Rot(ฮธ) Trans(-a, -b)
Yes, typically
linear
A uniform is a global Shader variable. These act as parameters that the user of a shader program can pass to that program.
Uniforms are so named because they do not change from one shader invocation to the next within a particular rendering call thus their value is uniform among all invocations. This makes them unlike shader stage inputs and outputs, which are often different for each invocation of a shader stage.
The human eye with normal vision has three kinds of cone cells that sense light, having peaks of spectral sensitivity in short ("S", 420 nm โ 440 nm), medium ("M", 530 nm โ 540 nm), and long ("L", 560 nm โ 580 nm) wavelengths. These cone cells underlie human color perception in conditions of medium and high brightness; in very dim light color vision diminishes, and the low-brightness, monochromatic "night vision" receptors, denominated "rod cells", become effective. Thus, three parameters corresponding to levels of stimulus of the three kinds of cone cells, in principle describe any human color sensation. these three values compose a tristimulus specification of the objective color of the light spectrum. The three parameters, denoted "S", "M", and "L", are indicated using a 3-dimensional space denominated the "LMS color space", which is one of many color spaces devised to quantify human color vision.
16.666 milliseconds
5-10 milliseconds, but it's somewhat irrelevant because this trip is not involved in the path from CPU to what you see on your screen.