 vec3 inscatterRadiance(inout vec3 x, inout float t, inout float irradianceFactor,
                        const vec3 v, const vec3 s, out float r, out float mu,
                        out vec3 attenuation, const vec3 fragPosObj,
-                       const double maxLength, const double pixelDepth ) {
+                       const double maxLength, const double pixelDepth,
+                       const vec4 spaceColor) {
   vec3 radiance;
   
   r  = length(x);

    meanPosition /= nAaSamples;
    // geoDepth /= nAaSamples;

    //meanNormal.xyz = normalize(meanNormal.xyz);
    
    // Ray in object space

    vec4 meanColor = vec4(0.0);
    vec4 meanNormal = vec4(0.0);
    vec4 meanPosition = vec4(0.0);
    //vec4 positionArray[nAaSamples];
    vec4 positionArray[8];
    float maxAlpha = -1.0;
    for (int i = 0; i < nAaSamples; i++) {
      meanNormal   += texelFetch(mainNormalReflectanceTexture, ivec2(gl_FragCoord), i);
      vec4 color = texelFetch(mainColorTexture, ivec2(gl_FragCoord), i);
      if ( color.a > maxAlpha )
        maxAlpha = color.a;
      meanColor += color;
      meanPosition += texelFetch(mainPositionTexture, ivec2(gl_FragCoord), i);
      positionArray[i] = texelFetch(mainPositionTexture, ivec2(gl_FragCoord), i);
      //     geoDepth += denormalizeFloat(texelFetch(mainDepthTexture, ivec2(gl_FragCoord), i).x);
    }
    meanColor    /= nAaSamples;
