I think what you want to do is something like this
// Incoming radiance (this would be the color and intensity of the light energy // that is coming towards your surface/shaded pixel) float3 Li = LightColor * LightIntensity; // This would correspond to your LightIntensity (the cosine factor) float NdotL = saturate(dot(Normal, LightDirection)); // Your final diffuse light output (or composition) float3 Diffuse = NdotL * Li; // Your ambient light term float3 AmbientLight = AmbientLight; // Now "add" the ambient light to your diffuse composition Diffuse += AmbientColor * AmbientIntensity; // And at last multiply the result of your light computation by your material's // diffuse color (albedo) -> basically the regular texture color float3 output = Diffuse * Albedo;