With built in shaders you can change texture offsets and scales with SetTextureOffset and SetTextureScale, which must be doing something similar to a SetVector call on a material. I was wondering if there was a way to access these values in Shader Graph.
I understand to recreate this behavior I can expose two vectors and then use a Tiling and Offset node that feeds into a Texture node.
I was just trying to have a unified code path when dealing with the offsets and scales, if there was a way to use SetTextureOffset/Scale in a shadergraph texture then I wouldn’t need to build in special cases for their access slightly differently in script.
Alternatively if we know what SetTextureOffset/Scale was doing in C++ land (the C# source stops just short of reveling what is happening) then maybe I could adjust the way I am setting those offset/scale values on the built in shaders.
What you want is possible and somewhat documented albeit it being rather hidden and not in plain sight for people who are just working with ShaderGraph:
If you have a texture for example named _BaseMap you can define a Vector4 called _BaseMap_ST. This special suffix makes it linked to the texture of the same name and can be changed by calling functions such as:
If your shader has a main texture by marking a Texture2D with [MainTexture] in Shaderlab or specifically naming it _MainTex (the latter way is the only way to do this in ShaderGraph!), you can also access these values through [material.mainTextureOffset](https://docs.unity3d.com/ScriptReference/Material-mainTextureOffset.html) and [material.mainTextureScale](https://docs.unity3d.com/ScriptReference/Material-mainTextureScale.html).
  Where the first two values are the Tiling and the latter two are the Offset. These you can plug straight into a TilingAndOffset node. 
When creating a custom ShaderGUI you can render a Tiling and Offset field with this piece of code. Here again this works because the *Vector4* is named the same as the texture but with the special _ST suffix.
internal class MyShaderGUI : UnityEditor.ShaderGUI
{
public override OnGUI(MaterialEditor editor, MaterialProperty[] properties)
{
var property = FindProperty("_BaseMap", properties);
editor.TexturePropertySingleLine(new GUIContent("Base Map"), property);
editor.TextureScaleOffsetProperty(property);
}
}
Thank you very much, i was trying to pass a bunch of material values through the shader graph without changing them and the _BaseMap_ST works to pass texture tiling without affecting it.