Diligent Engine API Reference: D:/GitHub/DiligentEngine/DiligentCore/Graphics/GraphicsEngine/interface/RasterizerState.h Source File

Diligent Engine API Reference

RasterizerState.h
1 /* Copyright 2015-2018 Egor Yusov
2 *
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
10 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
11 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF ANY PROPRIETARY RIGHTS.
12 *
13 * In no event and under no legal theory, whether in tort (including negligence),
14 * contract, or otherwise, unless required by applicable law (such as deliberate
15 * and grossly negligent acts) or agreed to in writing, shall any Contributor be
16 * liable for any damages, including any direct, indirect, special, incidental,
17 * or consequential damages of any character arising as a result of this License or
18 * out of the use or inability to use the software (including but not limited to damages
19 * for loss of goodwill, work stoppage, computer failure or malfunction, or any and
20 * all other commercial damages or losses), even if such Contributor has been advised
21 * of the possibility of such damages.
22 */
23
24 #pragma once
25
28
29 #include "BasicTypes.h"
30
31 namespace Diligent
32 {
33
35
40 enum FILL_MODE : Int32
41 {
43 FILL_MODE_UNDEFINED = 0,
44
47 FILL_MODE_WIREFRAME,
48
51 FILL_MODE_SOLID,
52
54 FILL_MODE_NUM_MODES
55 };
56
58
63 enum CULL_MODE : Int32
64 {
66 CULL_MODE_UNDEFINED = 0,
67
70 CULL_MODE_NONE,
71
75 CULL_MODE_FRONT,
76
80 CULL_MODE_BACK,
81
83 CULL_MODE_NUM_MODES
84 };
85
86
88
90 struct RasterizerStateDesc
91 {
93 FILL_MODE FillMode;
94
96 CULL_MODE CullMode;
97
102 Bool FrontCounterClockwise;
103
105 Int32 DepthBias;
106
109 Float32 DepthBiasClamp;
110
112 Float32 SlopeScaledDepthBias;
113
117 Bool DepthClipEnable;
118
120 Bool ScissorEnable;
121
123 Bool AntialiasedLineEnable;
124
126
138 RasterizerStateDesc(FILL_MODE _FillMode = FILL_MODE_SOLID,
139 CULL_MODE _CullMode = CULL_MODE_BACK,
140 Bool _FrontCounterClockwise = False,
141 Int32 _DepthBias = 0,
142 Float32 _DepthBiasClamp = 0.f,
143 Float32 _SlopeScaledDepthBias = 0.f,
144 Bool _DepthClipEnable = True,
145 Bool _ScissorEnable = False,
146 Bool _AntialiasedLineEnable = False) :
147 FillMode ( _FillMode ),
148 CullMode ( _CullMode ),
149 FrontCounterClockwise( _FrontCounterClockwise ),
150 DepthBias ( _DepthBias ),
151 DepthBiasClamp ( _DepthBiasClamp ),
152 SlopeScaledDepthBias ( _SlopeScaledDepthBias ),
153 DepthClipEnable ( _DepthClipEnable ),
154 ScissorEnable ( _ScissorEnable ),
155 AntialiasedLineEnable( _AntialiasedLineEnable )
156 {
157 }
158
159
161
166 bool operator == (const RasterizerStateDesc& RHS)const
167 {
168 return FillMode == RHS.FillMode &&
169 CullMode == RHS.CullMode &&
170 FrontCounterClockwise == RHS.FrontCounterClockwise &&
171 DepthBias == RHS.DepthBias &&
172 DepthBiasClamp == RHS.DepthBiasClamp &&
173 SlopeScaledDepthBias == RHS.SlopeScaledDepthBias &&
174 DepthClipEnable == RHS.DepthClipEnable &&
175 ScissorEnable == RHS.ScissorEnable &&
176 AntialiasedLineEnable == RHS.AntialiasedLineEnable;
177 }
178 };
179
180 }
Diligent::FILL_MODE_WIREFRAME
Rasterize triangles using wireframe fill. Direct3D counterpart: D3D11_FILL_WIREFRAME/D3D12_FILL_MOD...
Definition: RasterizerState.h:47
Diligent::RasterizerStateDesc::operator==
bool operator==(const RasterizerStateDesc &RHS) const
Tests if two structures are equivalent.
Definition: RasterizerState.h:166
Diligent::RasterizerStateDesc::DepthBias
Int32 DepthBias
Constant value added to the depth of a given pixel.
Definition: RasterizerState.h:105
Diligent::FILL_MODE_NUM_MODES
Helper value that stores the total number of fill modes in the enumeration.
Definition: RasterizerState.h:54
Diligent::FILL_MODE_UNDEFINED
Undefined fill mode.
Definition: RasterizerState.h:43
Diligent
Namespace for the OpenGL implementation of the graphics engine.
Definition: BufferD3D11Impl.h:34
Diligent::RasterizerStateDesc::FillMode
FILL_MODE FillMode
Determines traingle fill mode, see Diligent::FILL_MODE for details.
Definition: RasterizerState.h:93
Diligent::RasterizerStateDesc::DepthClipEnable
Bool DepthClipEnable
Enable clipping based on distance.
Definition: RasterizerState.h:117
Diligent::RasterizerStateDesc::FrontCounterClockwise
Bool FrontCounterClockwise
Determines if a triangle is front- or back-facing. If this parameter is True, a triangle will be cons...
Definition: RasterizerState.h:102
Diligent::FILL_MODE_SOLID
Rasterize triangles using solid fill. Direct3D counterpart: D3D11_FILL_SOLID/D3D12_FILL_MODE_SOLID...
Definition: RasterizerState.h:51
Diligent::RasterizerStateDesc::ScissorEnable
Bool ScissorEnable
Enable scissor-rectangle culling. All pixels outside an active scissor rectangle are culled...
Definition: RasterizerState.h:120
Diligent::CULL_MODE_UNDEFINED
Undefined cull mode.
Definition: RasterizerState.h:66
Diligent::RasterizerStateDesc::CullMode
CULL_MODE CullMode
Determines traingle cull mode, see Diligent::CULL_MODE for details.
Definition: RasterizerState.h:96
Diligent::RasterizerStateDesc::SlopeScaledDepthBias
Float32 SlopeScaledDepthBias
Scalar that scales the given pixel&#39;s slope before adding to the pixel&#39;s depth.
Definition: RasterizerState.h:112
Diligent::RasterizerStateDesc
Rasterizer state description.
Definition: RasterizerState.h:90
Diligent::RasterizerStateDesc::RasterizerStateDesc
RasterizerStateDesc(FILL_MODE _FillMode=FILL_MODE_SOLID, CULL_MODE _CullMode=CULL_MODE_BACK, Bool _FrontCounterClockwise=False, Int32 _DepthBias=0, Float32 _DepthBiasClamp=0.f, Float32 _SlopeScaledDepthBias=0.f, Bool _DepthClipEnable=True, Bool _ScissorEnable=False, Bool _AntialiasedLineEnable=False)
Initializes the structure members.
Definition: RasterizerState.h:138
Diligent::CULL_MODE_NONE
Draw all triangles. Direct3D counterpart: D3D11_CULL_NONE/D3D12_CULL_MODE_NONE. OpenGL counterpart:...
Definition: RasterizerState.h:70
Diligent::FILL_MODE
FILL_MODE
Fill mode.
Definition: RasterizerState.h:40
Diligent::CULL_MODE_NUM_MODES
Helper value that stores the total number of cull modes in the enumeration.
Definition: RasterizerState.h:83
Diligent::CULL_MODE_FRONT
Do not draw triangles that are front-facing. Front- and back-facing triangles are determined by the R...
Definition: RasterizerState.h:75
Diligent::RasterizerStateDesc::DepthBiasClamp
Float32 DepthBiasClamp
Maximum depth bias of a pixel.
Definition: RasterizerState.h:109
Diligent::CULL_MODE_BACK
Do not draw triangles that are back-facing. Front- and back-facing triangles are determined by the Ra...
Definition: RasterizerState.h:80
Diligent::CULL_MODE
CULL_MODE
Cull mode.
Definition: RasterizerState.h:63
Diligent::RasterizerStateDesc::AntialiasedLineEnable
Bool AntialiasedLineEnable
Specifies whether to enable line antialiasing.
Definition: RasterizerState.h:123