Browse Source

Various fixes in order to get example model to render

Marko Pintera 11 years ago
parent
commit
8c5ffb497d

+ 0 - 2
BansheeCore/Include/BsMeshData.h

@@ -277,8 +277,6 @@ namespace BansheeEngine
 
 
 		UINT32 mDescBuilding;
 		UINT32 mDescBuilding;
 
 
-		UINT8* mData;
-
 		UINT32 mNumVertices;
 		UINT32 mNumVertices;
 		UINT32 mNumIndices;
 		UINT32 mNumIndices;
 		IndexBuffer::IndexType mIndexType;
 		IndexBuffer::IndexType mIndexType;

+ 10 - 28
BansheeCore/Include/BsViewport.h

@@ -84,65 +84,47 @@ namespace BansheeEngine
 		const RectI& getArea() const { return mArea; }
 		const RectI& getArea() const { return mArea; }
 
 
 		/**
 		/**
-		 * @brief	Returns the color to clear the viewport color buffers to.
+		 * @brief	Activates or deactivates clears for color, depth or stencil buffers.
+		 *			Buffers will be cleared before rendering to this viewport is performed.
 		 */
 		 */
-		const Color& getClearColor() const { return mClearColor; }
+		void setRequiresClear(bool colorClear, bool depthClear, bool stencilClear);
 
 
 		/**
 		/**
-		 * @brief	Sets the color to clear the viewport color buffers to.
+		 * @brief	Sets values to clear color, depth and stencil buffers to.
 		 */
 		 */
-		void setClearColor(const Color& clearColor) { mClearColor = clearColor; }
+		void setClearValues(const Color& clearColor, float clearDepth = 0.0f, UINT16 clearStencil = 0);
 
 
 		/**
 		/**
-		 * @brief	Returns the value to clear the viewport depth buffers to.
+		 * @brief	Returns the color to clear the viewport color buffers to.
 		 */
 		 */
-		float getClearDepthValue() const { return mDepthClearValue; }
+		const Color& getClearColor() const { return mClearColor; }
 
 
 		/**
 		/**
-		 * @brief	Sets the value to clear the viewport depth buffer to.
+		 * @brief	Returns the value to clear the viewport depth buffers to.
 		 */
 		 */
-		void setClearDepthValue(float value) { mDepthClearValue = value; }
+		float getClearDepthValue() const { return mDepthClearValue; }
+
 
 
 		/**
 		/**
 		 * @brief	Returns the value to clear the viewport stencil buffer to.
 		 * @brief	Returns the value to clear the viewport stencil buffer to.
 		 */
 		 */
 		UINT16 getClearStencilValue() const { return mStencilClearValue; }
 		UINT16 getClearStencilValue() const { return mStencilClearValue; }
 
 
-		/**
-		 * @brief	Sets the value to clear the viewport stencil buffer to.
-		 */
-		void setStencilClearValue(UINT16 value) { mStencilClearValue = value; }
-
 		/**
 		/**
 		 * @brief	Returns true if viewport requires color clear before rendering.
 		 * @brief	Returns true if viewport requires color clear before rendering.
 		 */
 		 */
 		bool getRequiresColorClear() const { return mRequiresColorClear; }
 		bool getRequiresColorClear() const { return mRequiresColorClear; }
 
 
-		/**
-		 * @brief	Determines should viewport color buffer be cleared before rendering.
-		 */
-		void setRequiresColorClear(bool requiresClear) { mRequiresColorClear = requiresClear; }
-
 		/**
 		/**
 		 * @brief	Returns true if viewport requires depth clear before rendering.
 		 * @brief	Returns true if viewport requires depth clear before rendering.
 		 */
 		 */
 		bool getRequiresDepthClear() const { return mRequiresDepthClear; }
 		bool getRequiresDepthClear() const { return mRequiresDepthClear; }
 
 
-		/**
-		 * @brief	Determines should viewport depth buffer be cleared before rendering.
-		 */
-		void setRequiresDepthClear(bool requiresClear) { mRequiresDepthClear = requiresClear; }
-
 		/**
 		/**
 		 * @brief	Returns true if viewport requires stencil clear before rendering.
 		 * @brief	Returns true if viewport requires stencil clear before rendering.
 		 */
 		 */
 		bool getRequiresStencilClear() const { return mRequiresStencilClear; }
 		bool getRequiresStencilClear() const { return mRequiresStencilClear; }
 
 
-		/**
-		 * @brief	Determines should viewport stencil buffer be cleared before rendering.
-		 */
-		void setRequiresStencilClear(bool requiresClear) { mRequiresStencilClear = requiresClear; }
-
 		/**
 		/**
 		 * @brief	Makes an exact copy of this viewport.
 		 * @brief	Makes an exact copy of this viewport.
 		 */
 		 */

+ 1 - 1
BansheeCore/Source/BsGpuParams.cpp

@@ -96,7 +96,7 @@ namespace BansheeEngine
 		}
 		}
 
 
 		mInternalData->mParamBlockBuffers[iterFind->second.slot] = paramBlockBuffer;
 		mInternalData->mParamBlockBuffers[iterFind->second.slot] = paramBlockBuffer;
-		mInternalData->mParamBlocks[iterFind->second.slot] = paramBlockBuffer->getParamBlock();
+		mInternalData->mParamBlocks[iterFind->second.slot] = paramBlockBuffer != nullptr ? paramBlockBuffer->getParamBlock() : nullptr;
 
 
 		markCoreDirty();
 		markCoreDirty();
 	}
 	}

+ 2 - 4
BansheeCore/Source/BsMeshData.cpp

@@ -12,13 +12,13 @@
 namespace BansheeEngine
 namespace BansheeEngine
 {
 {
 	MeshData::MeshData(UINT32 numVertices, UINT32 numIndexes, const VertexDataDescPtr& vertexData, IndexBuffer::IndexType indexType)
 	MeshData::MeshData(UINT32 numVertices, UINT32 numIndexes, const VertexDataDescPtr& vertexData, IndexBuffer::IndexType indexType)
-	   :mNumVertices(numVertices), mNumIndices(numIndexes), mVertexData(vertexData), mIndexType(indexType), mData(nullptr)
+	   :mNumVertices(numVertices), mNumIndices(numIndexes), mVertexData(vertexData), mIndexType(indexType)
 	{
 	{
 		allocateInternalBuffer();
 		allocateInternalBuffer();
 	}
 	}
 
 
 	MeshData::MeshData()
 	MeshData::MeshData()
-		:mNumVertices(0), mNumIndices(0), mIndexType(IndexBuffer::IT_32BIT), mData(nullptr)
+		:mNumVertices(0), mNumIndices(0), mIndexType(IndexBuffer::IT_32BIT)
 	{ }
 	{ }
 
 
 	MeshData::~MeshData()
 	MeshData::~MeshData()
@@ -117,8 +117,6 @@ namespace BansheeEngine
 			for(UINT32 j = 0; j < numIndices; j++)
 			for(UINT32 j = 0; j < numIndices; j++)
 				idxPtr[j] = srcData[j] + vertexOffset;
 				idxPtr[j] = srcData[j] + vertexOffset;
 
 
-			subMeshes.push_back(SubMesh(indexOffset, numIndices, DOT_TRIANGLE_LIST));
-
 			indexOffset += numIndices;
 			indexOffset += numIndices;
 			idxPtr += numIndices;
 			idxPtr += numIndices;
 			vertexOffset += meshData->getNumVertices();
 			vertexOffset += meshData->getNumVertices();

+ 14 - 0
BansheeCore/Source/BsViewport.cpp

@@ -55,6 +55,20 @@ namespace BansheeEngine
         updateArea();
         updateArea();
     }
     }
 
 
+	void Viewport::setRequiresClear(bool colorClear, bool depthClear, bool stencilClear)
+	{
+		mRequiresColorClear = colorClear;
+		mRequiresDepthClear = depthClear;
+		mRequiresStencilClear = stencilClear;
+	}
+
+	void Viewport::setClearValues(const Color& clearColor, float clearDepth, UINT16 clearStencil)
+	{
+		mClearColor = clearColor;
+		mDepthClearValue = clearDepth;
+		mStencilClearValue = clearStencil;
+	}
+
 	Viewport Viewport::clone()
 	Viewport Viewport::clone()
 	{
 	{
 		return *this;
 		return *this;

+ 1 - 1
BansheeD3D11RenderSystem/Source/BsD3D11RenderSystem.cpp

@@ -984,7 +984,7 @@ namespace BansheeEngine
 		return VET_COLOR_ABGR;
 		return VET_COLOR_ABGR;
 	}
 	}
 
 
-	void D3D11RenderSystem::convertProjectionMatrix(const Matrix4& matrix, Matrix4& dest, bool forGpuProgram /*= false */)
+	void D3D11RenderSystem::convertProjectionMatrix(const Matrix4& matrix, Matrix4& dest, bool forGpuProgram)
 	{
 	{
 		dest = matrix;
 		dest = matrix;
 
 

+ 2 - 2
BansheeEditor/Source/BsDebugCamera.cpp

@@ -77,8 +77,8 @@ namespace BansheeEngine
 
 
 		if(camRotating)
 		if(camRotating)
 		{
 		{
-			mYaw += Degree(gInput().getAxisValue(InputDevice::Mouse, InputAxis::MainX) * ROTATION_SPEED);
-			mPitch += Degree(gInput().getAxisValue(InputDevice::Mouse, InputAxis::MainY) * ROTATION_SPEED);
+			mYaw += Degree(gInput().getAxisValue((UINT32)InputAxis::MouseX) * ROTATION_SPEED);
+			mPitch += Degree(gInput().getAxisValue((UINT32)InputAxis::MouseY) * ROTATION_SPEED);
 
 
 			Quaternion yRot;
 			Quaternion yRot;
 			yRot.fromAxisAngle(Vector3::UNIT_Y, Radian(mYaw));
 			yRot.fromAxisAngle(Vector3::UNIT_Y, Radian(mYaw));

+ 4 - 4
BansheeEngine/Include/BsInputConfiguration.h

@@ -17,7 +17,7 @@ namespace BansheeEngine
 		ShiftCtrlAlt = 0x07
 		ShiftCtrlAlt = 0x07
 	};
 	};
 
 
-	struct VIRTUAL_BUTTON_DESC
+	struct BS_EXPORT VIRTUAL_BUTTON_DESC
 	{
 	{
 		VIRTUAL_BUTTON_DESC();
 		VIRTUAL_BUTTON_DESC();
 		VIRTUAL_BUTTON_DESC(ButtonCode buttonCode, VButtonModifier modifiers = VButtonModifier::None, bool repeatable = false);
 		VIRTUAL_BUTTON_DESC(ButtonCode buttonCode, VButtonModifier modifiers = VButtonModifier::None, bool repeatable = false);
@@ -27,16 +27,16 @@ namespace BansheeEngine
 		bool repeatable;
 		bool repeatable;
 	};
 	};
 
 
-	struct VIRTUAL_AXIS_DESC
+	struct BS_EXPORT VIRTUAL_AXIS_DESC
 	{
 	{
 		VIRTUAL_AXIS_DESC();
 		VIRTUAL_AXIS_DESC();
-		VIRTUAL_AXIS_DESC(InputAxis type, float deadZone = 0.0001f, float sensitivity = 1.0f, bool invert = false, bool smooth = true);
+		VIRTUAL_AXIS_DESC(UINT32 type, float deadZone = 0.0001f, float sensitivity = 1.0f, bool invert = false, bool smooth = true);
 
 
 		float deadZone;
 		float deadZone;
 		float sensitivity;
 		float sensitivity;
 		bool invert;
 		bool invert;
 		bool smooth;
 		bool smooth;
-		InputAxis type;
+		UINT32 type;
 	};
 	};
 
 
 	/**
 	/**

+ 1 - 2
BansheeEngine/Include/BsRenderQueue.h

@@ -14,7 +14,6 @@ namespace BansheeEngine
 			:passIdx(0)
 			:passIdx(0)
 		{ }
 		{ }
 
 
-		RenderableProxyPtr renderable;
 		RenderableElement* renderElem;
 		RenderableElement* renderElem;
 		MaterialProxyPtr material;
 		MaterialProxyPtr material;
 		MeshProxyPtr mesh;
 		MeshProxyPtr mesh;
@@ -36,7 +35,7 @@ namespace BansheeEngine
 	public:
 	public:
 		RenderQueue();
 		RenderQueue();
 
 
-		void add(const RenderableProxyPtr& renderable, RenderableElement* element, const Vector3& worldPosForSort);
+		void add(RenderableElement* element, const Vector3& worldPosForSort);
 
 
 		void add(const MaterialProxyPtr& material, const MeshProxyPtr& mesh, const Vector3& worldPosForSort);
 		void add(const MaterialProxyPtr& material, const MeshProxyPtr& mesh, const Vector3& worldPosForSort);
 
 

+ 2 - 2
BansheeEngine/Include/BsRenderableHandler.h

@@ -8,9 +8,9 @@ namespace BansheeEngine
 	class BS_EXPORT RenderableHandler
 	class BS_EXPORT RenderableHandler
 	{
 	{
 	public:
 	public:
-		virtual void initializeProxy(const RenderableProxyPtr& proxy) = 0;
+		virtual void initializeRenderElem(RenderableElement* element) = 0;
 
 
-		virtual void bindPerObjectBuffers(const RenderableProxyPtr& renderable, const RenderableElement* element) = 0;
+		virtual void bindPerObjectBuffers(const RenderableElement* element) = 0;
 		virtual void bindGlobalBuffers(const RenderableElement* element);
 		virtual void bindGlobalBuffers(const RenderableElement* element);
 	};
 	};
 }
 }

+ 2 - 1
BansheeEngine/Include/BsRenderableProxy.h

@@ -25,6 +25,8 @@ namespace BansheeEngine
 		UINT64 layer;
 		UINT64 layer;
 
 
 		Any rendererData;
 		Any rendererData;
+		RenderableHandler* handler;
+		RenderableType renderableType;
 
 
 	private:
 	private:
 		bool mBoundsDirty;
 		bool mBoundsDirty;
@@ -37,7 +39,6 @@ namespace BansheeEngine
 
 
 		Vector<RenderableElement*> renderableElements;
 		Vector<RenderableElement*> renderableElements;
 
 
-		RenderableHandler* handler;
 		RenderableType renderableType;
 		RenderableType renderableType;
 	};
 	};
 }
 }

+ 5 - 0
BansheeEngine/Include/BsVirtualInput.h

@@ -66,4 +66,9 @@ namespace BansheeEngine
 		Queue<VirtualButtonEvent> mEvents;
 		Queue<VirtualButtonEvent> mEvents;
 		UINT32 mActiveModifiers;
 		UINT32 mActiveModifiers;
 	};
 	};
+
+	/**
+	 * @copydoc	VirtualInput
+	 */
+	BS_EXPORT VirtualInput& gVirtualInput();
 }
 }

