Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Device: samsung GT-I9505
- Stack trace: frame buffer couldn't be constructed: incomplete attachment <- com.badlogic.gdx.graphics.glutils.GLFrameBuffer.build(GLFrameBuffer.java:223) <-
- com.badlogic.gdx.graphics.glutils.GLFrameBuffer.<init>(GLFrameBuffer.java:118) <-
- com.badlogic.gdx.graphics.glutils.FrameBuffer.<init>(FrameBuffer.java:57) <-
- com.badlogic.gdx.graphics.glutils.FrameBuffer.<init>(FrameBuffer.java:45) <-
- Client code:
- Used for blur shader program
- Constructor:
- blurTargetA = new FrameBuffer(Pixmap.Format.RGBA8888, (int)WIDTH, (int)HEIGHT, false);
- blurTargetB = new FrameBuffer(Pixmap.Format.RGBA8888, (int)WIDTH, (int)HEIGHT, false);
- fboRegion = new TextureRegion(blurTargetA.getColorBufferTexture());
- fboRegionB = new TextureRegion(blurTargetB.getColorBufferTexture());
- fboRegion.flip(false, true);
- fboRegionB.flip(false, true);
- draw method:
- blurTargetA.begin();
- Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
- batch.setShader(null);
- super.draw(batch, 1f);
- batch.flush();
- blurTargetA.end();
- if(blurType == BlurType.Motion)
- drawMotionBlur(batch);
- if(blurType == BlurType.Gaussian)
- drawGaussianBlur(batch);
- batch.setShader(null);
- drawMotionBlur:
- batch.setShader(blurShader);
- blurShader.setUniformf("dir", -1f, 0f);
- blurShader.setUniformf("radius", 750 * 0.06f);
- fboRegion.setTexture(blurTargetA.getColorBufferTexture());
- batch.draw(fboRegion, 0, 0);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement