Commit Graph
17 Commits
Author SHA1 Message Date
Mr.doob 7480fb69cd Updated README examples.
Sound3D ⟶ Sound
2011-02-26 14:21:15 +00:00
Mr.doob c186b37be3 Pushed revision to 32.
Updated README.
2010-12-31 17:59:11 +00:00
Mr.doob a9e185aa70 Updated README includes.
Pushed revision number to 31.
2010-12-06 10:32:38 +00:00
Mr.doob bddcebce95 Few changes to README 2010-11-28 07:06:16 +00:00
Mr.doob c16394d2ec Updated README.
Pushed REVISION to 29.
2010-11-17 05:45:35 +00:00
alteredq 5192428f25 Added Loader class providing both asynchronous JS and web worker based loading of models.
The idea is that later there will be more loaders which would load different formats (like OBJLoader, ColladaLoader).

Usage (async JS):

var loader = new THREE.Loader();
loader.loadAsync( "obj/torus/Torus.js", function() { createScene( new Torus() ) } );

Usage (web worker):

var loader = new THREE.Loader();
loader.loadWorker( "obj/torus/Torus_slim.js", function( geometry ) { createScene( geometry ) } );

Web worker loader is useful for large meshes, where it allows browser to stay responsive for longer time and also it can handle larger meshes than async JS loader.

Web worker loader needs a simpler format of the model. Web workers can communicate with the main application only via message passing, where messages are JSON objects.

There is a new version of OBJ -> Three.js converter (convert_obj_threejs_slim.py) which can produce model in format needed for web workers.

All examples which were using models from OBJ converter were refactored to use Loader.

Except large mesh example, all examples are using just async JS loading. Web worker loading is there, it's just commented out, as it's a bit pain for local development.

Chrome doesn't allow to run web workers from pages accessed via file://, so you need either to run it with "--allow-file-access-from-files" flag, or access examples via local server (http://localhost/example.html).
2010-11-03 18:12:31 +01:00
alteredq 88c5d3e571 Forgot to build one-file version and to bump up version number. 2010-11-02 19:28:53 +01:00
alteredq 1c35d90fd7 Added handling of multiple lights to WebGLRenderer.
Limitations:

 - Chrome can handle up to 5 lights in total (directional + point)
 - Firefox seems to handle up to 29 lights

These number are GPU specific (mine is ATI Mobility Radeon 3650).

This turned out to be quite tricky. The number of varying vectors in shaders is limited. Additionally Chrome and Firefox have different limitations (at least on Windows, probably due to Chrome using ANGLE as rendering backend).

Hence WebGLRenderer has hardcoded limit of maximum 5 lights.

WebGLRenderer constructor now takes (optional) scene argument, so that numbers and types of lights present in the scene can be used to generate minimal possible shader.

If no scene is passed, shader allowing 1 directional + 4 point lights will be generated.
2010-10-31 00:45:04 +02:00
alteredq 79ab4bf2e6 Merged with mrdoob's branch. Got WebGLRenderer working again :)
Changed OBJ -> Three.js converter to use new materials system (eventual old models need to be reconverted).

Limitations:

  - one use case is now much slower
    - when a mesh has each face with different color (e.g. polyfield in examples/test.html)
    - before this used FaceColorFill material and in WebGLRenderer it was rendered fast with color attribute array
    - now when FaceColorFill material is gone, each face gets own VBO :(

  - material sorting uses Materials "toString" methods for hashing, so it's very important to keep these in a good shape
2010-10-28 19:35:13 +02:00
alteredq b6904f3d72 Added Blinn-Phong material for WebGLRenderer.
In Chrome it looks more or less ok, but it has some problem in Firefox 4 (with some camera angles there are black areas around edges).

Also updated Python builder scripts and examples to include this new material.
2010-10-27 21:16:11 +02:00
alteredq 277d117b3d Refactored multimaterials to also work with non-textured models composed from multiple material groups.
Old version was doing massive overdraw (whole mesh was drawn for each material).

Even current solution is still quite messy: there is a different behavior for stroke and fill materials (when used as secondary materials).

Stroke materials are applied to the complete mesh (as most common use case seems to be wireframe) while fill materials now apply only to faces within single material group (when "decalIndex" property of secondary fill material is set).
2010-10-26 12:18:30 +02:00
alteredq 2f1bf335c6 Forgot to build single file libraries and bump up version number. 2010-10-24 18:55:31 +02:00
alteredq 69d93317c8 Forgot to build single file libraries. 2010-10-22 02:49:58 +02:00
alteredq dde831bf6f Extended CanvasRenderer to be able to handle decals (MeshBitmapUVMappingMaterials as secondary materials).
For decals you need to set "decalIndex" property of the material (corresponding to materials index of the original mesh UV material).

Added multimaterials example.

Fixed forgotten sphere smoothing in OBJ converter example.
2010-10-21 01:38:29 +02:00
alteredq 396d8d1cec Added male model to OBJ converter example. 2010-10-18 14:19:39 +02:00
Mr.doob 647b4a57b8 * Added PointLight
* `CanvasRenderer` and `SVGRenderer` basic lighting support (`*ColorStroke`/`*ColorFill` only)
* `Renderer` > `Projector`. `CanvasRenderer`, `SVGRenderer` and `DOMRenderer` do not extend anymore
* Interactivity base code (hdi folder). To be refactored... ([mindlapse](http://github.com/mindlapse))
* Added `computeCentroids` method to `Geometry`
* Included `Stats.js` directly in the `/examples` folder to avoid the need of internet for playing around
2010-10-06 03:36:21 +01:00
Mr.doob e68109fdb2 - Clean up 2010-09-17 02:52:29 +01:00