float[] collectPhotonsFromBounces(float[] p, int type, int id)
 {
     float[] color = { 0.0f, 0.0f, 0.0f };
     float[] N     = surfaceNormal(type, id, p, variableUtils.getWorldOrigin());
     for (int i = 0; i < photonMap.photonsPerObject [type] [id]; i++)
     {
         if (findSqureDistance(p, photonMap.getPhotonData(type, id, i, 0), squareRadius))
         {
             float weight = Mathf.Max(0.0f, -dotProduct(N, photonMap.getPhotonData(type, id, i, 1)));
             weight *= (1.0f - Mathf.Sqrt(variableUtils.getSqDistance())) / exposure;
             color   = additionXYZ(color, multiplyThree(photonMap.getPhotonData(type, id, i, 2), weight));
         }
     }
     return(color);
 }