Commit Graph
50 Commits
Author SHA1 Message Date
alteredq 7ad44b434c Added level-of-details example (and LOD object to compiled lib).
Thanks to empaempa for implementing this feature ;)
2011-03-01 15:50:14 +01:00
alteredq 03b9dfe80d Extracted Spline from example into core lib. 2011-03-01 03:51:43 +01:00
alteredq cf901305e5 Synced with mrdoob's branch. 2011-02-27 22:11:27 +01:00
Mr.doob 430ce532be Custom builds were missing files. (thanks to alan2 for reporting) 2011-02-27 20:20:15 +00:00
Mr.doob 7480fb69cd Updated README examples.
Sound3D ⟶ Sound
2011-02-26 14:21:15 +00:00
Mr.doob e7e47b1f88 More reformating and clean up. 2011-02-26 09:18:10 +00:00
alteredq da8afc4e6d Refactored CameraControl into THREE.QuakeCamera.
Now you can add keyboard + mouse camera control with a single line, just change camera type and add parameters:

 camera = new THREE.QuakeCamera( { fov: 50, aspect: window.innerWidth / window.innerHeight, near: 1, far: 10000,
	                           movement_speed: 1, look_speed: 0.002, nofly: true, look_vertical: false } );

Thanks to mrdoob for suggestions ;)
2011-02-26 00:24:14 +01:00
alteredq 7415759392 Added 3d sound support plus example.
Thanks to @mikaelemtinger ;)
2011-02-25 09:08:15 +01:00
Mr.doob fef3c084b1 Changed build setup:
build/Three.js - Includes all renderers + extras
	build/custom/ThreeCanvas.js - Canvas renderer only
	build/custom/ThreeDOM.js - DOM renderer only
	build/custom/ThreeSVG.js - SVG renderer only
	build/custom/ThreeWebGL.js - WebGL renderer only
	build/custom/ThreeExtras.js - Extras only

Moved `THREE.Detector.js` to `examples/js/Detector.js`.

Updated examples to reflect these changes.
2011-02-23 12:35:31 +00:00
Mr.doob a4a8f184c6 src/objects/Object3D.jssrc/core/Objects3D.js 2011-02-22 23:26:19 +00:00
Mr.doob 5aa43cd1cd All canvas examples are now using RequestAnimationFrame.js
Webgl examples next.
2011-02-22 01:54:03 +00:00
Mr.doob 848d1a338c Removed debug version from compile script. 2011-02-20 04:38:34 +00:00
alteredq 9c2b5c257c Added MiscUtils with THREE.requestAnimationFrame.
This is lifted from greggman's ThreeD http://code.google.com/p/threedlibrary/

Also modified ribbons example to show how to use this.
2011-02-19 18:21:03 +01:00
alteredq e151ff394b Added Ribbon object.
It provides a lean way how to render TRIANGLE_STRIP primitives: needs just n+2 vertices for n triangles (one Ribbon = one strip). There are no faces, no indices, everything is rendered in one simple drawArray call.

Vertex colors are supported, normals not yet.
2011-02-19 16:21:23 +01:00
alteredq afbace2801 Cleaning up to make it pass through Closure compiler.
We have been very lucky - setters / getters were not supported till just 2 hours ago (so fresh, I had to build Closure myself from their repo ;).

http://code.google.com/p/closure-compiler/issues/detail?id=249

Also some refactoring plus added hackish animation offset feature.
2011-02-17 05:10:30 +01:00
alteredq 082da28c8e Renamed THREE.Supports to THREE.Detector, moved it to extras. Also cleaned up example title tags. 2011-02-13 19:19:55 +01:00
alteredq 8e2f8c8b13 Fixed broken WebGL support detection.
Created "THREE.Supports" object, which should centralize this stuff. So far it detects <canvas>, WebGL and WebWorkers; later it could detect for example GPU capabilities.

Not sure about name or location, but it's pretty tiring go through all examples when something changes, so it should be somewhere in the library.

Code duplication is bad: even html snippets with error message should be centralized somewhere, so that when new browsers arrive we wouldn't have to keep changing them in many places.
2011-02-12 20:02:05 +01:00
alteredq b198531c66 Added MarchingCubes object.
Very much work-in-progress. Expect things to change.

Also changed film shader to have optional grayscale (controlled via uniform).
2011-02-07 14:29:42 +01:00
Mr.doob 52c0de2b09 Merging with alteredq's branch. 2011-01-26 18:36:49 +00:00
alteredq 8faa18b620 Added simple scene format loader.
This is very much work in progress - expect things to change and to be broken.
2011-01-25 18:32:07 +01:00
astrodud a62dc97e60 added LathedObject to build script for extras options 2011-01-16 15:27:19 -08:00
Szymon Nowak 6294caed07 Added render-to-texture feature to WebGL renderer. 2011-01-11 10:10:05 +01:00
alteredq e43de3dcf7 Refactored lines handling in WebGLRenderer to use the same internal machinery as meshes.
No need to stuff them in different bucket, line-specific stuff is anyway done in `renderBuffer` method.

This was prompted by starting with implementation of ParticleSystem. It would be unwieldy to handle three different buckets of objects / buffers.
2011-01-08 17:33:55 +01:00
alteredq 0fe464c97a 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.
2010-12-28 17:11:50 +01:00
alteredq fb7788f0c6 Resurrected exponential fog as FogExp2.
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.
2010-12-26 04:11:35 +01:00
alteredq 76a56f2f5c First attempt at fog ;)
For the moment, it works just on Basic / Lambert / Phong materials.

Fog must be added to the scene before initialization of WebGLRenderer and scene must be passed to WebGLRenderer constructor (like for lights).

