Exemplo n.º 1
0
        public void traceDiffusePhoton(ShadingState previous, Ray r, Color power)
        {
            if (previous.getDiffuseDepth() >= maxDiffuseDepth)
            {
                return;
            }
            IntersectionState istate = previous.getIntersectionState();

            scene.trace(r, istate);
            if (previous.getIntersectionState().hit())
            {
                // create a new shading context
                ShadingState state = ShadingState.createDiffuseBounceState(previous, r, 0);
                shadePhoton(state, power);
            }
        }