Advertisement
Guest User

Untitled

a guest
Jan 21st, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.58 KB | None | 0 0
  1. Device: samsung GT-I9505
  2.  
  3. Stack trace: frame buffer couldn't be constructed: incomplete attachment <- com.badlogic.gdx.graphics.glutils.GLFrameBuffer.build(GLFrameBuffer.java:223) <-
  4. com.badlogic.gdx.graphics.glutils.GLFrameBuffer.<init>(GLFrameBuffer.java:118) <-
  5. com.badlogic.gdx.graphics.glutils.FrameBuffer.<init>(FrameBuffer.java:57) <-
  6. com.badlogic.gdx.graphics.glutils.FrameBuffer.<init>(FrameBuffer.java:45) <-
  7.  
  8. Client code:
  9. Used for blur shader program
  10.  
  11. Constructor:
  12. blurTargetA = new FrameBuffer(Pixmap.Format.RGBA8888, (int)WIDTH, (int)HEIGHT, false);
  13. blurTargetB = new FrameBuffer(Pixmap.Format.RGBA8888, (int)WIDTH, (int)HEIGHT, false);
  14. fboRegion = new TextureRegion(blurTargetA.getColorBufferTexture());
  15. fboRegionB = new TextureRegion(blurTargetB.getColorBufferTexture());
  16. fboRegion.flip(false, true);
  17. fboRegionB.flip(false, true);
  18.  
  19. draw method:
  20. blurTargetA.begin();
  21. Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
  22. batch.setShader(null);
  23.  
  24. super.draw(batch, 1f);
  25. batch.flush();
  26. blurTargetA.end();
  27.  
  28. if(blurType == BlurType.Motion)
  29. drawMotionBlur(batch);
  30. if(blurType == BlurType.Gaussian)
  31. drawGaussianBlur(batch);
  32.  
  33. batch.setShader(null);
  34.  
  35. drawMotionBlur:
  36. batch.setShader(blurShader);
  37. blurShader.setUniformf("dir", -1f, 0f);
  38. blurShader.setUniformf("radius", 750 * 0.06f);
  39. fboRegion.setTexture(blurTargetA.getColorBufferTexture());
  40. batch.draw(fboRegion, 0, 0);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement