Ejemplo n.º 1
0
 public Color getIrradiance(ShadingState state, Color diffuseReflectance)
 {
     // no gi engine, or we have already exceeded number of available bounces
     if (giEngine == null || state.getDiffuseDepth() >= maxDiffuseDepth)
     {
         return(Color.BLACK);
     }
     return(giEngine.getIrradiance(state, diffuseReflectance));
 }
Ejemplo n.º 2
0
        public ShadingState traceFinalGather(ShadingState previous, Ray r, int i)
        {
            if (previous.getDiffuseDepth() >= maxDiffuseDepth)
            {
                return(null);
            }
            IntersectionState istate = previous.getIntersectionState();

            scene.trace(r, istate);
            return(istate.hit() ? ShadingState.createFinalGatherState(previous, r, i) : null);
        }
Ejemplo n.º 3
0
        public Color traceRefraction(ShadingState previous, Ray r, int i)
        {
            // limit path depth and disable caustic paths
            if (previous.getRefractionDepth() >= maxRefractionDepth || previous.getDiffuseDepth() > 0)
            {
                return(Color.BLACK);
            }
            IntersectionState istate = previous.getIntersectionState();

            scene.trace(r, istate);
            return(istate.hit() ? shadeHit(ShadingState.createRefractionBounceState(previous, r, i)) : Color.BLACK);
        }
Ejemplo n.º 4
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);
            }
        }