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
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
#include "Headers/Scene.h"

#include <Hardware/Network/Headers/ASIOImpl.h>
#include "GUI/Headers/GUI.h"

#include "Core/Headers/ParamHandler.h"
#include "Core/Math/Headers/Transform.h"

#include "Utility/Headers/XMLParser.h"
#include "Managers/Headers/AIManager.h"
#include "Managers/Headers/SceneManager.h"
#include "Managers/Headers/CameraManager.h"
#include "Rendering/Camera/Headers/FreeFlyCamera.h"

#include "Environment/Sky/Headers/Sky.h"
#include "Environment/Terrain/Headers/Terrain.h"
#include "Environment/Terrain/Headers/TerrainDescriptor.h"

#include "Geometry/Shapes/Headers/Mesh.h"
#include "Geometry/Material/Headers/Material.h"
#include "Geometry/Shapes/Headers/Predefined/Box3D.h"
#include "Geometry/Shapes/Headers/Predefined/Quad3D.h"
#include "Geometry/Shapes/Headers/Predefined/Sphere3D.h"
#include "Geometry/Shapes/Headers/Predefined/Text3D.h"

#include "Dynamics/Physics/Headers/PhysicsSceneInterface.h"

Scene::Scene() :  Resource("temp_scene"),
                 _GFX(GFX_DEVICE),
                 _LRSpeedFactor(5.0f),
                 _loadComplete(false),
                 _cookCollisionMeshesScheduled(false),
                 _paramHandler(ParamHandler::getInstance()),
                 _currentSelection(nullptr),
                 _physicsInterface(nullptr),
                 _sceneGraph(New SceneGraph())
{
    _mousePressed[OIS::MB_Left]    = false;
    _mousePressed[OIS::MB_Right]   = false;
    _mousePressed[OIS::MB_Middle]  = false;
    _mousePressed[OIS::MB_Button3] = false;
    _mousePressed[OIS::MB_Button4] = false;
    _mousePressed[OIS::MB_Button5] = false;
    _mousePressed[OIS::MB_Button6] = false;
    _mousePressed[OIS::MB_Button7] = false;
}

Scene::~Scene()
{
}

bool Scene::idle(){ //Called when application is idle
    if(_sceneGraph){
        if(_sceneGraph->getRoot()->getChildren().empty()) return false;
        _sceneGraph->idle();
    }

    if(!_modelDataArray.empty())
        loadXMLAssets(true);

    if (_cookCollisionMeshesScheduled && checkLoadFlag()){
        if(GFX_DEVICE.getFrameCount() > 1){
            _sceneGraph->getRoot()->getComponent<PhysicsComponent>()->cookCollisionMesh(_name);
            _cookCollisionMeshesScheduled = false;
        }
    }
    return true;
}

void Scene::onCameraChange(){
    if(_sceneGraph)
        _sceneGraph->getRoot()->onCameraChange();
}

void Scene::postRender(){
#ifdef _DEBUG
    if(renderState()._debugDrawLines) {
        for(U8 i = 0; i < DEBUG_LINE_PLACEHOLDER; ++i)
            if(!_lines[i].empty())
                GFX_DEVICE.drawLines(_lines[i], mat4<F32>(), vec4<I32>(), false,  false);
    }
#endif
}

void Scene::addPatch(vectorImpl<FileData>& data){
}

void Scene::loadXMLAssets(bool singleStep){
    while(!_modelDataArray.empty()){
        FileData& it = _modelDataArray.top();
        //vegetation is loaded elsewhere
        if(it.type == VEGETATION){
            _vegetationDataArray.push_back(it);
        }else{
            loadModel(it);
        }
        _modelDataArray.pop();
        
        if(singleStep){
            return;
        }
    }
}

