SHARE
TWEET
Untitled
a guest
Dec 26th, 2014
139
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- //--------------------Particle Blur-------------------------
- {
- glUseProgram(blurShader.program);
- //Vertical blur
- glBindFramebuffer(GL_FRAMEBUFFER, blurShader.fboV);
- glDrawBuffer(GL_NONE);
- glReadBuffer(GL_NONE);
- glClear(GL_DEPTH_BUFFER_BIT);
- blurShader.blurDepthVAO();
- glActiveTexture(GL_TEXTURE0);
- glBindTexture(GL_TEXTURE_2D, depthShader.tex);
- glUniform1i(blurShader.depthMap, 0);
- RenderUtility.setVector2(blurShader, screenSize, "screenSize");
- RenderUtility.setMatrix(blurShader, projection, "projection");
- RenderUtility.setVector2(blurShader, new Vector2(0.0f, 1.0f / screenSize.y), "blurDir");
- glEnable(GL_DEPTH_TEST);
- glBindVertexArray(blurShader.vao);
- glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
- //Horizontal Blur
- glBindFramebuffer(GL_FRAMEBUFFER, blurShader.fboH);
- glDrawBuffer(GL_NONE);
- glReadBuffer(GL_NONE);
- glClear(GL_DEPTH_BUFFER_BIT);
- glActiveTexture(GL_TEXTURE0);
- glBindTexture(GL_TEXTURE_2D, blurShader.texV);
- glUniform1i(blurShader.depthMap, 0);
- RenderUtility.setVector2(blurShader, screenSize, "screenSize");
- RenderUtility.setMatrix(blurShader, projection, "projection");
- RenderUtility.setVector2(blurShader, new Vector2(1.0f / screenSize.x, 0.0f), "blurDir");
- glEnable(GL_DEPTH_TEST);
- glBindVertexArray(blurShader.vao);
- glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
- }
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.

