Texture Sample

This is a variation on the basic material shader that samples a texture for the Albedo of the material.

Shader

Shader "Custom/Simple" {
  Properties {
    _MainTex ("Albedo (RGB)", 2D) = "white" {}
  }
  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;

    struct Input {
      float2 uv_MainTex;
    };

    void surf (Input IN, inout SurfaceOutputStandard o) {
      o.Albedo = tex2D (_MainTex, IN.uv_MainTex);
    }
    ENDCG
  }
  FallBack "Diffuse"
}

Shader Notes

Recall that the Albedo is the base diffuse color of the target.

Other properties on the input surface can be set for variations in the surface.

See Shader Input Structure.