Bladeren bron

Changes in here and there

Panagiotis Christopoulos Charitos 15 jaren geleden
bovenliggende
commit
b7323f3c0f

File diff suppressed because it is too large
+ 0 - 0
build/debug/Makefile


+ 1 - 1
run-unit-tests.sh

@@ -2,4 +2,4 @@
 
 export LD_LIBRARY_PATH=extern/lib-x86-64-linux/
 ulimit -c unlimited
-unit-tests/build/anki-unit-tests
+unit-tests/build/anki-unit-tests $1

+ 1 - 1
src/Math/Mat4.inl.h

@@ -486,7 +486,7 @@ inline Mat4 Mat4::operator/(float f) const
 		mm = _mm_set1_ps(f);
 		for(int i = 0; i < 4; i++)
 		{
-			r.arrMm[i] = _mm_mul_ps(arrMm[i], mm);
+			r.arrMm[i] = _mm_div_ps(arrMm[i], mm);
 		}
 	#else
 		for(int i = 0; i < 16; i++)

+ 3 - 1
src/Renderer/Hdr.h

@@ -21,15 +21,17 @@ class Hdr: private RenderingPass
 	PROPERTY_R(float, renderingQuality, getRenderingQuality)
 	/// The blurring iterations of the tone map
 	PROPERTY_RW(uint, blurringIterationsNum, getBlurringIterationsNum, setBlurringIterationsNum)
-	PROPERTY_RW(float, exposure, getExposure, setExposure)///< How bright is the HDR
+	//PROPERTY_RW(float, exposure, getExposure, setExposure)///< How bright is the HDR
 	PROPERTY_RW(float, blurringDist, getBlurringDist, setBlurringDist)
 
 	public:
 		Hdr(Renderer& r_): RenderingPass(r_) {}
 		void init(const RendererInitializer& initializer);
 		void run();
+		GETTER_SETTER_BY_VAL(float, exposure, getExposure, setExposure)
 
 	private:
+		float exposure; ///< How bright is the HDR
 		Fbo toneFbo;
 		Fbo hblurFbo;
 		Fbo vblurFbo;

+ 1 - 1
src/Renderer/MainRenderer.cpp

@@ -100,7 +100,7 @@ void MainRenderer::render(Camera& cam_)
 	glDisable(GL_DEPTH_TEST);
 	glDisable(GL_BLEND);
 	sProg->bind();
-	//sProg->findUniVar("rasterImage")->setTexture(ms.getNormalFai(), 0);
+	//sProg->findUniVar("rasterImage")->setTexture(ms.getDiffuseFai(), 0);
 	sProg->findUniVar("rasterImage")->setTexture(pps.getPostPassFai(), 0);
 	drawQuad();
 }

+ 4 - 5
src/Renderer/Renderer.h

@@ -34,6 +34,7 @@ class Renderer
 	PROPERTY_R(uint, height, getHeight) ///< Height of the rendering. Dont confuse with the window width
 	PROPERTY_R(float, aspectRatio, getAspectRatio) ///< Just a precalculated value
 	PROPERTY_R(Mat4, viewProjectionMat, getViewProjectionMat) ///< Precalculated in case anyone needs it
+	PROPERTY_R(uint, framesNum, getFramesNum) ///< Frame number
 
 	//====================================================================================================================
 	// Public                                                                                                            =
@@ -66,10 +67,9 @@ class Renderer
 
 		/// @name Accessors
 		/// @{
-		uint getFramesNum() const {return framesNum;}
-		Ms& getMs() {return ms;}
-		Is& getIs() {return is;}
-		Pps& getPps() {return pps;}
+		GETTER_RW(Ms, ms, getMs)
+		GETTER_RW(Is, is, getIs)
+		GETTER_RW(Pps, pps, getPps)
 		/// @}
 
 		/// My version of gluUnproject
@@ -125,7 +125,6 @@ class Renderer
 		Bs bs; ///< Blending stage
 		/// @}
 
-		uint framesNum; ///< Frame number
 		const Camera* cam; ///< Current camera
 		static int maxColorAtachments; ///< Max color attachments an FBO can accept
 

+ 1 - 0
src/Renderer/SceneDbgDrawer.h

@@ -1,6 +1,7 @@
 #ifndef SCENE_DBG_DRAWER_H
 #define SCENE_DBG_DRAWER_H
 
+
 class Dbg;
 class Camera;
 class Light;

+ 225 - 0
src/Renderer/SceneDrawer.cpp

