SHARE
TWEET
Untitled
a guest
Dec 25th, 2014
3
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- //--------------------Composite--------------------------
- {
- glUseProgram(compositeShader.program);
- glBindFramebuffer(GL_FRAMEBUFFER, 0);
- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
- compositeShader.compositeVAO(width, height);
- glActiveTexture(GL_TEXTURE0);
- glBindTexture(GL_TEXTURE_2D, blurShader.texH);
- glUniform1i(compositeShader.depthMap, 0);
- glActiveTexture(GL_TEXTURE1);
- glBindTexture(GL_TEXTURE_2D, thicknessShader.tex);
- glUniform1i(compositeShader.thicknessMap, 1);
- glActiveTexture(GL_TEXTURE2);
- glBindTexture(GL_TEXTURE_2D, normShader.tex);
- glUniform1i(compositeShader.normalMap, 2);
- RenderUtility.setMatrix(compositeShader, projection, "projection");
- RenderUtility.setMatrix(compositeShader, mView, "mView");
- RenderUtility.setVector2(compositeShader, screenSize, "screenSize");
- RenderUtility.setVector3(compositeShader, new Vector3(0.3f, 0.3f, 0.8f), "color");
- RenderUtility.setVector3(compositeShader, lightPos, "lightPos");
- RenderUtility.setFloat(compositeShader, zFar, "zFar");
- RenderUtility.setFloat(compositeShader, zNear, "zNear");
- glEnable(GL_DEPTH_TEST);
- glEnable(GL_BLEND);
- glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
- glBindVertexArray(compositeShader.vao);
- glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
- glDisable(GL_DEPTH_TEST);
- glDisable(GL_BLEND);
- glViewport(0, 0, width, height);
- }
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.

