 #endif
 		inout vec3 diffuse_light, inout vec3 specular_light) {
 
+	vec4 orms_unpacked = unpackUnorm4x8(orms);
+
+	float roughness = orms_unpacked.y;
+	float metallic = orms_unpacked.z;
+
 #if defined(LIGHT_CODE_USED)
 	// light is written by the light shader
 

		float blinn = pow(cNdotH, shininess);
		blinn *= (shininess + 2.0) * (1.0 / (8.0 * M_PI));

		specular_light += light_color * attenuation * specular_amount * blinn * f0 * unpackUnorm4x8(orms).w;

#elif defined(SPECULAR_PHONG)


	float cLdotH = clamp(A + dot(L, H), 0.0, 1.0);
#endif

	if (metallic < 1.0) {
		float diffuse_brdf_NL; // BRDF times N.L for calculating diffuse radiance

#if defined(DIFFUSE_LAMBERT_WRAP)