I don't know yet how to solve properly MeshShaderMaterial & co :(
2010-12-21 01:22:44 +01:00
alteredq 5e74c741c1 Retired MeshCubeMaterial: replaced it with MeshShaderMaterial "cube" defined in ShaderUtils.
Instant performance boost in all cube mapping demos ;)

With panoramas there were insane amounts of unnecessary computations done in fragment shader - basically every pixel on the screen was computing the whole ubershader - ouch ouch ouch!

This was the lowest hanging fruit, still some more performance can be gained by removing other stuff from ubershader.

Big thanks to mrdoob for starting to question sanity of ubershader ;)
2010-12-18 02:48:59 +01:00
Mr.doob 15262507bd Added a sort parameter to Projector.projectObjects and Projector.projectScene. 2010-12-17 22:27:18 +00:00
alteredq a31a8aaacf Refactored build system so that it's possible to generate includes for each configuration.
Also made code slightly faster (and more Pythonic).
2010-12-06 12:59:30 +01:00
Mr.doob fecd2f3a39 python build.py --includes generate a includes.js for easy copy/pasting
TODO: Would be nice if `buildIncludes()` would reuse `buildCommon()` array.
2010-12-06 06:29:05 +00:00
Mr.doob 00795b3a83 Updated CanvasRenderer and some examples to handle the Texture( image, mapping) approach. 2010-12-04 16:33:16 +00:00
Mr.doob 2463d48d26 build.py: full ⟶ common 2010-12-01 07:41:35 +00:00
sole 3169b4cb86 buid.py: Show help message when no arguments are specified 2010-11-30 17:39:25 +00:00
Mr.doob a6c9984a67 Commented some WIP code in CanvasRenderer so it doesn't throw warnings while compiling.
Modified build script to avoid the extra full compilation.
2010-11-30 17:18:05 +00:00
Mr.doob 0f2badfdd1 Previous commit: Matrix4.transformMatrix4.transformVector3 and Matrix4.tranformVector4
This commit fixes what that change broke.
Removed chromatic distortion from WebGL reflection/refraction.
2010-11-30 16:15:16 +00:00
Mr.doob 67250c69d9 Merging with alteredq's branch. 2010-11-30 05:06:46 +00:00
Mr.doob a2acf0b390 CanvasRenderer/SVGRenderer: RenderableFace4 is now gone. Unfortunately it created more problems than it solved.
CanvasRenderer now with ShadingSmooth, or something along the lines...
2010-11-27 11:30:01 +00:00
alteredq 0cdd188e17 Added MeshCubeMaterial: WebGLRenderer specific material for more efficient rendering of panoramas when doing cube mapping.
Also moved loadImageArray utility function from examples into TextureCube.js

To be used like this:

    var urls = [ "px.jpg", "nx.jpg", "py.jpg", "ny.jpg", "pz.jpg", "nz.jpg" ];
    var images = THREE.loadImageArray( urls );
    var textureCube = new THREE.TextureCube( images );

    // create scene

    var objectMaterial = new THREE.MeshBasicMaterial( { color: 0xffffff, env_map: textureCube } )
    createScene( objectMaterial );

    // create panorama

    var size = 100000;
    var panoMaterial = new THREE.MeshCubeMaterial( { env_map: textureCube } );
    var mesh = new THREE.Mesh( new Cube( size, size, size, 1, 1, null, true ), panoMaterial );
    sceneCube.addObject( mesh );

Warning: this functionality is currently changing a lot, expect things to get broken before stabilization.
2010-11-22 02:10:07 +01:00
alteredq 3ee99dc4c5 Added cube mapping to WebGLRenderer. Also added cube map example. Finally ;)
TODO:

  - maybe image array loader should go into TextureCube.js so that people could just reuse the code

  - it may be worth to be able to specify different combination of environment map and underlying material (in single render pass),
    currently color/color map/environment map are multiplied, though addition also produces very interesting looking materials
2010-11-18 02:00:11 +01:00
Mr.doob fbfa375d2c src/io/Loader.js ⟶ src/extras/io/Loader.js
Removed Loader.js from compiled lib
Fixed examples
2010-11-16 14:04:54 +00:00
Mr.doob 5e4476bde8 Now using Closure Compiler (~2kbytes) 2010-11-16 12:53:00 +00:00
Mr.doob 4d209ac433 Implemented material blendings (THREE.NormalBlending, THREE.AdditiveBlending, THREE.SubtractiveBlending) in CanvasRenderer
Added MeshNormalMaterial (per face)
2010-11-15 16:52:22 +00:00
Mr.doob 98dc841aab Added MeshDepthMaterial.
Optimised Particles projection in CanvasRenderer.
2010-11-15 01:17:41 +00:00
Mr.doob 22f48a731b CanvasRenderer handles textures again.
Most of the examples working.
2010-11-13 07:11:57 +00:00
Mr.doob ce3d641ff2 Changed materials format a bit.
Almost done porting CanvasRenderer to the new material system (plus some performance gains on the way :D)
`Color` now handles hex with no alpha byte (probably there is a nicer way of doing it...)
2010-11-13 02:39:27 +00:00
Mr.doob a7d70a0eff * Builders clean up 2010-11-09 06:27:44 +00:00
sole b489e524ea Build system: now --debug applies to the current build (can generate debug versions of every type of build: canvas, dom, etc) 2010-11-08 11:43:13 +00:00
sole cb626b9d95 Merged with alteredq version (support python 2.6) and also made it more explicit as per mrdoobs suggestion 2010-11-07 19:46:53 +00:00
alteredq b14f09be61 Merged with sole's branch: took new Python build script, made it work with my ancient Python 2.6. 2010-11-06 19:50:37 +01:00
sole e43af53f19 refactored build system 2010-11-05 14:21:54 +00:00