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

#include "ASIO.h"
#include "GUI/Headers/GUI.h"
#include "GUI/Headers/GUIConsole.h"
#include "Utility/Headers/XMLParser.h"
#include "Managers/Headers/SceneManager.h" //Object selection
#include "Managers/Headers/AIManager.h"
#include "Environment/Terrain/Headers/Terrain.h"
#include "Environment/Terrain/Headers/TerrainDescriptor.h"
#include "Geometry/Shapes/Headers/Mesh.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"

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

	bool _updated = false;
	if(!PendingDataArray.empty())
	for(std::vector<FileData>::iterator iter = PendingDataArray.begin(); iter != PendingDataArray.end(); ++iter) {

		if(!loadModel(*iter)){

			WorldPacket p(CMSG_REQUEST_GEOMETRY);
			p << (*iter).ModelName;
			ASIO::getInstance().sendPacket(p);
			while(!loadModel(*iter)){
				PRINT_FN("Waiting for file .. ");
			}
		}else{
			std::vector<FileData>::iterator iter2;
			for(iter2 = ModelDataArray.begin(); iter2 != ModelDataArray.end(); ++iter2)	{
				if((*iter2).ItemName.compare((*iter).ItemName) == 0){
					ModelDataArray.erase(iter2);
					ModelDataArray.push_back(*iter);
					PendingDataArray.erase(iter);
					_updated = true;
					break;
				}
			}
			if(_updated) break;
			
		}
	}
	return true;
}

void Scene::addPatch(std::vector<FileData>& data){
	/*for(vector<FileData>::iterator iter = data.begin(); iter != data.end(); iter++)
	{
		for(unordered_map<string,Object3D*>::iterator iter2 = GeometryArray.begin(); iter2 != GeometryArray.end(); iter2++)
			if((iter2->second)->getName().compare((*iter).ModelName) == 0)
			{
				boost::mutex::scoped_lock l(_mutex);
				PendingDataArray.push_back(*iter);
				(iter2->second)->scheduleDeletion();
				GeometryArray.erase(iter2);
				break;
			}
	}*/
}


void Scene::setInitialData(){
	for(std::vector<FileData>::iterator it = ModelDataArray.begin(); it != ModelDataArray.end();){
		//vegetation is loaded elsewhere
		if((*it).type == VEGETATION){
			VegetationDataArray.push_back(*it);
			it = ModelDataArray.erase(it);
		}else{
			loadModel(*it);
			++it;
		}

	}
}	

bool Scene::loadModel(const FileData& data){

	if(data.type == PRIMITIVE)	return loadGeometry(data);

	ResourceDescriptor model(data.ItemName);
	model.setResourceLocation(data.ModelName);
	model.setFlag(true);
	Mesh *thisObj = CreateResource<Mesh>(model);
	if (!thisObj){
		ERROR_FN("SceneManager: Error loading model [ %s ]",  data.ModelName.c_str());
		return false;
	}
	SceneGraphNode* meshNode = _sceneGraph->getRoot()->addNode(thisObj);

	meshNode->getTransform()->scale(data.scale);
	meshNode->getTransform()->rotateEuler(data.orientation);
	meshNode->getTransform()->translate(data.position);
	
	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;
			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) {
		
			thisObj =CreateResource<Text3D>(item);
			dynamic_cast<Text3D*>(thisObj)->getWidth() = data.data;
			dynamic_cast<Text3D*>(thisObj)->getText() = data.data2;
	}else{
		ERROR_FN("SCENEMANAGER: Error adding unsupported geometry to scene: [ %s ]",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);
		tempMaterial->setAmbient(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);
	return true;
}

void Scene::addLight(Light* const lightItem){
	LightManager::getInstance().addLight(lightItem);
}

Light* Scene::addDefaultLight(){

	std::stringstream ss; ss << LightManager::getInstance().getLights().size();
	ResourceDescriptor defaultLight("Default omni light "+ss.str());
	defaultLight.setId(0); //descriptor ID is not the same as light ID. This is the light's slot!!
	defaultLight.setResourceLocation("root");
	Light* l = CreateResource<Light>(defaultLight);
	l->setLightType(LIGHT_DIRECTIONAL);
	_sceneGraph->getRoot()->addNode(l);
	addLight(l);
	vec4<F32> ambientColor(0.1f, 0.1f, 0.1f, 1.0f);
	LightManager::getInstance().setAmbientLight(ambientColor);
	return l;	
}