@@ -0,0 +1,225 @@
+#include "SceneDrawer.h"
+#include "Math.h"
+#include "Material.h"
+#include "SceneNodePatch.h"
+#include "Camera.h"
+#include "Renderer.h"
+#include "App.h"
+#include "Scene.h"
+
+
+//======================================================================================================================
+// setupShaderProg                                                                                                     =
+//======================================================================================================================
+void SceneDrawer::setupShaderProg(const Material& mtl, const Transform& nodeWorldTransform, const Camera& cam,
+		                              const Renderer& r)
+{
+	uint textureUnit = 0;
+
+	mtl.getShaderProg().bind();
+
+	//
+	// FFP stuff
+	//
+	if(mtl.isBlendingEnabled())
+	{
+		glEnable(GL_BLEND);
+		//glDisable(GL_BLEND);
+		glBlendFunc(mtl.getBlendingSfactor(), mtl.getBlendingDfactor());
+	}
+	else
+	{
+		glDisable(GL_BLEND);
+	}
+
+
+	if(mtl.isDepthTestingEnabled())
+	{
+		glEnable(GL_DEPTH_TEST);
+	}
+	else
+	{
+		glDisable(GL_DEPTH_TEST);
+	}
+
+	if(mtl.isWireframeEnabled())
+	{
+		glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
+	}
+	else
+	{
+		glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
+	}
+
+
+	//
+	// calc needed matrices
+	//
+	Mat4 modelMat(nodeWorldTransform);
+	const Mat4& projectionMat = cam.getProjectionMatrix();
+	const Mat4& viewMat = cam.getViewMatrix();
+	Mat4 modelViewMat;
+	Mat3 normalMat;
+	Mat4 modelViewProjectionMat;
+
+	// should I calculate the modelViewMat ?
+	if(mtl.getStdUniVar(Material::SUV_MODELVIEW_MAT) ||
+	   mtl.getStdUniVar(Material::SUV_MODELVIEWPROJECTION_MAT) ||
+	   mtl.getStdUniVar(Material::SUV_NORMAL_MAT))
+	{
+		modelViewMat = Mat4::combineTransformations(viewMat, modelMat);
+	}
+
+	// set matrices
+	if(mtl.getStdUniVar(Material::SUV_MODEL_MAT))
+	{
+		mtl.getStdUniVar(Material::SUV_MODEL_MAT)->setMat4(&modelMat);
+	}
+
+	if(mtl.getStdUniVar(Material::SUV_VIEW_MAT))
+	{
+		mtl.getStdUniVar(Material::SUV_VIEW_MAT)->setMat4(&viewMat);
+	}
+
+	if(mtl.getStdUniVar(Material::SUV_PROJECTION_MAT))
+	{
+		mtl.getStdUniVar(Material::SUV_PROJECTION_MAT)->setMat4(&projectionMat);
+	}
+
+	if(mtl.getStdUniVar(Material::SUV_MODELVIEW_MAT))
+	{
+		mtl.getStdUniVar(Material::SUV_MODELVIEW_MAT)->setMat4(&modelViewMat);
+	}
+
+	if(mtl.getStdUniVar(Material::SUV_VIEWPROJECTION_MAT))
+	{
+		mtl.getStdUniVar(Material::SUV_VIEWPROJECTION_MAT)->setMat4(&r.getViewProjectionMat());
+	}
+
+	if(mtl.getStdUniVar(Material::SUV_NORMAL_MAT))
+	{
+		normalMat = modelViewMat.getRotationPart();
+		mtl.getStdUniVar(Material::SUV_NORMAL_MAT)->setMat3(&normalMat);
+	}
+
+	if(mtl.getStdUniVar(Material::SUV_MODELVIEWPROJECTION_MAT))
+	{
+		modelViewProjectionMat = projectionMat * modelViewMat;
+		mtl.getStdUniVar(Material::SUV_MODELVIEWPROJECTION_MAT)->setMat4(&modelViewProjectionMat);
+	}
+
+
+	//
+	// FAis
+	//
+	if(mtl.getStdUniVar(Material::SUV_MS_NORMAL_FAI))
+	{
+		mtl.getStdUniVar(Material::SUV_MS_NORMAL_FAI)->setTexture(r.getMs().getNormalFai(), textureUnit++);
+	}
+
+	if(mtl.getStdUniVar(Material::SUV_MS_DIFFUSE_FAI))
+	{
+		mtl.getStdUniVar(Material::SUV_MS_DIFFUSE_FAI)->setTexture(r.getMs().getDiffuseFai(), textureUnit++);
+	}
+
+	if(mtl.getStdUniVar(Material::SUV_MS_SPECULAR_FAI))
+	{
+		mtl.getStdUniVar(Material::SUV_MS_SPECULAR_FAI)->setTexture(r.getMs().getSpecularFai(), textureUnit++);
+	}
+
+	if(mtl.getStdUniVar(Material::SUV_MS_DEPTH_FAI))
+	{
+		mtl.getStdUniVar(Material::SUV_MS_DEPTH_FAI)->setTexture(r.getMs().getDepthFai(), textureUnit++);
+	}
+
+	if(mtl.getStdUniVar(Material::SUV_IS_FAI))
+	{
+		mtl.getStdUniVar(Material::SUV_IS_FAI)->setTexture(r.getIs().getFai(), textureUnit++);
+	}
+
+	if(mtl.getStdUniVar(Material::SUV_PPS_PRE_PASS_FAI))
+	{
+		mtl.getStdUniVar(Material::SUV_PPS_PRE_PASS_FAI)->setTexture(r.getPps().getPrePassFai(), textureUnit++);
+	}
+
+	if(mtl.getStdUniVar(Material::SUV_PPS_POST_PASS_FAI))
+	{
+		mtl.getStdUniVar(Material::SUV_PPS_POST_PASS_FAI)->setTexture(r.getPps().getPostPassFai(), textureUnit++);
+	}
+
+
+	//
+	// Other
+	//
+	if(mtl.getStdUniVar(Material::SUV_RENDERER_SIZE))
+	{
+		Vec2 v(r.getWidth(), r.getHeight());
+		mtl.getStdUniVar(Material::SUV_RENDERER_SIZE)->setVec2(&v);
+	}
+
+	if(mtl.getStdUniVar(Material::SUV_SCENE_AMBIENT_COLOR))
+	{
+		Vec3 col(AppSingleton::getInstance().getScene().getAmbientCol());
+		mtl.getStdUniVar(Material::SUV_SCENE_AMBIENT_COLOR)->setVec3(&col);
+	}
+
+
+	//
+	// set user defined vars
+	//
+	boost::ptr_vector<MtlUserDefinedVar>::const_iterator it = mtl.getUserDefinedVars().begin();
+	for(; it !=  mtl.getUserDefinedVars().end(); it++)
+	{
+		const MtlUserDefinedVar& udv = *it;
+
+		switch(udv.getUniVar().getGlDataType())
+		{
+			// texture or FAI
+			case GL_SAMPLER_2D:
+				if(udv.getTexture() != NULL)
+				{
+					udv.getUniVar().setTexture(*udv.getTexture(), textureUnit);
+				}
+				else
+				{
+					switch(udv.getFai())
+					{
+						case MtlUserDefinedVar::MS_DEPTH_FAI:
+							udv.getUniVar().setTexture(r.getMs().getDepthFai(), textureUnit);
+							break;
+						case MtlUserDefinedVar::IS_FAI:
+							udv.getUniVar().setTexture(r.getIs().getFai(), textureUnit);
+							break;
+						case MtlUserDefinedVar::PPS_PRE_PASS_FAI:
+							udv.getUniVar().setTexture(r.getPps().getPrePassFai(), textureUnit);
+							break;
+						case MtlUserDefinedVar::PPS_POST_PASS_FAI:
+							udv.getUniVar().setTexture(r.getPps().getPostPassFai(), textureUnit);
+							break;
+						default:
+							RASSERT_THROW_EXCEPTION("WTF?");
+					}
+				}
+				++textureUnit;
+				break;
+			// float
+			case GL_FLOAT:
+				udv.getUniVar().setFloat(udv.getFloat());
+				break;
+			// vec2
+			case GL_FLOAT_VEC2:
+				udv.getUniVar().setVec2(&udv.getVec2());
+				break;
+			// vec3
+			case GL_FLOAT_VEC3:
+				udv.getUniVar().setVec3(&udv.getVec3());
+				break;
+			// vec4
+			case GL_FLOAT_VEC4:
+				udv.getUniVar().setVec4(&udv.getVec4());
+				break;
+		}
+	}
+
+	ON_GL_FAIL_THROW_EXCEPTION();
+}

+ 40 - 0
src/Renderer/SceneDrawer.h

@@ -0,0 +1,40 @@
+#ifndef SCENE_DRAWER_H
+#define SCENE_DRAWER_H
+
+#include "Math.h"
+
+
+class SceneNodePatch;
+class Renderer;
+class Camera;
+class Material;
+
+
+/// It includes all the functions to render a SceneNodePatch
+class SceneDrawer
+{
+	public:
+		enum RenderingPassType
+		{
+			RPT_COLOR,
+			RPT_DEPTH
+		};
+
+
+	private:
+		//const Renderer& r; ///< Keep it here cause the class wants a few FAIs
+
+		/// This function:
+		/// - binds the shader program
+		/// - loads the uniforms
+		/// - sets the GL state
+		/// @param mtl The material containing the shader program and the locations
+		/// @param nodeWorldTransform The world transformation to pass to the shader
+		/// @param cam Needed for some matrices (view & projection)
+		/// @param r The renderer, needed for some FAIs and some matrices
+		static void setupShaderProg(const Material& mtl, const Transform& nodeWorldTransform, const Camera& cam,
+		                            const Renderer& r);
+};
+
+
+#endif

+ 10 - 15
src/Resources/Texture.cpp

@@ -57,21 +57,27 @@ void Texture::load(const char* filename)
 			int internalFormat;
 			int format;
 			int type;
