             let simd = (map as! TileUniformMap).waterMaskTranslationAndScale.floatRepresentation
             memcpy(buffer, [simd], sizeof(float4))
         }
-    
+    */
     ]
     
     init(maxTextureCount: Int) {
         self.maxTextureCount = maxTextureCount
         dayTextures = [Texture]()
         dayTextures.reserveCapacity(maxTextureCount)
-        dayTextureTranslationAndScale = [Cartesian4]()
-        dayTextureTexCoordsRectangle = [Cartesian4]()
+        //dayTextureTranslationAndScale = [Cartesian4]()
+        //dayTextureTexCoordsRectangle = [Cartesian4]()
         dayTextureAlpha = [Float]()
         dayTextureBrightness = [Float]()
         dayTextureContrast = [Float]()
         dayTextureHue = [Float]()
         dayTextureSaturation = [Float]()
         dayTextureOneOverGamma = [Float]()
-    }
+        
+         metalUniformUpdateBlock = { buffer in
+            memcpy(buffer.data, &self._uniformStruct, sizeof(TileUniformStruct))
+            var textures = self.dayTextures
+            if let waterMask = self.waterMask {
+                textures.append(waterMask)
+            }
+            if let oceanNormalMap = self.oceanNormalMap {
+                textures.append(oceanNormalMap)
+            }
+            return textures
+        }
+
+    }
+    
+    var metalUniformUpdateBlock: ((buffer: Buffer) -> ([Texture]))!
+    
     
     func textureForUniform (uniform: UniformSampler) -> Texture? {
         let dayTextureCount = dayTextures.count

    
    var dayIntensity = 0.0
    
    var southAndNorthLatitude = Cartesian2()
    
    var southMercatorYLowAndHighAndOneOverHeight = Cartesian3()
    
    var waterMask: Texture? = nil
    
    var waterMaskTranslationAndScale = Cartesian4()
    
    private var _uniformStruct = TileUniformStruct()
    
    let uniforms: [String: UniformFunc] = [
        
        "u_initialColor": { (map: UniformMap, buffer: UnsafeMutablePointer<Void>) in
            let simd = (map as! TileUniformMap).initialColor.floatRepresentation
            memcpy(buffer, [simd], strideofValue(simd))

    
    var oceanNormalMap: Texture? = nil
    
    var lightingFadeDistance: float2 {
        get {
            return _uniformStruct.lightingFadeDistance
        }
        set {
            _uniformStruct.lightingFadeDistance = newValue
        }
    }
    
    var center3D: float3 {
        get {
            return _uniformStruct.center3D
        }
        set {
            _uniformStruct.center3D = newValue
        }
    }
    
    var modifiedModelView: float4x4 {
        get {
            return _uniformStruct.modifiedModelView
        }
        set {
            _uniformStruct.modifiedModelView = newValue
        }
    }
    
    var tileRectangle: float4 {
        get {
            return _uniformStruct.tileRectangle
        }
        set {
            _uniformStruct.tileRectangle = newValue
        }
    }
    
    var dayTextures: [Texture]
    
    var dayTextureTranslationAndScale: [float4] {
        get {
            var floatArray = [float4](count: MaximumMetalTextureCount, repeatedValue: float4())
            memcpy(&floatArray, &_uniformStruct.dayTextureTranslationAndScale, sizeof(float4) * MaximumMetalTextureCount)
            return floatArray
        }
        set {
            memcpy(&_uniformStruct.dayTextureTranslationAndScale, newValue, sizeof(float4) * MaximumMetalTextureCount)
        }
    }
    
    var dayTextureTexCoordsRectangle: [float4] {
        get {
            var floatArray = [float4](count: MaximumMetalTextureCount, repeatedValue: float4())
            memcpy(&floatArray, &_uniformStruct.dayTextureTexCoordsRectangle, sizeof(float4) * MaximumMetalTextureCount)
            return floatArray
        }
        set {
            memcpy(&_uniformStruct.dayTextureTexCoordsRectangle, newValue, sizeof(float4) * MaximumMetalTextureCount)
        }
    }
    
    var dayTextureAlpha: [Float]
    var dayTextureBrightness: [Float]
    var dayTextureContrast: [Float]