bool Scene::loadModel(const FileData& data){
    if(data.type == PRIMITIVE)	
        return loadGeometry(data);

    ResourceDescriptor model(data.ModelName);
    model.setResourceLocation(data.ModelName);
    model.setFlag(true);
    Mesh *thisObj = CreateResource<Mesh>(model);
    if (!thisObj){
        ERROR_FN(Locale::get("ERROR_SCENE_LOAD_MODEL"),  data.ModelName.c_str());
        return false;
    }
    
    SceneGraphNode* meshNode = _sceneGraph->getRoot()->addNode(thisObj, data.ItemName);
    meshNode->setCastsShadows(data.castsShadows);
    meshNode->setReceivesShadows(data.receivesShadows);
    meshNode->getTransform()->scale(data.scale);
    meshNode->getTransform()->rotateEuler(data.orientation);
    meshNode->getTransform()->translate(data.position);
    if(data.staticUsage){
        meshNode->setUsageContext(SceneGraphNode::NODE_STATIC);
    }
    if(data.navigationUsage){
        meshNode->getComponent<NavigationComponent>()->setNavigationContext(NavigationComponent::NODE_OBSTACLE);
    }
    if(data.physicsUsage){
        meshNode->getComponent<PhysicsComponent>()->setPhysicsGroup(data.physicsPushable ? PhysicsComponent::NODE_COLLIDE : PhysicsComponent::NODE_COLLIDE_NO_PUSH);
    }
    if(data.useHighDetailNavMesh){
        meshNode->getComponent<NavigationComponent>()->setNavigationDetailOverride(true);
    }
    return true;
}

bool Scene::loadGeometry(const FileData& data){
    Object3D* thisObj;
    ResourceDescriptor item(data.ItemName);
    item.setResourceLocation(data.ModelName);
    if(data.ModelName.compare("Box3D") == 0) {
            thisObj = CreateResource<Box3D>(item);
            dynamic_cast<Box3D*>(thisObj)->setSize(data.data);
    } else if(data.ModelName.compare("Sphere3D") == 0) {
            thisObj = CreateResource<Sphere3D>(item);
            dynamic_cast<Sphere3D*>(thisObj)->setRadius(data.data);
    } else if(data.ModelName.compare("Quad3D") == 0)	{
            vec3<F32> scale = data.scale;
            vec3<F32> position = data.position;
            P32 quadMask; quadMask.i = 0; quadMask.b.b0 = 1;
            item.setBoolMask(quadMask);
            thisObj = CreateResource<Quad3D>(item);
            dynamic_cast<Quad3D*>(thisObj)->setCorner(Quad3D::TOP_LEFT,vec3<F32>(0,1,0));
            dynamic_cast<Quad3D*>(thisObj)->setCorner(Quad3D::TOP_RIGHT,vec3<F32>(1,1,0));
            dynamic_cast<Quad3D*>(thisObj)->setCorner(Quad3D::BOTTOM_LEFT,vec3<F32>(0,0,0));
            dynamic_cast<Quad3D*>(thisObj)->setCorner(Quad3D::BOTTOM_RIGHT,vec3<F32>(1,0,0));
    } else if(data.ModelName.compare("Text3D") == 0) {
            ///set font file
            item.setResourceLocation(data.data3);
            item.setPropertyList(data.data2);
            thisObj = CreateResource<Text3D>(item);
            dynamic_cast<Text3D*>(thisObj)->getWidth() = data.data;
    }else{
        ERROR_FN(Locale::get("ERROR_SCENE_UNSUPPORTED_GEOM"),data.ModelName.c_str());
        return false;
    }
    Material* tempMaterial = XML::loadMaterial(data.ItemName+"_material");
    if(!tempMaterial){
        ResourceDescriptor materialDescriptor(data.ItemName+"_material");
        tempMaterial = CreateResource<Material>(materialDescriptor);
        tempMaterial->setDiffuse(data.color);
    }

    thisObj->setMaterial(tempMaterial);
    SceneGraphNode* thisObjSGN = _sceneGraph->getRoot()->addNode(thisObj);
    thisObjSGN->getTransform()->scale(data.scale);
    thisObjSGN->getTransform()->rotateEuler(data.orientation);
    thisObjSGN->getTransform()->translate(data.position);
    thisObjSGN->setCastsShadows(data.castsShadows);
    thisObjSGN->setReceivesShadows(data.receivesShadows);
    if(data.staticUsage){
        thisObjSGN->setUsageContext(SceneGraphNode::NODE_STATIC);
    }
    if(data.navigationUsage){
        thisObjSGN->getComponent<NavigationComponent>()->setNavigationContext(NavigationComponent::NODE_OBSTACLE);
    }
    if(data.physicsUsage){
        thisObjSGN->getComponent<PhysicsComponent>()->setPhysicsGroup(data.physicsPushable ? PhysicsComponent::NODE_COLLIDE : PhysicsComponent::NODE_COLLIDE_NO_PUSH);
    }
    if(data.useHighDetailNavMesh){
        thisObjSGN->getComponent<NavigationComponent>()->setNavigationDetailOverride(true);
    }
    return true;
}

