Subversion Repository Public Repository

Divide-Framework

This repository has no backups
This repository's network speed is throttled to 100KB/sec

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
/*
   Copyright (c) 2013 DIVIDE-Studio
   Copyright (c) 2009 Ionut Cava

   This file is part of DIVIDE Framework.
   
   Permission is hereby granted, free of charge, to any person obtaining a copy of this software
   and associated documentation files (the "Software"), to deal in the Software without restriction,
   including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 
   and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 
   subject to the following conditions:

   The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
   INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 
   IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
   WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE 
   OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

 */

#ifndef _GFX_ENUMS_H
#define _GFX_ENUMS_H

/// no need to include the entire resource header for one define
#ifndef toBit
#define toBit(X) (1 << (X))
#endif

///Fixed pipeline functionality should be avoided. Both D3D and OGL should have these matrices
enum MATRIX_MODE{
	VIEW_MATRIX = 0,
	PROJECTION_MATRIX = 1,
    TEXTURE_MATRIX = 2
};

///Compund matrices or sub-matrices
enum EXTENDED_MATRIX{
    MODEL_MATRIX  = 0, //<Current model matrix. Changed for each render call, mainly
    MV_MATRIX     = 1, //<ModelView matrix : ViewMatrix * ModelMatrix (as per OpenGL standards: name is backwards)
    MV_INV_MATRIX = 2, //<ModelViewInverse matrix: (ViewMatrix * ModelMatrix)^-1
    MVP_MATRIX    = 4, //<ModelViewProjection matrix: ProjectionMatrix * ViewMatrix * ModelMatrix
    NORMAL_MATRIX = 5, //<Normal matrix - for non-uniform scaled models: top left 3x3 of ((ViewMatrix * ModelMatrix)^-1)^T; for uniform scaled models: top left 3x3 of (ViewMatrix*ModelMatrix)
    BIAS_MATRIX   = 6  //<Bias matrix - scales and biases coordinates from [-1,1] to [0,1]
};

///Using multiple threads for streaming and issuing API specific construction commands to the rendering API will
///cause problems with libraries such as ASSIMP or with the scenegraph. Having 2 rendering contexts with a single
///display list, one for rendering and one for loading seems the best approach (for now)
enum CurrentContext {
	GFX_RENDERING_CONTEXT = 0,
	GFX_LOADING_CONTEXT
};

enum FogMode {
    FOG_NONE = 0,
    FOG_LINEAR,
    FOG_EXP,
    FOG_EXP2
};

enum RenderStage {
    DEFERRED_STAGE			   = toBit(1),
    SHADOW_STAGE			   = toBit(2),
    REFLECTION_STAGE		   = toBit(3),
    SSAO_STAGE				   = toBit(4),
    BLOOM_STAGE                = toBit(5),
	DOF_STAGE                  = toBit(6),
	LIGHT_SHAFT_STAGE          = toBit(7),
    FINAL_STAGE				   = toBit(8),
	ENVIRONMENT_MAPPING_STAGE  = toBit(9),
	FXAA_STAGE                 = toBit(10),
	DISPLAY_STAGE              = DEFERRED_STAGE | FINAL_STAGE,
	POSTFX_STAGE               = SSAO_STAGE | BLOOM_STAGE | DOF_STAGE | LIGHT_SHAFT_STAGE,
    DEPTH_STAGE                = SSAO_STAGE | DOF_STAGE | SHADOW_STAGE,
	//Place all stages above this
	INVALID_STAGE		       = toBit(11)
};

enum PBOType {
	PBO_TEXTURE_1D,
	PBO_TEXTURE_2D,
	PBO_TEXTURE_3D
};

enum FBOType {
	FBO_PLACEHOLDER,
	FBO_2D_COLOR,
	FBO_2D_ARRAY_COLOR, ///<FBO that uses texture arrays
	FBO_2D_COLOR_MS,///<Multisampled FBO with fallback to FBO_2D_COLOR
	FBO_CUBE_COLOR,
	FBO_CUBE_COLOR_ARRAY,
	FBO_CUBE_DEPTH_ARRAY,
	FBO_2D_DEPTH,  ///< This is the same as 2D_COLOR with color writes disabled.
	FBO_2D_ARRAY_DEPTH, ///< This is the same as 2D_DEPTH but uses array textures
	FBO_CUBE_DEPTH,
	FBO_2D_DEFERRED
};

