- Home /
Have Textures use the same Offset and Titling Values
I'm having an issue where I am trying to get a texture to follow the values of both tiling and offset of another texture on a shader. I'm fairly new to Shader programming and doing a "somewhat" quick google search (searching for about 20 minutes) returns little to no results to this question.
Answer by Martin_Gonzalez · Mar 27, 2018 at 07:18 PM
From a shader you cannot access to another shader value. BUT, you can create a C# script to GET
the value of a material (the representation of the shader) and SET
those parameters to another material.
Check this doc:
Look this.
Having a material reference you can use:
Vector2 offset = myDesired$$anonymous$$aterial.GetTextureOffset("_Offset");
myOther$$anonymous$$aterial.SetTextureOffset("_Offset", offset);
//Where "_Offset" is the name of your offset property in the shader
Your answer
![](https://koobas.hobune.stream/wayback/20220612155456im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Converting c# function to shader. 0 Answers
Combining 2 black-white textures 2 Answers
How to create a shader for a dynamic linear gradient 0 Answers
What's the best way to read a texture in camera space in a vertex shader? 0 Answers
Shader tiling error 0 Answers