Jason McKesson avatar Jason McKesson committed 38f1881

UBOs do in fact work. Tutorial 7 code complete.

Comments (0)

Files changed (2)

Tut 07 World in Motion/World Scene.cpp

 	glDepthMask(GL_TRUE);
 	glDepthFunc(GL_LEQUAL);
 	glDepthRange(0.0f, 1.0f);
+	glEnable(GL_DEPTH_CLAMP);
 }
 
 static float g_fYAngle = 0.0f;

Tut 07 World in Motion/World With UBO.cpp

 	glDepthMask(GL_TRUE);
 	glDepthFunc(GL_LEQUAL);
 	glDepthRange(0.0f, 1.0f);
+	glEnable(GL_DEPTH_CLAMP);
 }
 
 static float g_fYAngle = 0.0f;
 			Framework::MatrixStackPusher push(modelMatrix);
 			modelMatrix.Translate(glm::vec3(20.0f, 0.0f, -10.0f));
 
-//			DrawParthenon(modelMatrix);
+			DrawParthenon(modelMatrix);
 		}
 
 		if(g_bDrawLookatPoint)
 		{
-			/*
 			glDisable(GL_DEPTH_TEST);
 			glm::mat4 idenity(1.0f);
 
 			Framework::MatrixStackPusher push(modelMatrix);
 
-			glm::vec3 cameraAimVec = g_camTarget - camPos;
-			modelMatrix.Translate(0.0f, 0.0, -glm::length(cameraAimVec));
+			modelMatrix.Translate(g_camTarget);
 			modelMatrix.Scale(1.0f, 1.0f, 1.0f);
 
 			glUseProgram(ObjectColor.theProgram);
 			glUniformMatrix4fv(ObjectColor.modelToWorldMatrixUnif, 1, GL_FALSE, glm::value_ptr(modelMatrix.Top()));
-			glUniformMatrix4fv(ObjectColor.worldToCameraMatrixUnif, 1, GL_FALSE, glm::value_ptr(idenity));
 			g_pCubeColorMesh->Render();
 			glUseProgram(0);
 			glEnable(GL_DEPTH_TEST);
-			*/
+
 		}
 	}
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.