Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static int PingPong=0;
- PingPong= ( PingPong+ 1) % 4;
- start_fbo(accum[PingPong].fbo,XRES,YRES);
- sky_do(sceneTime);
- end_fbo();
- char temp[5]={0};
- int blurtex[4];
- for (int i=0;i<4;i++)
- {
- ZeroMemory(temp,5);
- sprintf(temp,"tex%d",i+1,4);
- blurtex[i]=oglGetUniformLocation(blur_shaderobj, temp);
- }
- oglUseProgram( blur_shaderobj );
- for (int i=0;i<4;i++)
- {
- oglUniform1i(blurtex[i], i);
- oglActiveTextureARB(GL_TEXTURE0_ARB + i);
- glBindTexture(GL_TEXTURE_2D,accum[((PingPong + i) % 4)].texture);
- }
- oglActiveTextureARB(GL_TEXTURE0_ARB + 0);
- draw_fbtexture(accum[PingPong].texture,XRES, YRES);
- oglUseProgram( NULL );
- glBindTexture(GL_TEXTURE_2D,0);
Add Comment
Please, Sign In to add comment