Can we combine the structure of all these functions in a local function like `renderFragment` in [TextureSpec.js](https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Specs/Renderer/TextureSpec.js)?