title: Libgdx: Framebuffer for "Fog of War"-Effect
body: <p>I am writing a RTS Game for Android and I want the "Fog of War" effect on the player's units. This effect means that only a "circle" around each unit shows the background map while on places where no player unit is located, the screen should be black. I don't want to use shaders.</p>
  
  <p>I have a first version of it working. What I am doing is to render the map to the default framebuffer, then I have a second Framebuffer (similar to light technics) which is completely black. Where the units of the players are, I then batch-draw a texture which is completely transparent and has a white circle with blurred edges in its middle.
  Finally I draw the second (light) FrameBuffer's colorTexture over the first one using Gdx.gl.glBlendFunc(GL20.GL_DST_COLOR, GL20.GL_ZERO);</p>
  
  <p>The visual effect now is that indeed the whole map is black and a circle around my units is visible - but a lot of white color is added. 
  The reason is pretty clear as I drew the light textures for the units like this:</p>
  
  <pre><code>lightBuffer.begin();
          Gdx.gl.glBlendFunc(GL20.GL_SRC_ALPHA, GL20.GL_ONE);
  
          Gdx.gl.glEnable(GL20.GL_BLEND);
  
          Gdx.gl.glClearColor(0.1f, 0.1f, 0.1f, 1f);
          Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
  
          batch.setProjectionMatrix(camera.combined);
          batch.begin();
  
          batch.setColor(1f, 1f, 1f, 1f);
          for (RTSTroopAction i : unitList) {
                  batch.draw(lightSprite, i.getX() + (i.getWidth() / 2) - 230, i.getY() + (i.getHeight() / 2) - 230, 460, 460); //, 0, 0, lightSprite.getWidth(), lightSprite.getHeight(), false, true);
  
          }
  
          batch.end();
          lightBuffer.end();
  </code></pre>
  
  <p>However, I don't want the "white stuff" on the original texture, I just want the original background shine through. How can I achieve that ?</p>
  
  <p>I think it's playing around with the blendFuncs, but I was not able to figure out which values to use yet.</p>