+ 5 - 6
BansheeEngine/Source/BsCamera.cpp

@@ -24,12 +24,10 @@ namespace BansheeEngine
     {
     {
 		setName("Camera");
 		setName("Camera");
 
 
-		updateView();
-		updateFrustum();
-        invalidateFrustum();
+		mViewMatrix = Matrix4::ZERO;
+		mProjMatrixRS = Matrix4::ZERO;
 
 
-        mViewMatrix = Matrix4::ZERO;
-        mProjMatrixRS = Matrix4::ZERO;
+        invalidateFrustum();
 
 
 		target->synchronize();
 		target->synchronize();
 		mViewport = bs_shared_ptr<Viewport, PoolAlloc>(target, left, top, width, height);
 		mViewport = bs_shared_ptr<Viewport, PoolAlloc>(target, left, top, width, height);
@@ -559,6 +557,7 @@ namespace BansheeEngine
 
 
     void Camera::invalidateFrustum() const
     void Camera::invalidateFrustum() const
     {
     {
+		mRecalcFrustum = true;
 		mRecalcFrustumPlanes = true;
 		mRecalcFrustumPlanes = true;
     }
     }
 
 
@@ -567,7 +566,7 @@ namespace BansheeEngine
 		CameraProxyPtr proxy = bs_shared_ptr<CameraProxy>();
 		CameraProxyPtr proxy = bs_shared_ptr<CameraProxy>();
 		proxy->layer = mLayers;
 		proxy->layer = mLayers;
 		proxy->priority = mPriority;
 		proxy->priority = mPriority;
-		proxy->projMatrix = getProjectionMatrixRS();
+		proxy->projMatrix = getProjectionMatrix();
 		proxy->viewMatrix = getViewMatrix();
 		proxy->viewMatrix = getViewMatrix();
 		proxy->viewport = mViewport->clone();
 		proxy->viewport = mViewport->clone();
 		proxy->ignoreSceneRenderables = mIgnoreSceneRenderables;
 		proxy->ignoreSceneRenderables = mIgnoreSceneRenderables;

+ 2 - 2
BansheeEngine/Source/BsInputConfiguration.cpp

@@ -17,10 +17,10 @@ namespace BansheeEngine
 	{ }
 	{ }
 
 
 	VIRTUAL_AXIS_DESC::VIRTUAL_AXIS_DESC()
 	VIRTUAL_AXIS_DESC::VIRTUAL_AXIS_DESC()
-		: type(InputAxis::MouseX), deadZone(0.0001f), sensitivity(1.0f), invert(false), smooth(true)
+		: type((UINT32)InputAxis::MouseX), deadZone(0.0001f), sensitivity(1.0f), invert(false), smooth(true)
 	{ }
 	{ }
 
 
-	VIRTUAL_AXIS_DESC::VIRTUAL_AXIS_DESC(InputAxis type, float deadZone, float sensitivity, bool invert, bool smooth)
+	VIRTUAL_AXIS_DESC::VIRTUAL_AXIS_DESC(UINT32 type, float deadZone, float sensitivity, bool invert, bool smooth)
 		:type(type), deadZone(deadZone), sensitivity(sensitivity), invert(invert), smooth(smooth)
 		:type(type), deadZone(deadZone), sensitivity(sensitivity), invert(invert), smooth(smooth)
 	{ }
 	{ }
 
 

+ 1 - 1
BansheeEngine/Source/BsProfilerOverlay.cpp

@@ -450,7 +450,7 @@ namespace BansheeEngine
 		mGPULayoutFrameContentsRight->addElement(GUILabel::create(mGPUVertexBufferBindsStr, GUIOptions(GUIOption::fixedWidth(200))));
 		mGPULayoutFrameContentsRight->addElement(GUILabel::create(mGPUVertexBufferBindsStr, GUIOptions(GUIOption::fixedWidth(200))));
 		mGPULayoutFrameContentsRight->addElement(GUILabel::create(mGPUIndexBufferBindsStr, GUIOptions(GUIOption::fixedWidth(200))));
 		mGPULayoutFrameContentsRight->addElement(GUILabel::create(mGPUIndexBufferBindsStr, GUIOptions(GUIOption::fixedWidth(200))));
 		mGPULayoutFrameContentsRight->addElement(GUILabel::create(mGPUGPUProgramBufferBindsStr, GUIOptions(GUIOption::fixedWidth(200))));
 		mGPULayoutFrameContentsRight->addElement(GUILabel::create(mGPUGPUProgramBufferBindsStr, GUIOptions(GUIOption::fixedWidth(200))));
-		mGPULayoutFrameContentsRight->addElement(GUILabel::create(mGPUGPUProgramBufferBindsStr, GUIOptions(GUIOption::fixedWidth(200))));
+		mGPULayoutFrameContentsRight->addElement(GUILabel::create(mGPUGPUProgramBindsStr, GUIOptions(GUIOption::fixedWidth(200))));
 		mGPULayoutFrameContentsRight->addFlexibleSpace();
 		mGPULayoutFrameContentsRight->addFlexibleSpace();
 
 
 		updateCPUSampleAreaSizes();
 		updateCPUSampleAreaSizes();

+ 1 - 4
BansheeEngine/Source/BsRenderQueue.cpp

@@ -16,13 +16,12 @@ namespace BansheeEngine
 		mSortedRenderElements.clear();
 		mSortedRenderElements.clear();
 	}
 	}
 
 
