mirror of
https://github.com/status-im/Vulkan-Docs.git
synced 2025-02-28 05:50:46 +00:00
Fix random math
incl. two unparsable latexmath blocks
This commit is contained in:
parent
5436521608
commit
102de56f69
@ -53,9 +53,9 @@ according to the pname:srcPremultiplied and pname:dstPremultiplied members
|
|||||||
of slink:VkPipelineColorBlendAdvancedStateCreateInfoEXT.
|
of slink:VkPipelineColorBlendAdvancedStateCreateInfoEXT.
|
||||||
If a color is considered non-premultiplied, the (R,G,B) color components are
|
If a color is considered non-premultiplied, the (R,G,B) color components are
|
||||||
multiplied by the alpha component prior to blending.
|
multiplied by the alpha component prior to blending.
|
||||||
For non-premultiplied color components in the range eq#[0,1]#, the
|
For non-premultiplied color components in the range [eq]#[0,1]#, the
|
||||||
corresponding premultiplied color component would have values in the range
|
corresponding premultiplied color component would have values in the range
|
||||||
eq#[0 {times} A, 1 {times} A]#.
|
[eq]#[0 {times} A, 1 {times} A]#.
|
||||||
|
|
||||||
Many of these advanced blending equations are formulated where the result of
|
Many of these advanced blending equations are formulated where the result of
|
||||||
blending source and destination colors with partial coverage have three
|
blending source and destination colors with partial coverage have three
|
||||||
|
@ -18,27 +18,28 @@ to the final post-processed image.
|
|||||||
This extension provides a mechanism to render VR scenes at a non-uniform
|
This extension provides a mechanism to render VR scenes at a non-uniform
|
||||||
resolution, in particular a resolution that falls linearly from the center
|
resolution, in particular a resolution that falls linearly from the center
|
||||||
towards the edges.
|
towards the edges.
|
||||||
This is achieved by scaling the "w" coordinate of the vertices in the clip
|
This is achieved by scaling the [eq]#w# coordinate of the vertices in the
|
||||||
space before perspective divide.
|
clip space before perspective divide.
|
||||||
The clip space "w" coordinate of the vertices can: be offset as of a
|
The clip space [eq]#w# coordinate of the vertices can: be offset as of a
|
||||||
function of "x" and "y" coordinates as follows:
|
function of [eq]#x# and [eq]#y# coordinates as follows:
|
||||||
|
|
||||||
w' = w + Ax + By
|
[eq]#w' = w + Ax + By#
|
||||||
|
|
||||||
In the intended use case for viewport position scaling, an application
|
In the intended use case for viewport position scaling, an application
|
||||||
should use a set of 4 viewports, one for each of the 4 quadrants of a
|
should use a set of 4 viewports, one for each of the 4 quadrants of a
|
||||||
Cartesian coordinate system.
|
Cartesian coordinate system.
|
||||||
Each viewport is set to the dimension of the image, but is scissored to the
|
Each viewport is set to the dimension of the image, but is scissored to the
|
||||||
quadrant it represents.
|
quadrant it represents.
|
||||||
The application should specify A and B coefficients of the w-scaling
|
The application should specify [eq]#A# and [eq]#B# coefficients of the
|
||||||
equation above, that have the same value, but different signs, for each of
|
[eq]#w#-scaling equation above, that have the same value, but different
|
||||||
the viewports.
|
signs, for each of the viewports.
|
||||||
The signs of A and B should match the signs of X and Y for the quadrant that
|
The signs of [eq]#A# and [eq]#B# should match the signs of [eq]#x# and
|
||||||
they represent such that the value of "w'" will always be greater than or
|
[eq]#y# for the quadrant that they represent such that the value of [eq]#w'#
|
||||||
equal to the original "w" value for the entire image.
|
will always be greater than or equal to the original [eq]#w# value for the
|
||||||
Since the offset to "w", (Ax + By), is always positive and increases with
|
entire image.
|
||||||
the absolute values of "x" and "y", the effective resolution will fall off
|
Since the offset to [eq]#w#, ([eq]#Ax + By#), is always positive, and
|
||||||
linearly from the center of the image to its edges.
|
increases with the absolute values of [eq]#x# and [eq]#y#, the effective
|
||||||
|
resolution will fall off linearly from the center of the image to its edges.
|
||||||
|
|
||||||
=== New Object Types
|
=== New Object Types
|
||||||
|
|
||||||
|
@ -20,10 +20,10 @@ single-pass cubemap rendering (broadcasting a primitive to multiple faces
|
|||||||
and reorienting the vertex position for each face) and voxel rasterization.
|
and reorienting the vertex position for each face) and voxel rasterization.
|
||||||
The per-viewport component remapping and negation provided by the swizzle
|
The per-viewport component remapping and negation provided by the swizzle
|
||||||
allows application code to re-orient three-dimensional geometry with a view
|
allows application code to re-orient three-dimensional geometry with a view
|
||||||
along any of the X, Y, or Z axes.
|
|
||||||
If a perspective projection and depth buffering is required, 1/W buffering
|
|
||||||
should be used, as described in the single-pass cubemap rendering example in
|
|
||||||
the "Issues" section below.
|
the "Issues" section below.
|
||||||
|
along any of the *X*, *Y*, or *Z* axes.
|
||||||
|
If a perspective projection and depth buffering is required, [eq]#1/W#
|
||||||
|
buffering should be used, as described in the single-pass cubemap rendering example in
|
||||||
|
|
||||||
|
|
||||||
=== New Object Types
|
=== New Object Types
|
||||||
@ -74,8 +74,8 @@ rendering to a cubemap.
|
|||||||
In this example, the application would attach a cubemap texture to a layered
|
In this example, the application would attach a cubemap texture to a layered
|
||||||
FBO where the six cube faces are treated as layers.
|
FBO where the six cube faces are treated as layers.
|
||||||
Vertices are sent through the vertex shader without applying a projection
|
Vertices are sent through the vertex shader without applying a projection
|
||||||
matrix, where the gl_Position output is (x,y,z,1) and the center of the
|
matrix, where the code:gl_Position output is [eq]#(x,y,z,1)# and the center
|
||||||
cubemap is at (0,0,0).
|
of the cubemap is at [eq]#(0,0,0)#.
|
||||||
With unextended Vulkan, one could have a conventional instanced geometry
|
With unextended Vulkan, one could have a conventional instanced geometry
|
||||||
shader that looks something like the following:
|
shader that looks something like the following:
|
||||||
|
|
||||||
@ -184,39 +184,40 @@ not need to be modified as part of this coordinate transformation.
|
|||||||
Note that while the rotate() operation in the regular geometry shader above
|
Note that while the rotate() operation in the regular geometry shader above
|
||||||
could include an arbitrary post-rotation projection matrix, the viewport
|
could include an arbitrary post-rotation projection matrix, the viewport
|
||||||
swizzle does not support arbitrary math.
|
swizzle does not support arbitrary math.
|
||||||
To get proper projection, 1/W buffering should be used.
|
To get proper projection, [eq]#1/W# buffering should be used.
|
||||||
To do this:
|
To do this:
|
||||||
|
|
||||||
1.
|
1.
|
||||||
Program the viewport swizzles to move the pre-projection W eye coordinate
|
Program the viewport swizzles to move the pre-projection [eq]#W# eye
|
||||||
(typically 1.0) into the Z coordinate of the swizzle output and the eye
|
coordinate (typically 1.0) into the [eq]#Z# coordinate of the swizzle output
|
||||||
coordinate component used for depth into the W coordinate.
|
and the eye coordinate component used for depth into the [eq]#W# coordinate.
|
||||||
For example, the viewport corresponding to the +Z face might use a swizzle
|
For example, the viewport corresponding to the [eq]#+Z# face might use a
|
||||||
of (+X, -Y, +W, +Z).
|
swizzle of [eq]#(+X, -Y, +W, +Z)#.
|
||||||
The Z normalized device coordinate computed after swizzling would then be
|
The [eq]#Z# normalized device coordinate computed after swizzling would then
|
||||||
z'/w' = 1/Z_eye.
|
be [eq]#z'/w' = 1/Z~eye~#.
|
||||||
|
|
||||||
2.
|
2.
|
||||||
On NVIDIA implementations supporting floating-point depth buffers with
|
On NVIDIA implementations supporting floating-point depth buffers with
|
||||||
values outside [0,1], prevent unwanted near plane clipping by enabling
|
values outside [eq]#[0,1]#, prevent unwanted near plane clipping by enabling
|
||||||
DEPTH_CLAMP.
|
DEPTH_CLAMP.
|
||||||
Ensure that the depth clamp doesn't mess up depth testing by programming the
|
Ensure that the depth clamp doesn't mess up depth testing by programming the
|
||||||
depth range to very large values, such as minDepthBounds=-z,
|
depth range to very large values, such as [eq]#pname:minDepthBounds=-z#,
|
||||||
maxDepthBounds=+z), where z == 2^127.
|
[eq]#pname:maxDepthBounds=+z#, where [eq]#z = 2^127^#.
|
||||||
It should be possible to use IEEE infinity encodings also (0xFF800000 for
|
It should be possible to use IEEE infinity encodings also (`0xFF800000` for
|
||||||
-INF, 0x7F800000 for +INF).
|
`-INF`, `0x7F800000` for `+INF`).
|
||||||
Even when near/far clipping is disabled, primitives extending behind the eye
|
Even when near/far clipping is disabled, primitives extending behind the eye
|
||||||
will still be clipped because one or more vertices will have a negative W
|
will still be clipped because one or more vertices will have a negative
|
||||||
coordinate and fail X/Y clipping tests.
|
[eq]#W# coordinate and fail [eq]#X#/[eq]#Y# clipping tests.
|
||||||
|
|
||||||
On other implementations, scale X, Y, and Z eye coordinates so that vertices
|
On other implementations, scale [eq]#X#, [eq]#Y#, and [eq]#Z# eye
|
||||||
on the near plane have a post-swizzle W coordinate of 1.0.
|
coordinates so that vertices on the near plane have a post-swizzle [eq]#W#
|
||||||
For example, if the near plane is at Z_eye = 1/256, scale X, Y, and Z by
|
coordinate of 1.0.
|
||||||
256.
|
For example, if the near plane is at [eq]#Z~eye~ = 1/256#, scale [eq]#X#,
|
||||||
|
[eq]#Y#, and [eq]#Z# by 256.
|
||||||
|
|
||||||
3.
|
3.
|
||||||
Adjust depth testing to reflect the fact that 1/W values are large near the
|
Adjust depth testing to reflect the fact that [eq]#1/W# values are large
|
||||||
eye and small away from the eye.
|
near the eye and small away from the eye.
|
||||||
Clear the depth buffer to zero (infinitely far away) and use a depth test of
|
Clear the depth buffer to zero (infinitely far away) and use a depth test of
|
||||||
GREATER instead of LESS.
|
GREATER instead of LESS.
|
||||||
|
|
||||||
|
@ -821,7 +821,7 @@ E = (\frac{c_1 + c_2 \times L^{m_1}}{1 + c_3 \times L^{m_1}})^{m_2}
|
|||||||
\]
|
\]
|
||||||
+++++++++++++++++++
|
+++++++++++++++++++
|
||||||
|
|
||||||
where:
|
where:
|
||||||
|
|
||||||
latexmath:[m_1 = 2610 / 4096 \times \frac{1}{4} = 0.1593017578125] +
|
latexmath:[m_1 = 2610 / 4096 \times \frac{1}{4} = 0.1593017578125] +
|
||||||
latexmath:[m_2 = 2523 / 4096 \times 128 = 78.84375] +
|
latexmath:[m_2 = 2523 / 4096 \times 128 = 78.84375] +
|
||||||
@ -843,12 +843,9 @@ E & =
|
|||||||
\end{aligned}
|
\end{aligned}
|
||||||
+++++++++++++++++++
|
+++++++++++++++++++
|
||||||
|
|
||||||
latexmath:[L \text{ - is the signal normalized by the reference white
|
[eq]#_L_# -- is the signal normalized by the reference white level +
|
||||||
level}] +
|
[eq]#_r_# -- is the reference white level and has a signal value of 0.5 +
|
||||||
latexmath:[r \text{ - is the reference white level and has a signal value of
|
[eq]#_a_ = 0.17883277# and [eq]#_b_ = 0.28466892# and [eq]#_c_ = 0.55991073#
|
||||||
0.5}] +
|
|
||||||
latexmath:[a = 0.17883277 \text{ and } b = 0.28466892 \text{, and } c =
|
|
||||||
0.55991073]
|
|
||||||
|
|
||||||
|
|
||||||
=== Adobe RGB (1998) OETF
|
=== Adobe RGB (1998) OETF
|
||||||
|
@ -1310,11 +1310,11 @@ pname:layerCount layers are blitted to the destination image.
|
|||||||
Slices in the source region bounded by pname:srcOffsets[0].pname:z and
|
Slices in the source region bounded by pname:srcOffsets[0].pname:z and
|
||||||
pname:srcOffsets[1].pname:z are copied to slices in the destination region
|
pname:srcOffsets[1].pname:z are copied to slices in the destination region
|
||||||
bounded by pname:dstOffsets[0].pname:z and pname:dstOffsets[1].pname:z.
|
bounded by pname:dstOffsets[0].pname:z and pname:dstOffsets[1].pname:z.
|
||||||
For each destination slice, a source z coordinate is linearly interpolated
|
For each destination slice, a source *z* coordinate is linearly interpolated
|
||||||
between pname:srcOffsets[0].pname:z and pname:srcOffsets[1].pname:z.
|
between pname:srcOffsets[0].pname:z and pname:srcOffsets[1].pname:z.
|
||||||
If the pname:filter parameter is ename:VK_FILTER_LINEAR then the value
|
If the pname:filter parameter is ename:VK_FILTER_LINEAR then the value
|
||||||
sampled from the source image is taken by doing linear filtering using the
|
sampled from the source image is taken by doing linear filtering using the
|
||||||
interpolated z coordinate.
|
interpolated *z* coordinate.
|
||||||
If pname:filter parameter is ename:VK_FILTER_NEAREST then value sampled from
|
If pname:filter parameter is ename:VK_FILTER_NEAREST then value sampled from
|
||||||
the source image is taken from the single nearest slice (with undefined
|
the source image is taken from the single nearest slice (with undefined
|
||||||
rounding mode).
|
rounding mode).
|
||||||
|
@ -1799,8 +1799,8 @@ structure, as specified below.
|
|||||||
[[descriptorsets-updates-consecutive, consecutive binding updates]]
|
[[descriptorsets-updates-consecutive, consecutive binding updates]]
|
||||||
If the pname:dstBinding has fewer than pname:descriptorCount array elements
|
If the pname:dstBinding has fewer than pname:descriptorCount array elements
|
||||||
remaining starting from pname:dstArrayElement, then the remainder will be
|
remaining starting from pname:dstArrayElement, then the remainder will be
|
||||||
used to update the subsequent binding - pname:dstBinding+1 starting at array
|
used to update the subsequent binding - [eq]#pname:dstBinding+1# starting at
|
||||||
element zero.
|
array element zero.
|
||||||
If a binding has a pname:descriptorCount of zero, it is skipped.
|
If a binding has a pname:descriptorCount of zero, it is skipped.
|
||||||
This behavior applies recursively, with the update affecting consecutive
|
This behavior applies recursively, with the update affecting consecutive
|
||||||
bindings as needed to update all pname:descriptorCount descriptors.
|
bindings as needed to update all pname:descriptorCount descriptors.
|
||||||
|
@ -3403,8 +3403,8 @@ ifdef::VK_KHR_sampler_ycbcr_conversion[]
|
|||||||
plane 1, and a 16-bit R component in each 16-bit word of plane 2.
|
plane 1, and a 16-bit R component in each 16-bit word of plane 2.
|
||||||
The horizontal and vertical dimensions of the R and B planes are halved
|
The horizontal and vertical dimensions of the R and B planes are halved
|
||||||
relative to the image dimensions, and each R and B component is shared
|
relative to the image dimensions, and each R and B component is shared
|
||||||
with the G components for which latexmath:[\lfloor i_G \times 0.5\
|
with the G components for which latexmath:[\lfloor i_G \times 0.5
|
||||||
rfloor = i_B = i_R] and latexmath:[\lfloor j_G \times 0.5 \rfloor = j_B
|
\rfloor = i_B = i_R] and latexmath:[\lfloor j_G \times 0.5 \rfloor = j_B
|
||||||
= j_R].
|
= j_R].
|
||||||
The location of each plane when this image is in linear layout can be
|
The location of each plane when this image is in linear layout can be
|
||||||
determined via vkGetImageSubresourceLayout, using
|
determined via vkGetImageSubresourceLayout, using
|
||||||
|
@ -1172,9 +1172,9 @@ the code:Output storage class.
|
|||||||
+
|
+
|
||||||
The variable decorated with code:FragStencilRefEXT must: be declared as a
|
The variable decorated with code:FragStencilRefEXT must: be declared as a
|
||||||
scalar integer value.
|
scalar integer value.
|
||||||
Only the least significant [eq]#s# bits of the integer value of the variable
|
Only the least significant *s* bits of the integer value of the variable
|
||||||
decorated with code:FragStencilRefEXT are considered for stencil testing,
|
decorated with code:FragStencilRefEXT are considered for stencil testing,
|
||||||
where [eq]#s# is the number of bits in the stencil framebuffer attachment,
|
where *s* is the number of bits in the stencil framebuffer attachment,
|
||||||
and higher order bits are discarded.
|
and higher order bits are discarded.
|
||||||
|
|
||||||
endif::VK_EXT_shader_stencil_export[]
|
endif::VK_EXT_shader_stencil_export[]
|
||||||
|
@ -1707,7 +1707,7 @@ The LOD parameter [eq]#{lambda}# is computed as follows:
|
|||||||
\begin{aligned}
|
\begin{aligned}
|
||||||
\lambda_{base}(x,y) & =
|
\lambda_{base}(x,y) & =
|
||||||
\begin{cases}
|
\begin{cases}
|
||||||
shaderOp.Lod & \text{(from optional: SPIR-V operand)} \\
|
shaderOp.Lod & \text{(from optional SPIR-V operand)} \\
|
||||||
\log_2 \left ( \frac{\rho_{max}}{N} \right ) & \text{otherwise}
|
\log_2 \left ( \frac{\rho_{max}}{N} \right ) & \text{otherwise}
|
||||||
\end{cases} \\
|
\end{cases} \\
|
||||||
\lambda'(x,y) & = \lambda_{base} + \mathbin{clamp}(sampler.bias + shaderOp.bias,-maxSamplerLodBias,maxSamplerLodBias) \\
|
\lambda'(x,y) & = \lambda_{base} + \mathbin{clamp}(sampler.bias + shaderOp.bias,-maxSamplerLodBias,maxSamplerLodBias) \\
|
||||||
@ -1729,13 +1729,13 @@ where:
|
|||||||
sampler.bias & = mipLodBias & \text{(from sampler descriptor)} \\
|
sampler.bias & = mipLodBias & \text{(from sampler descriptor)} \\
|
||||||
shaderOp.bias & =
|
shaderOp.bias & =
|
||||||
\begin{cases}
|
\begin{cases}
|
||||||
Bias & \text{(from optional: SPIR-V operand)} \\
|
Bias & \text{(from optional SPIR-V operand)} \\
|
||||||
0 & \text{otherwise}
|
0 & \text{otherwise}
|
||||||
\end{cases} \\
|
\end{cases} \\
|
||||||
sampler.lod_{min} & = minLod & \text{(from sampler descriptor)} \\
|
sampler.lod_{min} & = minLod & \text{(from sampler descriptor)} \\
|
||||||
shaderOp.lod_{min} & =
|
shaderOp.lod_{min} & =
|
||||||
\begin{cases}
|
\begin{cases}
|
||||||
MinLod & \text{(from optional: SPIR-V operand)} \\
|
MinLod & \text{(from optional SPIR-V operand)} \\
|
||||||
0 & \text{otherwise}
|
0 & \text{otherwise}
|
||||||
\end{cases} \\
|
\end{cases} \\
|
||||||
\\
|
\\
|
||||||
@ -1760,7 +1760,7 @@ computed based on the LOD parameter, as follows:
|
|||||||
\begin{aligned}
|
\begin{aligned}
|
||||||
d_{l} =
|
d_{l} =
|
||||||
\begin{cases}
|
\begin{cases}
|
||||||
nearest(d'), & \text{mipmapMode is VK_SAMPLER_MIPMAP_MODE_NEAREST} \\
|
nearest(d'), & \text{mipmapMode is VK\_SAMPLER\_MIPMAP\_MODE\_NEAREST} \\
|
||||||
d', & \text{otherwise}
|
d', & \text{otherwise}
|
||||||
\end{cases}
|
\end{cases}
|
||||||
\end{aligned}
|
\end{aligned}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user