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
#include "Headers/glResources.h"
#include "Headers/glEnumTable.h"

GLenum glBlendTable[BlendProperty_PLACEHOLDER];
GLenum glBlendOpTable[BlendOperation_PLACEHOLDER];
GLenum glCompareFuncTable[ComparisonFunction_PLACEHOLDER];
GLenum glStencilOpTable[StencilOperation_PLACEHOLDER];
GLenum glCullModeTable[CullMode_PLACEHOLDER];
GLenum glFillModeTable[FillMode_PLACEHOLDER];
GLenum glTextureTypeTable[TextureType_PLACEHOLDER];
GLenum glImageFormatTable[GFXImageFormat_PLACEHOLDER];
GLenum glPrimitiveTypeTable[PrimitiveType_PLACEHOLDER];
GLenum glDataFormat[GDF_PLACEHOLDER];
GLuint glWrapTable[TextureWrap_PLACEHOLDER];
GLuint glTextureFilterTable[TextureFilter_PLACEHOLDER];

namespace GL_ENUM_TABLE {
    void fill(){
       glBlendTable[BLEND_PROPERTY_ZERO] = GL_ZERO;
       glBlendTable[BLEND_PROPERTY_ONE] = GL_ONE;
       glBlendTable[BLEND_PROPERTY_SRC_COLOR] = GL_SRC_COLOR;
       glBlendTable[BLEND_PROPERTY_INV_SRC_COLOR] = GL_ONE_MINUS_SRC_COLOR;
       glBlendTable[BLEND_PROPERTY_SRC_ALPHA] = GL_SRC_ALPHA;
       glBlendTable[BLEND_PROPERTY_INV_SRC_ALPHA] = GL_ONE_MINUS_SRC_ALPHA;
       glBlendTable[BLEND_PROPERTY_DEST_ALPHA] = GL_DST_ALPHA;
       glBlendTable[BLEND_PROPERTY_INV_DEST_ALPHA] = GL_ONE_MINUS_DST_ALPHA;
       glBlendTable[BLEND_PROPERTY_DEST_COLOR] = GL_DST_COLOR;
       glBlendTable[BLEND_PROPERTY_INV_DEST_COLOR] = GL_ONE_MINUS_DST_COLOR;
       glBlendTable[BLEND_PROPERTY_SRC_ALPHA_SAT] = GL_SRC_ALPHA_SATURATE;

       glBlendOpTable[BLEND_OPERATION_ADD] = GL_FUNC_ADD;
       glBlendOpTable[BLEND_OPERATION_SUBTRACT] = GL_FUNC_SUBTRACT;
       glBlendOpTable[BLEND_OPERATION_REV_SUBTRACT] = GL_FUNC_REVERSE_SUBTRACT;
       glBlendOpTable[BLEND_OPERATION_MIN] = GL_MIN;
       glBlendOpTable[BLEND_OPERATION_MAX] = GL_MAX;

       glCompareFuncTable[CMP_FUNC_NEVER] = GL_NEVER;
       glCompareFuncTable[CMP_FUNC_LESS] = GL_LESS;
       glCompareFuncTable[CMP_FUNC_EQUAL] = GL_EQUAL;
       glCompareFuncTable[CMP_FUNC_LEQUAL] = GL_LEQUAL;
       glCompareFuncTable[CMP_FUNC_GREATER] = GL_GREATER;
       glCompareFuncTable[CMP_FUNC_NEQUAL] = GL_NOTEQUAL;
       glCompareFuncTable[CMP_FUNC_GEQUAL] = GL_GEQUAL;
       glCompareFuncTable[CMP_FUNC_ALWAYS] = GL_ALWAYS;

       glStencilOpTable[STENCIL_OPERATION_KEEP] = GL_KEEP;
       glStencilOpTable[STENCIL_OPERATION_ZERO] = GL_ZERO;
       glStencilOpTable[STENCIL_OPERATION_REPLACE] = GL_REPLACE;
       glStencilOpTable[STENCIL_OPERATION_INCR] = GL_INCR;
       glStencilOpTable[STENCIL_OPERATION_DECR] = GL_DECR;
       glStencilOpTable[STENCIL_OPERATION_INV]  = GL_INVERT;
       glStencilOpTable[STENCIL_OPERATION_INCR_WRAP] = GL_INCR_WRAP;
       glStencilOpTable[STENCIL_OPERATION_DECR_WRAP] = GL_DECR_WRAP;

       glCullModeTable[CULL_MODE_NONE] = GL_BACK;
       glCullModeTable[CULL_MODE_CW]   = GL_BACK;
       glCullModeTable[CULL_MODE_CCW]  = GL_FRONT;
       glCullModeTable[CULL_MODE_ALL]  = GL_FRONT_AND_BACK;

       glFillModeTable[FILL_MODE_POINT]     = GL_POINT;
       glFillModeTable[FILL_MODE_WIREFRAME] = GL_LINE;
       glFillModeTable[FILL_MODE_SOLID]     = GL_FILL;

       glTextureTypeTable[TEXTURE_1D] = GL_TEXTURE_1D;
       glTextureTypeTable[TEXTURE_2D] = GL_TEXTURE_2D;
       glTextureTypeTable[TEXTURE_3D] = GL_TEXTURE_3D;
       glTextureTypeTable[TEXTURE_CUBE_MAP] = GL_TEXTURE_CUBE_MAP;
       glTextureTypeTable[TEXTURE_2D_ARRAY] = GL_TEXTURE_2D_ARRAY_EXT;
       glTextureTypeTable[TEXTURE_CUBE_ARRAY] = GL_TEXTURE_CUBE_MAP_ARRAY;
       glTextureTypeTable[TEXTURE_2D_MS] = GL_TEXTURE_2D_MULTISAMPLE;
       glTextureTypeTable[TEXTURE_2D_ARRAY_MS] = GL_TEXTURE_2D_MULTISAMPLE_ARRAY;

       glImageFormatTable[LUMINANCE] = GL_LUMINANCE;
       glImageFormatTable[LUMINANCE_ALPHA] = GL_LUMINANCE_ALPHA;
       glImageFormatTable[LUMINANCE_ALPHA16F] = GL_LUMINANCE_ALPHA16F_ARB;
       glImageFormatTable[LUMINANCE_ALPHA32F] = GL_LUMINANCE_ALPHA32F_ARB;
       glImageFormatTable[INTENSITY] = GL_INTENSITY;
       glImageFormatTable[ALPHA] = GL_ALPHA;
       glImageFormatTable[RED] = GL_RED;
       glImageFormatTable[RED8] = GL_R8;
       glImageFormatTable[RED16] = GL_R16;
       glImageFormatTable[RED16F] = GL_R16F;
       glImageFormatTable[RED32] = GL_R32UI;
       glImageFormatTable[RED32F ] = GL_R32F;
       glImageFormatTable[BLUE] = GL_BLUE;
       glImageFormatTable[GREEN] = GL_GREEN;
       glImageFormatTable[RG] = GL_RG;
       glImageFormatTable[RG8] = GL_RG8;
       glImageFormatTable[RG16] = GL_RG16;
       glImageFormatTable[RG16F] = GL_RG16F;
       glImageFormatTable[RG32]  = GL_RG32UI;
       glImageFormatTable[RG32F] = GL_RG32F;
       glImageFormatTable[RGB] = GL_RGB;
       glImageFormatTable[BGR] = GL_BGR;
       glImageFormatTable[RGB8] = GL_RGB8;
       glImageFormatTable[RGB8I] = GL_RGB8I;
       glImageFormatTable[RGB16] = GL_RGB16;
       glImageFormatTable[RGB16F] = GL_RGB16F;
       glImageFormatTable[BGRA] = GL_BGRA;
       glImageFormatTable[RGBA] = GL_RGBA;
       glImageFormatTable[RGBA4] = GL_RGBA4;
       glImageFormatTable[RGBA8] = GL_RGBA8;
       glImageFormatTable[RGBA8I] = GL_RGBA8I;
       glImageFormatTable[RGBA16F] = GL_RGBA16F;
       glImageFormatTable[RGBA32F] = GL_RGBA32F;
       glImageFormatTable[DEPTH_COMPONENT] = GL_DEPTH_COMPONENT;
       glImageFormatTable[DEPTH_COMPONENT16] = GL_DEPTH_COMPONENT16;
       glImageFormatTable[DEPTH_COMPONENT24] = GL_DEPTH_COMPONENT24;
       glImageFormatTable[DEPTH_COMPONENT32] = GL_DEPTH_COMPONENT32;
       glImageFormatTable[DEPTH_COMPONENT32F] = GL_DEPTH_COMPONENT32F;

       glPrimitiveTypeTable[API_POINTS] = GL_POINTS;
       glPrimitiveTypeTable[LINES] = GL_LINES;
       glPrimitiveTypeTable[LINE_LOOP] = GL_LINE_LOOP;
       glPrimitiveTypeTable[LINE_STRIP] = GL_LINE_STRIP;
       glPrimitiveTypeTable[TRIANGLES] = GL_TRIANGLES;
       glPrimitiveTypeTable[TRIANGLE_STRIP] = GL_TRIANGLE_STRIP;
       glPrimitiveTypeTable[TRIANGLE_FAN] = GL_TRIANGLE_FAN;
       //glPrimitiveTypeTable[QUADS] = GL_QUADS; //<Deprecated
       glPrimitiveTypeTable[QUAD_STRIP] = GL_QUAD_STRIP;
       glPrimitiveTypeTable[POLYGON] = GL_POLYGON;

       glDataFormat[UNSIGNED_BYTE] = GL_UNSIGNED_BYTE;
       glDataFormat[UNSIGNED_SHORT] = GL_UNSIGNED_SHORT;
       glDataFormat[UNSIGNED_INT] = GL_UNSIGNED_INT;
       glDataFormat[SIGNED_BYTE] = GL_BYTE;
       glDataFormat[SIGNED_SHORT] = GL_SHORT;
       glDataFormat[SIGNED_INT] = GL_INT;
       glDataFormat[FLOAT_16] = GL_HALF_FLOAT;
       glDataFormat[FLOAT_32] = GL_FLOAT;

       glWrapTable[TEXTURE_MIRROR_REPEAT] = GL_MIRRORED_REPEAT;
       glWrapTable[TEXTURE_REPEAT] = GL_REPEAT;
       glWrapTable[TEXTURE_CLAMP] = GL_CLAMP;
       glWrapTable[TEXTURE_CLAMP_TO_EDGE] = GL_CLAMP_TO_EDGE;
       glWrapTable[TEXTURE_CLAMP_TO_BORDER] =  GL_CLAMP_TO_BORDER;
       glWrapTable[TEXTURE_DECAL] = GL_DECAL;

       glTextureFilterTable[TEXTURE_FILTER_LINEAR] = GL_LINEAR;
       glTextureFilterTable[TEXTURE_FILTER_NEAREST] = GL_NEAREST;
       glTextureFilterTable[TEXTURE_FILTER_NEAREST_MIPMAP_NEAREST] = GL_NEAREST_MIPMAP_NEAREST;
       glTextureFilterTable[TEXTURE_FILTER_LINEAR_MIPMAP_NEAREST] = GL_LINEAR_MIPMAP_NEAREST;
       glTextureFilterTable[TEXTURE_FILTER_NEAREST_MIPMAP_LINEAR] = GL_NEAREST_MIPMAP_LINEAR;
       glTextureFilterTable[TEXTURE_FILTER_LINEAR_MIPMAP_LINEAR] = GL_LINEAR_MIPMAP_LINEAR;
    }
}

