1. 23 10月, 2011 2 次提交
  2. 22 10月, 2011 1 次提交
    • A
      Added "autoUpdateObjects" flag to WebGLRenderer. · 5edfb126
      alteredq 提交于
      This is to be able to skip redundant updates in multipass rendering (like for shadow maps or dynamic cube maps).
      
      Also reshuffled initWebGLObjects calls to have just a single update in a basic scenario of shadow map pass followed by scene render.
      
      Still need to solve somehow potential redundant updates in EffectComposer (which can mix multiple scenes).
      5edfb126
  3. 21 10月, 2011 6 次提交
    • A
      Removing some cruft in WebGLRenderer. · 103154d2
      alteredq 提交于
      103154d2
    • A
      More strict equality checking. · f166079d
      alteredq 提交于
      Just for the sake of consistency, when object properties are not involved performance difference is negligible.
      f166079d
    • A
      Small change in setObjectFaces. · b410a780
      alteredq 提交于
      These little buggers were costing 3.35% of the total time in performance test.
      b410a780
    • A
      Cleaned up a bit buffers handling in WebGLRenderer. · b0aae55e
      alteredq 提交于
      b0aae55e
    • A
      All WebGL examples working with array-less materials. · 81b60ea2
      alteredq 提交于
      Noticeable difference: can't anymore assign Material references to faces directly - "face.materials" became "face.materialIndex". Materials have to go to "geometry.materials" array (to which "face.materialIndex" points). This is necessary to allow run-time changing of face materials (this indirection used to be done by arrays).
      
      Some casualties:
      
      - multi-materials example, this functionality isn't possible anymore
      - had to simplify LOD Text examples as LODs don't handle groups (used to fake multi-materials)
      - multi-materials sphere in materials example can't have faces with undefined materials (this may be fixable I guess, when there'll be some real use-case)
      - scene format still has materials arrays, only the last material will be used (except when there are face materials, then materials from JSON will be used, as before)
      
      Other renderers and their corresponding examples were not touched yet.
      
      WebGLRenderer still needs some prettification, some things don't make sense anymore without arrays, code can be cleaned up further.
      81b60ea2
    • A
      Experimenting with array-less materials. · 05b3db4d
      alteredq 提交于
      Do not use for anything, this is just snapshot of a test in progress. I solved quite a few issues, but many things are still clumsy and broken.
      05b3db4d
  4. 19 10月, 2011 1 次提交
    • A
      Experimenting with Phong computed fully in fragment shader. Added new point lights test. · b4f89f4b
      alteredq 提交于
      New per-pixel Phong code is enabled by setting `perPixel` parameter in Phong material.
      
      This version is able to light single untesselated quad correctly.
      
      Also it doesn't have point lights number limitation caused by varyings, all lights pass just through uniforms.
      
      Performance wise it seems surprisingly quite similar to old version (stress test is ~6 fps faster with new version, though I guess for different use cases / GPUs it can differ).
      b4f89f4b
  5. 18 10月, 2011 2 次提交
    • A
      Added "metal" parameter to Phong. Added new materials test. · 22535923
      alteredq 提交于
      Metal makes specular term multiplicative (default is additive). This is to be able to have textured materials that do not have diffuse color, just a specular one, to get metallic look (additive specular gives plastic look).
      22535923
    • A
      Changed ambient handling for Phong and Lambert materials. · 9968b7dc
      alteredq 提交于
      Removed diffuse color influence on ambient term in Phong. This was causing texture disappearance when diffuse color was black.
      
      Made Lambert more similar to Phong: now it also has ambient color parameter. Before ambient light was affecting Lambert as if ambient color was always 0xffffff.
      9968b7dc
  6. 16 10月, 2011 2 次提交
  7. 15 10月, 2011 1 次提交
    • A
      Refactored custom attributes handling to use lists to remove massive bottleneck. · 41eb5006
      alteredq 提交于
      Apparently iterating over object properties is dangerous even if that code path is not executed.
      
      Stress-testing particles buffers setting showed 60% performance increase (in Chrome) even when there were no custom attributes (and thus custom attributes handling code behind "if ( customAttributes )" was never executed).
      
      I suspect this may be caused by some V8 optimization heuristics.
      41eb5006
  8. 12 10月, 2011 2 次提交
  9. 11 10月, 2011 2 次提交
    • A
      Fixed random clipping of objects in WebGLRenderTargetCube / CubeCamera. · d2c6487b
      alteredq 提交于
      Turns out before all cube texture faces shared a single depth buffer.
      
      Last cube face still missing.
      d2c6487b
    • A
      Refactored CubeCamera / cube map handling. · addb3a12
      alteredq 提交于
      Before lighting was messed up in dynamically generated cube maps.
      
      Dynamic cube maps need to have flip uniforms (flipEnvMap / tFlip) set to 1, static cube maps to -1 (default).
      
      For standard materials this is handled automatically, it's just something to be aware of when using cube maps in custom ShaderMaterials (dynamic and static cube maps have different cube face orientations, dynamic ones are correct, static ones need flipped x-axis in lookup vector).
      
      There is still mystery of disappearing last cube face (negative-Z) and weirdly clipped objects in cars demo (works ok in simpler test).
      addb3a12
  10. 08 10月, 2011 2 次提交
  11. 07 10月, 2011 1 次提交
  12. 06 10月, 2011 4 次提交
  13. 05 10月, 2011 2 次提交
    • M
      More breakage... · c89e3fe4
      Mr.doob 提交于
      * Added `scene.ambientColor` and `Scene` now ignores `AmbientLights` (transferring hex for temporal backwards compatibility)
      * CanvasRenderer and SVGRenderer using `scene.ambientColor`. Tried to update `WebGLRenderer` too, but the method in question doesn't seem to have access to the scene :S
      * Removed `scene.origin` and updated examples that used it.
      * Improved subdivision example
      c89e3fe4
    • A
  14. 02 10月, 2011 4 次提交
    • M
      Fixed yet more examples. · 25d6480c
      Mr.doob 提交于
      25d6480c
    • M
      I hate that github now forces you to write a title for a commit :| · 32355db8
      Mr.doob 提交于
      Removed _gl.clear call from WebGLRenderer's .setSize().
      32355db8
    • M
      WebGLRenderer .autoClear* · 7700feb5
      Mr.doob 提交于
      Implemented .autoClearColor .autoClearDepth .autoClearStencil as per @alteredq's suggestion at #587.
      7700feb5
    • M
      Bunch of changes... · b87bfc71
      Mr.doob 提交于
      * Camera.useTarget is now false by default. Updated some of the examples. I tried to remove target altogether (and use lookAt every frame), but I found that WebGLRenderer's ShadowMaps uses a camera with target. Will try again at some point.
      * Object3D.lookAt now checks if it's a Camera and does the inverted view.
      * Quaternion glitch reported at #595
      * Added .name to Material
      * WebGLRenderer .clear() to .clear( color, depth, stencil ). All of them true by default.
      b87bfc71
  15. 29 9月, 2011 1 次提交
    • N
      Added "lower level" immediate rendering functionality. The existing mechanism... · c311a719
      Nik Van den Wijngaert 提交于
      Added "lower level" immediate rendering functionality. The existing mechanism requires modification of the WebGLRenderer for different objects. The new implementation leaves the current MarchingCubes immediate renderer intact but checks for existence of a immediateRenderCallback member function of the object. If found, that object is added to the scene.__webglObjectsImmediate array. The program, webgl context, and frustum are currently passed into the callback, putting al rendering responsibility at the implementing object. This may break the Three.js abstraction somewhat, but allows "power users" to do some funky webgl stuff while still relying on the Three.js framework for the rest of the scene...
      c311a719
  16. 27 9月, 2011 1 次提交
  17. 26 9月, 2011 2 次提交
    • A
      Optimized uniforms updates. · ba75a48a
      alteredq 提交于
      Should not refresh anything if material doesn't change for several objects in a row (in a single frame).
      
      Hope this didn't break something, I remember this being tricky. Went through examples and they seem to work ok, gained some fps in performance test.
      
      Also disabled sorting in depth-of-field example for some more fps gain.
      
      Still didn't figure out the original reason for recent fps drop in performance / dof examples :/
      ba75a48a
    • A
      Optimized iteration over uniforms in WebGLRenderer. · 4d34149a
      alteredq 提交于
      Similarly like for geometry groups, iterating over object properties turned out to be bottleneck for some use cases: gained 5-10 fps in depth-of-field example (which btw for some reason got slower recently).
      4d34149a
  18. 25 9月, 2011 1 次提交
  19. 21 9月, 2011 2 次提交
  20. 20 9月, 2011 1 次提交
    • A
      Fixed bug preventing re-adding of objects removed from the scene. · 0033a975
      alteredq 提交于
      Problem was that objects could be added to WebGLRenderer's internal render list only once (because of `webglInit` flag).
      
      Now there are two separate internal states (`webglInit` and `webglActive`) so that object can be initialized just once (expensive operation) but added / removed from the scene many times (cheap operation).
      0033a975