title: Java Tile Based Lighting Performance Issues
body: <p>I am trying to implement a tile based lighting system into my game, while keeping optimal performance. Currently, without lighting I have around 700-800 fps. When I render lighting the fps drops to around 300-400.</p>
  
  <p>I render lights using the g.fillRect() with a color of Color(0,0,0,alphaValue)</p>
  
  <p>Code:</p>
  
  <pre><code>for (int y = startY; y&lt;endY; y++) {
      for (int x = startX; x&lt;endX;x++) {
          g.setColor(new Color(0, 0, 0, 255/lightData[y][x]));
          g.fillRect((x*Tile.width)-Camera.x, (y*Tile.height)-Camera.y,
                     Tile.width, Tile.height);
      }
  }
  </code></pre>
  
  <p>LightData[y][x] is a value from 1-8.</p>
  
  <p>I am wondering if there is another way of more efficiently rendering lights. Any help would be greatly appreciated.</p>