Divide Framework 0.1
A free and open-source 3D Framework under heavy development
Loading...
Searching...
No Matches
MaterialEnums.h
Go to the documentation of this file.
1/*
2 Copyright (c) 2020 DIVIDE-Studio
3 Copyright (c) 2009 Ionut Cava
4
5 This file is part of DIVIDE Framework.
6
7 Permission is hereby granted, free of charge, to any person obtaining a copy
8 of this software
9 and associated documentation files (the "Software"), to deal in the Software
10 without restriction,
11 including without limitation the rights to use, copy, modify, merge, publish,
12 distribute, sublicense,
13 and/or sell copies of the Software, and to permit persons to whom the
14 Software is furnished to do so,
15 subject to the following conditions:
16
17 The above copyright notice and this permission notice shall be included in
18 all copies or substantial portions of the Software.
19
20 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21 IMPLIED,
22 INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
23 PARTICULAR PURPOSE AND NONINFRINGEMENT.
24 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
25 DAMAGES OR OTHER LIABILITY,
26 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
27 IN CONNECTION WITH THE SOFTWARE
28 OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29
30 */
31
32#pragma once
33#ifndef DVD_MATERIAL_ENUMS_H_
34#define DVD_MATERIAL_ENUMS_H_
35
36namespace Divide {
37 enum class MaterialDebugFlag : U8 {
38 ALBEDO = 0,
39 DEPTH,
42 KS,
43 UV,
44 SSAO,
48 NORMALS,
51 IBL,
62 SSR,
65 COUNT
66 };
67 namespace Names {
68 static const char* materialDebugFlag[] = {
69 "ALBEDO",
70 "DEPTH",
71 "LIGHTING",
72 "SPECULAR",
73 "KS",
74 "UV",
75 "SSAO",
76 "EMISSIVE",
77 "ROUGHNESS",
78 "METALNESS",
79 "NORMALS",
80 "TANGENTS",
81 "BITANGENTS",
82 "IBL",
83 "SHADOW_MAPS",
84 "CSM_SPLITS",
85 "LIGHT_HEATMAP",
86 "DEPTH_CLUSTERS",
87 "DEPTH_CLUSTER_AABBS",
88 "REFLECTIONS",
89 "REFRACTIONS",
90 "MATERIAL_IDS",
91 "SHADING_MODE",
92 "VELOCITY",
93 "SSR",
94 "SSR_BLEND",
95 "WORLD_AO",
96 "NONE"
97 };
98 };
99
100 static_assert(ArrayCount(Names::materialDebugFlag) == to_base(MaterialDebugFlag::COUNT) + 1, "MaterialDebugFlag name array out of sync!");
101
102 enum class BumpMethod : U8 {
103 NONE = 0,
104 NORMAL = 1,
105 PARALLAX = 2,
107 COUNT
108 };
109 namespace Names {
110 static const char* bumpMethod[] = {
111 "NONE", "NORMAL", "PARALLAX", "PARALLAX_OCCLUSION", "UNKNOWN"
112 };
113 };
114
115 static_assert(ArrayCount(Names::bumpMethod) == to_base(BumpMethod::COUNT) + 1, "BumpMethod name array out of sync!");
116
118 enum class TextureOperation : U8 {
119 NONE = 0,
120 MULTIPLY = 1,
121 ADD = 2,
122 SUBTRACT = 3,
123 DIVIDE = 4,
124 SMOOTH_ADD = 5,
125 SIGNED_ADD = 6,
126 DECAL = 7,
127 REPLACE = 8,
128 COUNT
129 };
130 namespace Names {
131 static const char* textureOperation[] = {
132 "NONE", "MULTIPLY", "ADD", "SUBTRACT", "DIVIDE", "SMOOTH_ADD", "SIGNED_ADD", "DECAL", "REPLACE", "UNKNOW",
133 };
134 };
135
136 static_assert(ArrayCount(Names::textureOperation) == to_base(TextureOperation::COUNT) + 1, "TextureOperation name array out of sync!");
137
138 enum class TranslucencySource : U8 {
141 OPACITY_MAP_R, //single channel
142 OPACITY_MAP_A, //rgba texture
143 COUNT
144 };
145
146 namespace Names {
147 static const char* translucencySource[] = {
148 "ALBEDO_COLOUR", "ALBEDO_TEX", "OPACITY_MAP_R", "OPACITY_MAP_A", "NONE"
149 };
150 };
151
152 static_assert(ArrayCount(Names::translucencySource) == to_base(TranslucencySource::COUNT) + 1, "TranslucencySource name array out of sync!");
153
154 enum class ShadingMode : U8 {
155 FLAT = 0,
157 TOON,
158 PBR_MR, //Metallic/Roughness
159 PBR_SG, //Specular/Glossiness
160 COUNT
161 };
162
163 namespace Names {
164 static const char* shadingMode[] = {
165 "FLAT", "BLINN_PHONG", "TOON", "PBR_MR", "PBR_SG", "NONE"
166 };
167 };
168
169 static_assert(ArrayCount(Names::shadingMode) == to_base(ShadingMode::COUNT) + 1, "ShadingMode name array out of sync!");
170
172 OK = toBit(1),
173 NEW_CULL = toBit(2),
174 NEW_SHADER = toBit(3),
178 COUNT = 6
179 };
180
181}; //namespace Divide
182
183#endif //DVD_MATERIAL_ENUMS_H_
constexpr auto ArrayCount(Args &&... args) -> decltype(std::size(FWD(args)...))
static const char * shadingMode[]
static const char * materialDebugFlag[]
Definition: MaterialEnums.h:68
static const char * translucencySource[]
static const char * textureOperation[]
static const char * bumpMethod[]
Handle console commands that start with a forward slash.
Definition: AIProcessor.cpp:7
MaterialDebugFlag
Definition: MaterialEnums.h:37
uint8_t U8
TextureOperation
How should each texture be added.
MaterialUpdateResult
TranslucencySource
constexpr T toBit(const T X)
Converts an arbitrary positive integer value to a bitwise value used for masks.
constexpr auto to_base(const Type value) -> Type