Commits for Divide-Framework/trunk/Source Code/Hardware/Video/OpenGL/glEnumTable.cpp

Diff revisions: vs.
Revision Author Commited Message
286 Diff Diff IonutCava picture IonutCava Fri 18 Jul, 2014 16:32:03 +0000

[Ionut] [[BR]]

    • very buggy commit ** [[BR]]

- New rendering pipeline: [[BR]]
— Bumped OpenGL version to 4.4 [[BR]]
— Command based rendering. GFXDevice dispatches rendering commands to their respective buffers [[BR]]
— State changing is exclusively controlled by the GFXDevice class [[BR]]
— Material properties and transform matrices are stored in shader storage buffers that are updated after culling and uploaded once per RenderPass. Objects use drawIDs to index data in shaders [[BR]]
— Removed all custom matrices and other, per shader, bind data [[BR]]
— Removed per node light data. Light culling and shader buffers will replace the old light management system [[BR]]
— Framebuffers now use the Texture class for attachments [[BR]]
— Sampler objects now work like RenderStateBlocks. GL_API handles them and stores them in a hash indexed map [[BR]]
— Removed “prepareMaterial” calls. Pre-draw material setup is now only limited to texture binding [[BR]]
— Moved immediate mode emulation and primitive rendering from API level to GFXDevice level [[BR]]
— Framebuffer rendering must be completed with a call to end() to ensure proper MSAA resolve (asserts, otherwise) [[BR]]
- Fixed hash code generation for RenderStateBlock (and now, glSamplerObject) using boost::hash_combine [[BR]]
- Temporarily disabled XML caching for materials [[BR]]

