Guest User

Untitled

a guest
Dec 10th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. static int PingPong=0;
  2. PingPong= ( PingPong+ 1) % 4;
  3.  
  4. start_fbo(accum[PingPong].fbo,XRES,YRES);
  5. sky_do(sceneTime);
  6. end_fbo();
  7.  
  8. char temp[5]={0};
  9. int blurtex[4];
  10. for (int i=0;i<4;i++)
  11. {
  12. ZeroMemory(temp,5);
  13. sprintf(temp,"tex%d",i+1,4);
  14. blurtex[i]=oglGetUniformLocation(blur_shaderobj, temp);
  15. }
  16. oglUseProgram( blur_shaderobj );
  17. for (int i=0;i<4;i++)
  18. {
  19. oglUniform1i(blurtex[i], i);
  20. oglActiveTextureARB(GL_TEXTURE0_ARB + i);
  21. glBindTexture(GL_TEXTURE_2D,accum[((PingPong + i) % 4)].texture);
  22. }
  23. oglActiveTextureARB(GL_TEXTURE0_ARB + 0);
  24. draw_fbtexture(accum[PingPong].texture,XRES, YRES);
  25. oglUseProgram( NULL );
  26. glBindTexture(GL_TEXTURE_2D,0);
Add Comment
Please, Sign In to add comment