anchor.diff:      #endif
       TexCoords texCoords = createTexCoords(result.index);
       vec2 texCoord = barycentricTexCoord(weights, texCoords);
  -    vec4 texRaw = texture(texArray, vec3(texCoord, mat.mapIndices.diffuse));
  -    vec3 texEmmissive = texture(texArray, vec3(texCoord, mat.mapIndices.specular)).rgb;
  +	  vec4 texRaw = texture(texArray, vec3(texCoord, mat.mapIndices.diffuse));
  +	  vec3 texEmmissive = texture(texArray, vec3(texCoord, mat.mapIndices.specular)).rgb;
       vec3 texDiffuse = texRaw.rgb;
  -    vec4 texMetallicRoughness = texture(texArray, vec3(texCoord, mat.mapIndices.roughness));
  -    float texRoughness = texMetallicRoughness.g;
  -    float texEmmissiveScale = texMetallicRoughness.b;
  +	  vec4 texMetallicRoughness = texture(texArray, vec3(texCoord, mat.mapIndices.roughness));
  +	  float texEmmissiveScale = texMetallicRoughness.b;
       vec3 texNormal = (texture(texArray, vec3(texCoord, mat.mapIndices.normal)).rgb - vec3(0.5, 0.5, 0.0)) * vec3(2.0, 2.0, 1.0);
  -    float roughness = texRoughness * texRoughness;
  +    texMetallicRoughness.g *= texMetallicRoughness.g;
       seed = origin.x * randBase + origin.y * 1.396529836 + origin.z * 4761.52835;
       vec3 baryNormal;
       vec3 macroNormal = barycentricNormal(weights, createNormals(result.index), texNormal, baryNormal);
  -    vec3 microNormal = ggxRandomImportantNormal(macroNormal, roughness);
       vec3 lightDir;
       ray.origin = origin + baryNormal * EPSILON * 2.0;
  -    float inside = sign(dot(-ray.dir, macroNormal));
  -    vec2 ns = inside > 0.0 ? vec2(1, mat.ior) : vec2(mat.ior, 1);
  -    bool metallic = rnd() > (1.0 - texMetallicRoughness.r);
  -    bool specular = false;
  -    if (!metallic){
  -      specular = schlick(ray.dir, inside * microNormal, ns.x, ns.y) > rnd();
  -    }
  -    texDiffuse = specular ? vec3(1.0) : texDiffuse;
  +
  +    //texDiffuse = specular ? vec3(1.0) : texDiffuse;
  +    // TODO: make this configurable in the materials
       color += accumulatedReflectance * texEmmissive * 10.0;
  -    float colorAlbedo = albedo(texDiffuse) + EPSILON;
  -    if( rnd() > colorAlbedo ){ break; }
  +
       #ifdef USE_EXPLICIT
       vec3 direct = getDirectEmission(ray.origin, macroNormal, lightDir);
       #else
  
positive.code:     #endif
      vec3 incident = ray.dir;
      float directWeight = 0.0;
      float indirectWeight = 0.0;
      if (specular || metallic) {
        //specular reflection
        ray.dir = reflect(incident, microNormal);
        //ray.dir = dot(ray.dir,macroNormal) > 0.0 ? ray.dir : -ray.dir;
        float indirectPdf = ggxPdf(macroNormal, microNormal, roughness);
        #ifdef USE_EXPLICIT
        float directPdf = ggxPdf(macroNormal, normalize(lightDir - incident), roughness);
        vec2 weights = misWeights(directPdf, indirectPdf);
        float sd = smith(macroNormal, lightDir, roughness);
        float si = smith(macroNormal, ray.dir, roughness);
        directWeight = sd * directPdf;
        //indirectWeight = weights.y * si;
        #else
        float si = smith(macroNormal, ray.dir, roughness);
        indirectWeight = si * ceil(dot(ray.dir, macroNormal)) * (dot(ray.dir, microNormal) / (dot(ray.dir, macroNormal) * dot(macroNormal, microNormal)));//ggxPdf(macroNormal, normalize(ray.dir - incident), roughness) * M_PI;//indirectPdf * si;
        #endif
      } else if(mat.dielectric > 0.0) {
        //refract into material
        ray.origin = -inside * macroNormal * EPSILON + origin * 2.0;
        ray.dir = refract(incident,inside * microNormal, ns.x / ns.y);
        directWeight = 0.0;
        indirectWeight = 1.0;
      } else {
        //lambertian scattering
        ray.dir = cosineWeightedRandomVec(macroNormal);
        #ifdef USE_EXPLICIT
        directWeight = max(dot(lightDir, macroNormal), 0.0) * INV_PI;
        indirectWeight = 0.0;
        #else
        indirectWeight = 1.0;
        #endif
      }
      #ifdef USE_ALPHA
      vec3 indirect = getIndirectEmission(ray, result, mat, weights);
      #else
      vec3 indirect = getIndirectEmission(ray, result, mat);
      #endif
      accumulatedReflectance *= (texDiffuse / colorAlbedo);
      color += accumulatedReflectance * (direct * max(directWeight, 0.0) + clamp(indirect * max(indirectWeight, 0.0),vec3(0),vec3(6400)));
    }
  
  
negative.code: }
  
  float rayBoxIntersect(Node node, Ray ray) {
    vec3 inverse = 1.0 / ray.dir;
    vec3 t1 = (node.boxMin - ray.origin) * inverse;
    vec3 t2 = (node.boxMax - ray.origin) * inverse;
    vec3 minT = min(t1, t2);
  