enum RenderAPI {
	OpenGL,
	OpenGLES,
	Direct3D,///< not supported yet
	Software,///< not supported yet
	None,    ///< not supported yet
	GFX_RENDER_API_PLACEHOLDER
};

enum RenderAPIVersion{
	OpenGL1x,  ///< support dropped
	OpenGL2x,  ///< support dropped
	OpenGL3x,
	OpenGL4x,  ///< not supported yet
	Direct3D8, ///< support dropped
	Direct3D9, ///< support dropped
	Direct3D10,///< not supported yet
	Direct3D11,///< not supported yet
	GFX_RENDER_API_VER_PLACEHOLDER
};

enum PrimitiveType {
	API_POINTS      = 0x0000,
	LINES           = 0x0001,
	LINE_LOOP       = 0x0002,
	LINE_STRIP      = 0x0003,
	TRIANGLES       = 0x0004,
	TRIANGLE_STRIP  = 0x0005,
	TRIANGLE_FAN    = 0x0006,
	QUADS           = 0x0007,
	QUAD_STRIP      = 0x0008,
	POLYGON         = 0x0009,
	PrimitiveType_PLACEHOLDER = 0x0010
};

enum RenderDetailLevel{
	DETAIL_LOW = 0,
	DETAIL_MEDIUM = 1,
	DETAIL_HIGH = 2
};

enum FullScreenAntiAliasingMethod{
	FS_MSAA = 1,
	FS_FXAA = 2,
	FS_SMAA = 3,
	FS_MSwFXAA = 4 ///<MSAA rendering + FXAA post processing if possible
};

/// Specifies how the red, green, blue, and alpha source blending factors are computed.
enum BlendProperty{
   BLEND_PROPERTY_ZERO = 0,
   BLEND_PROPERTY_ONE,
   BLEND_PROPERTY_SRC_COLOR,
   BLEND_PROPERTY_INV_SRC_COLOR,
   /// Transparency is best implemented using blend function (SRC_ALPHA, ONE_MINUS_SRC_ALPHA) with primitives sorted from farthest to nearest.
   BLEND_PROPERTY_SRC_ALPHA,
   BLEND_PROPERTY_INV_SRC_ALPHA,
   BLEND_PROPERTY_DEST_ALPHA,
   BLEND_PROPERTY_INV_DEST_ALPHA,
   BLEND_PROPERTY_DEST_COLOR,
   BLEND_PROPERTY_INV_DEST_COLOR,
   /// Polygon antialiasing is optimized using blend function (SRC_ALPHA_SATURATE, GL_ONE) with polygons sorted from nearest to farthest.
   BLEND_PROPERTY_SRC_ALPHA_SAT,
   ///Place all properties above this.
   BlendProperty_PLACEHOLDER
};

/// Specifies how source and destination colors are combined.
enum BlendOperation {
   /// The ADD equation is useful for antialiasing and transparency, among other things.
   BLEND_OPERATION_ADD = 0,
   BLEND_OPERATION_SUBTRACT,
   BLEND_OPERATION_REV_SUBTRACT,
   /// The MIN and MAX equations are useful for applications that analyze image data
   /// (image thresholding against a constant color, for example).
   BLEND_OPERATION_MIN,
   /// The MIN and MAX equations are useful for applications that analyze image data
   /// (image thresholding against a constant color, for example).
   BLEND_OPERATION_MAX,
   /// Place all properties above this.
   BlendOperation_PLACEHOLDER
};

/// Valid comparison functions for most states
/// YYY = test value using this function
enum ComparisonFunction {
   /// Never passes.
   CMP_FUNC_NEVER = 0,
   /// Passes if the incoming YYY value is less than the stored YYY value.
   CMP_FUNC_LESS,
   /// Passes if the incoming YYY value is equal to the stored YYY value.
   CMP_FUNC_EQUAL,
   /// Passes if the incoming YYY value is less than or equal to the stored YYY value.
   CMP_FUNC_LEQUAL,
   /// Passes if the incoming YYY value is greater than the stored YYY value.
   CMP_FUNC_GREATER,
   /// Passes if the incoming YYY value is not equal to the stored YYY value.
   CMP_FUNC_NEQUAL,
   /// Passes if the incoming YYY value is greater than or equal to the stored YYY value.
   CMP_FUNC_GEQUAL,
   /// Always passes.
   CMP_FUNC_ALWAYS,
   /// Place all properties above this.
   ComparisonFunction_PLACEHOLDER
};

