- Home /
Can you get texture scale/offset in a surface shader?
In a vert/frag shader you can use the _ST variables (e.g. _MainTex_ST
), which have the texture scale and offset. But in a surface shader, these things aren't defined yet since (I guess) they're part of the automatically generated code, nor can you define them yourself. Is there an alternative to *_ST that's available to surface shaders, or a way to access them?
I'm considering setting a property on the material for each texture (I'm using albido and emission) with the scale and offset values, but that seems pretty clunky.
I'm having the same issue! I am trying to build Unity editor tools but not able to deter$$anonymous$$e offset and scale of an existing material via Editor script. I even looked at the compiled standard shader properties and it doesn't seem to exist.