   surface.reflection = reflect(-surface.view, normal);
 
   vec4 color = Color;
-  if (useColorTexture) color *= getPixel(ColorTexture, UV);
+  if (flag_colorTexture) color *= getPixel(ColorTexture, UV);
 
   float metallic = Material.metalness;
-  if (useMetalnessTexture) metallic *= getPixel(MetalnessTexture, UV).b;
+  if (flag_metalnessTexture) metallic *= getPixel(MetalnessTexture, UV).b;
 
   surface.f0 = mix(vec3(.04), color.rgb, metallic);
   surface.diffuse = mix(color.rgb, vec3(0.), metallic);
 
   surface.emissive = Material.glow.rgb * Material.glow.a;
-  if (useGlowTexture) surface.emissive *= getPixel(GlowTexture, UV).rgb;
+  if (flag_glow && flag_glowTexture) surface.emissive *= getPixel(GlowTexture, UV).rgb;
 
   float roughness = Material.roughness;
-  if (useRoughnessTexture) roughness *= getPixel(RoughnessTexture, UV).g;
+  if (flag_roughnessTexture) roughness *= getPixel(RoughnessTexture, UV).g;
   roughness = max(roughness, .05);
   surface.roughness2 = roughness * roughness;
 
   surface.occlusion = 1.;
-  if (useOcclusionTexture) surface.occlusion *= getPixel(OcclusionTexture, UV).r * Material.occlusionStrength;
+  if (flag_occlusionTexture) surface.occlusion *= getPixel(OcclusionTexture, UV).r * Material.occlusionStrength;
 
   surface.clearcoat = Material.clearcoat;
-  if (useClearcoatTexture) surface.clearcoat *= getPixel(ClearcoatTexture, UV).r;
+  if (flag_clearcoatTexture) surface.clearcoat *= getPixel(ClearcoatTexture, UV).r;
 
   surface.clearcoatRoughness = Material.clearcoatRoughness;
 


// Framebuffer
#ifdef GL_FRAGMENT_SHADER
layout(location = 0) out vec4 PixelColor[attachmentCount];
#endif

// Varyings

    normal = -normal;
  }

  if (flag_normalMap) {
    vec3 normalScale = vec3(Material.normalScale, Material.normalScale, 1.);
    surface.normal = TangentMatrix * (normalize(getPixel(NormalTexture, UV).rgb * 2. - 1.) * normalScale);
  } else {
