                  .rgb) *
                 2.0 -
             1.0)
-            .xyz;
+            .xyz);
   } else {
     data.worldNormal = nw;
   }

  // return uv;
}

bool _isBackFace(vec3 rayDir, vec3 normal) {
  return dot(rayDir, normal) <= 0.0;
}

vec3 _revertNormal(vec3 normal, vec3 rayDir) {
  return normal * (float(_isBackFace(rayDir, normal))) * 2.0 - 1.0;
}

vec3 _handleNormalForDoubleSide(vec3 normal, vec3 rayDir, bool isDoubleSide) {
  if (isDoubleSide) {
    return _revertNormal(normal, rayDir);
  }

  return normal;
}

HitShadingData getHitShadingData(uint instanceIndex, uint primitiveIndex) {

  }

  if (_hasMap(normalMapLayerIndex)) {
    data.worldNormal = normalize(
        mat3(tw, bw, nw) *
        normalize(
            (texture(sampler2DArray(textureArray, textureSampler),
