anchor.diff:    }
   }
   
  -vec3 randomPointOnTriangle(Triangle tri){
  +vec3 randomPointOnTriangle(Triangle tri, vec2 seed){
     vec3 e1 = tri.v2 - tri.v1;
     vec3 e2 = tri.v3 - tri.v1;
  -  float u = rand(coords.xy);
  -  float v = (1.0 - u) * rand(coords.yx);
  -  return e1 * v + e2 * u;
  -}
  -
  -Triangle randomLight(){
  -  vec2 range = lightRanges[uint(rand(coords.xy) * numLights)];
  -  float index = floor(range.x + rand(coords.yx) * (range.y + 1.0 - range.x));
  +  float u = rand(coords.xy + seed);
  +  float v = (1.0 - u) * rand(coords.yx + seed);
  +  return tri.v1 + e1 * v + e2 * u;
  +}
  +
  +Triangle randomLight(vec2 seed){
  +  vec2 range = lightRanges[uint(rand(coords.xy + seed) * numLights)];
  +  float index = floor(range.x + rand(coords.yx + seed) * (range.y + 1.0 - range.x));
     return createLight(index);
   }
   
  
positive.code:   float a = 12.9898;
    float b = 78.233;
    float c = 43758.5453;
    float dt= dot(co ,vec2(a,b) + float(tick) * 0.0194161103873);
    float sn= mod(dt,M_PI);
    return fract(sin(sn) * c);
  }
  
negative.code:   result = traverseTree(ray);
    Triangle tri = createTriangle(result.index);
    vec3 origin = ray.origin + ray.dir * result.t;
    Triangle light = randomLight(origin.xz);
    vec3 lightPoint = randomPointOnTriangle(light, origin.zy);
    vec3 dir = normalize(lightPoint - origin);
    vec3 normal = barycentricNormal(createTriangle(result.index), createNormals(result.index), origin);
    ray = Ray(origin + normal*EPSILON, dir);
    Hit shadow = traverseTree(ray);
    Material mat = createMaterial(shadow.index);
    if(result.index > -1.0 && dot(mat.emittance, vec3(1)) > 0.0){
      vec3 lightNormal = barycentricNormal(createTriangle(shadow.index), createNormals(shadow.index), origin);
      vec3 p = ray.origin + ray.dir * shadow.t;
      color = dot(ray.dir, normal) * mat.emittance * attenuationFactor(ray, light, p, lightNormal) / numLights;
    }
  
    fragColor = clamp(vec4((color + (tcolor * float(tick)))/(float(tick)+1.0),1.0),vec4(0), vec4(1));
  }
  