Here is how to do the same thing, but a bit more detailed and with support for tiling in addition to offset.
-Download build in shaders.
-Copy “Standard.shader”, rename to “StandardShift.shader”, and put into project in the same folder called Shaders.
-Copy the following files and put into project in a folder called Shaders. Note that only the file “UnityStandardInput.cginc” from this list will be modified, but all other files are needed, otherwise it won’t work.
UnityStandardInput.cginc
UnityStandardCore.cginc
UnityStandardCoreForward.cginc
UnityStandardCoreForwardSimple.cginc
UnityStandardMeta.cginc
-Open StandardShift.shader.
-Modify the first line to:
Shader "StandardShift"
Place this code just below the line “_DetailNormalMap(“Normal Map”,…”
_EmissionTileOffset("EmissionTileOffset", Vector) = (1,1,0,0)
-Open UnityStandardInput.cginc.
Place this code just below the line “sampler2D _EmissionMap;”
half4 _EmissionTileOffset;
-Search for this function:
“half3 Emission(float2 uv)”
-Place this code just above the line “return tex2D(…”
uv.x *= _EmissionTileOffset.x;
uv.y *= _EmissionTileOffset.y;
uv.x += _EmissionTileOffset.z;
uv.y += _EmissionTileOffset.w;
-Create a material and set the shader to StandardShift.
-Add the material to an object.
-Create a script and add the script to the object.
-Add this code to the script:
rend = GetComponent<Renderer>();
rend.material.SetVector("_EmissionTileOffset", new Vector4(0.5f, 0.5f, 0f, 0f));
The vector format is:
Tile X, Tile Y, Offset X, Offset Y
Note that you can only set the shader properties in code, not in the Editor.
If it doesn’t work, make sure all required files are copied to the Shader folder. Then go to Unity->Assets->Reimport All. After that, select the StandardShift shader → Inspector → compile and show code.