I want to make a block that changes its texture based on the state of a tile entity. It does this by overlaying other textures onto the base texture. I've set up an ISBRH to do the rendering. First it renders the base block with AO. Then, it loops through each potential overlay and renders the overlayed texture if necessary, with a slight offset to prevent z-fighting. Took a while, but I got it working pretty well.
However, I've got one remaining issue. If you place a solid block to the east of one of my custom rendered blocks, the overlayed textures get darker. Adding another block to the top-east makes it even darker. Putting a block to the east AND west of the block makes it brighter than the base texture. Placing a block only on the west has no effect. Blocks placed to the north or south don't seem to have an effect.
I have no idea what's causing this or how to fix it. Example of the problem:
On the left is what it should like. On the right is a solid, opaque block. In the center is the darkened block.
I want to make a block that changes its texture based on the state of a tile entity. It does this by overlaying other textures onto the base texture. I've set up an ISBRH to do the rendering. First it renders the base block with AO. Then, it loops through each potential overlay and renders the overlayed texture if necessary, with a slight offset to prevent z-fighting. Took a while, but I got it working pretty well.
However, I've got one remaining issue. If you place a solid block to the east of one of my custom rendered blocks, the overlayed textures get darker. Adding another block to the top-east makes it even darker. Putting a block to the east AND west of the block makes it brighter than the base texture. Placing a block only on the west has no effect. Blocks placed to the north or south don't seem to have an effect.
I have no idea what's causing this or how to fix it. Example of the problem:
On the left is what it should like. On the right is a solid, opaque block. In the center is the darkened block.
Here's my rendering code