The additional texture uniforms (those added by res:setTexture) are notably reading the wrong texture.
When I tried to add a secondary texture to a render mode or ResFX (PostEffect included), it appeared to read the last texture used instead of the sent one.
I also tried to send a texture uniform through ccb.ProgramState:setTexture, and it behaved the exact same way, even when changing the slot.
Here we can see the shader is using the player's option's image: (the option is on LAYER_PLAYER, while the images using the shader are on LAYER_ENEMY_BULLET)
And when an item appears (such as when the player dies), it changes the texture that's being rendered: (it's on LAYER_ITEM)
The additional texture uniforms (those added by res:setTexture) are notably reading the wrong texture. When I tried to add a secondary texture to a render mode or ResFX (PostEffect included), it appeared to read the last texture used instead of the sent one. I also tried to send a texture uniform through ccb.ProgramState:setTexture, and it behaved the exact same way, even when changing the slot. Here we can see the shader is using the player's option's image: (the option is on LAYER_PLAYER, while the images using the shader are on LAYER_ENEMY_BULLET) And when an item appears (such as when the player dies), it changes the texture that's being rendered: (it's on LAYER_ITEM)