-			internalFormat = (compressionEnabled) ? GL_COMPRESSED_RGB : GL_RGB;
+			internalFormat = GL_RGBA;
 			format = GL_RGBA;
 			type = GL_UNSIGNED_BYTE;
 
 			int w = 100, h = 100;
 			int level = 0;
-			//uint cols
+			uint cols[3] = {0xFF0000FF, 0xFF00FF00, 0xFFFF0000};
+			uint ii = 0;
 			while(1)
 			{
-				uint col = rand();
+				uint col = cols[ii++];
 				Vec<uint> buff(w * h, col);
 				glTexImage2D(target, level, internalFormat, w, h, 0, format, type, &buff[0]);
 				++level;
 				w /= 2;
 				h /= 2;
+				if(ii > 2)
+				{
+					ii = 0;
+				}
+
 				if(w == 0 || h == 0)
 				{
 					break;
@@ -81,18 +87,7 @@ void Texture::load(const char* filename)
 			setTexParameter(GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
 			//setTexParameter(GL_TEXTURE_MIN_FILTER, GL_LINEAR);
 			setTexParameter(GL_TEXTURE_MAG_FILTER, GL_LINEAR);
-			setTexParameter(GL_TEXTURE_MAX_ANISOTROPY_EXT, float(anisotropyLevel));
-
-
-			/*w = img.getWidth();
-			h = img.getHeight();
-			Vec<uchar> buff__(w * h * 3, 0x0F);
-			glTexSubImage2D(target, 0, 0, 0, w, h, format, type, &buff__[0]);
-
-			w = img.getWidth() / 2;
-			h = img.getHeight() / 2;
-			Vec<uchar> buff(w * h * 3, 0xFF);
-			glTexSubImage2D(target, 1, 0, 0, w, h, format, type, &buff[0]);*/
+			//setTexParameter(GL_TEXTURE_MAX_ANISOTROPY_EXT, float(anisotropyLevel));
 			return;
 		}
 

+ 1 - 1
src/Scene/ModelNode.cpp

@@ -12,6 +12,6 @@ void ModelNode::init(const char* filename)
 
 	for(uint i = 0; i < model->getModelPatches().size(); i++)
 	{
-		patches.push_back(new ModelNodePatch(model->getModelPatches()[i]));
+		patches.push_back(new ModelNodePatch(*this, model->getModelPatches()[i]));
 	}
 }

+ 3 - 1
src/Scene/ModelNodePatch.cpp

@@ -3,12 +3,14 @@
 #include "Material.h"
 #include "MeshData.h"
 #include "ModelPatch.h"
+#include "ModelNode.h"
 
 
 //======================================================================================================================
 // Constructor                                                                                                         =
 //======================================================================================================================
-ModelNodePatch::ModelNodePatch(const ModelPatch& modelPatch_):
+ModelNodePatch::ModelNodePatch(const ModelNode& modelNode, const ModelPatch& modelPatch_):
+	SceneNodePatch(modelNode),
 	modelPatchRsrc(modelPatch_)
 {
 	boost::array<const Vbo*, Mesh::VBOS_NUM> vboArr;

+ 4 - 2
src/Scene/ModelNodePatch.h

@@ -7,13 +7,15 @@
 #include "RsrcPtr.h"
 #include "ModelPatch.h"
 #include "Properties.h"
+#include "SceneNodePatch.h"
 
 
 class Material;
+class ModelNode;
 
 
 /// A fragment of the ModelNode
-class ModelNodePatch
+class ModelNodePatch: public SceneNodePatch
 {
 	/// VAO for MS and BS. All VBOs could be attached except for the vert weights
 	PROPERTY_R(Vao, cpVao, getCpVao)
@@ -22,7 +24,7 @@ class ModelNodePatch
 	PROPERTY_R(Vao, dpVao, getDpVao)
 
 	public:
-		ModelNodePatch(const ModelPatch& modelPatch);
+		ModelNodePatch(const ModelNode& modelNode, const ModelPatch& modelPatch);
 
 		/// @name Accessors
 		/// @{

+ 29 - 0
src/Scene/SceneNodePatch.h

@@ -0,0 +1,29 @@
+#ifndef SCENE_NODE_PATCH_H
+#define SCENE_NODE_PATCH_H
+
+#include "SceneNode.h"
+
+
+class Vao;
+class Material;
+
+
+/// Abstract class, patch of a compound SceneNode derivative.
+/// Despite of what the name suggests the class is not a SceneNode derivative.
+class SceneNodePatch
+{
+	public:
+		SceneNodePatch(const SceneNode& father_): father(father_) {}
+
+		virtual const Vao& getCpVao() const = 0; ///< Get color pass VAO
+		virtual const Vao& getDpVao() const = 0; ///< Get depth pass VAO
+		virtual const Material& getCpMtl() const = 0;  ///< Get color pass material
+		virtual const Material& getDpMtl() const = 0;  ///< Get depth pass material
+		const Transform& getWorldTransform() const {return father.getWorldTransform();}
+
+	private:
+		const SceneNode& father;
+};
+
+
+#endif

+ 6 - 3
src/Scripting/Renderer/Hdr.bpi.cpp

@@ -4,9 +4,12 @@
 
 WRAP(Hdr)
 {
+	//typedef ;
+
 	class_<Hdr, noncopyable>("Hdr", no_init)
-		BP_PROPERTY_BASIC_TYPE(uint, Hdr, "blurringIterationsNum", getBlurringIterationsNum, setBlurringIterationsNum)
-		BP_PROPERTY_BASIC_TYPE(float, Hdr, "exposure", getExposure, setExposure)
-		BP_PROPERTY_BASIC_TYPE(float, Hdr, "blurringDist", getBlurringDist, setBlurringDist)
+		BP_PROPERTY_BASIC_TYPE(uint, Hdr, blurringIterationsNum, getBlurringIterationsNum, setBlurringIterationsNum)
+		//BP_PROPERTY_BASIC_TYPE(float, Hdr, exposure, getExposure, setExposure)
+		.add_property("exposure", (float (Hdr::*)() const)(&Hdr::getExposure), &Hdr::setExposure)
+		BP_PROPERTY_BASIC_TYPE(float, Hdr, blurringDist, getBlurringDist, setBlurringDist)
 	;
 }

+ 5 - 2
src/Scripting/Renderer/Renderer.bpi.cpp

@@ -4,8 +4,11 @@
 
 WRAP(Renderer)
 {
+	typedef Pps& (Renderer::* getPpsAccessor)();
+
 	class_<Renderer, noncopyable>("Renderer", no_init)
-		.def("getFramesNum", &Renderer::getFramesNum)
-		.def("getPps", &Renderer::getPps, return_value_policy<reference_existing_object>())
+		//BP_PROPERTY_BASIC_TYPE(uint, Renderer, framesNum, getter__, setter__)
+		//.def("getFramesNum", &Renderer::getFramesNum)
+		.def("getPps", (getPpsAccessor)(&Renderer::getPps), return_value_policy<reference_existing_object>())
 	;
 }

+ 1 - 1
src/Scripting/ScriptingCommon.h

@@ -41,7 +41,7 @@ void setterSv(ClassType* t, InType in)
 
 /// Boost python property for simple types (int, float etc) that cannot be wrapped by boost::python correctly
 #define BP_PROPERTY_BASIC_TYPE(Type__, Class__, var__, getter__, setter__) \
-	.add_property(var__, &getterSv<Class__, Type__, &Class__::getter__>, \
+	.add_property(#var__, &getterSv<Class__, Type__, &Class__::getter__>, \
 	              &setterSv<Class__, Type__, &Class__::setter__>)
 
 

+ 32 - 5
src/Util/Properties.h

@@ -2,6 +2,35 @@
 #define PROPERTIES_H
 
 
+/// Read only getter, cause we are to bored to write
+#define GETTER_R(type__, var__, getter__) \
+	const type__& getter__() const {return var__;}
+
+
+/// Read-write getter, cause we are to bored to write
+#define GETTER_RW(type__, var__, getter__) \
+	type__& getter__() {return var__;} \
+	GETTER_R(type__, var__, getter__)
+
+
+/// Setter, cause we are to bored to write
+#define SETTER(type__, var__, setter__) \
+	void setter__(const type__& x__) {var__ = x__;}
+
+
+/// The macro implies read write var
+#define GETTER_SETTER(type__, var__, getter__, setter__) \
+	GETTER_RW(type__, var__, getter__) \
+	SETTER(type__, var__, setter__)
+
+
+/// The macro implies read write var
+#define GETTER_SETTER_BY_VAL(type__, var__, getter__, setter__) \
+	type__ getter__() const {return var__;} \
+	type__& getter__() {return var__;} \
+	void setter__(type__ x__) {var__ = x__;}
+
+
 /// Read write property
 ///
 /// - It deliberately does not work with pointers
@@ -12,9 +41,8 @@
 	private: \
 		Type__ varName__; \
 	public: \
-		void setFunc__(const Type__& x__) {varName__ = x__;} \
-		const Type__& getFunc__() const {return varName__;} \
-		Type__& getFunc__() {return varName__;} \
+		GETTER_RW(Type__, varName__, getFunc__) \
+		void setFunc__(const Type__& x__) {varName__ = x__;}
 
 
 /// Read only private property
@@ -25,8 +53,7 @@
 	private: \
 		Type__ varName__; \
 	public: \
-		const Type__& getFunc__() const {return varName__;} \
-		Type__ getFunc__##Value() const {return varName__;}
+		GETTER_R(Type__, varName__, getFunc__)
 
 
 #endif

+ 4 - 1
unit-tests/Math/MathCommon.ut.h

@@ -104,7 +104,10 @@ void testOperators()
 	EXPECT_EQ(a, c);
 }
 
-
+/// @tparam op eg Type + float
+/// @tparam compoundAssignment eg Type += float
+/// @tparam opExtern eg float + Type
+/// @tparam normalOp The normal function
 template<
 	typename Type,
 	Type (Type::* op)(float) const,

+ 37 - 3
unit-tests/Math/Matrices.ut.cpp

@@ -3,17 +3,51 @@
 #include "Math.h"
 #include "MathCommon.ut.h"
 
+/// Test nxn matrix multiplication
+template<typename Type>
+void testMatrixMul()
+{
+	int dimention = log2(sizeof(Type) / sizeof(float));
+	Type r, a, b;
+
+	// Fill
+	for(int i = 0; i < dimention; i++)
+	{
+		for(int j = 0; j < dimention; j++)
+		{
+			a(i, j) = randFloat();
+			b(i, j) = randFloat();
+		}
+	}
+
+	// Calc r = a * b as usual
+	for(int i = 0; i < dimention; i++)
+	{
+		for(int j = 0; j < dimention; j++)
+		{
+			r(i, j) = 0.0;
+			for(int k = 0; k < dimention; k++)
+			{
+				r(i, j) += a(i, k) * b(k, j);
+			}
+		}
+	}
+
+	EXPECT_EQ(r, a * b);
+}
+
 
 template<typename Type>
 void arithmeticOperations()
 {
-	/*testOperators<Type, &Type::operator+, &Type::operator+=, &addf>();
+	testOperators<Type, &Type::operator+, &Type::operator+=, &addf>();
+	testMatrixMul<Type>();
 	testOperators<Type, &Type::operator-, &Type::operator-=, &subf>();
 	testOperatorsWithFloat<Type, &Type::operator+, &Type::operator+=, &operator+, &addf>();
 	testOperatorsWithFloat<Type, &Type::operator-, &Type::operator-=, &operator-, &subf>();
-	testOperatorsWithFloat<Type, &Type::operator*, &Type::operator*=, &operator*, &mulf>();*/
+	testOperatorsWithFloat<Type, &Type::operator*, &Type::operator*=, &operator*, &mulf>();
 	testOperatorsWithFloat<Type, &Type::operator/, &Type::operator/=, &operator/, &divf>();
-	/*testCmpOperators<Type>();*/
+	testCmpOperators<Type>();
 }
 
 

Some files were not shown because too many files changed in this diff