 
         color += weight * illuminate(collision_point, collision.normal, P, rsi);
 
+        // russian roulette //
+
+        float alpha = (
+
+            (collision.material.albedo.x +
+             collision.material.albedo.y +
+             collision.material.albedo.z) / 3.0
+        );
+
+        if (random(rsi++) > alpha) { break; }
+        else { weight /= alpha; }
+
         // bounce ray //
 
         float pdf;


// texture sampling

vec4 sample_1d(sampler2D sampler, const int i, const int n) {

    float x = (float(i) + 0.5) / float(n);
    return texture2D(sampler, vec2(x, 0.5));
}

SphereLight get_sphere_light(const int i) {

    return SphereLight(

        vec3(sample_1d(

            lighting_sphere_position, i, N_LIGHTING_SPHERE
        )),

        sample_1d(

            lighting_sphere_radius, i, N_LIGHTING_SPHERE
        ).x,

        vec3(sample_1d(

            lighting_sphere_color, i, N_LIGHTING_SPHERE
        )),

        sample_1d(

            lighting_sphere_intensity, i, N_LIGHTING_SPHERE
        ).x

    );
}

// tracing

/**
