, fixed atten) { //对各种向量都进行规范化 viewDir = normalize(viewDir); lightDir = normalize...(lightDir); half3 halfVec = normalize (lightDir + viewDir); fixed NdotL = max (0, dot...float HdotV = pow(1-max(0, dot(halfVec, viewDir)), _FresnelPower); float NdotE = pow(1-max(0,...dot(s.Normal, viewDir)), _RimPower); //也可以使用我们上面的公式来创建,效果是一样的 //float HdotV = max(0..., min(1,pow((1+dot(-viewDir,s.Normal)),_FresnelPower))); float finalSpecMask = HdotV+NdotE