- Home /
Access sprite secondary texture in shader for UI canvas image
In Unity, I have a sprite with the usual _MainTex
and an additional _inner
texture defined as secondary texture in the sprite editor. In shaderGraph, when I want to access this secondary texture for a material meant for the sprite renderer, I can just enter the "ref" as _inner
in the Texture2D
property, works like a charm.
But when I try to do the same with the same sprite with a shader meant for a UI canvas image (in-game UI), the shader does not appear to find the secondary texture (so the same shader works on my SpriteRenderer, but doesn't on my UI image renderer).
Am I doing something wrong? Any idea what?
Answer by Gerark87 · Nov 04, 2021 at 06:53 PM
Unfortunately only the SpriteRenderer support Secondary Textures meaning that the CanvasRenderer is excluded :( https://docs.unity3d.com/Manual/SpriteEditor-SecondaryTextures.html