 
   density = texture(volumeSampler, texturePos).r;
 
-  // gradient calculation based on dataset values
-
+  // gradient calculation based on dataset values using central differences
   gradient = -vec3(texture(volumeSampler, vec3(texturePos.x+sampleDistance.x*gscf.x, texturePos.yz)).x-
                    texture(volumeSampler, vec3(texturePos.x-sampleDistance.x*gscf.y, texturePos.yz)).x,
                    texture(volumeSampler, vec3(texturePos.x,texturePos.y+sampleDistance.y*gscf.y, texturePos.z)).x-

  const vec3 lightPos = vec3(0.0f, 0.0f, 0.0f);
  vec3 lightDir = normalize(lightPos - startpos_eye);
  vec3 viewDir = -1.0f * normalize(startpos_eye);
  vec3 nGradient = normalize(gradient);

  // float dotNL = abs(dot(ngradient, lightDir));
  float dotNL = max(dot(nGradient, lightDir), 0.0f);
  vec3 H = normalize(lightDir + viewDir);
  // float dotNH = abs(dot(ngradient, H));
  float dotNH = max(dot(nGradient, H), 0.0f);
  float ka = 0.3;  // gl_LightSource[li].ambient.xyz
  float kd = 0.5;  // gl_LightSource[li].diffuse.xyz
  float ks = 0.5;  // gl_LightSource[li].specular.xyz

    finalColor = blend(finalColor, next_fragment.color);
  }

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