/// Specifies whether front- or back-facing facets are candidates for culling.
enum CullMode {
   CULL_MODE_NONE = 0,
   /// Cull Back facing polygons
   CULL_MODE_CW,
   /// Cull Front facing polygons
   CULL_MODE_CCW,
   /// Cull All polygons
   CULL_MODE_ALL,
    ///Place all properties above this.
   CullMode_PLACEHOLDER
};

/// Valid front and back stencil test actions
enum StencilOperation {
   /// Keeps the current value.
   STENCIL_OPERATION_KEEP = 0,
   /// Sets the stencil buffer value to 0.
   STENCIL_OPERATION_ZERO,
   /// Sets the stencil buffer value to ref, as specified by StencilFunc.
   STENCIL_OPERATION_REPLACE,
   /// Increments the current stencil buffer value. Clamps to the maximum representable unsigned value.
   STENCIL_OPERATION_INCR,
   ///  Decrements the current stencil buffer value. Clamps to 0.
   STENCIL_OPERATION_DECR,
   /// Bitwise inverts the current stencil buffer value.
   STENCIL_OPERATION_INV,
   /// Increments the current stencil buffer value.
   /// Wraps stencil buffer value to zero when incrementing the maximum representable unsigned value.
   STENCIL_OPERATION_INCR_WRAP,
   /// Decrements the current stencil buffer value.
   /// Wraps stencil buffer value to the maximum representable unsigned value when decrementing a stencil buffer value of zero.
   STENCIL_OPERATION_DECR_WRAP,
   /// Place all properties above this.
   StencilOperation_PLACEHOLDER
};

///Defines all available fill modes for primitives
enum FillMode {
   ///Polygon vertices that are marked as the start of a boundary edge are drawn as points.
   FILL_MODE_POINT = 1,
   ///Boundary edges of the polygon are drawn as line segments.
   FILL_MODE_WIREFRAME,
   ///The interior of the polygon is filled.
   FILL_MODE_SOLID,
    ///Place all properties above this.
   FillMode_PLACEHOLDER
};

enum TextureType {
	TEXTURE_1D = 0,
	TEXTURE_2D,
    TEXTURE_3D,
    TEXTURE_CUBE_MAP,
	TEXTURE_2D_ARRAY,
	TEXTURE_CUBE_ARRAY,
	TEXTURE_2D_MS,
	TEXTURE_2D_ARRAY_MS,
	TextureType_PLACEHOLDER
};

enum TextureFilter{
	TEXTURE_FILTER_LINEAR	= 0x0000,
	TEXTURE_FILTER_NEAREST   = 0x0001,
	TEXTURE_FILTER_NEAREST_MIPMAP_NEAREST = 0x0002,
	TEXTURE_FILTER_LINEAR_MIPMAP_NEAREST  = 0x0003,
	TEXTURE_FILTER_NEAREST_MIPMAP_LINEAR  = 0x0004,
	TEXTURE_FILTER_LINEAR_MIPMAP_LINEAR   = 0x0005,
	TextureFilter_PLACEHOLDER            = 0x0006
};

enum TextureWrap {
	/** Texture coordinates outside [0...1] are clamped to the nearest valid value.	 */
	TEXTURE_CLAMP = 0x0,
	TEXTURE_CLAMP_TO_EDGE = 0x1,
	TEXTURE_CLAMP_TO_BORDER = 0x2,
	/** If the texture coordinates for a pixel are outside [0...1] the texture is not applied to that pixel */
	TEXTURE_DECAL = 0x3,
	TEXTURE_REPEAT = 0x4,
	TextureWrap_PLACEHOLDER = 0x5
};