-	void RenderQueue::add(const RenderableProxyPtr& renderable, RenderableElement* element, const Vector3& worldPosForSort)
+	void RenderQueue::add(RenderableElement* element, const Vector3& worldPosForSort)
 	{
 	{
 		// TODO - Make sure RenderQueueElements are cached so we dont allocate memory for them every frame
 		// TODO - Make sure RenderQueueElements are cached so we dont allocate memory for them every frame
 		mRenderElements.push_back(RenderQueueElement());
 		mRenderElements.push_back(RenderQueueElement());
 
 
 		RenderQueueElement& renderOp = mRenderElements.back();
 		RenderQueueElement& renderOp = mRenderElements.back();
-		renderOp.renderable = renderable;
 		renderOp.renderElem = element;
 		renderOp.renderElem = element;
 		renderOp.material = element->material;
 		renderOp.material = element->material;
 		renderOp.mesh = element->mesh;
 		renderOp.mesh = element->mesh;
@@ -35,7 +34,6 @@ namespace BansheeEngine
 		mRenderElements.push_back(RenderQueueElement());
 		mRenderElements.push_back(RenderQueueElement());
 
 
 		RenderQueueElement& renderOp = mRenderElements.back();
 		RenderQueueElement& renderOp = mRenderElements.back();
-		renderOp.renderable = nullptr;
 		renderOp.renderElem = nullptr;
 		renderOp.renderElem = nullptr;
 		renderOp.material = material;
 		renderOp.material = material;
 		renderOp.mesh = mesh;
 		renderOp.mesh = mesh;
@@ -53,7 +51,6 @@ namespace BansheeEngine
 				mSortedRenderElements.push_back(RenderQueueElement());
 				mSortedRenderElements.push_back(RenderQueueElement());
 
 
 				RenderQueueElement& sortedElem = mSortedRenderElements.back();
 				RenderQueueElement& sortedElem = mSortedRenderElements.back();
-				sortedElem.renderable = renderElem.renderable;
 				sortedElem.renderElem = renderElem.renderElem;
 				sortedElem.renderElem = renderElem.renderElem;
 				sortedElem.material = renderElem.material;
 				sortedElem.material = renderElem.material;
 				sortedElem.mesh = renderElem.mesh;
 				sortedElem.mesh = renderElem.mesh;

+ 5 - 0
BansheeEngine/Source/BsVirtualInput.cpp

@@ -240,4 +240,9 @@ namespace BansheeEngine
 			}
 			}
 		}
 		}
 	}
 	}
+
+	VirtualInput& gVirtualInput()
+	{
+		return VirtualInput::instance();
+	}
 }
 }

+ 3 - 3
BansheeRenderer/Include/BsBansheeLitTexRenderableHandler.h

@@ -16,7 +16,7 @@ namespace BansheeEngine
 		{
 		{
 			GpuParamBlockBufferPtr perObjectParamBuffer;
 			GpuParamBlockBufferPtr perObjectParamBuffer;
 
 
-			bool hasWVPParam;
+			bool hasWVPParam = false;
 			GpuParamMat4 wvpParam;
 			GpuParamMat4 wvpParam;
 
 
 			Vector<MaterialProxy::BufferBindInfo> perObjectBuffers;
 			Vector<MaterialProxy::BufferBindInfo> perObjectBuffers;
@@ -24,9 +24,9 @@ namespace BansheeEngine
 
 
 		LitTexRenderableHandler();
 		LitTexRenderableHandler();
 
 
-		void initializeProxy(const RenderableProxyPtr& proxy);
+		void initializeRenderElem(RenderableElement* element);
 
 
-		void bindPerObjectBuffers(const RenderableProxyPtr& renderable, const RenderableElement* element);
+		void bindPerObjectBuffers(const RenderableElement* element);
 
 
 		void updateGlobalBuffers(float time);
 		void updateGlobalBuffers(float time);
 		void updatePerObjectBuffers(RenderableElement* element, const Matrix4& wvpMatrix);
 		void updatePerObjectBuffers(RenderableElement* element, const Matrix4& wvpMatrix);

+ 0 - 2
BansheeRenderer/Include/BsBansheeRenderer.h

@@ -79,9 +79,7 @@ namespace BansheeEngine
 		Vector<RenderableProxyPtr> mDeletedRenderableProxies;
 		Vector<RenderableProxyPtr> mDeletedRenderableProxies;
 		Vector<CameraProxyPtr> mDeletedCameraProxies;
 		Vector<CameraProxyPtr> mDeletedCameraProxies;
 
 
-		UnorderedMap<UINT64, RenderableProxyPtr> mRenderableProxies;
 		UnorderedMap<UINT64, CameraProxyPtr> mCameraProxies;
 		UnorderedMap<UINT64, CameraProxyPtr> mCameraProxies;
-
 		Vector<RenderTargetData> mRenderTargets;
 		Vector<RenderTargetData> mRenderTargets;
 
 
 		Vector<RenderableElement*> mRenderableElements;
 		Vector<RenderableElement*> mRenderableElements;

+ 69 - 75
BansheeRenderer/Source/BsBansheeLitTexRenderableHandler.cpp

@@ -123,7 +123,7 @@ namespace BansheeEngine
 		lightDirParam.set(Vector4(0.707f, 0.707f, 0.707f, 0.0f));
 		lightDirParam.set(Vector4(0.707f, 0.707f, 0.707f, 0.0f));
 	}
 	}
 
 
-	void LitTexRenderableHandler::initializeProxy(const RenderableProxyPtr& proxy)
+	void LitTexRenderableHandler::initializeRenderElem(RenderableElement* element)
 	{
 	{
 		static auto paramsMatch = [](const GpuParamDataDesc& a, const GpuParamDataDesc& b)
 		static auto paramsMatch = [](const GpuParamDataDesc& a, const GpuParamDataDesc& b)
 		{
 		{
@@ -131,116 +131,110 @@ namespace BansheeEngine
 				a.arraySize == b.arraySize && a.arrayElementStride == b.arrayElementStride;
 				a.arraySize == b.arraySize && a.arrayElementStride == b.arrayElementStride;
 		};
 		};
 
 
-		for (auto& element : proxy->renderableElements)
-		{
-			element->rendererData = PerObjectData();
-			PerObjectData* rendererData = any_cast_unsafe<PerObjectData>(&element->rendererData);
+		element->rendererData = PerObjectData();
+		PerObjectData* rendererData = any_cast_unsafe<PerObjectData>(&element->rendererData);
 
 
-			ShaderProxyPtr shader = element->material->shader;
+		ShaderProxyPtr shader = element->material->shader;
 
 
-			const Map<String, SHADER_PARAM_BLOCK_DESC>& paramBlockDescs = shader->paramBlocks;
-			const Map<String, SHADER_DATA_PARAM_DESC>& dataParamDescs = shader->dataParams;
-			String staticBlockName;
-			String perFrameBlockName;
-			String perObjectBlockName;
+		const Map<String, SHADER_PARAM_BLOCK_DESC>& paramBlockDescs = shader->paramBlocks;
+		const Map<String, SHADER_DATA_PARAM_DESC>& dataParamDescs = shader->dataParams;
+		String staticBlockName;
+		String perFrameBlockName;
+		String perObjectBlockName;
 
 
-			String wvpParamName;
+		String wvpParamName;
 
 
-			for (auto& paramBlockDesc : paramBlockDescs)
+		for (auto& paramBlockDesc : paramBlockDescs)
+		{
+			switch (paramBlockDesc.second.rendererSemantic)
 			{
 			{
-				switch (paramBlockDesc.second.rendererSemantic)
-				{
-				case RBS_Static:
-					staticBlockName = paramBlockDesc.second.name;
-					break;
-				case RBS_PerFrame:
-					perFrameBlockName = paramBlockDesc.second.name;
-					break;
-				case RBS_PerObject:
-					perObjectBlockName = paramBlockDesc.second.name;
-					break;
-				}
+			case RBS_Static:
+				staticBlockName = paramBlockDesc.second.name;
+				break;
+			case RBS_PerFrame:
+				perFrameBlockName = paramBlockDesc.second.name;
+				break;
+			case RBS_PerObject:
+				perObjectBlockName = paramBlockDesc.second.name;
+				break;
 			}
 			}
+		}
 
 
-			for (auto& paramDesc : dataParamDescs)
-			{
-				if (paramDesc.second.rendererSemantic == RPS_WorldViewProjTfrm)
-					wvpParamName = paramDesc.second.gpuVariableName;
-			}
+		for (auto& paramDesc : dataParamDescs)
+		{
+			if (paramDesc.second.rendererSemantic == RPS_WorldViewProjTfrm)
+				wvpParamName = paramDesc.second.gpuVariableName;
+		}
 
 
-			UINT32 idx = 0;
-			for (auto& gpuParams : element->material->params)
-			{
-				const GpuParamDesc& paramsDesc = gpuParams->getParamDesc();
+		UINT32 idx = 0;
+		for (auto& gpuParams : element->material->params)
+		{
+			const GpuParamDesc& paramsDesc = gpuParams->getParamDesc();
 
 
-				if (staticBlockName != "")
+			if (staticBlockName != "")
+			{
+				auto findIter = paramsDesc.paramBlocks.find(staticBlockName);
+				if (findIter != paramsDesc.paramBlocks.end())
 				{
 				{
-					auto findIter = paramsDesc.paramBlocks.find(staticBlockName);
-					if (findIter != paramsDesc.paramBlocks.end())
+					// TODO - We only compare block sizes but not actual contents. Should I check them too?
+					//        Probably shouldn't concern myself with that here, instead check that on a higher level.
+					if (findIter->second.blockSize == staticParamBlockDesc.blockSize)
 					{
 					{
-						// TODO - We only compare block sizes but not actual contents. Should I check them too?
-						//        Probably shouldn't concern myself with that here, instead check that on a higher level.
-						if (findIter->second.blockSize == staticParamBlockDesc.blockSize)
-						{
-							UINT32 slotIdx = findIter->second.slot;
-							element->material->rendererBuffers.push_back(MaterialProxy::BufferBindInfo(idx, slotIdx, staticParamBuffer));
-						}
+						UINT32 slotIdx = findIter->second.slot;
+						element->material->rendererBuffers.push_back(MaterialProxy::BufferBindInfo(idx, slotIdx, staticParamBuffer));
 					}
 					}
 				}
 				}
+			}
 
 
-				if (perFrameBlockName != "")
+			if (perFrameBlockName != "")
+			{
+				auto findIter = paramsDesc.paramBlocks.find(perFrameBlockName);
+				if (findIter != paramsDesc.paramBlocks.end())
 				{
 				{
-					auto findIter = paramsDesc.paramBlocks.find(perFrameBlockName);
-					if (findIter != paramsDesc.paramBlocks.end())
+					if (findIter->second.blockSize == perFrameParamBlockDesc.blockSize)
 					{
 					{
-						if (findIter->second.blockSize == perFrameParamBlockDesc.blockSize)
-						{
-							UINT32 slotIdx = findIter->second.slot;
-							element->material->rendererBuffers.push_back(MaterialProxy::BufferBindInfo(idx, slotIdx, perFrameParamBuffer));
-						}
+						UINT32 slotIdx = findIter->second.slot;
+						element->material->rendererBuffers.push_back(MaterialProxy::BufferBindInfo(idx, slotIdx, perFrameParamBuffer));
 					}
 					}
 				}
 				}
+			}
 
 
-				if (perObjectBlockName != "")
+			if (perObjectBlockName != "")
+			{
+				auto findIter = paramsDesc.paramBlocks.find(perObjectBlockName);
+				if (findIter != paramsDesc.paramBlocks.end())
 				{
 				{
-					auto findIter = paramsDesc.paramBlocks.find(perObjectBlockName);
-					if (findIter != paramsDesc.paramBlocks.end())
+					if (findIter->second.blockSize == perObjectParamBlockDesc.blockSize)
 					{
 					{
-						if (findIter->second.blockSize == perObjectParamBlockDesc.blockSize)
-						{
-							if (rendererData->perObjectParamBuffer == nullptr)
-								rendererData->perObjectParamBuffer = HardwareBufferManager::instance().createGpuParamBlockBuffer(perObjectParamBlockDesc.blockSize * sizeof(UINT32));
+						if (rendererData->perObjectParamBuffer == nullptr)
+							rendererData->perObjectParamBuffer = HardwareBufferManager::instance().createGpuParamBlockBuffer(perObjectParamBlockDesc.blockSize * sizeof(UINT32));
 
 
-							rendererData->perObjectBuffers.push_back(MaterialProxy::BufferBindInfo(idx, findIter->second.slot, rendererData->perObjectParamBuffer));
+						rendererData->perObjectBuffers.push_back(MaterialProxy::BufferBindInfo(idx, findIter->second.slot, rendererData->perObjectParamBuffer));
 
 
-							if (!rendererData->hasWVPParam && wvpParamName != "")
+						if (!rendererData->hasWVPParam && wvpParamName != "")
+						{
+							auto findIter2 = paramsDesc.params.find(wvpParamName);
+							if (findIter2 != paramsDesc.params.end())
 							{
 							{
-								auto findIter2 = paramsDesc.params.find(wvpParamName);
-								if (findIter2 != paramsDesc.params.end())
+								if (paramsMatch(findIter2->second, wvpParamDesc))
 								{
 								{
-									if (paramsMatch(findIter2->second, wvpParamDesc))
-									{
-										gpuParams->getParam(wvpParamName, rendererData->wvpParam);
-										rendererData->hasWVPParam = true;
-									}
+									gpuParams->getParam(wvpParamName, rendererData->wvpParam);
+									rendererData->hasWVPParam = true;
 								}
 								}
 							}
 							}
 						}
 						}
 					}
 					}
 				}
 				}
-
-				idx++;
 			}
 			}
 
 
-			bindGlobalBuffers(element);
+			idx++;
 		}
 		}
+
+		bindGlobalBuffers(element);
 	}
 	}
 
 
