0
전경 텍스처를 LibGDX의 배경 텍스처 위에 가려는 중입니다. 그것은 화면에 그릴 때 잘 작동하지만 FBO에서 그릴 때 배경이 사라집니다.FBO에서 마스킹 할 때 보이지 않는 배경
정기
batch.begin();
batch.enableBlending();
batch.setProjectionMatrix(camera.combined);
drawFull(32, 600 - (64 * 4) - 32);
batch.end();
:
여기
batch.draw(background, x, y);
batch.flush();
Gdx.gl.glColorMask(false, false, false, true);
batch.setBlendFunction(GL20.GL_ONE, GL20.GL_ZERO);
batch.draw(mask, x, y);
batch.flush();
Gdx.gl.glColorMask(true, true, true, true);
batch.setBlendFunction(GL20.GL_DST_ALPHA, GL20.GL_ONE_MINUS_DST_ALPHA);
batch.draw(foreground, x, y);
batch.flush();
batch.setBlendFunction(GL20.GL_SRC_ALPHA, GL20.GL_ONE_MINUS_SRC_ALPHA);
내가 FBO 일 정규 하나를 그리기, 그리고 내가 얼마나입니다 : 여기
는 마스크를 그려하는 방법입니다
FBO
// draw the FB mask
fb.begin();
batch.begin();
batch.setProjectionMatrix(fbcamera.combined);
batch.enableBlending();
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
drawFull(0, 0);
batch.end();
fb.end();
// draw the FB mask to the main batch
batch.begin();
batch.enableBlending();
batch.setProjectionMatrix(camera.combined);
batch.draw(fb.getColorBufferTexture(), 32, 600 - (64 * 7) - 32);
batch.end();
전체 SSCCE는 GitHub 볼 수 있습니다.