Commit 4eeafca1 authored by hybrid's avatar hybrid

Enable test for projection matrix. I have removed the projection matrix tweak...

Enable test for projection matrix. I have removed the projection matrix tweak from OpenGL driver, as it does not seem to have any effect. At least no good one.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@3501 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 6b183756
......@@ -113,7 +113,7 @@ int main(int argumentCount, char * arguments[])
TEST(viewPort);
TEST(mrt);
// TODO: Needs to be fixed first.
// TEST(projectionMatrix);
TEST(projectionMatrix);
// large scenes/long rendering
// shadows are slow
// TEST(orthoCam);
......
......@@ -32,7 +32,7 @@ static bool runTestWithDriver(E_DRIVER_TYPE driverType)
driver->setMaterial(mat);
core::dimension2d<u32> dims = driver->getCurrentRenderTargetSize();
core::dimension2d<f32> dims(driver->getCurrentRenderTargetSize());
//apply custom projection, no offset
core::matrix4 pmtx = matrix4().buildProjectionMatrixOrthoLH(dims.Width, dims.Height, 0, 100);
driver->setTransform(ETS_PROJECTION, pmtx);
......@@ -42,12 +42,12 @@ static bool runTestWithDriver(E_DRIVER_TYPE driverType)
//the red cross appears at center
for (u32 i=0; i<10; ++i)
{
driver->draw3DLine(vector3df(0+i,-50,1), vector3df(0+i,50,1), SColor(255,255,0,0));
driver->draw3DLine(vector3df(-50,0+i,1), vector3df(50,0+i,1), SColor(255,255,0,0));
driver->draw3DLine(vector3df(0.f+i,-50.f,1.f), vector3df(0.f+i,50.f,1.f), SColor(255,255,0,0));
driver->draw3DLine(vector3df(-50.f,0.f+i,1.f), vector3df(50.f,0.f+i,1.f), SColor(255,255,0,0));
}
//apply custom projection, offset to right-top
pmtx.setTranslation(vector3df(0.7, 0.7, 0));
pmtx.setTranslation(vector3df(0.7f, 0.7f, 0.f));
driver->setTransform(ETS_PROJECTION, pmtx);
driver->setTransform(ETS_VIEW, matrix4());
driver->setTransform(ETS_WORLD, matrix4());
......@@ -55,15 +55,17 @@ static bool runTestWithDriver(E_DRIVER_TYPE driverType)
//The green cross must be in right-top corner. But for OpenGL driver it is in left-top corner
for (u32 i=0; i<10; ++i)
{
driver->draw3DLine(vector3df(0+i,-50,1), vector3df(0+i,50,1), SColor(255,0,255,0));
driver->draw3DLine(vector3df(-50,0+i,1), vector3df(50,0+i,1), SColor(255,0,255,0));
driver->draw3DLine(vector3df(0.f+i,-50,1), vector3df(0.f+i,50,1), SColor(255,0,255,0));
driver->draw3DLine(vector3df(-50,0.f+i,1), vector3df(50,0.f+i,1), SColor(255,0,255,0));
}
driver->endScene();
result = takeScreenshotAndCompareAgainstReference(driver, "-projMat.png");
device->drop();
device->closeDevice();
device->run();
device->drop();
return result;
}
......@@ -73,7 +75,8 @@ bool projectionMatrix(void)
{
bool passed = true;
passed &= runTestWithDriver(EDT_SOFTWARE);
// TODO: Seems that software driver does not handle this projection matrix
// passed &= runTestWithDriver(EDT_SOFTWARE);
passed &= runTestWithDriver(EDT_BURNINGSVIDEO);
passed &= runTestWithDriver(EDT_DIRECT3D9);
passed &= runTestWithDriver(EDT_DIRECT3D8);
......@@ -81,4 +84,3 @@ bool projectionMatrix(void)
return passed;
}
......@@ -67,6 +67,7 @@
<Unit filename="meshTransform.cpp" />
<Unit filename="mrt.cpp" />
<Unit filename="planeMatrix.cpp" />
<Unit filename="projectionMatrix.cpp" />
<Unit filename="removeCustomAnimator.cpp" />
<Unit filename="sceneCollisionManager.cpp" />
<Unit filename="sceneNodeAnimator.cpp" />
......
......@@ -118,6 +118,7 @@
<ClCompile Include="mrt.cpp" />
<ClCompile Include="orthoCam.cpp" />
<ClCompile Include="planeMatrix.cpp" />
<ClCompile Include="projectionMatrix.cpp" />
<ClCompile Include="removeCustomAnimator.cpp" />
<ClCompile Include="renderTargetTexture.cpp" />
<ClCompile Include="sceneCollisionManager.cpp" />
......
......@@ -284,6 +284,10 @@
RelativePath=".\planeMatrix.cpp"
>
</File>
<File
RelativePath=".\projectionMatrix.cpp"
>
</File>
<File
RelativePath=".\removeCustomAnimator.cpp"
>
......
......@@ -319,6 +319,10 @@
RelativePath=".\planeMatrix.cpp"
>
</File>
<File
RelativePath=".\projectionMatrix.cpp"
>
</File>
<File
RelativePath=".\removeCustomAnimator.cpp"
>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment