Shader : use a color instead of texture

Hi,

I use the following shader, but I always keep the default texture : “white”.
My mesh don’t have UV coordinates, so Unity complains about “Shader wants texture coordinates, but the mesh doesn’t have them”

Is there any way to replace the use of the texture with a white color ?

Regards,

Aurelien

Shader "Water shader" {
    Properties {
        _Color ("Main Color", Color) = (1,1,1,0)
        _SpecColor ("Spec Color", Color) = (1,1,1,1)
        _Shininess ("Shininess", Range (0.01, 1)) = 0.7
        _MainTex ("Base (RGB)", 2D) = "white" {}
    }
	
    SubShader {
		Tags { "Queue" = "Transparent" }
		Material {
			Diffuse [_Color]
			Ambient [_Color]
			Shininess [_Shininess]
			Specular [_SpecColor]
		}
		
		Lighting On
		SeparateSpecular On
		Blend SrcAlpha OneMinusSrcAlpha			
			
		Pass {
			Cull Front
			SetTexture [_MainTex] {
				Combine texture * primary DOUBLE, texture * primary
			}
		}
			
		Pass {
			Cull Back
			SetTexture [_MainTex] {
				Combine texture * primary DOUBLE, texture * primary
			}
		}
    }
}

Multiplying by white is pointless. It just results in whatever you multiplied it by. So just use the lighting calculation for each pass. Unity will still complain about UVs, but that is a bug that has been reported. You should simplify your shader, even though it’s not going to fix what you want it to fix.

Properties {
        _Color ("Main Color", Color) = (1,1,1,0)
        _SpecColor ("Spec Color", Color) = (1,1,1,1)
        _Shininess ("Shininess", Range (0.01, 1)) = 0.7
}
    
SubShader {
	Tags {"Queue"="Transparent"}
	Blend SrcAlpha OneMinusSrcAlpha

	Lighting On Material {
		Ambient [_Color]
		Diffuse [_Color]
		Specular [_SpecColor]
		Shininess [_Shininess]
	}	SeparateSpecular On
	
	Pass {Cull Front}
	Pass {}
}