1. 18 1月, 2011 6 次提交
  2. 17 1月, 2011 2 次提交
    • A
      Small optimizations to matrix math. · 08f6ceef
      alteredq 提交于
      For the moment just things that are executed every frame in WebGLRenderer.render.
      
      Continuing with quest to minimize creation of new data structures. Should instead create per class/object structures and just reuse them (as gman does in ThreeD). Main goal is to avoid annoying garbage collection pauses.
      
      Let's hope it didn't break something (could be if some code was dependent on cloning of return values of "flatten" or "makeInvert3x3", though from what I checked these are just used to set typed arrays uniforms).
      08f6ceef
    • A
      Added support for `flipSided` mesh property to WebGLRenderer. · d110c49c
      alteredq 提交于
      Also doesn't seem to decrease performance so far (though most of demos have small number of objects).
      d110c49c
  3. 16 1月, 2011 2 次提交
  4. 15 1月, 2011 1 次提交
    • A
      Added postprocessing example. · a03f7142
      alteredq 提交于
      For this had to extend WebGLRenderer a bit:
      
      - MeshShaderMaterial now can take non-specific float array uniforms as "fv1"
        (there is already "fv" type for array of 3-item-vectors, which probably should be renamed to "fv3" to be consistent)
      
      - render method has yet another parameter "clear" for clearing newly set framebuffer (defaults to true).
        This is a bit hackish but it seems necessary to control this somehow. I didn't manage to replicate
        desired behavior just with autoClear.
      
      - another dirty thing is accessing GL context from the application side:
          renderer.context.disable( renderer.context.DEPTH_TEST );
      
          This should be refactored somehow, wrapped in some API call.
      a03f7142
  5. 14 1月, 2011 2 次提交
    • A
      Another update of render-to-texture example and related bugfix. · 7c9fe8ff
      alteredq 提交于
      Rendering proper 3d object into the texture uncovered another issue - framebuffer had to be cleared after switching.
      
      Texture is still flipped :( (original scene has small red torus on the top)
      
      This is proving to be rather tricky. Yet again I tried to handle image coordinate mess in a proper way (UNPACK_FLIP_Y_WEBGL as texture parameter and non-inverted UVs), fixing hacks across the codebase.
      
      This did indeed help with render-to-texture flipping, but instead it created really ugly problems with both normal map and minecraft AO demos. So back to square one :(
      7c9fe8ff
    • A
      Fixed discrepancy between ANGLE and OpenGL when rendering to texture. · 9bc383e1
      alteredq 提交于
      Had to set viewport to make it work in OpenGL.
      
      Also made it easier to see texture orientation in the example.
      
      Now it's visible that there is indeed flipping. At least now it's consistent ;).
      9bc383e1
  6. 13 1月, 2011 1 次提交
  7. 12 1月, 2011 1 次提交
    • A
      Added basic support for dynamic geometry in WebGLRenderer (with silly ocean example). · fe6008b6
      alteredq 提交于
      If you want to refresh VBOs (and thus have geometry changes reflected in renderer), you need to set dirty flags on geometry object.
      
      There are separate flags for different buffers (as not always all buffers need to be updated and oh my is updating costly):
      
          mesh.geometry.__dirtyVertices = true;
          mesh.geometry.__dirtyNormals = true;
          mesh.geometry.__dirtyUvs = true;
          mesh.geometry.__dirtyTangents = true;
      
          mesh.geometry.__dirtyElements = true;
      
      That was quite tough feature, a lot of refactoring, yet performance is still quite bad :(
      
      The biggest remaining bottleneck seems to be translation between Three.js internal data formats and buffers. I removed as much per-frame arrays creation as I could, but even just iterating through existing data and setting of values is still very costly. Also per-frame normals computation is expensive.
      fe6008b6
  8. 11 1月, 2011 1 次提交
  9. 09 1月, 2011 2 次提交
  10. 08 1月, 2011 1 次提交
  11. 06 1月, 2011 1 次提交
  12. 04 1月, 2011 2 次提交
    • A
      Refactored lines grid in materials_gl example. · 8ea0f276
      alteredq 提交于
      8ea0f276
    • A
      Added crude lines support to WebGLRenderer. · 548c3315
      alteredq 提交于
      As expected, performance of one-to-one conversion from CanvasRenderer was horrible, so I had to change a bit how lines are handled.
      
      Line object now has "type" property:
      
          - default type is "THREE.LineContinuous" which should behave as before: geometry represents one continuous line (v0 ... vn)
      
          - new option is "THREE.LinePieces" which tells renderer that geometry represents collection of individual line segments (v0,v1) ... (vn-1, vn)
      
      (one Line object corresponds to one VBO)
      
      (same limitations as with meshes - once VBO is baked, no changes are possible except object transforms - scale / rotation / position)
      548c3315
  13. 03 1月, 2011 2 次提交
  14. 01 1月, 2011 1 次提交
  15. 31 12月, 2010 2 次提交
  16. 30 12月, 2010 3 次提交
  17. 29 12月, 2010 2 次提交
    • A
      Moved MeshBasicMaterial out of ubershader. · 3cabd118
      alteredq 提交于
      None of the demos seem to be slower, some are noticeably faster (especially terrain).
      
      I suspect biggest performance gain comes from conditional include of environment mapping: if it's not used, it doesn't go into shader at all.
      3cabd118
    • A
      Refactored uniforms cloning into separate file so that it can be reused also... · 0fe464c9
      alteredq 提交于
      Refactored uniforms cloning into separate file so that it can be reused also for MeshShaderMaterials.
      
      Also changed MeshShaderMaterial demos to show how to use cloning. For these particular demos uniforms cloning is not really necessary as they use only one instance of shader material, but for example, if there were two normal mapped models in one scene, each model would need separate material with own uniforms.
      0fe464c9
  18. 28 12月, 2010 2 次提交
  19. 27 12月, 2010 5 次提交
  20. 26 12月, 2010 1 次提交
    • A
      Resurrected exponential fog as FogExp2. · fb7788f0
      alteredq 提交于
      For the moment, only one type of fog is baked into shader, depending on scene.fog initial value.
      
      If use case arise for dynamic fog type switching, this could be changed, though than both fogs would need to be computed all the time :S.
      fb7788f0