Copying an unanswered post from the UI forum:
I’m trying to create a UI panel that alternates between pure black and pure white every frame, and is unaffected by lighting, so the actual displayed pixels will always have RGBA values of (0, 0, 0, 1) or (1, 1, 1, 1). (If you’re curious, I’m doing this so I can get precise timing of each frame using optical sensors attached to an external timing computer - this is for a neuroscience experiment so I need better timing than Unity is capable of.)
This seems to be a little more complex than I originally assumed, and after some confused googling I tried creating a new material using an “Unlit/Texture” shader. Then I created a UI panel, set the source image to “None”, and dropped the new material onto it. But now it just seems to be white all the time. In my script, I’ve tried modifying the CanvasRenderer’s colour, the Image’s colour, and the Image.Materials’ colour. None of those seem to change anything.
Do I need to create two custom textures, and attach each to a material, and then through the script change the material attached to the square every time ? This seems a very convoluted way of doing things!