Bläddra i källkod

RecordSO command now properly records a single object instead of the entire hierarchy
Moved documentation into a separate folder and TODO docs outside of the project

BearishSun 10 år sedan
förälder
incheckning
9a7c493976

+ 61 - 62
BansheeEditor/Include/BsCmdRecordSO.h

@@ -1,63 +1,62 @@
-#pragma once
-
-#include "BsEditorPrerequisites.h"
-#include "BsEditorCommand.h"
-#include "BsUndoRedo.h"
-#include "BsCmdUtility.h"
-
-namespace BansheeEngine
-{
-	/**
-	 * @brief	A command used for undo/redo purposes. It records a state of the entire
-	 *			scene object at a specific point and allows you to restore it to its
-	 *			original values as needed.
-	 */
-	class BS_ED_EXPORT CmdRecordSO : public EditorCommand
-	{
-	public:
-		~CmdRecordSO();
-
-		/**
-		 * @brief	Creates and executes the command on the provided scene object.
-		 *			Automatically registers the command with undo/redo system.
-		 *
-		 * @param	sceneObject	Scene object to record.
-		 * @param	description	Optional description of what exactly the command does.
-		 */
-		static void execute(const HSceneObject& sceneObject, const WString& description = StringUtil::WBLANK);
-
-		/**
-		 * @copydoc	EditorCommand::commit
-		 */
-		void commit() override;
-
-		/**
-		 * @copydoc	EditorCommand::revert
-		 */
-		void revert() override;
-
-	private:
-		friend class UndoRedo;
-
-		CmdRecordSO(const WString& description, const HSceneObject& sceneObject);
-
-		/**
-		 * @brief	Saves the state of the specified object, all of its children
-		 *			and components. Make sure to call "clear" when you no longer need
-		 *			the data, or wish to call this method again.
-		 */
-		void recordSO(const HSceneObject& sceneObject);
-
-		/**
-		 * @brief	Clears all the stored data and frees memory.
-		 */
-		void clear();
-
-		HSceneObject mSceneObject;
-		CmdUtility::SceneObjProxy mSceneObjectProxy;
-
-		UINT8* mSerializedObject;
-		UINT32 mSerializedObjectSize;
-		UINT64 mSerializedObjectParentId;
-	};
+#pragma once
+
+#include "BsEditorPrerequisites.h"
+#include "BsEditorCommand.h"
+#include "BsUndoRedo.h"
+#include "BsCmdUtility.h"
+
+namespace BansheeEngine
+{
+	/**
+	 * @brief	A command used for undo/redo purposes. It records a state of the entire
+	 *			scene object at a specific point and allows you to restore it to its
+	 *			original values as needed.
+	 */
+	class BS_ED_EXPORT CmdRecordSO : public EditorCommand
+	{
+	public:
+		~CmdRecordSO();
+
+		/**
+		 * @brief	Creates and executes the command on the provided scene object.
+		 *			Automatically registers the command with undo/redo system.
+		 *
+		 * @param	sceneObject	Scene object to record.
+		 * @param	description	Optional description of what exactly the command does.
+		 */
+		static void execute(const HSceneObject& sceneObject, const WString& description = StringUtil::WBLANK);
+
+		/**
+		 * @copydoc	EditorCommand::commit
+		 */
+		void commit() override;
+
+		/**
+		 * @copydoc	EditorCommand::revert
+		 */
+		void revert() override;
+
+	private:
+		friend class UndoRedo;
+
+		CmdRecordSO(const WString& description, const HSceneObject& sceneObject);
+
+		/**
+		 * @brief	Saves the state of the specified object, all of its children
+		 *			and components. Make sure to call "clear" when you no longer need
+		 *			the data, or wish to call this method again.
+		 */
+		void recordSO(const HSceneObject& sceneObject);
+
+		/**
+		 * @brief	Clears all the stored data and frees memory.
+		 */
+		void clear();
+
+		HSceneObject mSceneObject;
+		CmdUtility::SceneObjProxy mSceneObjectProxy;
+
+		UINT8* mSerializedObject;
+		UINT32 mSerializedObjectSize;
+	};
 }

+ 31 - 13
BansheeEditor/Source/BsCmdRecordSO.cpp

@@ -6,7 +6,7 @@
 namespace BansheeEngine
 {
 	CmdRecordSO::CmdRecordSO(const WString& description, const HSceneObject& sceneObject)
-		:EditorCommand(description), mSceneObject(sceneObject), mSerializedObject(nullptr), mSerializedObjectParentId(0), mSerializedObjectSize(0)
+		:EditorCommand(description), mSceneObject(sceneObject), mSerializedObject(nullptr), mSerializedObjectSize(0)
 	{
 
 	}
@@ -20,7 +20,6 @@ namespace BansheeEngine
 	void CmdRecordSO::clear()
 	{
 		mSerializedObjectSize = 0;
-		mSerializedObjectParentId = 0;
 
 		if (mSerializedObject != nullptr)
 		{
@@ -49,34 +48,53 @@ namespace BansheeEngine
 
 	void CmdRecordSO::revert()
 	{
-		if (mSceneObject == nullptr)
+		if (mSceneObject == nullptr || mSceneObject.isDestroyed())
 			return;
 
-		HSceneObject parent;
-		if (mSerializedObjectParentId != 0)
-			parent = GameObjectManager::instance().getObject(mSerializedObjectParentId);
+		HSceneObject parent = mSceneObject->getParent();
 
-		GameObjectManager::instance().setDeserializationMode(GODM_RestoreExternal | GODM_UseNewIds);
+		UINT32 numChildren = mSceneObject->getNumChildren();
+		Vector<HSceneObject> children(numChildren);
+		for (UINT32 i = 0; i < numChildren; i++)
+		{
+			HSceneObject child = mSceneObject->getChild(i);
+			children[i] = child;
 
-		if (!mSceneObject.isDestroyed())
-			mSceneObject->destroy(true);
+			child->setParent(HSceneObject());
+		}
+
+		mSceneObject->destroy(true);
+
+		GameObjectManager::instance().setDeserializationMode(GODM_RestoreExternal | GODM_UseNewIds);
 
 		MemorySerializer serializer;
 		std::shared_ptr<SceneObject> restored = std::static_pointer_cast<SceneObject>(serializer.decode(mSerializedObject, mSerializedObjectSize));
 
 		CmdUtility::restoreIds(restored->getHandle(), mSceneObjectProxy);
 		restored->setParent(parent);
+
+		for (auto& child : children)
+			child->setParent(restored->getHandle());
 	}
 
 	void CmdRecordSO::recordSO(const HSceneObject& sceneObject)
 	{
+		UINT32 numChildren = mSceneObject->getNumChildren();
+		Vector<HSceneObject> children(numChildren);
+		for (UINT32 i = 0; i < numChildren; i++)
+		{
+			HSceneObject child = mSceneObject->getChild(i);
+			children[i] = child;
+
+			child->setParent(HSceneObject());
+		}
+
 		MemorySerializer serializer;
 		mSerializedObject = serializer.encode(mSceneObject.get(), mSerializedObjectSize);
 
-		HSceneObject parent = mSceneObject->getParent();
-		if (parent != nullptr)
-			mSerializedObjectParentId = parent->getInstanceId();
-
 		mSceneObjectProxy = CmdUtility::createProxy(mSceneObject);
+
+		for (auto& child : children)
+			child->setParent(sceneObject->getHandle());
 	}
 }

+ 1 - 1
BansheeEditor/Source/BsEditorTestSuite.cpp

@@ -441,7 +441,7 @@ namespace BansheeEngine
 		so2_0->setParent(so1_0);
 
 		GameObjectHandle<TestComponentA> cmpA1_1 = so1_1->addComponent<TestComponentA>();
-		GameObjectHandle<TestComponentB> cmpB1_1 = so1_1->addComponent<TestComponentB>();
+		GameObjectHandle<TestComponentB> cmpB1_1 = so0_0->addComponent<TestComponentB>();
 
 		HSceneObject soExternal = SceneObject::create("soExternal");
 		GameObjectHandle<TestComponentA> cmpExternal = soExternal->addComponent<TestComponentA>();

+ 3 - 3
BansheeEngine.sln

@@ -133,9 +133,9 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BansheeFBXImporter", "Bansh
 EndProject
 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Guides", "Guides", "{4259680D-8A9B-4C17-B75B-CA29482AB299}"
 	ProjectSection(SolutionItems) = preProject
-		CompilingDependenciesManually.txt = CompilingDependenciesManually.txt
-		Mono-3.8.0-IntegrationGuide.txt = Mono-3.8.0-IntegrationGuide.txt
-		NVTTCompilationGuide.txt = NVTTCompilationGuide.txt
+		Documentation\CompilingDependenciesManually.txt = Documentation\CompilingDependenciesManually.txt
+		Documentation\Mono-3.8.0-IntegrationGuide.txt = Documentation\Mono-3.8.0-IntegrationGuide.txt
+		Documentation\NVTTCompilationGuide.txt = Documentation\NVTTCompilationGuide.txt
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BansheeSL", "BansheeSL\BansheeSL.vcxproj", "{2BA791F1-87F6-4863-A784-D07FF605AC5E}"

+ 0 - 0
CompilingDependenciesManually.txt → Documentation/CompilingDependenciesManually.txt


+ 0 - 0
Mono-3.8.0-IntegrationGuide.txt → Documentation/Mono-3.8.0-IntegrationGuide.txt


+ 7 - 7
NVTTCompilationGuide.txt → Documentation/NVTTCompilationGuide.txt

@@ -1,8 +1,8 @@
-You might need to make some tweaks to get nvtt to compile on Visual Studio 2013. If you are using the Banshee provided source you do not have to do anything but if you want to compile a newever version of nvtt you might need to perform these steps:
-
-- Make sure to compile using the (no cuda) configurations.
-- In nvmath.h remove sqrt_asset, sqrtf_assert, acos_assert, acosf_assert, asin_assert, asinf_assert (and replace anything that complains about those missing with normal sqrt/sqrtf/acos/acosf/asin/asinf) methods.
-- Remove nvtt.rc resource file from nvtt project.
-- Remove libpng.lib;jpeg.lib;tiff.lib; input libraries from nvtt project
-- Remove ImageIO.h & ImageIO.cpp from nvimage project
+You might need to make some tweaks to get nvtt to compile on Visual Studio 2013. If you are using the Banshee provided source you do not have to do anything but if you want to compile a newever version of nvtt you might need to perform these steps:
+
+- Make sure to compile using the (no cuda) configurations.
+- In nvmath.h remove sqrt_asset, sqrtf_assert, acos_assert, acosf_assert, asin_assert, asinf_assert (and replace anything that complains about those missing with normal sqrt/sqrtf/acos/acosf/asin/asinf) methods.
+- Remove nvtt.rc resource file from nvtt project.
+- Remove libpng.lib;jpeg.lib;tiff.lib; input libraries from nvtt project
+- Remove ImageIO.h & ImageIO.cpp from nvimage project
 - Remove Image::load method from Image.h/Image.cpp in nvimage project

+ 0 - 119
Mono-3.2.3-IntegrationGuide.txt

@@ -1,119 +0,0 @@
-Download mono 3.2.3 source from http://download.mono-project.com/sources/.
-
-Mono can be a bit problematic to compile on Windows as MSVC solution is not maintained very often. 
-Cygwin option that is provided doesn't come with a 64bit configuration, plus it also has errors.
-
---------------------------------------Compiling with Visual Studio 2012 on Windows 7 x64--------------------------------------------------
- - 3.2.3 version is missing "mono.props" file and without it Visual Studio will fail to open some project files. To fix download the .props file 
-   from https://raw.github.com/mono/mono/master/msvc/mono.props and put it in mono-3.2.3\msvc folder before opening any projects or solution
- - Even though solution is VS2010, it will only compile with VS2012 unless you change platform toolkit to 
-   v10 for all projects. (Haven't actually tested with VS2010)
- - If compiler complains it cannot find pthreads.h make sure to define "HAS_64BITS_ATOMIC" in libmonoutils project (for all configurations)
- - In dlmalloc.c change #include <dlmalloc.h> to #include "dlmalloc.h" if compiler complains it cannot find that file
- - In "mono-proclib.c" add this bit of code somewhere near the start of the file:
-
-#ifdef HOST_WIN32
-#define strtoll _strtoi64
-#define strtoull _strtoui64
-#endif
-
-  - In "threads.c" replace a line in ves_icall_System_Threading_Interlocked_CompareExchange_Long method, from:
-
-return InterlockedCompareExchange64 (location, value, comparand);
-
-    to
-
-#ifdef HOST_WIN32
-	return _InterlockedCompareExchange64 (location, value, comparand);
-#else
-	return InterlockedCompareExchange64 (location, value, comparand); 
-#endif
-
-    InterlockedCompareExchange64 is just a typedef for _InterlockedCompareExchange64 on Windows and for some
-	reason compiler doesn't realize it (typedefs to intrinstics don't work?). Anyway, so we just reference the intrinsic
-	directly.
-
-  - In "threads.c" replace a line in ves_icall_System_Threading_Thread_VolatileRead8 method, from:
-
-return InterlockedCompareExchange64 (ptr, 0, 0);
-     
-	to
-
-#ifdef HOST_WIN32
-	return _InterlockedCompareExchange64 (ptr, 0, 0);
-#else
-	return InterlockedCompareExchange64 (ptr, 0, 0);    
-#endif
-
-    Same problem as previous.
-
-  - For all projects and configurations update their property pages under "C/C++->Optimization" and set "Enable Intrinsic Functions" to "Yes"
-    - You might be able to skip this step.
-  - In "exceptions-amd64.c" replace line 121:
-
-if (win32_chained_exception_needs_run) { 
-    
-   with
-
-if (mono_win_chained_exception_needs_run) {
-
-  - In "exceptions-amd64.c" delete lines 167 and 168:
-
-if (old_win32_toplevel_exception_filter)
-	SetUnhandledExceptionFilter(mono_old_win_toplevel_exception_filter);
-
-  - In "exceptions-amd64.c" move line 166 (line # after previous changes) to start of the function:
-
-guint32 ret = 0;
-
-  - in threads.c in mono_thread_get_stack_bounds method replace the bit of code under "#if defined(HOST_WIN32)" from:
-
-void* tib = (void*)__readfsdword(0x18);
-guint8 *stackTop = (guint8*)*(int*)((char*)tib + 4);
-guint8 *stackBottom = (guint8*)*(int*)((char*)tib + 8);
-
-    to:
-
-NT_TIB* tib = (NT_TIB*)NtCurrentTeb();
-guint8 *stackTop = (guint8*)tib->StackBase;
-guint8 *stackBottom = (guint8*)tib->StackLimit;
-
-    __readfsdword doesn't exist when building 64bit. Use may use __readgsqword instead but then you need
-	to double all your offsets. NtCurrentTeb works equally for both 32 and 64 bit builds.
-
-  - Build "mono" project. 
-  - You should end up with mono-2.0.dll, mono-2.0.lib, MonoPosixHelper.dll and mono.exe and we are done compiling
-
---------------------------------------VS2013 specific changes--------------------------------------------
-
-If compiling for VS2013 you will also need to perform these modifications:
- - Edit libmonoruntime project file and remove item "..\mono\metadata\sgen-bridge.c" as it is duplicate 
-  (just search for it and you'll see two copies). If you dont VS2013 will fail to load that project.
-
- - In mono_compiler.h at line 192 rename "trunc" macro to "mono_trunc" and all its references too.
-   - (Should just be 4 references in jit-icalls.c at lines 888, 891, 904, 932.)
-   - This is needed because standard math.h now contains a trunc method which conflicts with the macro
-
--------------------------------Special Banshee-specific changes--------------------------------------------
-
-Move & modify:
-  MonoClass* mono_class_bind_generic_parameters (MonoClass *klass, int type_argc, MonoType **types, gboolean is_dynamic) MONO_INTERNAL; 
-from object-internals.h
-to:
-  MONO_API MonoClass* mono_class_bind_generic_parameters (MonoClass *klass, int type_argc, MonoType **types, mono_bool is_dynamic);
-in object.h
-
-In reflection.c change:
-  MonoClass* mono_class_bind_generic_parameters (MonoClass *klass, int type_argc, MonoType **types, gboolean is_dynamic)
-to:
-  MonoClass* mono_class_bind_generic_parameters (MonoClass *klass, int type_argc, MonoType **types, mono_bool is_dynamic)
-
-
---------------------------------Integrating Mono into Banshee----------------------------------------------
- - Add mono-2.0.dll to (BansheeRootDir)/bin/(Platform)/(Configuration)
- - Add mono-2.0.lib to (BansheeRootDir)/Dependencies/lib/(Platform)/(Configuration)
- - Install mono 3.2.3 prebuilt binaries
-   - Copy contents of (PrebuiltMonoFolder)/include/mono/mono-2.0/mono to (BansheeRootDir)/Dependencies/Include/Mono
-   - Copy folders (PrebuiltMonoFolder)/etc and (PrebuiltMonoFolder)/lib folders into (BansheeRootDir)/bin/Mono
-     - TODO - Not all files from /lib are needed, but I haven't yet determined which are
- - TODO - mono.exe and mono compiler are not used at the moment. Update docs once they are.

+ 0 - 7
Mono-3.4.0-IntegrationGuide.txt

@@ -1,7 +0,0 @@
-Download Mono 3.4.0 source from http://download.mono-project.com/sources/.
-Extract and open mono-3.4.0 folder.
-Open /msvc/mono.sln with Visual Studio 2013 and upgrade all projects to VS 2013 when asked
-In root folder rename "winconfig.h" to "config.h"
-Add /mono/mini/mini-native-types.c to "libmono" VS project
-Compile libmono as Debug or Release (not the SGen version as those might require some extra fixes), Win32 or x64
-When compiling x64 also remove "mono_debugger_agent_register_transport" method from /msvc/mono.def (and restore if building Win32)

+ 0 - 87
TODO.txt

@@ -1,87 +0,0 @@
---------- ALL LONG TERM TASKS / FIXES BELONG TO GOOGLE DOCS: ImplementationTODO OR PossibleImprovements ----------
-
-----------------------------------------------------------------------
-Polish
-
-Other polish:
- - Add menu items:
-  - Edit: Cut/Copy/Paste/Duplicate/Delete(need to make sure it works in Hierarchy, with shortcuts), View/Move/rotate/scale
-  - Game Object (also add to context): Create(Empty, Empty Child, Camera, Renderable, Point/Spot/Directional Light), Apply prefab, Break prefab, Revert prefab
- - Inspector persistance (See below for details)
- - Ortographic camera views (+ gizmo in scene view corner that shows camera orientation) (Use custom handles and implement this?)
- - Add tooltips to toolbar items and other buttons with icons
- - Undo/Redo
-  - CmdRecordSO records an SO and all its children but it should only record a single SO
-  - CmdRecordSO should instead of recording the entire object record a diff
-  - There should be a CmdRecordSO equivalent for resources (probably)
-  - Add commands for breaking or reverting a scene object 
-  - Test & finalize undo/redo system
- - Drag and drop of a mesh into Hierarchy doesn't instantiate it
-  - Add OnResourceDropped callback to SceneTreeView and then hook it up on C# side
- - Drag and dropping a prefab onto the scene (or hierarchy) should work the same as with meshes
- - Start editor in fullscreen
- - If user clears the default shader he has no way of re-assigning it - add default shader to project folder? (needs to be packaged with project)
- - Toggle to enable/disable SceneObject in Inspector (+ Fade out disabled objects in hierarchy)
- - Resource import options don't get saved
- - Cursors should be replaced with better ones, or at least hot-spots fixed
- - Either disable light tool icons before release or make them functional (With gizmos)
-
-Finalizing:
- - Add copyright notices in all files & change license to GPL
- - Need to generate a proper merge of dev and preview branches
-   - Use "git revert --no-commit <COMMITID>..HEAD" to reverse anything on the preview branch that was done after the branch creation, then merge
-   - Consider moving dev to that branch completely and just marking the release with a tag (this might mean I just need to move the master branch to that repo instead of merging)
- - Test if C++ example still works
- - Add "example" for using the editor (possibly a video, or a set of screenshots + a data.rar with required resources)
- - Make sure to include BansheeOIS source in dependencies.
-
-----------------------------------------------------------------------
-Inspector persistance
-
- - When I expand inspector elements and them come back to that object it should remember the previous state
-   - In the Inspector base add a dictionary "Persistent<string, object>"
-   - InspectorWindow will keep a reference to this dictionary whenever it creates a new inspector for SO or resource
-    - Or if one already exists it will restore it
-	- This dictionary will not persist editor shutdown
-   - Generic inspector and inspectable fields can use the serialized property name for the key
-    - Will need a way to retrieve the full property name, up to the parent Component/Resource
-	- Will need to extend inspectable fields so they know their parent inspector so they have access to the dictionar
-   - Custom inspectors can get rid of manual "isExpanded" bools and use the dictionary instead
-
-/*********************************************************************/
-/************************ LESS IMPORTANT *****************************/
-/*********************************************************************/
-
-----------------------------------------------------------------------
-Mono notes
-
-I can get mono errors by checking g_print calls in goutput.c
- - Calling thunks incorrectly can cause those weird errors with no real callstack
-
-Running embedded mono with VS attached causes managed null refs to be registered as access violations
-
-There seems to be a bug in Mono when passing complex structs from C# to C++. e.g. passing Rect3 as a parameter
-will corrupt the parameter after it, even if layout and size is exact as the C++ version. 
-Rect3 has child structs (Vector3) which could be the reason. Be aware of other similar problems.
-
-Mono cannot marshal structures? Taken from their documentation:
- Internal calls do not provide support for marshalling structures. This means that any API calls that take a structure 
- (excluding the system types like int32, int64, etc) must be passed as a pointer, in C# this means passing the value as a "ref" or "out" parameter.
- - This was further confirmed by one of the developers on a forum.
-
-Mono has problems with returning a struct from an internal C++ method. Returned value might end up being corrupted. It works weirdly as
-I am able (for example) return a Rect2 with no problems, but it doesn't work when returning a Degree struct. Returning the value as input
-parameter solves the problem (presumably boxing the return value would also work).
-
-Sometimes exceptions cause a crash in Event, although this is due to an exception triggering a dialog box which triggers
-the message loop and causes another exception. Make sure to look for the original exception.
-
-Finalizers on attribute members will get called more than once. This causes issues if some of the members reference native 
-objects as already deleted native objects will try to be deleted again. 
-
-----------------------------------------------------------------------
-C# Material/Shader
-
-TODO - Implement param block and sampler support
-TODO - When creating a Material without a shader, a default one should be used, at least in editor
-TODO - Setting Material array parameters isn't possible from C#

+ 0 - 123
TODOExperimentation.txt

@@ -1,123 +0,0 @@
-------------------------- STUDY --------------------------------
-Study shadow rendering implementations
-Study how is transparency handled (is it order independant?)
-Figure out what is skylight
-Determine how is light bleeding handled (if at all)
-
----------------------- IMPLEMENTATION ---------------------------
-
-Assign ViewOrigin, PreViewTranslation, TransViewProj
- - Dont use pre-view translation for ortographic
- - Modify view and view projecion matrices so othey use translated 
- - Apply PreViewTranslation when generating world position in shader (multiply 3x3 rotation col by col, then add translation to last col and add that to rotated position)
- - Perhaps do all these modifcations outside of shader (i.e. have the world matrix be pre-transformed)
- - Do this after I have basic rendering working, to avoid additional issues when I'm initially trying to get it to work
- 
-Later:
- - Resolving scene color to final scene color in RenderTargets::resolve is not implemented
-  - Need to be able to copy portions of an MSAA texture to a non-MSAA texture 
- - Add warnings for depth buffers or MSAA on output target
- - Remove depth buffers from Scene and Game window RT's, as well as the primary window  
- - I changed how unsupported texture formats work, I should test if I didn't break OpenGL
- - When rendering lights right now I need to bind Gbuffer and light parameters to material, and then bind the material parameters to the pipeline
-  - Either unify these two processes by finding a better way, or hide the binding in light material class
- - Finish up DefferedPointLightPass by generating cone geometry in shader
- - Modify Light so it generated adequate number of vertices required for cone geometry, without actually creating the cone
- - Think about how to handle post-processing shaders (HDR tone mapping)
- - Add cube and 3D support for render texture pool
- - Lights aren't being culled
- - Load up and set up a test-bed with Ribek's scene
-
-Notes:
- - When doing viewport clear in DX11 it will only clear the first render target
- - Quantize buffer sizes so they're divideable by 8 when requesting them from RenderTexturePool
- - R11G11B10 and R10G10B10A2 formats haven't been tested
- - Will need to ensure the code works in OpenGL (means porting shaders or building the cross compiler). I cannot delay 
-   this as later it will be hard to debug when the pipeline is more complex.
- - Consider having a debug toggle that makes the gbuffer use floating point storage, to compare quality quickly
- - I'll need to add sky-lighting and perhaps other form of pre-computed lighting. Base pass should output colors resulting
-   from those operations during its base pass. Right now I just output constant ambient.
- - Don't forget to make everything gamma correct
-
-Generate different RenderableController for each set of elements
- - Will likely want to rename current LitTexRenderableController to OpaqueSomething
- - Each controller would be connected to its own render queue (generated in above step)
- - Renderable controller should probably be notified when rendering starts/ends so it may bind gbuffer and/or other resoures.
-
-Light queues:
- - Will likely need to generate a set of visible lights per camera similar to renderables (separate them by type most likely)
- - Will also need a set of renderables per light when rendering shadows
-
-(Optionally) Optimize visibility determination
- - Instead of doing frustum culling + layer culling every frame do it only when renderable or camera is updated
- - I'll need to add _notifyCameraUpdated method
- - I'll need to store various queue IDs in Renderable's in order to avoid scanning the queues when adding/removing/updating
- - Since removing/adding elements would unsort the queue, sorting should be delayed and done once per-frame
- - It might just be possible its more efficient to test all elements every frame
-
-GUI rendering can be more efficient - I re-apply all materials for every frame, while I should check if it
-differs from previous material and avoid re-applying, or just re-apply the few different states
-
---------------------------- DESIGN ---------------------------
-
-How will cameras interact with the renderer? The cameras currently available shouldn't have depth buffers
- - Need to modify RenderWindow so it doesn't create depth buffers
-  - Find all places where I create windows and modify this
-  - Modify render target creation in SceneWindow
- - What happens when a user creates a camera with a depth buffer?
-   - Print out a warning and ignore it?
-   - Or resolve the gbuffer into it? Probably this, as I want to be able to read the depth buffer from script code if needed
-     - This still isn't perfect as I'd have duplicate buffers when using non-MSAA buffer that require no resolve
- - Similar issue when a multisampled buffer is used for the camera
-
-Separate GUI rendering into a separate part to be rendered after gbuffer is resolved?
-
-Will likely need an easy way to determine supported feature set (likely just depending on shader model)
-
-Consider encapsulating shaders together with methods for setting their parameters (and possibly retrieving output)
- - So that external code doesn't need to know about its internal and do less work
- - This would contain a reference to the shader and its parameters
- - It would then have a SetParameters method (custom per each shader) which updates its params in a simple manner
- - (Later) Possibly allow them to return a feature level and/or platform they're to be used on
- - (Later) It might be important to be easily able to use different versions of the shader (e.g. different defines)
-   - This might require handling compilation on this class, instead on resource load (But then again I could potentially
-     have the shader in an include file and then specific shader files for each define version)
-
---------------------------- LONG TERM ------------------------
-
-Deferred:
- - Create a tile deferred renderer
- - Support for point, directional and spot lights
- - Basic lambert shading initially
-  - Create brand new default shaders
- - HDR, tone mapping and gamma correct (toggle-able)
-   - Will likely need a simple framework for rendering full-screen effects
-     (e.g. I will need to downsample scene to determine brightness here, but will
-      also need that framework for all post-processing)
-
-Implement shadows
- - Start with hard shadows
- - Move to PCF soft shadows (see if there's anything better)
- - Then cascaded maps
-
-Later: 
- - Reflection probes
- - Proper PBR materials with reflection
- - Post-processing system - FXAA, SSAO, Color correction, Depth of field (Bokeh)
- - Forward rendering for transparent objects
- - Occlusion culling
- - GI
- - Volumetric lighting
- - SSR
- - Depth pre-pass - Make sure this can be toggled on and off as needed
- - HDR skybox, skylight stuff
- - Skin & vegetation shaders
- - Tesselation/displacement/parallax
- - Water
- - Fog
- - Motion blur
- - Per object shadows
- - Extend camera with shutter speed (motion blur), aperture size and focal distance (depth of field), exposure (HDR)
---------------------------- TEST -----------------------------
-
-Test all APIs with new changes regarding depth buffer creation on windows