SHARE
TWEET

Untitled

a guest Dec 25th, 2014 3 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //--------------------Composite--------------------------
  2.                         {      
  3.                                 glUseProgram(compositeShader.program);
  4.                                 glBindFramebuffer(GL_FRAMEBUFFER, 0);
  5.                                
  6.                                 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
  7.        
  8.                                 compositeShader.compositeVAO(width, height);
  9.        
  10.                                 glActiveTexture(GL_TEXTURE0);
  11.                                 glBindTexture(GL_TEXTURE_2D, blurShader.texH);
  12.                                 glUniform1i(compositeShader.depthMap, 0);
  13.        
  14.                                 glActiveTexture(GL_TEXTURE1);
  15.                                 glBindTexture(GL_TEXTURE_2D, thicknessShader.tex);
  16.                                 glUniform1i(compositeShader.thicknessMap, 1);
  17.                                
  18.                                 glActiveTexture(GL_TEXTURE2);
  19.                                 glBindTexture(GL_TEXTURE_2D, normShader.tex);
  20.                                 glUniform1i(compositeShader.normalMap, 2);
  21.        
  22.                                 RenderUtility.setMatrix(compositeShader, projection, "projection");
  23.                                 RenderUtility.setMatrix(compositeShader, mView, "mView");
  24.                                 RenderUtility.setVector2(compositeShader, screenSize, "screenSize");
  25.                                 RenderUtility.setVector3(compositeShader, new Vector3(0.3f, 0.3f, 0.8f), "color");
  26.                                 RenderUtility.setVector3(compositeShader, lightPos, "lightPos");
  27.                                 RenderUtility.setFloat(compositeShader, zFar, "zFar");
  28.                                 RenderUtility.setFloat(compositeShader, zNear, "zNear");
  29.        
  30.                                 glEnable(GL_DEPTH_TEST);
  31.                                 glEnable(GL_BLEND);
  32.                                 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
  33.        
  34.                                 glBindVertexArray(compositeShader.vao);
  35.                                
  36.                                 glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
  37.        
  38.                                 glDisable(GL_DEPTH_TEST);
  39.                                 glDisable(GL_BLEND);
  40.        
  41.                                 glViewport(0, 0, width, height);
  42.                                
  43.                         }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top