- Home /
Strange shader behaviour on UI component
I have a shader which takes two color textures and one greyscale texture, blends the pixel values from the two first textures, and also applies an alpha-mask using the last texture. This works exactly as expected when applied to a regular 3D plane, but it behaves really strangely when I try to apply it to an Image object from the new GUI system. What seems to happen is that the alpha-mask is applied as usual, but instead of blending between texture A and B, it blends between texture B and the alpha-mask! Does anyone know why this would happen to a GUI component only?
EDIT: OK, so it appears that it isn't actually blending between texture B and the alpha-mask, but between texture B and just a white texture. In other words there doesn't seem to be a texture A, or _MainTex. It shows up working perfectly in the material preview window, but not in the game view.