ParticleEmitter* Scene::getParticleEmitter(const std::string& name){
    ParticleEmitterMap::const_iterator emitterIt = _particleEmitters.find(name);
    if(emitterIt != _particleEmitters.end()){
        return _particleEmitters[name];
    }
    return nullptr;
}

ParticleEmitter* Scene::addParticleEmitter(const std::string& name, const ParticleEmitterDescriptor& descriptor){
   ParticleEmitterMap::const_iterator emitterIt = _particleEmitters.find(name);
   if(emitterIt != _particleEmitters.end()){
       RemoveResource(_particleEmitters[name]);
   }

   ResourceDescriptor particleEmitter(name);
   ParticleEmitter* temp = CreateResource<ParticleEmitter>(particleEmitter);    
   _particleEmitters[name] = temp;
   temp->setDescriptor(descriptor);
   return temp;
}

SceneGraphNode* Scene::addLight(Light* const lightItem, SceneGraphNode* const parentNode){
    SceneGraphNode* returnNode = nullptr;
    if(parentNode)
        returnNode = parentNode->addNode(lightItem);
    else
        returnNode = _sceneGraph->getRoot()->addNode(lightItem);

    return returnNode;
}

DirectionalLight* Scene::addDefaultLight(){
    std::stringstream ss; ss << LightManager::getInstance().getLights().size();
    ResourceDescriptor defaultLight("Default directional light "+ss.str());
    defaultLight.setId(0); //descriptor ID is not the same as light ID. This is the light's slot!!
    defaultLight.setResourceLocation("root");
    defaultLight.setEnumValue(LIGHT_TYPE_DIRECTIONAL);
    DirectionalLight* l = dynamic_cast<DirectionalLight*>(CreateResource<Light>(defaultLight));
    l->setCastShadows(true);
    addLight(l);
    vec3<F32> ambientColor(0.1f, 0.1f, 0.1f);
    LightManager::getInstance().setAmbientLight(ambientColor);
    return l;
}
///Add skies
Sky* Scene::addDefaultSky(){
    STUBBED("ToDo: load skyboxes from XML")
    Sky* tempSky = New Sky("Default Sky");
    _skiesSGN.push_back(_sceneGraph->getRoot()->addNode(tempSky));
    return tempSky;
}

SceneGraphNode* Scene::addGeometry(SceneNode* const object,const std::string& sgnName){
    return _sceneGraph->getRoot()->addNode(object,sgnName);
}

bool Scene::removeGeometry(SceneNode* node){
    if(!node) {
        ERROR_FN(Locale::get("ERROR_SCENE_DELETE_NULL_NODE"));
        return false;
    }
    SceneGraphNode* _graphNode = _sceneGraph->findNode(node->getName());

    SAFE_DELETE_CHECK(_graphNode);
}

bool Scene::preLoad() {
    _GFX.enableFog(_sceneState.getFogDesc()._fogDensity,
                   _sceneState.getFogDesc()._fogColor);
    return true;
}

