 
     discard;  // no fragment, early exit
   }
-
 
   int activeobjects = 0;
   int activeobjectcount = 0;


  if (maxage == 1)
  {
    next_fragment_read_status = fetchFragment(ij, 1, next_fragment);    
  }

  if (next_fragment_read_status)

              vec3 specularColor = vec3(1.0, 1.0, 1.0);

              currentColor.xyz +=
                  /*gl_LightSource[li].ambient.xyz**/ ka * TFColor.xyz +
                  /*gl_LightSource[li].diffuse.xyz**/ kd * TFColor.xyz * dotNL +
                  (shininess + 2.0f) / (2.0f * 3.1415f) *
                      /*gl_LightSource[li].specular.xyz**/ ks * TFColor.w *
                      specularColor * pow(dotNH, shininess);
            }
            else
            {
              currentColor.xyz += TFColor.xyz;
            }

            // clamp color
            currentColor.xyz = clamp(currentColor.xyz, 0.0f, 1.0f);
            currentColor.w = TFColor.w;

            // we sum up overlapping contributions
            sampleColor += currentColor;
          }  // per active object loop

          // clamp cumulatie sample value
          clamp(sampleColor, vec4(0.0f, 0.0f, 0.0f, 0.0f),
                vec4(1.0f, 1.0f, 1.0f, 1.0f));

          // sample accumulation

          fragmentColor =
              fragmentColor + sampleColor * (1.0f - fragmentColor.w);

          // early ray termination
          if (fragmentColor.w > 0.999)
            break;

          // prepare next segment
          lastpos_eye = startpos_eye;
          startpos_eye += stepFactor * dirvec_eye;

          // FIXME: do we need it?
          // pos_proj = gl_ProjectionMatrix*vec4(startpos_eye,1.0f);
          // pos_proj.z /= pos_proj.w;
          // pos_proj.z += 1.0f;
          // pos_proj.z /=2.0f;

        }  // sampling steps

      }  // if (activeobjectcount > 0) ...
    }
    else
    {
      fragmentColor = current_fragment.color;
      // current_fragment.color = vec4(0.0, 1.0, 1.0, 0.5);
    }

    if (current_fragment_read_status)
    {
      // clr = blend(clr, current_fragment.color);

      // set Fragment value
      finalColor = finalColor + fragmentColor * (1.0f - finalColor.a);
    }

    if (finalColor.a > 0.999)
