 		   vec4 diffuseColor, vec4 materialColor,
 		   inout vec4 color ) {
   vec3 H = normalize( lightDir + viewDir );
+
+#if defined(USE_PHYSICAL_MAPPING) || defined(r_specularMapping)
   float NdotH = clamp( dot( normal, H ), 0.0, 1.0 );
-
-#if defined(r_physicalMapping) && defined(USE_PHYSICAL_MAPPING)
+#endif // USE_PHYSICAL_MAPPING || r_specularMapping
+
+#if defined(USE_PHYSICAL_MAPPING)
   // Daemon PBR packing defaults to ORM like glTF 2.0 defines
   // https://www.khronos.org/blog/art-pipeline-for-gltf
   // > ORM texture for Occlusion, Roughness, and Metallic

#endif // USE_REFLECTIVE_SPECULAR

  color.rgb += diffuseColor.rgb * lightColor.rgb * NdotL;
#if defined(r_specularMapping) && !defined(USE_PHYSICAL_MAPPING)
  color.rgb += materialColor.rgb * lightColor.rgb * pow( NdotH, u_SpecularExponent.x * materialColor.a + u_SpecularExponent.y) * r_SpecularScale;
#endif // r_specularMapping && !USE_PHYSICAL_MAPPING&
#endif // !r_physicalMapping || !USE_PHYSICAL_MAPPING
}

#if defined(TEXTURE_INTEGER)

  color.rgb += lightColor.rgb * (1.0 - metalness) * NdotL * diffuseColor.rgb;
  color.rgb += lightColor.rgb * vec3((D * F * G) / (4.0 * NdotV));
  color.a = mix(diffuseColor.a, 1.0, FexpNV);
#else // !USE_PHYSICAL_MAPPING
  float NdotL = dot( normal, lightDir );
#if defined(r_HalfLambertLighting)
  // http://developer.valvesoftware.com/wiki/Half_Lambert