SceneGraphNode* Scene::addGeometry(Object3D* const object){
	return _sceneGraph->getRoot()->addNode(object);
}

bool Scene::removeGeometry(SceneNode* node){
	if(!node) {
		ERROR_FN("Trying to delete NULL scene node!");
		return false;
	}
	SceneGraphNode* _graphNode = _sceneGraph->findNode(node->getName());

	SAFE_DELETE_CHECK(_graphNode);

}

bool Scene::load(const std::string& name){
	SceneGraphNode* root = _sceneGraph->getRoot();
	if(TerrainInfoArray.empty()) return true;
	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->useDefaultTransform(false);
		terrainTemp->setTransform(NULL);
		terrainTemp->setActive(TerrainInfoArray[i]->getActive());
		temp->initializeVegetation(TerrainInfoArray[i]);
	}
	return true;
}

bool Scene::unload(){
	clearEvents();
	//_inputEvent.get()->stopEvent();
	//_inputEvent.reset();
	if(_aiEvent.get()){
		_aiEvent.get()->stopEvent();
		_aiEvent.reset();
	}
	_inputManager.terminate();
	_inputManager.DestroyInstance();

	SAFE_DELETE(_lightTexture);
	SAFE_DELETE(_deferredBuffer);

	if(_deferredShader != NULL){
		RemoveResource(_deferredShader);
	}
	AIManager::getInstance().Destroy();
	AIManager::getInstance().DestroyInstance();
	clearObjects();
	clearLights();
	return true;
}

void Scene::clearObjects(){
	for(U8 i = 0; i < TerrainInfoArray.size(); i++){
		RemoveResource(TerrainInfoArray[i]);
	}
	TerrainInfoArray.clear();
	ModelDataArray.clear();
	VegetationDataArray.clear();
	PendingDataArray.clear();
	assert(_sceneGraph);

	SAFE_DELETE(_sceneGraph);
}

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

void Scene::clearEvents()
{
	PRINT_FN("Stopping all events ...");
	_events.clear();
}

void Scene::onMouseMove(const OIS::MouseEvent& key){
	GUI::getInstance().checkItem(key.state.X.abs,key.state.Y.abs);
}

void Scene::processInput(){
	_inputManager.tick();
	//AIManager::getInstance().tick();
}

bool Scene::loadEvents(bool continueOnErrors){
	//Running the input manager through a separate thread degrades performance. Enable at your own risk - Ionut
	//_inputEvent.reset(New Event(1,true,false,boost::bind(&InputManagerInterface::tick, boost::ref(InputManagerInterface::getInstance()))));
	_aiEvent.reset(New Event(3,false,false,boost::bind(&AIManager::tick,boost::ref(AIManager::getInstance()))));
	return true;
}

void Scene::onMouseClickDown(const OIS::MouseEvent& key,OIS::MouseButtonID button){
	switch(button){
		case OIS::MB_Left:{
			GUI::getInstance().clickCheck();
		}break;

		case OIS::MB_Right:{
		}break;

		case OIS::MB_Middle:{
		}break;

		case OIS::MB_Button3:
		case OIS::MB_Button4:
		case OIS::MB_Button5:
		case OIS::MB_Button6:
		case OIS::MB_Button7:
		default:
			break;
	}
}

void Scene::onMouseClickUp(const OIS::MouseEvent& key,OIS::MouseButtonID button){

	switch(button){
		case OIS::MB_Left:{
			GUI::getInstance().clickReleaseCheck();
		}break;

		case OIS::MB_Right:	{
		}break;

		case OIS::MB_Middle:{
		}break;

		case OIS::MB_Button3:
		case OIS::MB_Button4:
		case OIS::MB_Button5:
		case OIS::MB_Button6:
		case OIS::MB_Button7:
		default:
			break;
	}
}