-	void LitTexRenderableHandler::bindPerObjectBuffers(const RenderableProxyPtr& renderable, const RenderableElement* element)
+	void LitTexRenderableHandler::bindPerObjectBuffers(const RenderableElement* element)
 	{
 	{
-		if (renderable->renderableType != RenType_LitTextured)
-			return;
-
 		const PerObjectData* rendererData = any_cast_unsafe<PerObjectData>(&element->rendererData);
 		const PerObjectData* rendererData = any_cast_unsafe<PerObjectData>(&element->rendererData);
 		for (auto& perObjectBuffer : rendererData->perObjectBuffers)
 		for (auto& perObjectBuffer : rendererData->perObjectBuffers)
 		{
 		{

+ 15 - 24
BansheeRenderer/Source/BsBansheeRenderer.cpp

@@ -75,23 +75,17 @@ namespace BansheeEngine
 			mWorldTransforms.push_back(element->worldTransform);
 			mWorldTransforms.push_back(element->worldTransform);
 			mWorldBounds.push_back(element->calculateWorldBounds());
 			mWorldBounds.push_back(element->calculateWorldBounds());
 
 
-			element->id = (UINT32)(mRenderableElements.size() - 1);
-		}
-
-		// Find and set up renderer buffers and parameters
-		static auto paramsMatch = [](const GpuParamDataDesc& a, const GpuParamDataDesc& b)
-		{
-			return a.gpuMemOffset == b.gpuMemOffset && a.elementSize == b.elementSize &&
-				a.arraySize == b.arraySize && a.arrayElementStride == b.arrayElementStride;
-		};
+			element->renderableType = proxy->renderableType;
+			if (proxy->renderableType == RenType_LitTextured)
+				element->handler = mLitTexHandler;
+			else
+				element->handler = nullptr;
 
 
-		if (proxy->renderableType == RenType_LitTextured)
-			proxy->handler = mLitTexHandler;
-		else
-			proxy->handler = nullptr;
+			if (element->handler != nullptr)
+				element->handler->initializeRenderElem(element);
 
 
-		if (proxy->handler != nullptr)
-			proxy->handler->initializeProxy(proxy);
+			element->id = (UINT32)(mRenderableElements.size() - 1);
+		}
 	}
 	}
 
 
 	void BansheeRenderer::removeRenderableProxy(RenderableProxyPtr proxy)
 	void BansheeRenderer::removeRenderableProxy(RenderableProxyPtr proxy)
@@ -431,11 +425,12 @@ namespace BansheeEngine
 		if (!cameraProxy.ignoreSceneRenderables)
 		if (!cameraProxy.ignoreSceneRenderables)
 		{
 		{
 			// Update per-object param buffers and queue render elements
 			// Update per-object param buffers and queue render elements
-			for (auto& proxy : mRenderableProxies)
-			{
-				for (auto& renderElem : proxy.second->renderableElements)
+				for (auto& renderElem : mRenderableElements)
 				{
 				{
-					if (proxy.second->renderableType == RenType_LitTextured)
+					if (renderElem->handler != nullptr)
+						renderElem->handler->bindPerObjectBuffers(renderElem);
+
+					if (renderElem->renderableType == RenType_LitTextured)
 					{
 					{
 						Matrix4 worldViewProjMatrix = viewProjMatrix * mWorldTransforms[renderElem->id];;
 						Matrix4 worldViewProjMatrix = viewProjMatrix * mWorldTransforms[renderElem->id];;
 						mLitTexHandler->updatePerObjectBuffers(renderElem, worldViewProjMatrix);
 						mLitTexHandler->updatePerObjectBuffers(renderElem, worldViewProjMatrix);
@@ -447,9 +442,8 @@ namespace BansheeEngine
 					}
 					}
 
 
 					// TODO - Do frustum culling
 					// TODO - Do frustum culling
-					renderQueue->add(proxy.second, renderElem, mWorldBounds[renderElem->id].getSphere().getCenter());
+					renderQueue->add(renderElem, mWorldBounds[renderElem->id].getSphere().getCenter());
 				}
 				}
-			}
 		}
 		}
 
 
 		renderQueue->sort();
 		renderQueue->sort();
@@ -459,9 +453,6 @@ namespace BansheeEngine
 		{
 		{
 			MaterialProxyPtr materialProxy = iter->material;
 			MaterialProxyPtr materialProxy = iter->material;
 
 
-			if (iter->renderable != nullptr && iter->renderable->handler != nullptr)
-				iter->renderable->handler->bindPerObjectBuffers(iter->renderable, iter->renderElem);
-
 			setPass(materialProxy, iter->passIdx);
 			setPass(materialProxy, iter->passIdx);
 			draw(*iter->mesh);
 			draw(*iter->mesh);
 		}
 		}

+ 103 - 0
ExampleProject/CameraFlyer.cpp

