Slick Forums

Discuss the Slick 2D Library
It is currently Tue Oct 24, 2017 11:20 am

All times are UTC




Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Thu Aug 10, 2017 7:27 pm 
Offline

Joined: Thu Aug 10, 2017 7:22 pm
Posts: 1
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!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group