SHARE
TWEET

Untitled

a guest Dec 23rd, 2014 135 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //--------------------Particle Blur-----------------------
  2.                         {
  3.                                 glUseProgram(blurShader.program);
  4.                                
  5.                                 //Vertical blur
  6.                                 glBindFramebuffer(GL_FRAMEBUFFER, blurShader.fboV);
  7.                                 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
  8.  
  9.                                 blurShader.blurDepthVAO();
  10.                                
  11.                                 glActiveTexture(GL_TEXTURE0);
  12.                                 glBindTexture(GL_TEXTURE_2D, depthShader.tex);
  13.                                 glUniform1i(blurShader.depthMap, 0);
  14.                                
  15.                                 RenderUtility.addVector2(blurShader, screenSize, "screenSize");
  16.                                 RenderUtility.addMatrix(blurShader, projection, "projection");
  17.                                 RenderUtility.addVector2(blurShader, new Vector2(0.0f, 1.0f / screenSize.y), "blurDir");
  18.                                
  19.                                 glEnable(GL_DEPTH_TEST);
  20.                                
  21.                                 glBindVertexArray(blurShader.vao);
  22.                                
  23.                                 glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
  24.                                
  25.                                 //Horizontal Blur
  26.                                 glBindFramebuffer(GL_FRAMEBUFFER, blurShader.fboH);
  27.                                 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
  28.                                
  29.                                 glActiveTexture(GL_TEXTURE0);
  30.                                 glBindTexture(GL_TEXTURE_2D, blurShader.texV);
  31.                                 glUniform1i(blurShader.depthMap, 0);
  32.                                
  33.                                 RenderUtility.addVector2(blurShader, screenSize, "screenSize");
  34.                                 RenderUtility.addMatrix(blurShader, projection, "projection");
  35.                                 RenderUtility.addVector2(blurShader, new Vector2(1.0f / screenSize.x, 0.0f), "blurDir");
  36.                                
  37.                                 glEnable(GL_DEPTH_TEST);
  38.                                
  39.                                 glBindVertexArray(blurShader.vao);
  40.                                
  41.                                 glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
  42.                         }
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