@@ -0,0 +1,103 @@
+#include "CameraFlyer.h"
+#include "BsVector3.h"
+#include "BsTime.h"
+#include "BsMath.h"
+#include "BsSceneObject.h"
+#include "BsCamera.h"
+#include "BsPlatform.h"
+#include "BsCursor.h"
+#include "BsDebug.h"
+
+namespace BansheeEngine
+{
+	const float CameraFlyer::START_SPEED = 40.0f;
+	const float CameraFlyer::TOP_SPEED = 130.0f;
+	const float CameraFlyer::ACCELERATION = 10.0f;
+	const float CameraFlyer::FAST_MODE_MULTIPLIER = 2.0f;
+	const float CameraFlyer::ROTATION_SPEED = 0.5f; // Degrees/pixel
+
+	CameraFlyer::CameraFlyer(const HSceneObject& parent)
+		:Component(parent), mPitch(0.0f), mYaw(0.0f), mLastButtonState(false)
+	{
+		setName("CameraFlyer");
+
+		mCamera = sceneObject()->getComponent<Camera>();
+		mCamera->setNearClipDistance(5);
+
+		mMoveForward = VirtualButton("Forward");
+		mMoveBack = VirtualButton("Back");
+		mMoveLeft = VirtualButton("Left");
+		mMoveRight = VirtualButton("Right");
+		mFastMove = VirtualButton("FastMove");
+		mRotateCam = VirtualButton("RotateCam");
+		mHorizontalAxis = VirtualAxis("Horizontal");
+		mVerticalAxis = VirtualAxis("Vertical");
+	}
+
+	void CameraFlyer::update()
+	{
+		bool goingForward = gVirtualInput().isButtonHeld(mMoveForward);
+		bool goingBack = gVirtualInput().isButtonHeld(mMoveBack);
+		bool goingLeft = gVirtualInput().isButtonHeld(mMoveLeft);
+		bool goingRight = gVirtualInput().isButtonHeld(mMoveRight);
+		bool fastMove = gVirtualInput().isButtonHeld(mFastMove);
+		bool camRotating = gVirtualInput().isButtonHeld(mRotateCam);
+
+		if (camRotating != mLastButtonState)
+		{
+			if (camRotating)
+				Cursor::instance().hide();
+			else
+				Cursor::instance().show();
+
+			mLastButtonState = camRotating;
+		}
+
+		Vector3 direction = Vector3::ZERO;
+		if (goingForward) direction += SO()->getForward();
+		if (goingBack) direction -= SO()->getForward();
+		if (goingRight) direction += SO()->getRight();
+		if (goingLeft) direction -= SO()->getRight();
+
+		if (direction.squaredLength() != 0)
+		{
+			direction.normalize();
+
+			float multiplier = 1.0f;
+			if (fastMove)
+				multiplier = FAST_MODE_MULTIPLIER;
+
+			mCurrentSpeed = Math::clamp(mCurrentSpeed + ACCELERATION * gTime().getFrameDelta(), START_SPEED, TOP_SPEED);
+			mCurrentSpeed *= multiplier;
+		}
+		else
+		{
+			mCurrentSpeed = 0.0f;
+		}
+
+		float tooSmall = std::numeric_limits<float>::epsilon();
+		if (mCurrentSpeed > tooSmall)
+		{
+			Vector3 velocity = direction * mCurrentSpeed;
+			SO()->move(velocity * gTime().getFrameDelta());
+		}
+
+		if (camRotating)
+		{
+			mYaw += Degree(gVirtualInput().getAxisValue(mHorizontalAxis) * ROTATION_SPEED);
+			mPitch += Degree(gVirtualInput().getAxisValue(mVerticalAxis) * ROTATION_SPEED);
+
+			Quaternion yRot;
+			yRot.fromAxisAngle(Vector3::UNIT_Y, Radian(mYaw));
+
+			Quaternion xRot;
+			xRot.fromAxisAngle(yRot.xAxis(), Radian(mPitch));
+
+			Quaternion camRot = xRot * yRot;
+
+			SO()->setRotation(camRot);
+		}
+
+		LOGWRN(toString(SO()->getPosition()));
+	}
+}

+ 4 - 0
ExampleProject/ExampleProject.vcxproj

@@ -144,8 +144,12 @@
     </Link>
     </Link>
   </ItemDefinitionGroup>
   </ItemDefinitionGroup>
   <ItemGroup>
   <ItemGroup>
+    <ClCompile Include="CameraFlyer.cpp" />
     <ClCompile Include="Main\Main.cpp" />
     <ClCompile Include="Main\Main.cpp" />
   </ItemGroup>
   </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="Include\CameraFlyer.h" />
+  </ItemGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <ImportGroup Label="ExtensionTargets">
   <ImportGroup Label="ExtensionTargets">
   </ImportGroup>
   </ImportGroup>

+ 8 - 0
ExampleProject/ExampleProject.vcxproj.filters

@@ -18,5 +18,13 @@
     <ClCompile Include="Main\Main.cpp">
     <ClCompile Include="Main\Main.cpp">
       <Filter>Source Files</Filter>
       <Filter>Source Files</Filter>
     </ClCompile>
     </ClCompile>
+    <ClCompile Include="CameraFlyer.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="Include\CameraFlyer.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
   </ItemGroup>
   </ItemGroup>
 </Project>
 </Project>

+ 41 - 0
ExampleProject/Include/CameraFlyer.h

@@ -0,0 +1,41 @@
+#pragma once
+
+#include "BsPrerequisites.h"
+#include "BsComponent.h"
+#include "BsMath.h"
+#include "BsVirtualInput.h"
+
+namespace BansheeEngine
+{
+	class CameraFlyer : public Component
+	{
+	public:
+		CameraFlyer(const HSceneObject& parent);
+
+		virtual void update();
+
+	private:
+		float mCurrentSpeed;
+
+		Degree mPitch;
+		Degree mYaw;
+		bool mLastButtonState;
+
+		HCamera mCamera;
+
+		VirtualButton mMoveForward;
+		VirtualButton mMoveBack;
+		VirtualButton mMoveLeft;
+		VirtualButton mMoveRight;
+		VirtualButton mFastMove;
+		VirtualButton mRotateCam;
+		VirtualAxis mVerticalAxis;
+		VirtualAxis mHorizontalAxis;
+
+		static const float START_SPEED;
+		static const float TOP_SPEED;
+		static const float ACCELERATION;
+		static const float FAST_MODE_MULTIPLIER;
+		static const float ROTATION_SPEED; // Degrees/second
+	};
+}

+ 21 - 7
ExampleProject/Main/Main.cpp

@@ -27,6 +27,9 @@
 #include "BsSceneObject.h"
 #include "BsSceneObject.h"
 #include "BsCoreThread.h"
 #include "BsCoreThread.h"
 #include "BsProfilerOverlay.h"
 #include "BsProfilerOverlay.h"
