say i have a plane containing UV information that i made in blender and imported to unity and i want it to have a brown color (taken from a texture not the albedo color) but also contain a checkerboard pattern (from a separate texture).
The standard shader allows for an albedo texture and also a detail map, so maybe you can assign one of your textures to the detail map and see if that looks okay. It’s also possible to write your own shader that will blend two textures together. It’s probably more efficient to just blend the textures in a paint program and then import the resulting image in to Unity, though.
I could merge it using photoshop but i have many different models andathey all use the same two textures. one is for colour and the other is for patterns. Not every object will have a patterni. im trying to find the most efficient and easiest way of achieving the result.
For anyone who needs a similar thing you can use the shader below. It is a standard surface shader. It will allow you to merge two textures together but also keep the first texture visible through the second textures alpha. it will blend the rest. you can tweak it to get other results but i wanted a color and a pattern on top.
its also set up to use two uv sets. so the first texture will use the first set of uvs and the second will use the second set. you can change “uv2_MainTex2” to “uv_MainTex2” to use the same (first) set of uvs.
apply this to a material, select your textures and use the slider to control the blend
Shader "Custom/Texture Blend" {
Properties {
_Color ("Color", Color) = (1,1,1,1)
_Blend ("Texture Blend", Range(0,1)) = 0.0
_MainTex ("Albedo (RGB)", 2D) = "white" {}
_MainTex2 ("Albedo 2 (RGB)", 2D) = "white" {}
_Glossiness ("Smoothness", Range(0,1)) = 0.5
_Metallic ("Metallic", Range(0,1)) = 0.0
}
SubShader {
Tags { "RenderType"="Opaque" }
LOD 200
CGPROGRAM
// Physically based Standard lighting model, and enable shadows on all light types
#pragma surface surf Standard fullforwardshadows
// Use shader model 3.0 target, to get nicer looking lighting
#pragma target 3.0
sampler2D _MainTex;
sampler2D _MainTex2;
struct Input {
float2 uv_MainTex;
float2 uv2_MainTex2;
};
half _Blend;
half _Glossiness;
half _Metallic;
fixed4 _Color;
void surf (Input IN, inout SurfaceOutputStandard o) {
// Albedo comes from a texture tinted by color
fixed4 c = lerp (tex2D (_MainTex, IN.uv_MainTex), tex2D (_MainTex2, IN.uv2_MainTex2), _Blend) * tex2D (_MainTex, IN.uv_MainTex);
o.Albedo = c.rgb;
// Metallic and smoothness come from slider variables
o.Metallic = _Metallic;
o.Smoothness = _Glossiness;
o.Alpha = tex2D (_MainTex, IN.uv_MainTex);
}
ENDCG
}
FallBack "Diffuse"
}