New answers tagged

0

Somewhere in your shader you'll have a declaration of your texture sampler, something like this: sampler2D _MainTex; // This is the sampler. float4 _MainTex_ST; // This is the scale/offset parameters set in the material widget. Add one extra line below these: float4 _MainTex_TexelSize; This gives you a variable you can access in your shader, that Unity ...


Top 50 recent answers are included