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)
This should allow attaching of lights to objects. As a side effect, directional lights positions don't need to be normalized explicitly anymore.
Also changed viewport dimensions passed to render plugins to work with render targets with different dimensions than the screen framebuffer.
And fixed new dependencies in build script.
It was quite a pain - ArrayBuffers / Typed Arrays are fussy about byte alignment - but seems to be worth it.
Parsing times are down (modest gains for small objects / Firefox, bigger gains for large objects / Chrome, performance gains from 10% - 200%).
Also as a positive side effect, changing interleaved face arrays into uniform arrays seems to have helped a bit with gzip compression (about 6% smaller size for gzipped 526K Lucy).
Fixed Blender importer to work with Blender 2.60, add option for importing workers or non-worker models.
Fixed more examples to use worker-less format. All examples should work now.
Only Max exporter should be left to change.
Work-in-progress => do not merge yet.
OBJ converter, JSONLoader, BinaryLoader and some examples are done. Still need to do Blender exporter, SceneLoader and more examples.
Advantages:
- faster parse times
- bypass array initializer size limit in Firefox
- no more crashes in Chrome 15 (caused by too many concurrently active workers)
Disadvantages:
- more browser UI freezing
- multiple models tend to appear all at once with the last one (instead of popping up progressively)
* Camera is now a base object. PerspectiveCamera should be used instead. Figured out a way to show a warning when misused.
* OrthoCamera is now OrthographicCamera.
* Removed `target` from Camera.
Misc
* Renamed Trident to Axes.
* Added support to texture.offset in CanvasRenderer
* Removed ShadowVolume, ShadowVolumeDynamicMaterial and LensFlare classes.
* Removed Stencil Shadows and LensFlare code out of WebGLRenderer
* Added 2.59 folder to Blender, and removed old ones.
Included corresponding compressor in "utils/exporters/utf8" (prebuilt exe for Windows plus slightly modified C++ source code).
Use UTF8 format with caution, it is very neat but has quite a few limitations:
- number of vertices < 65536 (this is after optimizations in compressor, input OBJ may have even less)
- models must have normals and texture coordinates
- texture coordinates must be only from <0,1>
- no materials support yet
- models are scaled and offset (copy numbers from compressor and use them as parameters in UTF8Loader.load() )