Hello
I want to create a dark room and light the way of the character. But this code:
g.clearAlphaMap();
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE);
g.setDrawMode(Graphics.MODE_ALPHA_MAP);
character.getAlphaMap().drawCentered(activeProt.x, activeProt.y);
GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_DST_ALPHA);
g.setColor(Color.darkGray);
g.fillRect(0, 0, 750, 450);
g.setDrawMode(Graphics.MODE_NORMAL);
does not work. This snippet is in the render method. Before this code snippet there are only items and animations drawn. And a g.resetTransform();
I already put the first part “g.clearAlphaMap()” at the beginning of the render Method. But then there is a grey box.
I tested the alpha mapping in a test project, only containing of a background image and the alphamap png. That worked as expected.
What is wrong? Please help me