对待我的最快办法似乎如下:
- Render the view with plain images to the target buffer
- Render the view with lightmap images on a second
BufferedImage
- Draw the second
BufferedImage
on the target buffer using a custom CompositeContext
The custom CompositeContext
would first apply the darkening + blue shifting, and then multiply by the lightmap value.
Also look into the use of VolatileImage
(see this article for example) to leverage hardware acceleration. Furthermore, you can consider using LWJGL (a complete game dev library) or JOGL (Java OpenGL bindings), again to leverage hardware acceleration. If you ve never done any 3D programming it may seem daunting or overkill, but it s really quite elegant and straightforward for 2D graphics as well.