static F32 speedFactor = 0.25f;
void Scene::onKeyDown(const OIS::KeyEvent& key){

	switch(key.key){
		case OIS::KC_LEFT : 
			_angleLR = -(speedFactor/5);
			break;
		case OIS::KC_RIGHT : 
			_angleLR = speedFactor/5;
			break;
		case OIS::KC_UP : 
			_angleUD = -(speedFactor/5);
			break;
		case OIS::KC_DOWN : 
			_angleUD = speedFactor/5;
			break;
		case OIS::KC_END:
			SceneManager::getInstance().deleteSelection();
			break;
		case OIS::KC_F2:{
			PRINT_FN("Toggling Skeleton Visibility");
			SceneManager::getInstance().toggleSkeletons();
			}break;
		case OIS::KC_B:{
			PRINT_FN("Toggling Bounding Boxes");
			SceneManager::getInstance().toggleBoundingBoxes();
			}break;
		case OIS::KC_ADD:
			if (speedFactor < 10)  speedFactor += 0.1f;
			break;
		case OIS::KC_SUBTRACT:
			if (speedFactor > 0.1f)   speedFactor -= 0.1f;
			break;
		case OIS::KC_F10:
			LightManager::getInstance().togglePreviewDepthMaps();
			break;
		case OIS::KC_F12:
			GFX_DEVICE.Screenshot("screenshot_",vec4<F32>(0,0,Application::getInstance().getWindowDimensions().x,Application::getInstance().getWindowDimensions().y));
			break;
		default:
			break;
	}
}

void Scene::onKeyUp(const OIS::KeyEvent& key){

	switch( key.key ){
		case OIS::KC_LEFT:
		case OIS::KC_RIGHT:
			_angleLR = 0.0f;
			break;
		case OIS::KC_UP:
		case OIS::KC_DOWN:
			_angleUD = 0.0f;
			break;
		case OIS::KC_F:
			_paramHandler.setParam("enableDepthOfField", !_paramHandler.getParam<bool>("enableDepthOfField")); 
			break;
//		case OIS::KC_GRAVE: ///tilde
//			GUI::getInstance().toggleConsole();
//			break;
		default:
			break;
	}
}

void Scene::OnJoystickMoveAxis(const OIS::JoyStickEvent& key,I8 axis){

	if(axis == 1){
		if(key.state.mAxes[axis].abs > 0)
			_angleLR = speedFactor/5;
		else if(key.state.mAxes[axis].abs < 0)
			_angleLR = -(speedFactor/5);
		else
			_angleLR = 0;

	}else if(axis == 0){

		if(key.state.mAxes[axis].abs > 0)
			_angleUD = speedFactor/5;
		else if(key.state.mAxes[axis].abs < 0)
			_angleUD = -(speedFactor/5);
		else
			_angleUD = 0;
	}
}

void Scene::updateSceneState(D32 sceneTime){
	_sceneGraph->sceneUpdate(sceneTime);
}

Commits for Divide-Framework/trunk/Source Code/Scenes/Scene.cpp

Diff revisions: vs.
Revision Author Commited Message
117 Diff Diff k1ngp1n picture k1ngp1n Tue 05 Jun, 2012 17:30:40 +0000

[Ionut] [[BR]]
-Separated responsibilities between “Application” and “Kernel” [[BR]]
--“Application” handles data such as window dimensions, logs, “ParamHandler” etc [[BR]]
--“Kernel” handles the main loop, SFX, GFX, physics, sceneManager etc updates [[BR]]
---“Kernel” is now a “Core” component [[BR]]
-Reduced coupling between some classes by passing more info via parameters rather than relying on singleton access [[BR]]
--Ex: eyePos in “Terrain”,“Water” and “Trigger” classes is now passed as a "vec3<F32>" on render call rather than querying “CameraManager” [[BR]]
-Reworked “GLWrapper” shutdown routine [[BR]]
Singleton witch hunt [[BR]]
-“Kernel” is no longer a singleton and it’s initialized on application startup in the “Application” class[[BR]]
-“CameraManager” is no longer a singleton and it’s instantiated in the kernel [[BR]]

116 Diff Diff k1ngp1n picture k1ngp1n Mon 04 Jun, 2012 22:27:07 +0000

[Ionut] [[BR]]
-Removed now useless “BaseCache” class as a simple unordered_map in each manager-type class is all that’s needed [[BR]]
-Moved loading responsibility from each Resource implementation to each "ImplResourceLoader<T>" class (defaults via macro’s are available for convenience) [[BR]]
--Resources now have a “setInitialData” method for setting post-load values [[BR]]
--Also added a loader for Particle Emitters [[BR]]
-Added a new class, “HardwareResource” (for textures, shaders, etc) that needs special loading routines to facilitate future multi-threaded asset streaming [[BR]]
--HardwareResource’s have a “generateHWResource” that should be called after threaded loading routines join with main thread [[BR]]
-Renamed “Guardian” class to “Kernel” as that’s what it’s new responsibility will be in future revisions [[BR]]
-Added the “threadpool” library from here: http://threadpool.sourceforge.net/ (not used yet) [[BR]]
-Added some more macro’s and cleanups [[BR]]

113 Diff Diff k1ngp1n picture k1ngp1n Fri 01 Jun, 2012 16:51:23 +0000

[Ionut] [[BR]]
-Fixed animated bounding box calculations[[BR]]
-BoundingBox recalculation per frame is now a general SceneNode property [[BR]]
--Note: Animated BB’s have problems with multi-threaded collision detection for now (see AITenisScene) [[BR]]
-Wrapped boost::mutex to separate file and moved it to shared_mutex structure as read requests are more frequent than write requests [[BR]]
-Mesh class now calls animations update on all of it’s subclasses so animations for each node in a mesh are in sync [[BR]]
-Split up GUI elements by class [[BR]]
-Added base code for a console GUI element (disabled) [[BR]]
-Animations can now be disabled in confg file [[BR]]
-Added a “texture not found” default texture [[BR]]
-Some AI rewrite in AITenisScene (translation to english in next commit) [[BR]]
-Inlines, const’s, cleanups, etc [[BR]]

111 Diff Diff k1ngp1n picture k1ngp1n Tue 08 May, 2012 21:49:31 +0000

[Ionut] [[BR]]
-Added animation support based on Scott Lee’s animation loader library added a few revision’s back [[BR]]
--Added cached skeleton rendering to the library [[BR]]
--Added cached AABB transformations based on current animation frame [[BR]]
--Scene animators are added per submesh and only processed if said submesh is visible and only in the rendering stage: FINAL_STAGE [[BR]]
[[BR]]
-Added support for shader-based VBO data upload (glVertexAttribPointer) with full backwards compatibility to old method (glTexCoordPointer)[[BR]]
-Added support for Index Buffer Object (improper name) indice upload for VBO’s with full backwards compatibility to old method [[BR]]
-Reworked coordination class to better handle AIEntity teams [[BR]]
-Added “updateSceneState(currentTime)” callback that is called once per frame (used for animation update)[[BR]]
-Added “initializeAI/deinitializeAI” scene callbacks for AI creation/destruction [[BR]]
-Templatized the Quaternion class [[BR]]
-Added a “drawLines” subroutine to the rendering api[[BR]]
-Disabled tree loading in MainScene as current ASSIMP implementation is slow. Will be restored after backing and loading models to own format is added in next revision [[BR]]
-Other various small performance tweaks [[BR]]

106 Diff Diff k1ngp1n picture k1ngp1n Wed 28 Mar, 2012 21:50:23 +0000

[Ionut] [[BR]]
Unstable revision – New animation code is not yet optimized and loading performance is low [[BR]]
[[BR]]
-Added animation loading and bone matrix calculations (actual skinning not implemented yet)[[BR]]
-Modified VBO classes to support dynamic data and faster updates [[BR]]
-Templatized Math classes (vec2,vec3,vec4,mat3,mat4) for greater flexibility [[BR]]
-Separated Rendering API from Rendering API version [[BR]]
-Fixed buggy GL error checking [[BR]]
-Small bugs fixed in Projectile and Weapon classes [[BR]]

103 Diff Diff k1ngp1n picture k1ngp1n Mon 12 Mar, 2012 19:06:00 +0000

[Ionut] [[BR]]
Features: [[BR]]
-Added a proper RenderState Management system similar to the D3D default one[[BR]]
--All possible states are managed: cull, blend, alpha-blend, color mask, lighting, stencil mask, fill mode etc [[BR]]
--Every material has different states for normal rendering, shadow rendering and reflection rendering [[BR]]
--Nodes are sorted by shader first then by state hash depending on current render stage [[BR]]
--Redundant states are not changed [[BR]]
--Every entity submits it’s desired state before render [[BR]]
--Every state is checked before rendering a VBO or other primitive type[[BR]]
[[BR]]
-Added a Reflector base class used for reflection calculations and updates (useful for water, mirrors, portals etc)[[BR]]
--Reflections are triggered between pre-render and render calls [[BR]]
--Water now derives from Reflector class as well [[BR]]
[[BR]]
-Material now properly calculates if it has transparency or is double sided, setting desired states to handle this feature (cull, blend) [[BR]]
-Added some basic defines or inline template functions to facilitate access to useful classes and methods (hardware devices, resource management, console printing, etc) [[BR]]
-Lights are updated after every camera update[[BR]]
-Added a new FrameListener event triggered after pre-render call is finished (used by reflectors) [[BR]]
-Added a CRC class to compute unique hash values for entities[[BR]]
-Added D3D dummy files [[BR]]
-Removed executables from subversion [[BR]]
Performance: [[BR]]
-Image loading has been improved a bit [[BR]]
-Terrain texel density now varies with LOD level [[BR]]
-Light API specific calls,except position, are set only if values changed[[BR]]
-Specific GUI casting and rendering are the Rendering API’s job now, not the GUI class [[BR]]
-Rendering Queue processing is now more efficient in sorting valid visible nodes and setting appropriate states/materials
[[BR]]
Bug fixes: [[BR]]
-Better drawState checks[[BR]]
-Proper light effects in deferred rendering[[BR]]
-Light dummy now renders properly[[BR]]
-Reworked bounding box computation [[BR]]
[[BR]]
Known bugs: [[BR]]
-Terrain infinite plain still not visible [[BR]]
-Some z-fighting occurs when looking at certain objects from a distance. (looking at another object and back again fixes it) [[BR]]

100 Diff Diff k1ngp1n picture k1ngp1n Mon 05 Mar, 2012 17:45:11 +0000

[Ionut] [[BR]]
Features: [[BR]]
-Added a physics system interface instead of direct PhysX interaction to allow other physics engines (Bullet, ODE etc) to be easily implemented [[BR]]
--This will aid in Object-Object collisions and character control in future revisions [[BR]]
-Added an Ogre3D inspired FrameListener which now allows Before-frame/during-frame/after-frame event plugins of callbacks [[BR]]
-Added a renderInViewport system to draw elements in a user defined rectangle on screen [[BR]]
--Current uses: shadowmap preview (F10) [[BR]]
-Separated Shaders from ShaderPrograms[[BR]]
--ShaderPrograms can now use multiple Shaders [[BR]]
-Error output is now sent to errors.log[[BR]]
-All SceneNode based elements now have a postDraw calls as well [[BR]]
-A cubemap generating function has been added to the GFXDevice class[[BR]]
-Added debug only print options to the Console class [[BR]]
[[BR]]
Performance: [[BR]]
-All shadows are now filtered by a faster Gaussian 3x3 blur filter [[BR]]
-All renderables are now sorted and rendered by material/front-to-back/back-to-front, depending on case [[BR]]
-RenderQueue now sorts and queue’s translucent and opaque objects separately[[BR]]
-Shader uniforms/attributes are now cached to reduce number of address calls to the GPU[[BR]]
-Shaders are now cached, so that if multiple ShaderPrograms use an already compiled Shader, that Shader is returned from memory instead of creating a new copy[[BR]]
-Shaders are not unbound/rebound except when an objects demands so (vastly improves performance)[[BR]]
-Reduced calls to glEnable[[BR]]
[[BR]]
Bug fixes: [[BR]]
-Preprocessor configurations now work properly [[BR]]
-Video API is now unloaded before destruction [[BR]]
-Manager base class now properly frees memory [[BR]]
-Materials are saved to XML only if they are changed at any point [[BR]]

99 Diff Diff k1ngp1n picture k1ngp1n Fri 10 Feb, 2012 22:17:24 +0000

[ Ionut ] [[BR]]
- Added a PreRenderStage Builder that allows multiple pre-render stages to be added to the pre-render step [[ BR ]]
--A PreRenderStage is composed of a series of PreRender Operators that generate certain PostFX outputs that are used by the PostFX class [[BR]]
--Each PreRenderOperator, similar to a “plugin”, can use any number of input FBO’s, any input shader and render target to generate an effect [[BR]]
--Rendering pipeline has been modified to allow the specification of current render stage [[BR]]
[[BR]]
Added C++<>Shader attribute passing support for shaders[[BR]]
-Added per-pixel fog [[BR]]
-Fixed some typo’s in uniform names [[BR]]
-Optimized shadow generation pipeline [[BR]]
-Added cast/receive shadow options for materials [[BR]]
-FBO’s now clear color and depth buffers when Begin() is called [[BR]]
-Fixed loading of primitives' material properties [[BR]]
-All shaders now use the same shadowmapping techniques [[BR]]
-Quad3D’s can now be modified by specifying a target rect [[BR]]
-Split the “lighting.frag” shader in 3 variants: one that only applies color properties, one with textures and one with bump-mapping [[BR]]
--This reduces fragment shader complexity for the first 2 shaders [[BR]]
--Each material change will now force a shader recalculation for the object [[BR]]
-Renamed sphere’s “size” member to “radius” [[BR]]

