VkFrontFace(3)

# VkFrontFace(3) Manual Page

## Name

VkFrontFace - Interpret polygon front-facing orientation

Loading… please wait.

## C Specification

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:

a=−2 1​i=0∑n−1​x f i​y f i⊕1​−x f i⊕1​y f i​

where x f i​ and y f i​ are the x and y framebuffer coordinates of the ith vertex of the n-vertex polygon (vertices are numbered starting at zero for the purposes of this computation) and i ⊕ 1 is (i + 1) mod n.

The interpretation of the sign of a is determined by the VkPipelineRasterizationStateCreateInfo::`frontFace` property of the currently active pipeline. Possible values are:

    // Provided by VK_VERSION_1_0
    typedef enum VkFrontFace {
        VK_FRONT_FACE_COUNTER_CLOCKWISE = 0,
        VK_FRONT_FACE_CLOCKWISE = 1,
    } VkFrontFace;

## Description

- `VK_FRONT_FACE_COUNTER_CLOCKWISE` specifies that a triangle with positive area is considered front-facing.

- `VK_FRONT_FACE_CLOCKWISE` specifies that a triangle with negative area is considered front-facing.

Any triangle which is not front-facing is back-facing, including zero-area triangles.

## See Also

VK_VERSION_1_0, VkPipelineRasterizationStateCreateInfo, vkCmdSetFrontFace, vkCmdSetFrontFaceEXT

## Document Notes

For more information, see the Vulkan Specification

This page is extracted from the Vulkan Specification. Fixes and changes should be made to the Specification, not directly.

## Copyright

Copyright 2014-2023 The Khronos Group Inc.

SPDX-License-Identifier: CC-BY-4.0