Slick Forums
http://slick.ninjacave.com/forum/

[Lighting] AlphaMap conflicts with the player sprite
http://slick.ninjacave.com/forum/viewtopic.php?f=3&t=8433
Page 1 of 1

Author:  Xolitude [ Thu Aug 10, 2017 7:27 pm ]
Post subject:  [Lighting] AlphaMap conflicts with the player sprite

Hey everyone! I'm having an issue with the "fake lighting" using an alpha map and the player sprite's alpha. I've read that these two conflict but have found no concrete answer on why or how to go about solving the issue. Here is a screenshot of the problem:
Image

And below is the code I am using to render these two:
Code:
g.clearAlphaMap();
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE);
      
g.setDrawMode(Graphics.MODE_ALPHA_MAP);
this.gradient.drawCentered(100, 100);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);

g.setDrawMode(Graphics.MODE_ALPHA_BLEND);
map.render(gc, sbg, g);
map.renderEntities(gc, sbg, g);
      
g.setDrawMode(Graphics.MODE_NORMAL);
// render UI's.


Is there a way to blend them together or something? Sorry, I'm a bit new at producing light for games as this is my first game and my first attempt at lighting; any help would be greatly appreciated!

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/