bool Scene::load(const std::string& name, CameraManager* const cameraMgr, GUI* const guiInterface){
    _GUI = guiInterface;
    _name = name;
    renderState()._cameraMgr = cameraMgr;
    preLoad();
    loadXMLAssets();
    SceneGraphNode* root = _sceneGraph->getRoot();
    //Add terrain from XML
    if(!_terrainInfoArray.empty()){
        for(U8 i = 0; i < _terrainInfoArray.size(); i++){
            ResourceDescriptor terrain(_terrainInfoArray[i]->getVariable("terrainName"));
            Terrain* temp = CreateResource<Terrain>(terrain);
            SceneGraphNode* terrainTemp = root->addNode(temp);
            terrainTemp->setActive(_terrainInfoArray[i]->getActive());
            terrainTemp->setUsageContext(SceneGraphNode::NODE_STATIC);
            terrainTemp->getComponent<NavigationComponent>()->setNavigationContext(NavigationComponent::NODE_OBSTACLE);
            terrainTemp->getComponent<PhysicsComponent>()->setPhysicsGroup(_terrainInfoArray[i]->getCreatePXActor() ? PhysicsComponent::NODE_COLLIDE_NO_PUSH : PhysicsComponent::NODE_COLLIDE_IGNORE);
        }
    }
    //Camera position is overridden in the scene's XML configuration file
    if(ParamHandler::getInstance().getParam<bool>("options.cameraStartPositionOverride")){
        renderState().getCamera().setEye(vec3<F32>(_paramHandler.getParam<F32>("options.cameraStartPosition.x"),
                                                     _paramHandler.getParam<F32>("options.cameraStartPosition.y"),
                                                     _paramHandler.getParam<F32>("options.cameraStartPosition.z")));
        vec2<F32> camOrientation(_paramHandler.getParam<F32>("options.cameraStartOrientation.xOffsetDegrees"),
                                 _paramHandler.getParam<F32>("options.cameraStartOrientation.yOffsetDegrees"));
        renderState().getCamera().setGlobalRotation(camOrientation.y/*yaw*/,camOrientation.x/*pitch*/);
    }else{
        renderState().getCamera().setEye(vec3<F32>(0,50,0));
    }

    //Create an AI thread, but start it only if needed
    Kernel* kernel = Application::getInstance().getKernel();
    _aiTask.reset(kernel->AddTask(1000.0 / Config::AI_THREAD_UPDATE_FREQUENCY, false, false,
                                  DELEGATE_BIND(&AIManager::update, DELEGATE_REF(AIManager::getInstance()))));
    _loadComplete = true;
    return _loadComplete;
}

bool Scene::unload(){
    // prevent double unload calls
    if(!checkLoadFlag()) return false;
    clearTasks();
    clearObjects();
    clearLights();
    clearPhysics();
    _loadComplete = false;
    return true;
}

PhysicsSceneInterface* Scene::createPhysicsImplementation(){
    return PHYSICS_DEVICE.NewSceneInterface(this);
}

bool Scene::loadPhysics(bool continueOnErrors){
    //Add a new physics scene (can be overridden in each scene for custom behavior)
    _physicsInterface = createPhysicsImplementation();
    PHYSICS_DEVICE.setPhysicsScene(_physicsInterface);
    //Initialize the physics scene
    PHYSICS_DEVICE.initScene();
    //Cook geometry
    if(_paramHandler.getParam<bool>("options.autoCookPhysicsAssets"))
        _cookCollisionMeshesScheduled = true;
    return true;
}

void Scene::clearPhysics(){
    if(_physicsInterface){
        _physicsInterface->exit();
        SAFE_DELETE(_physicsInterface);
    }
}

bool Scene::initializeAI(bool continueOnErrors)   {
    _aiTask->startTask();
    return true;
}

bool Scene::deinitializeAI(bool continueOnErrors) {	///Shut down AIManager thread
    if(_aiTask.get()){
        _aiTask->stopTask();
        _aiTask.reset();
    }
    while(_aiTask.get()){};
    return true;
}

void Scene::clearObjects(){
    for(U8 i = 0; i < _terrainInfoArray.size(); ++i){
        RemoveResource(_terrainInfoArray[i]);
    }
    _skiesSGN.clear(); //< Skies are cleared in the SceneGraph
    _terrainInfoArray.clear();
    while(!_modelDataArray.empty())
        _modelDataArray.pop();
    _vegetationDataArray.clear();

    _particleEmitters.clear();
    SAFE_DELETE(_sceneGraph);
}

void Scene::clearLights(){
    LightManager::getInstance().clear();
}

bool Scene::updateCameraControls(){

    Camera& cam = renderState().getCamera();
    switch (cam.getType()){
        default:
        case Camera::FREE_FLY:{
            if (state()._angleLR) cam.rotateYaw(state()._angleLR);
            if (state()._angleUD) cam.rotatePitch(state()._angleUD);
            if (state()._roll)    cam.rotateRoll(state()._roll);
            if (state()._moveFB)  cam.moveForward(state()._moveFB);
            if (state()._moveLR)  cam.moveStrafe(state()._moveLR);
        }break;
    }

    state()._cameraUpdated =  (state()._moveFB || state()._moveLR || state()._angleLR || state()._angleUD || state()._roll);
    return state()._cameraUpdated;
}

void Scene::updateSceneState(const U64 deltaTime){
    updateSceneStateInternal(deltaTime);
    state()._cameraUnderwater = renderState().getCamera().getEye().y < state()._waterHeight;
    _sceneGraph->sceneUpdate(deltaTime, _sceneState);
}

void Scene::deleteSelection(){
    if(_currentSelection != nullptr){
        _currentSelection->scheduleDeletion();
    }
}

void Scene::addTask(Task_ptr taskItem) {
    _tasks.push_back(taskItem);
}

void Scene::clearTasks(){
    PRINT_FN(Locale::get("STOP_SCENE_TASKS"));
    for(Task_ptr& task : _tasks){
        task->stopTask();
    }
    _tasks.clear();
}

void Scene::removeTask(Task_ptr taskItem){
    taskItem->stopTask();

    for(vectorImpl<Task_ptr>::iterator it = _tasks.begin(); it != _tasks.end(); it++){
        if((*it)->getGUID() == taskItem->getGUID()){
            _tasks.erase(it);
            return;
        }
    }
}

void Scene::removeTask(U32 guid){
    for(vectorImpl<Task_ptr>::iterator it = _tasks.begin(); it != _tasks.end(); it++){
        if((*it)->getGUID() == guid){
            (*it)->stopTask();
            _tasks.erase(it);
            return;
        }
    }
}

void Scene::processGUI(const U64 deltaTime){
    for (U16 i = 0; i < _guiTimers.size(); ++i)
        _guiTimers[i] += getUsToMs(deltaTime);
}

void Scene::processTasks(const U64 deltaTime){
    for(U16 i = 0; i < _taskTimers.size(); ++i)
        _taskTimers[i] += getUsToMs(deltaTime);
}

TerrainDescriptor* Scene::getTerrainInfo(const std::string& terrainName) {
    for (U8 i = 0; i < _terrainInfoArray.size(); i++)
    if (terrainName.compare(_terrainInfoArray[i]->getVariable("terrainName")) == 0)
        return _terrainInfoArray[i];

    DIVIDE_ASSERT(false, "Scene error: INVALID TERRAIN NAME FOR INFO LOOKUP"); // not found;
    return _terrainInfoArray[0];
}

Commits for Divide-Framework/trunk/Source Code/Scenes/Scene.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]]

279 Diff Diff IonutCava picture IonutCava Sat 28 Jun, 2014 16:20:46 +0000

[Ionut][[BR]]
- Unified draw command system into GenericDrawCommand [[BR]]
- Fixed double VB creation in Object3D [[BR]]
- Reworked triangle data computation (now Object3D’s responsibility) [[BR]]
- VertexArrays can now render using the primitive type specified in the draw command instead of the fixed type specified at creation [[BR]]
- Optimized terrain shader [[BR]]

273 Diff Diff IonutCava picture IonutCava Wed 11 Jun, 2014 20:34:00 +0000

[Ionut] [[BR]]
- Improved batching part2: [[BR]]
— Moved all bone transformation matrices upload from uniform functions in SceneNode to Shader Storage Buffers in AnimationController class with updates controlled by SceneGraphNode’s AnimationComponent [[BR]]
-— No double-buffering or efficient mapping of data yet. Just raw buffer updates [[BR]]
— Replaced all RenderStateBlock* pointers with I64 hash values [[BR]]
-— Will be used later in draw commands as per-shader state hash [[BR]]
— Moved getShaderProgram from Material to Material::ShaderInfo [[BR]]
-— Improved redundant uniform checks [[BR]]
— Improved texture unit changing in case of redundant texture bind case (i.e. skip changing the texture unit) [[BR]]
[[BR]]
- Improved float and double comparison functions using algorithms described in http://randomascii.wordpress.com/2012/02/13/dont-store-that-in-a-float/ [[BR]]
- Added a new utility function, DIVIDE_ASSERT, to more easily bind an assert check with a specific message [[BR]]
- Added missing files from Forward+ renderer’s initial code [[BR]]

