I am trying to mask out places in between tiles to render smooth transition sprites,
but the blending for the tiles isn’t working properly for some reason.
The white areas represent where I want the transitions to render.
The mask renders properly on tiles by itself,
but when I try to blend transition tiles with the mask, nothing happens.
Before transition tiles
With transition tiles
Really not sure what is causing this because I’ve tried so many blending combos and nothing works.
g.clearAlphaMap();
// render alpha map and filter out black
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE);
TileArt.blendmap.startUse();
for (int x = xt - 6; x < x1 + 6; x++) {
for (int y = yt - 6; y < y1 + 6; y++) {
if (x < 0)
x = 0;
if (y < 0)
y = 0;
if (x > worldW)
x = worldH;
if (y > worldH)
y = worldW;
alphmap[x][y].renderMap(g, (int) x * 12
- (int) TritonForge.sx, (int) y * 12
- (int) TritonForge.sy);
}
}
TileArt.blendmap.endUse();
//now render the transitional tile where the white is with the same alpha
//(if it actually worked)
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
TileArt.tileset_terrain.startUse();
for (int x = xt - 6; x < x1 + 6; x++) {
for (int y = yt - 6; y < y1 + 6; y++) {
if (x < 0)
x = 0;
if (y < 0)
y = 0;
if (x > worldW)
x = worldH;
if (y > worldH)
y = worldW;
try {
alphmap[x][y].renderBase(g, (int) x * 12
- (int) TritonForge.sx, (int) y * 12
- (int) TritonForge.sy);
} catch (Exception e) {
e.printStackTrace();
}
}
}
TileArt.tileset_terrain.endUse();
GL11.glDisable(GL11.GL_BLEND);
g.clearAlphaMap();
Maybe the issue has something to do with the image binding but I doubt it.
Does anyone seem to have an idea what’s up?