75 lines
2.2 KiB
Plaintext
75 lines
2.2 KiB
Plaintext
// Copyright (c) 2014-2016 Khronos Group. This work is licensed under a
|
|
// Creative Commons Attribution 4.0 International License; see
|
|
// http://creativecommons.org/licenses/by/4.0/
|
|
|
|
VkFrontFace(3)
|
|
==============
|
|
|
|
Name
|
|
----
|
|
VkFrontFace - interpret polygon front-facing orientation
|
|
|
|
C Specification
|
|
---------------
|
|
|
|
// refBegin VkFrontFace interpret polygon front-facing orientation
|
|
|
|
The first step of polygon rasterization is to determine whether the triangle
|
|
is _back-facing_ or _front-facing_. This determination is made based on the
|
|
sign of the (clipped or unclipped) polygon's area computed in framebuffer
|
|
coordinates. One way to compute this area is:
|
|
|
|
[latexmath]
|
|
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
|
\[
|
|
a = -{1 \over 2}\sum_{i=0}^{n-1}
|
|
x_f^i y_f^{i \oplus 1} -
|
|
x_f^{i \oplus 1} y_f^i
|
|
\]
|
|
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
|
|
|
where latexmath:[$x_f^i$] and latexmath:[$y_f^i$] are the latexmath:[$x$]
|
|
and latexmath:[$y$] framebuffer coordinates of the latexmath:[$i$]th vertex
|
|
of the latexmath:[$n$]-vertex polygon (vertices are numbered starting at
|
|
zero for the purposes of this computation) and latexmath:[$i \oplus 1$] is
|
|
latexmath:[$(i + 1)~ \textrm{mod}~ n$].
|
|
|
|
The interpretation of the sign of latexmath:[$a$]
|
|
is determined by the
|
|
slink:VkPipelineRasterizationStateCreateInfo::pname:frontFace property of
|
|
the currently active pipeline, which takes the following values:
|
|
|
|
include::../enums/VkFrontFace.txt[]
|
|
|
|
|
|
Description
|
|
-----------
|
|
|
|
If pname:frontFace is set to ename:VK_FRONT_FACE_COUNTER_CLOCKWISE, a triangle with
|
|
positive area is considered front-facing. If it is set to
|
|
ename:VK_FRONT_FACE_CLOCKWISE, a triangle with negative area is considered
|
|
front-facing. Any triangle which is not front-facing is back-facing,
|
|
including zero-area triangles.
|
|
|
|
// refEnd VkFrontFace
|
|
|
|
|
|
See Also
|
|
--------
|
|
|
|
slink:VkPipelineRasterizationStateCreateInfo
|
|
|
|
|
|
Document Notes
|
|
--------------
|
|
|
|
For more information, see the Vulkan Specification at URL
|
|
|
|
https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html#VkFrontFace
|
|
|
|
This page is extracted from the Vulkan Specification.
|
|
Fixes and changes should be made to the Specification,not directly.
|
|
|
|
include::footer.txt[]
|
|
|