#How to access MainTex in shadergraph
1 messages · Page 1 of 1 (latest)
For Canvas/UI shaders please use the UI shaders.
I believe you can sample _MainTex in a custom node otherwise without declaring it. There might be a node for it already, but I haven't worked with UI shaders in a while
This is with a canvas shadergraph, but I don't see a node for MainTex or any similar name in the dropdowns, except for the one I tried to create.
If you ignore that error and use the property does it actually break the shader?
It seems to work. The shader has access to whatever sprite is assigned the Image, without me needing to manually assign it in a material.
Its only when I open, modify, or save the shader that it spams the console with that error.
You created the property as Texture2D right?
Yes. It also gives the error with both Global and Per Material
Strange. Can't seem to replicate it. I'd maybe try restarting the project and see if it stops
If not maybe try a more up-to-date unity version / make a bug report
I'll try updating, as I'm probably a few versions behind
Updated to latest, 6000.0.58f1
Still the same error