enum GFXImageFormat{
	LUMINANCE = 0,
	LUMINANCE_ALPHA,
	INTENSITY,
	ALPHA,
	BGR,
	RGB,
	RGB8,
	RGB8I,
	RGB16,
	RGB16F,
	BGRA,
	RGBA,
	RGBA4,
	RGBA8,
	RGBA8I,
	RGBA16F,
	RGBA32F,
	DEPTH_COMPONENT,
    DEPTH_COMPONENT16,
	DEPTH_COMPONENT24,
    DEPTH_COMPONENT32,
	IMAGE_FORMAT_PLACEHOLDER
};

enum GFXDataFormat{
	UNSIGNED_BYTE    = 0x0000,
	UNSIGNED_SHORT   = 0x0001,
	UNSIGNED_INT     = 0x0002,
	SIGNED_BYTE      = 0x0003,
	SIGNED_SHORT     = 0x0004,
	SIGNED_INT       = 0x0005,
	FLOAT_32         = 0x0006,
	GDF_PLACEHOLDER  = 0x0007
};

enum GPUVendor {
	GPU_VENDOR_NVIDIA = 0,
	GPU_VENDOR_AMD,
	GPU_VENDOR_INTEL,
	GPU_VENDOR_OTHER,
	GPU_VENDOR_PLACEHOLDER
};

enum GPURenderer{
	GPU_RENDERER_PLACEHOLDER
};
#endif

Commits for Divide-Framework/trunk/Source Code/Hardware/Video/Headers/RenderAPIEnums.h

Diff revisions: vs.
Revision Author Commited Message
168 Diff Diff k1ngp1n picture k1ngp1n Sat 26 Oct, 2013 19:03:21 +0000

- Reworked the Camera class[[BR]]
— Now fully quaternion based [[BR]]
— Basic camera types added but not used yet (third person, first person, orbit) [[BR]]
- Cleaned up Material and Texture handling [[BR]]
- Added clipping plane support [[BR]]
— Similar to OpenGL fixed-function clip planes but fully shader driven [[BR]]
— Added a new class, “Plane”, that helps define clip planes [[BR]]
- Optimized the Singleton class to allow faster “getInstance” calls without performance penalties [[BR]]
-- “createInstance” must be called for each singleton class before usage. Or “gerOrCreateInstance” can be used, which is basically the former “getInstance” implementation [[BR]]
- Improved console logging by changing some heap allocations to stack and removing dependencies on the std::string class [[BR]]
- Added a lot of performance optimizations related to coding standards and redundant calculations [[BR]]
— e.g. Frustum AABB check didn’t need to recompute the AABB points as they were calculated already [[BR]]
— e.g. A vector did not need to be set to 0 on initialization as that is already it’s default state on creation [[BR]]
— e.g. Faster Framerate and Timing calculations by using less member variables that are not needed outsied of calling functions [[BR]]
- The SceneState now contains the SceneRenderState and is passed on to the SceneGraph’s update calls [[BR]]
- Better material export/import to/from XML format [[BR]]
- More bug fixes and cleanups [[BR]]

160 Diff Diff k1ngp1n picture k1ngp1n Wed 10 Jul, 2013 17:07:04 +0000

[Ionut] [[BR]]
- Changed licensing from LGPL to the MIT license [[BR]]
— Code can now be used in non-commercial or commercial closed or open source projects [[BR]]

152 Diff Diff k1ngp1n picture k1ngp1n Thu 20 Jun, 2013 14:23:31 +0000

[Ionut] [[BR]]
- New rendering pipeline (experimental and unstable): [[BR]]
— OpenGL 3.x clean context (glLight commands are still used for now, but UBO support is there, but not used yet) [[BR]]
— Custom matrix stacks and UBO based shader data (UBOs cause some link errors on some nVidia cards)[[BR]]
— Multi-threaded texture loading and shader compilation (mt shader compilation disabled for now. needs more tests) [[BR]]
— VAO rendering is self contained (no more enable/disable calls before a draw request) [[BR]]
— Render instance class used for rendering information [[BR]]
[[BR]]
- New unique ID generation base class: GUIDWrapper. Each class that derives from this, gets an application wide unique id on construction [[BR]]
- Added base code for an in-game editor using CEGUI [[BR]]
- Replaced some mutex locks with lockless data structures or atomic data [[BR]]
- CEGUI 0.8.2, FTGL-GL3 and GLIM 0.4 modified to support GLEW_MX if defined [[BR]]
- Dropped VS2008 support [[BR]]
- Networking library, server framework and ReCast files are now projects inside the Divide Framework solution [[BR]]
- New console command “setFov” that modifies the horizontal FoV value in realtime [[BR]]
- New console command “recompileShader” that reparses shader files, recompiles shaders and relinks shader programs who’s names match or contain the argument string [[BR]]
- New debug utility: axis angle drawn in corner of the screen if needed [[BR]]
- More ‘const’-s pasted around the code, more loop performance tweaks (allocations before a loop, tighter loops, etc), more utility member functions added to various classes [[BR]]

