 		poisson_factor);
 }
 
+#endif
+
+// When USE_REFLECTION_VECTOR is defined, the reflect() function is used for specular
+// light calculation instead of calculating the halfway vector.
+#ifndef MICROFACET
+#define USE_REFLECTION_VECTOR
 #endif
 
 void main() {

#ifdef NORMAL_MAP_OPTION
	if (use_normal_map_in) {
#endif
#if defined(NORMAL_MAP_OPTION) || defined(NORMAL_MAP_FIXED)
		// Convert vectors for the light calculation into tangent space.
#if GL_ES
		L = tbn_matrix_var * L;
                H = tbn_matrix_var * H;
#else
		L = normalize(tbn_matrix_var * L);
		H = normalize(tbn_matrix_var * H);
#endif
#ifdef MICROFACET
		V = normalize(tbn_matrix_var * V);
#endif
		// When the z component is non-zero, it is assumed to be the z component of
		// the normal vector, and the components are scaled from [0, 1] to [-1, 1].
		// When the z component is zero (which happens with two-component signed

		specular_component = (1.0 - diffuse_fraction_in) * microfacet_texture_value *
			GeometricAttenuationFactor(NdotH, LdotH,  dot(normal, V), dot(normal, L)) / NdotV;
#else
#ifdef USE_REFLECTION_VECTOR
		specular_component = specular_reflection_color_in * pow(RdotV, specular_exponent_in);
#else
		specular_component = specular_reflection_color_in * pow(NdotH, specular_exponent_in);
#endif
#endif
		c += light_att * light_color * specular_map_color * specular_component;
	}
