• A
    Made VBOs reusable. · c0e30b2c
    alteredq 提交于
    The most tangible practical effect is that demos with multiple Lucys / Walts are now initialized much faster ;).
    
    Reuse is achieved mostly by moving mesh chunks / VBOs (formerly called materialFaceGroups) from Mesh into Geometry.
    
    This means sorting of geometry by face materials + breaking large geometries into chunks now has to be done after construction of geometry.
    
    It becomes a step in the usual sequence:
    
        geometry.computeNormals();
        geometry.computeCentroids();
        geometry.sortFacesByMaterial();
    
    If geometry is constructed programmatically (e.g. with GeometryUtils.merge), this has to be called afterwards.
    
    Also of note: single geometry cannot be reused both for flat and smooth shading, as only one stream of normals is baked into VBO.
    c0e30b2c
Sphere.js 2.8 KB