How to get UV coordinates from different textures?

Hi, I’m trying to make a shader which has 6 textures. And I tried to get uv coordinates from the textures, but I don’t know how to get them. It’s my code about textures.

	Properties {
		_SkinTexture("Skin Texture", 2D) = "white" {}
		_OcclusionTexture("Occlusion Texture", 2D) = "white" {}
		_BumpMap1("Bump Map 1", 2D) = "Bump" {}
		_BumpMap2("Bump Map 2", 2D) = "Bump" {}
		_SkinColor("Skin Color", Color) = (1, 1, 1, 1)
		_DetailGlossMap("Detail Gloss Map", 2D) = "White" {}
	}
	SubShader
	{
		Tags { "RenderType" = "Opaque" }
		CGPROGRAM
		#pragma surface surf Lambert
		struct Input {
			float2 uv_SkinTexture;
			float2 uv_OcclusionTexture;
			float2 uv_BumpMap1;
			float2 uv_BumpMap2;
			float2 uv_DetailGlossMap;
		};
		sampler2D _SkinTexture;
		sampler2D _OcclusionTexture;
		sampler2D _BumpMap1;
		sampler2D _BumpMap2;
		sampler2D _DetailGlossMap;
		float4 _SkinColor;

If there isn’t something wrong, I’ll show my whole code. Thank you :slight_smile:

Using texture coordinates? i.e. TEXCOORDn in your vertex shader input?


see: Unity - Manual: Shader semantics


Many modern GPUs don’t really care what semantics these variables have; however some old systems (most notably, shader model 2 GPUs on Direct3D 9) did have special rules about the semantics:

TEXCOORD0, TEXCOORD1 etc are used to indicate arbitrary high precision data such as texture coordinates and positions.
COLOR0 and COLOR1 semantics on vertex outputs and fragment inputs are for low-precision, 0–1 range data (like simple color values).
For best cross platform support, label vertex outputs and fragment inputs as TEXCOORDn semantics.