Diligent Engine API Reference: D:/GitHub/DiligentEngine/DiligentCore/Graphics/GraphicsTools/include/CommonlyUsedStates.h Source File

Diligent Engine API Reference

CommonlyUsedStates.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 "GraphicsTypes.h"
30 #include "DepthStencilState.h"
31 #include "BlendState.h"
32 #include "RasterizerState.h"
33 #include "Sampler.h"
34
35 namespace Diligent
36 {
37 // Common depth-stencil states
38 const DepthStencilStateDesc DSS_DisableDepth(False, False);
39
40 // Common rasterizer states
41 const RasterizerStateDesc RS_SolidFillNoCull(FILL_MODE_SOLID, CULL_MODE_NONE);
42
43 const RasterizerStateDesc RS_WireFillNoCull(FILL_MODE_WIREFRAME, CULL_MODE_NONE, false, 1, 0.f, 1.f);
44
45
46 // Common sampler states
47 const SamplerDesc Sam_LinearClamp(FILTER_TYPE_LINEAR, FILTER_TYPE_LINEAR, FILTER_TYPE_LINEAR,
48 TEXTURE_ADDRESS_CLAMP, TEXTURE_ADDRESS_CLAMP, TEXTURE_ADDRESS_CLAMP);
49
50 const SamplerDesc Sam_PointClamp(FILTER_TYPE_POINT, FILTER_TYPE_POINT, FILTER_TYPE_POINT,
51 TEXTURE_ADDRESS_CLAMP, TEXTURE_ADDRESS_CLAMP, TEXTURE_ADDRESS_CLAMP);
52
53 const SamplerDesc Sam_LinearMirror(FILTER_TYPE_LINEAR, FILTER_TYPE_LINEAR, FILTER_TYPE_LINEAR,
54 TEXTURE_ADDRESS_MIRROR, TEXTURE_ADDRESS_MIRROR, TEXTURE_ADDRESS_MIRROR);
55
56 const SamplerDesc Sam_PointWrap(FILTER_TYPE_POINT, FILTER_TYPE_POINT, FILTER_TYPE_POINT,
57 TEXTURE_ADDRESS_WRAP, TEXTURE_ADDRESS_WRAP, TEXTURE_ADDRESS_WRAP);
58
59 const SamplerDesc Sam_LinearWrap(FILTER_TYPE_LINEAR, FILTER_TYPE_LINEAR, FILTER_TYPE_LINEAR,
60 TEXTURE_ADDRESS_WRAP, TEXTURE_ADDRESS_WRAP, TEXTURE_ADDRESS_WRAP);
61
62 const SamplerDesc Sam_Aniso2xClamp(FILTER_TYPE_ANISOTROPIC, FILTER_TYPE_ANISOTROPIC, FILTER_TYPE_ANISOTROPIC,
63 TEXTURE_ADDRESS_CLAMP, TEXTURE_ADDRESS_CLAMP, TEXTURE_ADDRESS_CLAMP, 0.f, 2);
64
65 const SamplerDesc Sam_Aniso4xClamp(FILTER_TYPE_ANISOTROPIC, FILTER_TYPE_ANISOTROPIC, FILTER_TYPE_ANISOTROPIC,
66 TEXTURE_ADDRESS_CLAMP, TEXTURE_ADDRESS_CLAMP, TEXTURE_ADDRESS_CLAMP, 0.f, 4);
67
68 const SamplerDesc Sam_Aniso8xClamp(FILTER_TYPE_ANISOTROPIC, FILTER_TYPE_ANISOTROPIC, FILTER_TYPE_ANISOTROPIC,
69 TEXTURE_ADDRESS_CLAMP, TEXTURE_ADDRESS_CLAMP, TEXTURE_ADDRESS_CLAMP, 0.f, 8);
70
71 const SamplerDesc Sam_Aniso16xClamp(FILTER_TYPE_ANISOTROPIC, FILTER_TYPE_ANISOTROPIC, FILTER_TYPE_ANISOTROPIC,
72 TEXTURE_ADDRESS_CLAMP, TEXTURE_ADDRESS_CLAMP, TEXTURE_ADDRESS_CLAMP, 0.f, 16);
73
74 const SamplerDesc Sam_Aniso8xWrap(FILTER_TYPE_ANISOTROPIC, FILTER_TYPE_ANISOTROPIC, FILTER_TYPE_ANISOTROPIC,
75 TEXTURE_ADDRESS_WRAP, TEXTURE_ADDRESS_WRAP, TEXTURE_ADDRESS_WRAP, 0.f, 8);
76 }
Diligent::FILL_MODE_WIREFRAME
Rasterize triangles using wireframe fill. Direct3D counterpart: D3D11_FILL_WIREFRAME/D3D12_FILL_MOD...
Definition: RasterizerState.h:47
Diligent::TEXTURE_ADDRESS_CLAMP
Texture coordinates outside the range [0.0, 1.0] are set to the texture color at 0.0 or 1.0, respectively. Direct3D Counterpart: D3D11_TEXTURE_ADDRESS_CLAMP/D3D12_TEXTURE_ADDRESS_MODE_CLAMP. OpenGL counterpart: GL_CLAMP_TO_EDGE.
Definition: GraphicsTypes.h:821
Diligent
Graphics engine namespace.
Definition: AdaptiveFixedBlockAllocator.h:30
Diligent::FILL_MODE_SOLID
Rasterize triangles using solid fill. Direct3D counterpart: D3D11_FILL_SOLID/D3D12_FILL_MODE_SOLID...
Definition: RasterizerState.h:51
Diligent::TEXTURE_ADDRESS_WRAP
Tile the texture at every integer junction. Direct3D Counterpart: D3D11_TEXTURE_ADDRESS_WRAP/D3D12_...
Definition: GraphicsTypes.h:812
Diligent::CULL_MODE_NONE
Draw all triangles. Direct3D counterpart: D3D11_CULL_NONE/D3D12_CULL_MODE_NONE. OpenGL counterpart:...
Definition: RasterizerState.h:70
Diligent::FILTER_TYPE_POINT
Point filtering.
Definition: GraphicsTypes.h:783
Diligent::TEXTURE_ADDRESS_MIRROR
Flip the texture at every integer junction. Direct3D Counterpart: D3D11_TEXTURE_ADDRESS_MIRROR/D3D1...
Definition: GraphicsTypes.h:816
Diligent::FILTER_TYPE_ANISOTROPIC
Anisotropic filtering.
Definition: GraphicsTypes.h:785
Diligent::FILTER_TYPE_LINEAR
Linear filtering.
Definition: GraphicsTypes.h:784