| 
					
				 | 
			
			
				@@ -1,46 +1,35 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 #include "Wrapper.h" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-#include <random> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+#include <cmath> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 DummyClient DummyClient::dummy; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 IClient* Engine::client = &DummyClient::dummy; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-GLFWwindow* Engine::window = nullptr; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-// active program 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-GLuint Engine::activeProgram = 0; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-// world data 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-ShaderProgram Engine::worldShader; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-GLuint Engine::worldFrameBuffer = 0; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-GLuint Engine::worldPositionTexture = 0; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-GLuint Engine::worldNormalTexture = 0; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-GLuint Engine::worldColorTexture = 0; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-GLuint Engine::worldDepthTexture = 0; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-// ssao shader 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-ShaderProgram Engine::ssaoShader; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-GLuint Engine::ssaoFrameBuffer = 0; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-GLuint Engine::ssaoTexture = 0; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-// post shader 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-GLuint Engine::postVba = 0; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-GLuint Engine::postVbo = 0; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-ShaderProgram Engine::postShader; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+// window data 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+GLFWwindow* Engine::window = nullptr; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 int Engine::scale = 1; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 int Engine::width = 0; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 int Engine::height = 0; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-bool Engine::lineMode = false; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-float Engine::testX = 0; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-float Engine::testY = 0; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-float Engine::testZ = 0; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-// ssao kernel data 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-Vector3D Engine::ssaoKernel[ssaoKernelAmount]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-GLuint Engine::noiseTexture = 0; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-Matrix3D Engine::testMat; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+// projection data 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+float Engine::fovY = 60; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+float Engine::nearClip = 0.1f; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+float Engine::farClip = 1000.0f; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+Matrix3D Engine::projMatrix; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+// rectangle for framebuffer drawing 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+FramebufferRectangle Engine::rectangle; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+// shader stage 1 - world 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+WorldShader Engine::worldShader; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+// shader stage 2 - world ssao 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+SSAOShader Engine::ssaoShader; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+// shader stage 3 - world ssao blur 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+SSAOBlurShader Engine::ssaoBlurShader; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+// shader stage 4 - world post 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+WorldPostShader Engine::worldPostShader; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+// shader stage 5 - 2D overlay 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+OverlayShader Engine::overlayShader; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 bool Engine::init(int width, int height, const char* name) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -78,25 +67,7 @@ bool Engine::init(int width, int height, const char* name) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     cout << "Status: Using GLEW " << glewGetString(GLEW_VERSION) << endl; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    worldShader.compile("shader/worldVertex.vs", "shader/worldFragment.fs"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    if(!worldShader.isValid()) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        glfwDestroyWindow(window); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        glfwTerminate(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        return false; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    activeProgram = worldShader.getProgram(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    ssaoShader.compile("shader/ssaoVertex.vs", "shader/ssaoFragment.fs"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    if(!ssaoShader.isValid()) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        glfwDestroyWindow(window); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        glfwTerminate(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        return false; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-     
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    postShader.compile("shader/postVertex.vs", "shader/postFragment.fs"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    if(!postShader.isValid()) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    if(!worldShader.init() || !ssaoShader.init() || !ssaoBlurShader.init() || !worldPostShader.init() || !overlayShader.init() || !rectangle.init()) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         glfwDestroyWindow(window); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         glfwTerminate(); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -118,8 +89,6 @@ void Engine::start(IClient* client) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         Engine::client = client; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				      
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    onInit(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     glEnable(GL_CULL_FACE); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     glDepthFunc(GL_LEQUAL); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				      
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -158,7 +127,6 @@ void Engine::start(IClient* client) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         glfwPollEvents(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				      
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    onTerm(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     glfwDestroyWindow(window); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     glfwTerminate(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 } 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -184,15 +152,10 @@ void Engine::onWindowResize(GLFWwindow* w, int width, int height) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     Engine::width = width; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     Engine::height = height; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     updateScale(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-     
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    /*glBindFramebuffer(GL_FRAMEBUFFER, frameBuffer);  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    glBindTexture(GL_TEXTURE_2D, frameTexture); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    glBindTexture(GL_TEXTURE_2D, 0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    glBindRenderbuffer(GL_RENDERBUFFER, depthTexture);  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT, width, height);   
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    glBindRenderbuffer(GL_RENDERBUFFER, 0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    glBindFramebuffer(GL_FRAMEBUFFER, 0);*/ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    worldShader.resize(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    ssaoShader.resize(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    ssaoBlurShader.resize(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    worldPostShader.resize(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 void Engine::updateScale() 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -219,24 +182,19 @@ int Engine::getHeight() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     return height; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-GLint Engine::getUniformLocation(const GLchar* name) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    return glGetUniformLocation(activeProgram, name); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-void Engine::setMatrix(GLint location, const GLfloat* m) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+float Engine::getFieldOfView() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    glUniformMatrix4fv(location, 1, 0, m); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    return fovY; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-void Engine::setInt(GLint location, GLint i) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+float Engine::getNearClip() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    glUniform1i(location, i); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    return nearClip; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-void Engine::setFloat(GLint location, GLfloat f1, GLfloat f2, GLfloat f3, GLfloat f4) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+float Engine::getFarClip() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    glUniform4f(location, f1, f2, f3, f4); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    return farClip; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 void Engine::printError() 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -273,205 +231,86 @@ void Engine::printError() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-void Engine::onInit() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+void Engine::onRenderTick(float lag) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    // generate framebuffer and textures for world buffer 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    glGenFramebuffers(1, &worldFrameBuffer); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    glBindFramebuffer(GL_FRAMEBUFFER, worldFrameBuffer); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    // world position texture 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    glGenTextures(1, &worldPositionTexture); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    glBindTexture(GL_TEXTURE_2D, worldPositionTexture); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB16F, width, height, 0, GL_RGB, GL_FLOAT, NULL); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, worldPositionTexture, 0);    
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    // world normal texture 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    glGenTextures(1, &worldNormalTexture); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    glBindTexture(GL_TEXTURE_2D, worldNormalTexture); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB16F, width, height, 0, GL_RGB, GL_FLOAT, NULL); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT1, GL_TEXTURE_2D, worldNormalTexture, 0);    
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    // world color texture 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    glGenTextures(1, &worldColorTexture); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    glBindTexture(GL_TEXTURE_2D, worldColorTexture); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT2, GL_TEXTURE_2D, worldColorTexture, 0);   
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    // set color attachements for the worldFrameBuffer 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    GLuint attachments[3] =  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        GL_COLOR_ATTACHMENT0, GL_COLOR_ATTACHMENT1, GL_COLOR_ATTACHMENT2  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    }; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    glDrawBuffers(3, attachments); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    // world depth texture 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    glGenTextures(1, &worldDepthTexture); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    glBindTexture(GL_TEXTURE_2D, worldDepthTexture); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH24_STENCIL8, width, height, 0, GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8, NULL); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, GL_TEXTURE_2D, worldDepthTexture, 0);  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    // check if world framebuffer is okay 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    if(glCheckFramebufferStatus(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-	cout << "world frame buffer is not complete!" << endl; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    glBindFramebuffer(GL_FRAMEBUFFER, 0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    // update projection matrix 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    float tan = tanf((0.5f * fovY) * M_PI / 180.0f); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    float q = 1.0f / tan; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    float aspect = (float) width / height; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    projMatrix.set(0, 0, q / aspect); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    projMatrix.set(1, 1, q); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    projMatrix.set(2, 2, (nearClip + farClip) / (nearClip - farClip)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    projMatrix.set(3, 2, -1.0f); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    projMatrix.set(2, 3, (2.0f * nearClip * farClip) / (nearClip - farClip)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    projMatrix.set(3, 3, 0);  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				      
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    // generate data for drawing previously generated framebuffer as rectangle 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    glGenVertexArrays(1, &postVba); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    glBindVertexArray(postVba); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    // ------------------------------------------------------------------------- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    // shader stage 1 - world 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    // ------------------------------------------------------------------------- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    worldShader.preRender(projMatrix.getValues()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    // call render tick for further drawing 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    client->render3DTick(lag); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				      
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    glGenBuffers(1, &postVbo); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    glBindBuffer(GL_ARRAY_BUFFER, postVbo); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    glVertexAttribPointer(0, 2, GL_FLOAT, 0, sizeof(float) * 4, (GLvoid*) 0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    glEnableVertexAttribArray(0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    glVertexAttribPointer(1, 2, GL_FLOAT, 0, sizeof(float) * 4, (GLvoid*) (sizeof(float) * 2)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    glEnableVertexAttribArray(1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    // ------------------------------------------------------------------------- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    // shader stage 2 - world ssao 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    // ------------------------------------------------------------------------- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    ssaoShader.preRender(projMatrix.getValues()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    // bind previously generated texture data buffers 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    worldShader.bindPositionTexture(1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    worldShader.bindNormalTexture(2); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    worldShader.bindColorTexture(3); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    worldShader.bindDepthTexture(4); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    ssaoShader.bindNoiseTexture(5); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				      
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    float data[] =  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        -1.0f, 1.0f, 0.0f, 1.0f,  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        -1.0f, -1.0f, 0.0f, 0.0f, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        1.0f, -1.0f, 1.0f, 0.0f, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        -1.0f, 1.0f, 0.0f, 1.0f, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        1.0f, -1.0f, 1.0f, 0.0f, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        1.0f, 1.0f, 1.0f, 1.0f 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    }; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    rectangle.draw(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				      
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    glBufferData(GL_ARRAY_BUFFER, sizeof(float) * 24, data, GL_STATIC_DRAW); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    // ------------------------------------------------------------------------- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    // shader stage 3 - world ssao blur 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    // ------------------------------------------------------------------------- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    ssaoBlurShader.preRender(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    ssaoShader.bindTexture(6); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    rectangle.draw(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				      
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    // generate ssao kernel data 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    glGenFramebuffers(1, &ssaoFrameBuffer); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    glBindFramebuffer(GL_FRAMEBUFFER, ssaoFrameBuffer); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    // ssao color texture 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    glGenTextures(1, &ssaoTexture); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    glBindTexture(GL_TEXTURE_2D, ssaoTexture); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    glTexImage2D(GL_TEXTURE_2D, 0, GL_RED, width, height, 0, GL_RGB, GL_FLOAT, NULL); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, ssaoTexture, 0);   
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    // check if world framebuffer is okay 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    if(glCheckFramebufferStatus(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-	cout << "ssao frame buffer is not complete!" << endl; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    glBindFramebuffer(GL_FRAMEBUFFER, 0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    // ------------------------------------------------------------------------- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    // shader stage 4 - world post 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    // ------------------------------------------------------------------------- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    worldPostShader.preRender(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    ssaoBlurShader.bindTexture(7); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    rectangle.draw(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				      
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    std::uniform_real_distribution<float> randomF(0.0, 1.0); // random floats between 0.0 - 1.0 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    std::default_random_engine gen; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    for(int i = 0; i < ssaoKernelAmount; i++) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        ssaoKernel[i].set(randomF(gen) * 2.0 - 1.0, randomF(gen) * 2.0 - 1.0, randomF(gen)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        ssaoKernel[i].normalize(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        ssaoKernel[i].mul(randomF(gen)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-         
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        float scale = (float) i / ssaoKernelAmount;  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        scale  = 0.1f + (scale * scale) * 0.9f; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        ssaoKernel[i].mul(scale); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        //cout << ssaoKernel[i] << endl; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    // ------------------------------------------------------------------------- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    // shader stage 5 - 2D overlay 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    // ------------------------------------------------------------------------- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				      
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    float noise[48]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    for(int i = 0; i < 16; i++) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        noise[i * 3] = randomF(gen) * 2.0 - 1.0; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        noise[i * 3 + 1] = randomF(gen) * 2.0 - 1.0; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        noise[i * 3 + 2] = 0.0f; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    }   
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    overlayShader.preRender(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    worldPostShader.bindTexture(0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    rectangle.draw(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    overlayShader.setViewMatrix(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				      
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    glGenTextures(1, &noiseTexture); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    glBindTexture(GL_TEXTURE_2D, noiseTexture); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB16F, 4, 4, 0, GL_RGB, GL_FLOAT, noise); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    overlayShader.setUseColor(true); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    overlayShader.setUseTexture(true); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    glEnable(GL_BLEND); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    glBlendEquation(GL_FUNC_ADD); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    client->render2DTick(lag); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    glDisable(GL_BLEND); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-void Engine::onRenderTick(float lag) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+void Engine::setWorldViewMatrix(const float* data) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    //-------------------------------------------------------------------------- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    // Stage 1: draw scene in world framebuffer 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    //-------------------------------------------------------------------------- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    glActiveTexture(GL_TEXTURE0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-     
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    activeProgram = worldShader.getProgram(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    glUseProgram(activeProgram); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-     
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    glBindFramebuffer(GL_FRAMEBUFFER, worldFrameBuffer); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    glEnable(GL_DEPTH_TEST); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    if(lineMode) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        Engine::client->renderTick(lag); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        Engine::client->renderTick(lag); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    //-------------------------------------------------------------------------- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    // Stage 2: draw textured framebuffer 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    //-------------------------------------------------------------------------- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    glActiveTexture(GL_TEXTURE1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    glBindTexture(GL_TEXTURE_2D, worldPositionTexture); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    glActiveTexture(GL_TEXTURE2); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    glBindTexture(GL_TEXTURE_2D, worldNormalTexture); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    glActiveTexture(GL_TEXTURE3); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    glBindTexture(GL_TEXTURE_2D, worldColorTexture); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    glActiveTexture(GL_TEXTURE4); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    glBindTexture(GL_TEXTURE_2D, worldDepthTexture); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    glActiveTexture(GL_TEXTURE5); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    glBindTexture(GL_TEXTURE_2D, noiseTexture); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    activeProgram = ssaoShader.getProgram(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    glUseProgram(activeProgram); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-     
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    for(int i = 0; i < ssaoKernelAmount; i++) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        glUniform3f(glGetUniformLocation(activeProgram, (string("ssaoKernel[") + std::to_string(i) + "]").c_str()),  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                ssaoKernel[i].getX(), ssaoKernel[i].getY(), ssaoKernel[i].getZ()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-     
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    Engine::setMatrix(glGetUniformLocation(activeProgram, "projMatrix"), testMat.getValues()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    glBindFramebuffer(GL_FRAMEBUFFER, ssaoFrameBuffer); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    glClear(GL_COLOR_BUFFER_BIT); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    glDisable(GL_DEPTH_TEST); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    glBindVertexArray(postVba); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    glBindBuffer(GL_ARRAY_BUFFER, postVbo); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    glDrawArrays(GL_TRIANGLES, 0, 6); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-     
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    glActiveTexture(GL_TEXTURE6); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    glBindTexture(GL_TEXTURE_2D, ssaoTexture); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    glBindFramebuffer(GL_FRAMEBUFFER, 0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    glClear(GL_COLOR_BUFFER_BIT); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    activeProgram = postShader.getProgram(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    glUseProgram(activeProgram); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    glDrawArrays(GL_TRIANGLES, 0, 6); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    worldShader.setViewMatrix(data); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-void Engine::onTerm() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+void Engine::setWorldModelMatrix(const float* data) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    glDeleteVertexArrays(1, &postVba); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    glDeleteBuffers(1, &postVbo); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-     
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    glDeleteFramebuffers(1, &worldFrameBuffer); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    glDeleteTextures(1, &worldPositionTexture); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    glDeleteTextures(1, &worldNormalTexture); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    glDeleteTextures(1, &worldColorTexture); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    glDeleteTextures(1, &worldDepthTexture); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    worldShader.setModelMatrix(data); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-void Engine::setLineMode(bool mode) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+void Engine::setOverlayModelMatrix(const float* data) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    lineMode = mode; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    overlayShader.setModelMatrix(data); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+// 562 
			 |