151 Diff Diff k1ngp1n picture k1ngp1n Tue 07 May, 2013 00:00:52 +0000

[Ionut] [[BR]]
- Better ReCast integration [[BR]]
— Any entity can be used as an obstacle in the NavMesh if that’s specified in each scene’s assets.xml file for said entity [[BR]]
— New console command, “createNavMesh”, that passes geometry data to ReCast [[BR]]
-— NavMesh generation is not yet complete [[BR]]
- Better PhysX integration [[BR]]
— Each scene passes data to and gets data from the Physics API better and safer[[BR]]
- Multi-threaded support extended: [[BR]]
— Event class replaced with Task [[BR]]
— Kernel uses a threadpool for scene tasks [[BR]]
— Each task can be added to a different threadpool if needed [[BR]]
— Most critical sections use the new boost::atomic wrapper for thread safety [[BR]]
- Rendering system updated [[BR]]
— VBO’s keep track of the geometry type internally [[BR]]
— Rendering by specific element list is internal to the VBO [[BR]]
— VBO’s can draw a “lite” version that doesn’t send Tangent, BiTangent and TexCoord data for depth rendering (disabled) [[BR]]
- Reflectors now offer a preview of the generated reflective texture if needed [[BR]]
- Buttons are now added and rendered by CEGUI [[BR]]
[[BR]]
Deprecation: [[BR]]
- Removed fixed pipeline material system [[BR]]
- Removed BoundingBox late update system [[BR]]
- Shadow references in the material system are now depth references [[BR]]
[[BR]]
Bug fixes: [[BR]]
- Problematic FBO double bind check removed [[BR]]
- Faster terrain rendering via chunk size selection through each scene’s terrain.xml[[BR]]
- Rendering is paused when the window is minimized [[BR]]
- CEGUI and impostors now render properly in deferred rendering mode [[BR]]
- Fixed various level 4 (VS2008) warnings [[BR]]
- Better state management and cleaning [[BR]]
- Better SceneGraph node management and trasformation/AABB update calls [[BR]]
- AITenisScene has proper collisions now [[BR]]

146 Diff Diff k1ngp1n picture k1ngp1n Wed 10 Apr, 2013 13:20:15 +0000

[Ionut] [[BR]]
*Final LightBranch updates 2/3 : Main trunk merge and build test (VC90, VC100, gDebugger) [[BR]]
-Merged light branch with trunk [[BR]]
-Deleted light branch [[BR]]

141 Diff Diff k1ngp1n picture k1ngp1n Wed 30 Jan, 2013 19:35:31 +0000

[Ionut] [[BR]]
-Updated to boost 1.52 and CEGUI 0.7.9 [[BR]]
-Updated to PhysX 3.2 [[BR]]
-Updated copyright notices [[BR]]

124 Diff Diff k1ngp1n picture k1ngp1n Thu 14 Jun, 2012 10:57:25 +0000

[Ionut] [[BR]]
-Fixed a bug regarding detail level selection [[BR]]

123 Diff Diff k1ngp1n picture k1ngp1n Tue 12 Jun, 2012 16:52:41 +0000

[Ionut] [[BR]]
-Split FBO’s in 3: RenderToTexture, RenderToDepth and RenderToDeferred (experimental) [[BR]]

122 k1ngp1n picture k1ngp1n Mon 11 Jun, 2012 14:39:08 +0000

[Ionut] [[BR]]
-Restructured “Hardware” folder to match the rest of the projects header-separation pattern [[BR]]