+#include "BsRenderer.h"
+
+#include "CameraFlyer.h"
 
 
 namespace BansheeEngine
 namespace BansheeEngine
 {
 {
@@ -141,7 +144,9 @@ namespace BansheeEngine
 		// Create material
 		// Create material
 		ShaderPtr exampleShader = Shader::create("ExampleShader");
 		ShaderPtr exampleShader = Shader::create("ExampleShader");
 
 
-		exampleShader->addParameter("matViewProjection", "matViewProjection", GPDT_MATRIX_4X4);
+		// Set up shader parameters and renderer semantics
+		exampleShader->setParamBlockAttribs("PerObject", true, GPBU_DYNAMIC, RBS_PerObject);
+		exampleShader->addParameter("matWorldViewProj", "matWorldViewProj", GPDT_MATRIX_4X4, RPS_WorldViewProjTfrm);
 		exampleShader->addParameter("samp", "samp", GPOT_SAMPLER2D);
 		exampleShader->addParameter("samp", "samp", GPOT_SAMPLER2D);
 		exampleShader->addParameter("tex", "tex", GPOT_TEXTURE2D);
 		exampleShader->addParameter("tex", "tex", GPOT_TEXTURE2D);
 
 
@@ -163,21 +168,31 @@ namespace BansheeEngine
 		HSceneObject sceneCameraSO = SceneObject::create("SceneCamera");
 		HSceneObject sceneCameraSO = SceneObject::create("SceneCamera");
 
 
 		RenderWindowPtr window = gApplication().getPrimaryWindow();
 		RenderWindowPtr window = gApplication().getPrimaryWindow();
-		sceneCamera = sceneCameraSO->addComponent<Camera>(window, 0.0f, 0.0f, 1.0f, 1.0f);
+		sceneCamera = sceneCameraSO->addComponent<Camera>(window);
 
 
 		sceneCamera->setPriority(1);
 		sceneCamera->setPriority(1);
-		sceneCameraSO->setPosition(Vector3(0, 50, 1240));
-		sceneCameraSO->lookAt(Vector3(0, 50, -300));
+		sceneCameraSO->setPosition(Vector3(40.0f, 30.0f, 230.0f));
+		sceneCameraSO->lookAt(Vector3(0, 0, 0));
 		sceneCamera->setNearClipDistance(5);
 		sceneCamera->setNearClipDistance(5);
 		sceneCamera->setAspectRatio(resolutionWidth / (float)resolutionHeight); // TODO - This needs to get called whenever resolution changes
 		sceneCamera->setAspectRatio(resolutionWidth / (float)resolutionHeight); // TODO - This needs to get called whenever resolution changes
 
 
+		sceneCameraSO->addComponent<CameraFlyer>();
+
 		// Register input configuration
 		// Register input configuration
 		auto inputConfig = VirtualInput::instance().getConfiguration();
 		auto inputConfig = VirtualInput::instance().getConfiguration();
 
 
 		inputConfig->registerButton("Forward", BC_W);
 		inputConfig->registerButton("Forward", BC_W);
+		inputConfig->registerButton("Back", BC_S);
 		inputConfig->registerButton("Left", BC_A);
 		inputConfig->registerButton("Left", BC_A);
 		inputConfig->registerButton("Right", BC_D);
 		inputConfig->registerButton("Right", BC_D);
-		inputConfig->registerButton("Back", BC_S);
+		inputConfig->registerButton("Forward", BC_UP);
+		inputConfig->registerButton("Back", BC_BACK);
+		inputConfig->registerButton("Left", BC_LEFT);
+		inputConfig->registerButton("Right", BC_RIGHT);
+		inputConfig->registerButton("FastMove", BC_LSHIFT);
+		inputConfig->registerButton("RotateCam", BC_MOUSE_RIGHT);
+		inputConfig->registerAxis("Horizontal", VIRTUAL_AXIS_DESC((UINT32)InputAxis::MouseX));
+		inputConfig->registerAxis("Vertical", VIRTUAL_AXIS_DESC((UINT32)InputAxis::MouseY));
 
 
 		inputConfig->registerButton("CPUProfilerOverlay", BC_F1);
 		inputConfig->registerButton("CPUProfilerOverlay", BC_F1);
 		inputConfig->registerButton("GPUProfilerOverlay", BC_F2);
 		inputConfig->registerButton("GPUProfilerOverlay", BC_F2);
@@ -187,14 +202,13 @@ namespace BansheeEngine
 
 
 		VirtualInput::instance().onButtonUp.connect(&buttonUp);
 		VirtualInput::instance().onButtonUp.connect(&buttonUp);
 
 
-		// TODO - Add vertical/horizontal axes here
-
 		HSceneObject exampleSO = SceneObject::create("Example");
 		HSceneObject exampleSO = SceneObject::create("Example");
 
 
 		HCamera guiCamera = exampleSO->addComponent<Camera>(window);
 		HCamera guiCamera = exampleSO->addComponent<Camera>(window);
 		guiCamera->setNearClipDistance(5);
 		guiCamera->setNearClipDistance(5);
 		guiCamera->setAspectRatio(1.0f);
 		guiCamera->setAspectRatio(1.0f);
 		guiCamera->setIgnoreSceneRenderables(true);
 		guiCamera->setIgnoreSceneRenderables(true);
+		guiCamera->getViewport()->setRequiresClear(false, false, false);
 
 
 		HGUIWidget gui = exampleSO->addComponent<GUIWidget>(guiCamera->getViewport().get());
 		HGUIWidget gui = exampleSO->addComponent<GUIWidget>(guiCamera->getViewport().get());
 		gui->setDepth(128);
 		gui->setDepth(128);

+ 4 - 0
Polish.txt

@@ -12,6 +12,8 @@ Polish TODO:
  - Make a separate release branch with no editor/script stuff, and without .txt files and other development data
  - Make a separate release branch with no editor/script stuff, and without .txt files and other development data
  - (HIGHLY OPTIONAL) Make a Getting Started guide, along with the example project. Or just finish up the manual.
  - (HIGHLY OPTIONAL) Make a Getting Started guide, along with the example project. Or just finish up the manual.
 
 
+ Model triangles are inverted.
+
 Rebuild OIS with XINPUT support (OIS_WIN32_XINPUT_SUPPORT)
 Rebuild OIS with XINPUT support (OIS_WIN32_XINPUT_SUPPORT)
 Rename CamelotOIS to BansheeOIS
 Rename CamelotOIS to BansheeOIS
 
 
@@ -25,6 +27,8 @@ Add smoothing
   - UE4 seems to receive multiple mouse samples per frame. I only sample input once per frame
   - UE4 seems to receive multiple mouse samples per frame. I only sample input once per frame
     - Actually OIS seems to receive multiple samples too, but it just accumulates them automatically
     - Actually OIS seems to receive multiple samples too, but it just accumulates them automatically
 
 
+Scale input by FOV like in UE4?
+
 -----------------
 -----------------
 
 
 There's still a crash regarding an uninitialized mCachedPtr on a C# class when shutting down. Attempt to find consistent repro steps.
 There's still a crash regarding an uninitialized mCachedPtr on a C# class when shutting down. Attempt to find consistent repro steps.