     float fEDotN = dot(normalize(vEye), vNormal);
     int nNumSamples = int(mix(fMaxSamples, fMinSamples, fEDotN));
     float fStepSize = 1.0 / float(nNumSamples);
+    vec2 vMaxTimesStep = vMaxOffset * fStepSize;
 
     vec2 vCurrOffset = vec2(0.0);
     vec2 vLastOffset = vec2(0.0);

    float fEDotN = dot(normalize(vEye), vNormal);
    int nNumSamples = int(mix(fMaxSamples, fMinSamples, fEDotN));
    float fStepSize = 1.0 / float(nNumSamples);

    vec2 vCurrOffset = vec2(0.0);
    vec2 vLastOffset = vec2(0.0);

    float fLastSampledHeight = 1.0;
    float fCurrSampledHeight = 1.0;

    for(int nCurrSample=0; nCurrSample<nNumSamples; ++nCurrSample)
    {
        vec2 vNew = vTexCoord + vCurrOffset;
        fCurrSampledHeight = texture(sMap1, vNew * fMapScale1).a * texture(sMap2, vNew * fMapScale2).a;

        if(fCurrSampledHeight > fCurrRayHeight)
        {
            float delta1 = fCurrSampledHeight - fCurrRayHeight;
