Added Python script for file concatenation with keeping track of file start offsets.
This single file way is a bit slower, but should be easier on server / workers (before every part spawned own worker, now all parts for a single model are handled by a single worker).
CTM pipeline produces very small and efficient models, just it's quite involved.
Models with multiple materials need to be split into separate files. For this there "split_obj.py" helper script.
Also, as CTM format uses indexed shared vertices, with more complex UV unwrapping mesh may need to get preprocessed to create extra vertices for faces which have different UVs for the same vertices (MeshLab can do this).
Work in progress. For the moment works just with CTMLoader. Still not sure where some pieces of code would go.
Upsides:
- initialization time cut down significantly (1.8 seconds => 0.7 seconds for CTM example)
- much smaller GL buffers thanks to fully used indexing (Walt has 6x less vertices)
- consequently much smaller memory footprint all around, both for main and GPU memories,
which means less swapping and better vertex caching
Downsides:
- can't have anymore sharp per-face effects like flat shading (at least if mesh is not constructed in a way where each face has own vertices)
- can't have multiple materials per mesh
- no more easy manipulation of anything (for the moment actually no runtime manipulation at all, typed arrays are just thrown away, dynamic geometries code path not yet implemented)
OpenCTM mesh format looks quite promising, smaller than UTF8 and more robust, just geometry creation time is slower (decompression is done in JavaScript as opposed to piggybacking on built-in http gzip).
Dynamic terrain example now creates a specular texture from the color texture. That saves 2.17 MB download.
Just I had to drop materials pre-initialization, for some reason this doesn't play nice with having extra scene / render target :S.
In theory also detail normal texture could be computed from the color texture, just we need some nicer normal map filter (Gimp plugin has 9 different ones).
This allows, for example, better integration of additively blended materials with a regular scene.
Not to be confused with depthTest (which controls complete access to depth buffer, including reading).
Also messed up a bit with particle emitter example.
Masking was real pain to get working with multiple render targets :/.
Unfortunately this introduced dependencies on MaskPass.js and ShaderPass.js even for use cases that do not use masking. Bah, will need to figure out some better way for deployment.
Cause everywhere there are warnings about not writing to the same texture which is also being read. Curiously enough this didn't make problems so far (save for mysterious lines when doing "heat" effect in ro.me).