AnalyticalGraphicsInc/cesium — pull request #2357 by pjcozzi (2014-12-29 19:53:20+00:00)
Title: Minor shader uniform cleanup and performance improvements

At fullscreen 3K, the terrain test case is:
```
Before: 85-88 fps
After: 91-93 fps
```

The 3D models test case is:
```
Before: 15-16 fps
After: 15-17 fps
```

We can do a lot more, especially with WebGL 2, see #649.

Terrain Sandcastle test:
```javascript
var viewer = new Cesium.Viewer('cesiumContainer', {
terrainProvider : new Cesium.CesiumTerrainProvider({
url : '//cesiumjs.org/stk-terrain/tilesets/world/tiles'
}),
baseLayerPicker : false
});

viewer.scene.debugShowFramesPerSecond = true;

var eye = new Cesium.Cartesian3(294572.0645397696, 5637826.573008351, 2978624.6868285);
var target = Cesium.Cartesian3.add(eye, new Cesium.Cartesian3(0.9028130862217908, -0.42449297750082904, -0.06880583840911567), new Cesium.Cartesian3());
var up = new Cesium.Cartesian3(0.40668971896562117, 0.790807045510862, 0.45741413322152297);
viewer.camera.lookAt(eye, target, up);
```

3D models test:
```javascript
var viewer = new Cesium.Viewer('cesiumContainer');
var scene = viewer.scene;
scene.debugShowFramesPerSecond = true;

function createModel(url, position, zoom) {
var modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(position);

var model = scene.primitives.add(Cesium.Model.fromGltf({
url : url,
modelMatrix : modelMatrix
}));

model.readyToRender.addEventListener(function(model) {
// Zoom to model
if (zoom) {
var center = Cesium.Matrix4.multiplyByPoint(model.modelMatrix, model.boundingSphere.center, new Cesium.Cartesian3());
var transform = Cesium.Transforms.eastNorthUpToFixedFrame(center);
var camera = scene.camera;
camera.transform = transform;
var controller = scene.screenSpaceCameraController;
var r = 2.0 * Math.max(model.boundingSphere.radius, camera.frustum.near);
controller.minimumZoomDistance = r * 0.5;
camera.lookAt(new Cesium.Cartesian3(r, r, r * 0.2), Cesium.Cartesian3.ZERO, Cesium.Cartesian3.UNIT_Z);
}
});
}

var url = '../../SampleData/models/CesiumGround/Cesium_Ground.gltf';

var zoom = true;
for (var x = 0; x < 20; ++x) {
for (var y = 0; y < 20; ++y) {
createModel(url, Cesium.Cartesian3.fromDegrees(-123.0 - (x * 0.0002), 44.0 - (y * 0.0002), 0.0), zoom);
zoom = false;
}
}
```