264 Diff Diff k1ngp1n picture k1ngp1n Tue 27 May, 2014 13:04:38 +0000

[Ionut] [[BR]]
- New camera system: [[BR]]
— Stack based (push/pop active camera) [[BR]]
— Per camera frustum [[BR]]
— Per camera projection [[BR]]
— Shadow mapping now uses the new camera system (each light has a shadow camera) [[BR]]
[[BR]]
- New terrain, water and vegetation system: [[BR]]
— Direct import of terrain from L3DT both as 8-bit grayscale and 16-bit raw formats [[BR]]
— Multiple alpha maps for texture splatting support [[BR]]
— Per texture detail map support [[BR]]
— Transform feedback based visibility culling for vegetation [[BR]]
— Alpha-map based vegetation placing on terrain [[BR]]
— Water now uses a refraction map instead of alpha blending for better refraction effects [[BR]]
[[BR]]
- SceneGraph improvements: [[BR]]
— Better bounding box updates from child to parent [[BR]]
— Better onDraw / postDraw implementation [[BR]]
[[BR]]
- Performance improvements: [[BR]]
— Batch 2D rendering tasks together as much as possible[[BR]]
— Improve renderStateBlock hash generation for better sorting [[BR]]
— Move most state related gfx changes from API implementation to the GFXDevice class [[BR]]
— Move viewport stack to the GFXDevice class [[BR]]
— Added various performance counters (frame duration with round-robin query system, draw call count, etc) [[BR]]
— Fixed and improved clip plane management [[BR]]
— Delete client-side texture data after GPU upload [[BR]]
[[BR]]
- New features: [[BR]]
— Added callback support to the Task class so that a specific task may call a function in the main thread upon completion [[BR]]
— Added mouse-wheel zoom support to Orbit/ThirdPerson cameras [[BR]]
— Added 2D Texture Array support (e.g. used for terrain textures) [[BR]]

262 Diff Diff k1ngp1n picture k1ngp1n Tue 06 May, 2014 21:04:00 +0000

[Ionut] [[BR]]
- Some AI refactoring (basic AIEntity <-> AESOP interoperability) [[BR]]
- Some render batch sorting code refactored and fixed (wasn’t properly sorted in FINAL_STAGE) [[BR]]
- Simplified RenderStateBlockDescriptor and deferred hash value calculation [[BR]]
- Basic draw call count implementation [[BR]]
- Renamed some classes [[BR]]

260 Diff Diff k1ngp1n picture k1ngp1n Sat 03 May, 2014 19:33:41 +0000

[Ionut] [[BR]]
- More work on CSM. Reverted back to VSM to allow easier blurring and filtering [[BR]]
- Rewrote FrameBuffer classes to fix MSAA and memory leaks that occurred on resize (double creation of textures) [[BR]]
— Removed FBType. FrameBuffer types depend only on attachment types and if it’s MSAA enabled or not [[BR]]
- Rewrote RenderState classes to be API agnostic [[BR]]
- Bug fixes in math classes [[BR]]
- Changed “resolution change” logic [[BR]]
- Simplified some options in config.xml [[BR]]
- Improved per-light shadow options [[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]]

258 Diff Diff k1ngp1n picture k1ngp1n Tue 15 Apr, 2014 15:26:22 +0000

[Ionut]
- Bumped minimum OpenGL required version to 4.3 (any Fermi and GCN 1.1 GPU)
- Fixed an issue with opacity maps
- Improved loading times by optimizing console output system and various optimizations in DVDConverter
- Create GUIConsole when needed (not on load)
- Moved common control code to the Scene class

257 Diff Diff k1ngp1n picture k1ngp1n Sun 13 Apr, 2014 17:30:59 +0000

[Ionut] [[BR]]
- Some C++11 code stuff here and there [[BR]]

254 k1ngp1n picture k1ngp1n Wed 09 Apr, 2014 15:25:42 +0000

[Ionut] [[BR]]
- Fixed a bug from previous commit with stringstream clearing [[BR]]
- Extended the SceneGraphNode component system to include navigation and physics components [[BR]]
- Code cleanups [[BR]]