118 Commits
Author SHA1 Message Date
Mr.doob c186b37be3 Pushed revision to 32.
Updated README.
2010-12-31 17:59:11 +00: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 a9e185aa70 Updated README includes.
Pushed revision number to 31.
2010-12-06 10:32:38 +00: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 cee17e1043 Merge remote branch 'orgicus/master' 2010-12-02 17:19:33 +00:00
George Profenza e90f60ec3b added slim conversion 2010-12-01 15:46:34 +00:00
Mr.doob 2463d48d26 build.py: full ⟶ common 2010-12-01 07:41:35 +00:00
Mr.doob b21ced8562 Merge remote branch 'sole/master' 2010-11-30 17:44:19 +00:00
sole 3169b4cb86 buid.py: Show help message when no arguments are specified 2010-11-30 17:39:25 +00:00
Mr.doob 870102c68d You gotta love MacOS and its .DS_Store files... 2010-11-30 17:34:18 +00:00
Mr.doob e72b82cda2 Merging with orgicus' branch. 2010-11-30 17:30:45 +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
George Profenza 38d3d0a364 merged with r29 2010-11-30 14:26:11 +00:00
George Profenza caf2c2000f merging with r29 2010-11-30 13:45:00 +00:00
George Profenza 774b5e843d merged with original 2010-11-30 11:54:43 +00:00
Mr.doob 67250c69d9 Merging with alteredq's branch. 2010-11-30 05:06:46 +00:00
George Profenza 0528c143fc blender 2.49 exporter 2010-11-29 15:05:55 +00:00
George Profenza 61d7fe9575 c4d export 2010-11-29 14:40:00 +00:00
Mr.doob bddcebce95 Few changes to README 2010-11-28 07:06:16 +00:00
Mr.doob 34f802e392 Code clean up.
Removed old Blender exporters.
Slim exporter is now Normal exporter (needs some testing).
2010-11-28 06:52:59 +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 4adb1eea37 Added option to OBJ converter allowing to invert material transparency (some models interpret 0 as opaque and 1 as transparent). 2010-11-23 22:37:03 +01:00
alteredq f02f057677 Fixed broken material names generation in OBJ converter. 2010-11-22 22:12:54 +01: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 c16394d2ec Updated README.
Pushed REVISION to 29.
2010-11-17 05:45:35 +00: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 5feee3839f Trying to merge... 2010-11-15 01:56:10 +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
unknown ed6f2ccd79 Testing workflow with branches - this should merge changes from "master" branch to "materials". 2010-11-12 17:06:59 +01:00
alteredq f9ec9325f9 Tested exporters with new Blender 2.55 Beta. It seems both old and new one work without any changes \o/ 2010-11-11 01:54:02 +01:00
alteredq b31c9bd8a3 Added handling of empty material slots in new Blender exporter.
Such broken materials will be replaced by dummy materials names like this "undefined_dummy_5".
2010-11-10 23:59:08 +01:00
alteredq ca7e2fc923 Added model alignment to new Blender exporter.
Fixed crash bug with non-textured models in new Blender exporter.

Fixed bottom alignment bug in OBJ converters.
2010-11-10 02:16:29 +01:00
alteredq baced836f3 Merge remote branch 'remotes/upstream/master' 2010-11-09 22:47:16 +01:00
alteredq c545318b51 Added experimental Blender exporter for the new ascii JSON format.
Models exported by this version should be loaded like this (the same as for slim OBJ converter):

    var loader = new THREE.Loader();
    loader.loadAscii( "path/to/model/Model.js", function( geometry ) { createScene( geometry ) }, "path/to/model" );

Compared to OBJ converter, currently only single mesh is exported (many models are composed of several meshes).

TODO
    - model alignment
    - copy used images to folder where exported file goes
    - export all selected meshes / all meshes in the scene?
    - binary format
2010-11-09 22:44:22 +01:00
alteredq b3bacc8af8 Refactored OBJ slim converter (to make it easier to reuse ASCII converter snippets in Blender exporter). 2010-11-09 22:22:39 +01:00
Mr.doob a7d70a0eff * Builders clean up 2010-11-09 06:27:44 +00:00
alteredq a0fa2ae3dd Optimized binary model format to use indexed UVs. Updated OBJ slim converter and Loader accordingly.
This saves about 10% from size of textured binary models.
2010-11-08 23:20:25 +01:00
alteredq ecf97e0d4c Synced with sole's branch. 2010-11-08 20:10:32 +01:00