- Home /
Shader, 2 Textures on one UV Map
Hi,
I'm not sure how possible this is but to improve our workflow we are trying to get two textures to share a UV.
For instance the end result we want is a shader than can take 2 textures such as these: http://answers.unity3d.com/storage/temp/76956-example1.png http://answers.unity3d.com/storage/temp/76957-example2.png
and create an end result texture of this: https://gyazo.com/bce0bec7843e23e0acdc3c4b3d481e96
But by using only one uv map and material.
Answer by DavidWatts · Aug 26, 2016 at 02:58 PM
yes it is possible if its a surface shader you can have something like
fixed4 c;
if( IN.uv_Tex1.y > 0.5 ) {
c = tex2D (_Tex1, float2( IN.uv_Tex1.x, (IN.uv_Tex1.y-0.5)*2 ) ) * _Color;
}
else {
c = tex2D (_Tex2, float2( IN.uv_Tex1.x, IN.uv_Tex1.y*2 ) ) * _Color;
}
Your answer
Follow this Question
Related Questions
Assigning UV Map to model at runtime 0 Answers
Overlaying a Darkening Texture over Certain UVs with a Shader 0 Answers
Custom skybox Shader uv issue, skybox texture stretching along one axis. 0 Answers
Why are the UV's in my texture array shader always zero? 1 Answer
Uv's not set in unity according to maya 0 Answers