somewhat correct simulation of path tracing