public void setMaxTextureSize(long maxTextureSize) {
        this.maxTextureSize = maxTextureSize;
        
        /**
         * compute max. allowed texture width and depth
         * equation:
         * width * depth * height * sampleSize = maxTexSize
         * and: width/depth = delta.X/delta.Y
         * thus: width = depth * delta.X / delta.Y
         *       depth^2 = (maxTexSize * delta.Y) / (delta.X * height * sampleSize)
         */
        
        // delta X and delta Y, for the following equations:
        int deltaX = FESVo.xMax() - FESVo.xMin();
        int deltaY = FESVo.yMax() - FESVo.yMin();
        
        int maxTexDepth = (int)(Math.sqrt(
                  ((double)this.maxTextureSize * deltaY) 
                / ((double)deltaX * this.srdsSource.samplesPerTrace * this.srdsSource.sampleSize)));
        int maxTexWidth = (int)(((float)maxTexDepth * deltaX) / (float)deltaY);
                
        // compute top LOD, and thus max. texture dimension:
        // -------------------------------------------------
        
        // (1) get dimension of LOD 0:
        int texWidth = deltaX/FESVo.getLodUnitWidth();
        int texDepth = deltaY/FESVo.getLodUnitDepth();
        
        // save it:
        this.lod0Dimension = new int[]{texWidth, texDepth, this.srdsSource.samplesPerTrace};
        
        // (2) compute top LOD:
        this.topLOD = 0; // initial value
        while (true){
            // stop if the computed texture width and depth can fit in texture:
            if (texWidth <= maxTexWidth && texDepth <= maxTexDepth)
                break;
            
            // otherwise, go to next level - dividing by 2
            texWidth /= 2;
            texDepth /= 2;
            this.topLOD ++;
        }//while
        
        // check width and depth not to be0; 
        // if so, make them 1 as their min. values
        // and re-set max. texture size:
        if (texWidth < 1 && texDepth < 1) this.maxTextureSize = this.srdsSource.samplesPerTrace * this.srdsSource.sampleSize;
        if (texWidth < 1) texWidth = 1;
        if (texDepth < 1) texDepth = 1;
        
        // (3) set max. texture dimension:
        this.maxTextureDimension[0] = texWidth;
        this.maxTextureDimension[1] = texDepth;
        this.maxTextureDimension[2] = this.srdsSource.samplesPerTrace;
        
        // make current (active) texture dimension same as max. dimension as a default value:
        this.textureDimension = this.maxTextureDimension;
    }//setMaxTextureSize