1
\$\begingroup\$

A GIF is worth a 10002 words:

A line disappearing against a white background

Why does the rainbow-colored line disappear when it is displayed against the white image?

A few more details: The line is a Vectrosity line that is rendered using Unity's built-in Unlit/Transparent shader. The white square in the background is a RawImage that displays a pure white PNG texture. The line is closer to the camera in the scene, but it is disappearing when it is rendered on top of the white RawImage behind it.

If I change my line's material to use the Unlit/Color shader, the line shows up as expected:

A line showing up against the white background as expected

I'm using Unity 5.6.1f1.

\$\endgroup\$
2
\$\begingroup\$

It should be because the alpha channel of the line is set to 0, so the Unlit/Transparent shader effectively makes it invisible when there're other objects rendered behind it.

You should see it if you select the Unlit/Texture shader, or if you set the Alpha channel of the line to 1.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.