     {
       currentColor.rgb = calculateLighting(currentColor, startPos_eye.xyz, gradient);
     }
-    currentColor.rgb = clamp(currentColor.rgb, vec3(0.0f), vec3(1.0f));
+    currentColor.rgb = clampColor(currentColor.rgb);
 
     // we sum up overlapping contributions
     sampleColor += currentColor;
   }  // per active object loop
 
   // clamp cumulatie sample value
-  return clamp(sampleColor, vec4(0.0f), vec4(1.0f));
+  return clampColor(sampleColor);
 }
 
 vec4 calculateColorOfVolumes(in int activeObjects, in int activeObjectCount,

{
  VolumeData volumes[];
};

float getVolumeSampleDensity(in vec3 texturePos)
{

  if (position.w == POSITION_NOT_SET)
    position.w = 1;

  finalColor = clampColor(finalColor);

  outputColor = blend(finalColor, vec4(backgroundColor, 1.0));
}