97 Diff Diff k1ngp1n picture k1ngp1n Tue 07 Feb, 2012 15:23:45 +0000

[ Ionut ] [[BR]]
-Restructured code base to a more logical layout [[BR]]
--Geometry folder contains shapes, materials, animations and the importer; Environment folder holds sky, terrain, water, vegetation; etc [[BR]]
--All header files are moved to a “Headers” sub-folder [[BR]]
--Renamed most of the Romanian code/comments/files/folders to English [[BR]]
--Added comments to parts of the code (ongoing from now on) [[BR]]
[[BR]]
-Rewrote the entire lighting system [[BR]]
--Added a LightManager class to handle all lights [[BR]]
---LightManager calls updates and render calls to all lights it manages [[BR]]
--Lights have all needed properties stored in 2 maps (one for vector values, one for float values) [[BR]]
--Added a LightImpostor class that takes the light’s properties and applies it to a dummy sphere [[BR]]
--If a light should draw it’s impostor, the impostor draws the dummy sphere [[BR]]
--Rewrote the Light <-> GFXDevice interaction [[BR]]
---Each light stores it’s type in a variable and passes all properties to the rendering API that then decides what to use based on that type [[BR]]
--Each light handles it’s own ShadowMapping [[BR]]
[[BR]]
-ShadowMapping: [[BR]]
-Each light stores it’s own depth maps and generates them based on it’s type [[BR]]
-LightManager binds all available depth maps and shaders pick them up automatically for use [[BR]]
-Each shadow map (of a total of 3 per light) corresponds to a detail level[[BR]]
-The final shadow map resolution is decided by the shadow detail level set in the config [[BR]]
--Camera and Frustum are set up for shadow rendering and applied to the render callback set for the current light (for example, Scene::render()) [[BR]]
--The light manager tells every light that has “_castShadows = true” to generate shadowmaps automatically after the Scene::PreRender stage [[BR]]
--ShadowMaps are blurred before applied to the fragment’s final color via shaders. [[BR]]
[[BR]]
-Added detail level configuration options [[BR]]
--ToDo: add shaders for each detail level [[BR]]
[[BR]]
-Moved all predefined geometry from immediate mode to VBO’s [[BR]]
--This allowed the rendering pipeline to be more streamlined (one render function for all geometry) [[BR]]
[[BR]]
-Fixed GuiElement visibility toggle [[BR]]
-Fixed GuiText color state problem [[BR]]
-Added FBO texture format options [[BR]]
-VBO rendering uses U16 as default instead of U32 (better for GPU) [[BR]]
-VBO’s now contain BiTangent data as well [[BR]]
-Added OpenGL 2.0 compatibility (not guaranteed!) [[BR]]
-Added static (on load) shader selection based on detail level [[BR]]
-Added SSAO PostFX option, but this won’t work until the implementation of “plugins” for PostFX system [[BR]]
-Optimized/Fixed code based on VisualLint + CppCheck analysis [[BR]]

95 k1ngp1n picture k1ngp1n Sun 29 Jan, 2012 02:01:44 +0000

[Ionut] [[BR]]
-Fixed TBN base normalmapping [[BR]]
-Improved shadow rendering performance by cutting down texturing, shading and culling calls when rendering to depth buffer [[BR]]
-Materials now support opacity maps (and future map support is planned, such as specular and emissive) [[BR]]
-Materials no longer hold pointers to a shader, but rather the shader’s name, preventing some memory leaks for now [[BR]]
-Removed SceneNode::getSceneGraphNode() as it was too buggy. Proper replacement in place [[BR]]
-More work on the render batching system [[BR]]
-Transformations are now applied to meshes before shaders, but support is added to move them in the shaders themselves later [[BR]]
-All shaders now send default matrices upon binding [[BR]]
-Fixed underwater rendering [[BR]]
-8-bit texture loading support added [[BR]]
-Fixed the model importer, as texture paths and materials were not properly [[BR]]
-Trees now get proper shaders again [[BR]]
-Added assimp animation loader by http://nolimitsdesigns.com/game-design/open-asset-import-library-animation-loader/ [[BR]]
--Not used for now. Modified code to compile in framework [[BR]]
-Added a better version of the Sponza Atrium (the Crytek version with fixed maps) [[BR]]
--From: http://graphics.cs.williams.edu/data/meshes.xml [[BR]]
-Fixed some code layout and const correctness [[BR]]