Prechádzať zdrojové kódy

Merge pull request #749 from kondrak/master

 	use separate projection matrices for left/right eyes in HMD examples
Branimir Karadžić 9 rokov pred
rodič
commit
04cc1a5051

+ 1 - 1
examples/01-cubes/cubes.cpp

@@ -143,7 +143,7 @@ class ExampleCubes : public entry::AppI
 			{
 				float view[16];
 				bx::mtxQuatTranslationHMD(view, hmd->eye[0].rotation, eye);
-				bgfx::setViewTransform(0, view, hmd->eye[0].projection);
+				bgfx::setViewTransform(0, view, hmd->eye[0].projection, BGFX_VIEW_STEREO, hmd->eye[1].projection);
 
 				// Set view 0 default viewport.
 				//

+ 1 - 1
examples/02-metaballs/metaballs.cpp

@@ -577,7 +577,7 @@ class ExampleMetaballs : public entry::AppI
 			{
 				float view[16];
 				bx::mtxQuatTranslationHMD(view, hmd->eye[0].rotation, eye);
-				bgfx::setViewTransform(0, view, hmd->eye[0].projection);
+				bgfx::setViewTransform(0, view, hmd->eye[0].projection, BGFX_VIEW_STEREO, hmd->eye[1].projection);
 
 				// Set view 0 default viewport.
 				//

+ 1 - 1
examples/04-mesh/mesh.cpp

@@ -91,7 +91,7 @@ class ExampleMesh : public entry::AppI
 			{
 				float view[16];
 				bx::mtxQuatTranslationHMD(view, hmd->eye[0].rotation, eye);
-				bgfx::setViewTransform(0, view, hmd->eye[0].projection);
+				bgfx::setViewTransform(0, view, hmd->eye[0].projection, BGFX_VIEW_STEREO, hmd->eye[1].projection);
 
 				// Set view 0 default viewport.
 				//

+ 1 - 1
examples/05-instancing/instancing.cpp

@@ -160,7 +160,7 @@ class ExampleInstancing : public entry::AppI
 				{
 					float view[16];
 					bx::mtxQuatTranslationHMD(view, hmd->eye[0].rotation, eye);
-					bgfx::setViewTransform(0, view, hmd->eye[0].projection);
+					bgfx::setViewTransform(0, view, hmd->eye[0].projection, BGFX_VIEW_STEREO, hmd->eye[1].projection);
 
 					// Set view 0 default viewport.
 					//

+ 1 - 1
examples/06-bump/bump.cpp

@@ -225,7 +225,7 @@ class ExampleBump : public entry::AppI
 			{
 				float view[16];
 				bx::mtxQuatTranslationHMD(view, hmd->eye[0].rotation, eye);
-				bgfx::setViewTransform(0, view, hmd->eye[0].projection);
+				bgfx::setViewTransform(0, view, hmd->eye[0].projection, BGFX_VIEW_STEREO, hmd->eye[1].projection);
 
 				// Set view 0 default viewport.
 				//

+ 1 - 1
examples/12-lod/lod.cpp

@@ -174,7 +174,7 @@ class ExampleLod : public entry::AppI
 			{
 				float view[16];
 				bx::mtxQuatTranslationHMD(view, hmd->eye[0].rotation, eye);
-				bgfx::setViewTransform(0, view, hmd->eye[0].projection);
+				bgfx::setViewTransform(0, view, hmd->eye[0].projection, BGFX_VIEW_STEREO, hmd->eye[1].projection);
 
 				// Set view 0 default viewport.
 				//

+ 1 - 1
examples/24-nbody/nbody.cpp

@@ -305,7 +305,7 @@ int _main_(int _argc, char** _argv)
 
 				float tmp[16];
 				bx::mtxMul(tmp, view, viewHead);
-				bgfx::setViewTransform(0, tmp, hmd->eye[0].projection);
+				bgfx::setViewTransform(0, tmp, hmd->eye[0].projection, BGFX_VIEW_STEREO, hmd->eye[1].projection);
 
 				// Set view 0 default viewport.
 				//