259 Diff Diff k1ngp1n picture k1ngp1n Sun 27 Apr, 2014 18:24:52 +0000

[Ionut][[BR]]
- Implemented Exponential Stable Cascaded Shadow Maps for directional lights (still buggy, but basically working) [[BR]]
— CSM settings (resolution, number of splits, etc) are part of the scene render state [[BR]]
- SGN can skip rendering for the current frame if they are not ready (e.g. OnDraw can now return false or materials can fail to bind) [[BR]]
- Frustum class is now using the Plane class [[BR]]
- Removed Math SIMD implementation as the compiler generated code will always be faster and safer [[BR]]
- Added a “STUBBED” macro for outputing to the error stream of important messages (instead of using #pragma message) [[BR]]
- Added “freeze time” logic to pause/resume updates with or without freezing the GUI too [[BR]]
- Added “processGUI” method the every Scene class to separate time-sensitive GUI updates from game logic loop [[BR]]
- GLSL <-> Vertex Buffer bind locations are automatically set for every vertex shader [[BR]]
- Added basic support for compute shaders [[BR]]
- Removed most OS define checks to make porting to a new platform easier [[BR]]
- Texture transparency check per-pixel is now using OpenMP [[BR]]
- Texture samplers can now set a border color for CLAMP_TO_BORDER wrap mode [[BR]]
- Removed “Object” suffix from GFX Classes (pixel buffer, vertex buffer, frame buffer, etc) [[BR]]
- Stop processing scene input when application looses focus [[BR]]
- SceneGraphNode class is now responsible for updating SGNComponents on draw and calling its _node’s OnDraw method [[BR]]
- UBOs can now list all of the active uniforms inside a block with info such as type and offset [[BR]]
- Removed deprecated ‘GLCheck’ macro [[BR]]
- A lot of bug fixes and performance improvements in various places [[BR]]

223 Diff Diff k1ngp1n picture k1ngp1n Thu 09 Jan, 2014 15:55:04 +0000

[Ionut] [[BR]]
- Fixed most compatibility bugs on nVidia [[BR]]
— Removed the use of gl_Color in shaders [[BR]]
— Removed the use of GL_QUADS for VBOs [[BR]]
— Added VAO support to GLIM [[BR]]
— Hacked extension checking with GLEW (used glGetStringi for anisotropy and s3tc) [[BR]]
- Changed grass rendering to triangle strips (but disabled for now) [[BR]]
- Improved Transform class for more robustness [[BR]]
- Fixed transform related crash in SceneGraphNode when deleting a parentTransform [[BR]]
- Removed grandParent support in SceneGraphNode class as it was useless (getParent()->getParent() works just as well) [[BR]]

193 Diff Diff k1ngp1n picture k1ngp1n Sun 01 Dec, 2013 16:45:35 +0000

[Ionut] [[BR]]
- VSM preparation work [[BR]]
- Material bug fixes (translucency) [[BR]]
- FBO mipMap optimization [[BR]]

189 Diff Diff k1ngp1n picture k1ngp1n Thu 28 Nov, 2013 22:30:25 +0000

[Ionut] [[BR]]
- FBO cleanup [[BR]]

171 Diff Diff k1ngp1n picture k1ngp1n Sun 03 Nov, 2013 18:15:06 +0000

-Replaced all tabs with spaces [[BR]]

170 Diff Diff k1ngp1n picture k1ngp1n Sun 03 Nov, 2013 17:24:57 +0000

-Moved hardware related code to a separate project [[BR]]
-More work on post-processing: [[BR]]
— HDR rendering is working, but final tonemapping needs more work [[BR]]
-Important changes in BloomPreRenderOperator.cpp, PostFX.cpp and glFrameBufferObject.cpp [[BR]]
-Trailing and leading whitespace cleanups [[BR]]

169 Diff Diff k1ngp1n picture k1ngp1n Tue 29 Oct, 2013 21:17:29 +0000

Ionut: [[BR]]
- Code cleanups and optimizations [[BR]]
- Better memory allocation and deallocation tracking and logging [[BR]]
- Added vertex color support for VBOs [[BR]]
-Improved PostProcessing: [[BR]]
— A lot of code cleanups and scalability was increased [[BR]]
-— HDR lighting with automatic exposure, God Rays and working SSAO will be added in the next commit [[BR]]
— Added single pass SSAO by Aurel Manea [[BR]]
-— Not finished – a lot of artifacts [[BR]]
— Reduced the VRAM requirements for most render targets by using smaller data types [[BR]]

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]]

152 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]]