     sh[8] * (n.x * n.x - n.y * n.y)
   , 0.);
 }
+
+vec3 tonemap(vec3 x) {
+  float a = 2.51;
+  float b = 0.03;
+  float c = 2.43;
+  float d = 0.59;
+  float e = 0.14;
+  return (x * (a * x + b)) / (x * (c * x + d) + e);
+}
 #endif
 
 // Entrypoints

layout(constant_id = 1013) const bool flag_roughnessTexture = true;
layout(constant_id = 1014) const bool flag_occlusionTexture = false;
layout(constant_id = 1015) const bool flag_clearcoatTexture = false;

// Resources
#ifndef GL_COMPUTE_SHADER

    }
  }

  if (flag_tonemap) {
    PixelColor[0].rgb = tonemap(PixelColor[0].rgb);
  }

  if (flag_alphaCutoff && PixelColor[0].a <= Material.alphaCutoff) {
    discard;
  }
