350 Commits
Author SHA1 Message Date
Mr.doob c16394d2ec Updated README.
Pushed REVISION to 29.
r29
2010-11-17 05:45:35 +00:00
Mr.doob b025a6176d Projector merged succesfully. 2010-11-17 05:18:57 +00:00
Mr.doob 0d9dc84980 Merge remote branch 'julianwa/master' into materials 2010-11-17 05:07:25 +00:00
Mr.doob b8ae37245f Merging julianwa's branch 2010-11-17 05:07:16 +00:00
Mr.doob 2b92a824c2 Added FaceMaterial example in materials demo. 2010-11-17 04:56:47 +00:00
Mr.doob 9c12250c61 Merge remote branch 'alteredq/materials' into materials 2010-11-17 04:53:43 +00:00
Mr.doob ec0de29153 Merging alteredq branch 2010-11-17 04:53:21 +00:00
Mr.doob 7dd33d6df6 Merging with alteredq branch 2010-11-17 04:51:43 +00:00
Mr.doob 51f91fdd03 Removed alpha component from the Color class
GouraudShading and PhongShading ⟶ SmoothShading
2010-11-17 04:49:30 +00:00
alteredq e98d8da4ad Added poor man's additive blending to WebGLRenderer.
Render first objects / material groups that use normal blending, then render ones which use additive blending.

Proper solution should be: sort triangles by blending, render all the normal ones, sort additive ones by depth and then render them back to front.

http://www.opengl.org/resources/faq/technical/transparency.htm
http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=08

While this is acceptable in C++ / OpenGL, with JavaScript / WebGL this would kill the performance (you would need to sort triangles in JS and also create new buffers every frame).

Also tried to come up with subtractive / darken blending, but didn't find any satisfactory formula :(.
2010-11-17 05:42:56 +01:00
Julian Walker 49f878c5a5 * Added near and far plane clipping for THREE.Line rendering in CanvasRenderer.
* Changed THREE.Vertex.positionScreen from a Vector3 to a Vector4 to support clipping.
2010-11-16 20:40:02 -08:00
alteredq 3d3708919b Added support to "shading" materials parameter in WebGLRenderer.
This is actually tricky due to multimaterials and vertex normals.

The practical effects of "shading" parameter in WebGLRenderer are currently following:

- if your model has vertex normals, now you can "dumb down" its shading by specifying THREE.FlatShading for MeshLambertMaterial and MeshPhongMaterial
- if your model has only face normals, it will always have just flat shading, no matter which shading you set, no escape from this
- if your model has multiple materials, smooth shading always "wins", meaning if there is at least one smooth shaded material in multimaterial group, all other materials in this group will be also smooth shaded (this is solvable by having multiple normal buffers, but seems wasteful, at least for the moment, till there are no practical use cases)

Currently implemented shading / material combinations:

  - MeshNormalMaterial: FlatShading [default], GouradShading
  - MeshDepthMaterial:  no shading parameter in material, uses own specific shading
  - MeshBasicMaterial: no shading parameter in material, uses own specific shading
  - MeshLambertMaterial: FlatShading, GouraudShading [default]
  - MeshPhongMaterial: FlatShading, PhongShading [default]
2010-11-16 22:38:06 +01:00
Mr.doob f7d71abc3e Improved materials demo. 2010-11-16 17:22:37 +00:00
Mr.doob 23688daf08 Added WIP materials example (showing all at once). 2010-11-16 14:57:06 +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 b449fdf5a8 Added a variation of the interactive example (using Tween.js) 2010-11-16 13:35:47 +00:00
Mr.doob 5e4476bde8 Now using Closure Compiler (~2kbytes) 2010-11-16 12:53:00 +00:00
Mr.doob dc6e335dc9 Color: Nicer way to check whether the hex has the alpha component or not. Removed unused methods.
CanvasRenderer/SVGRenderer: More code clean up and optimisations.
2010-11-16 12:27:25 +00:00
Mr.doob fe82bdbda9 Came up with a crazy approach to get Vertex Colors. Gouraud yet on step closer.
Changed the DepthMaterial to use this approach instead.
2010-11-16 11:02:45 +00:00
Julian Walker 592ea71e48 Merge remote branch 'upstream/master' 2010-11-15 22:18:58 -08:00
Julian Walker 1f0b44a860 Added multiplyScalar and divideScalar to Vector4. 2010-11-15 22:18:40 -08:00
Mr.doob c6d69d8286 Refactored the CanvasRenderer a bit. 2010-11-16 05:54:37 +00:00
alteredq 9081529d84 Made all examples working again. 2010-11-16 03:06:46 +01:00
alteredq 007ee285fa Added MeshNormalMaterial support to WebGLRenderer. 2010-11-16 02:50:46 +01:00
Mr.doob 7b58b806d3 Fixed NormalToComponent function (it was over saturated). 2010-11-15 17:04:10 +00:00
Mr.doob bf3dede88a Implemented MeshNormalMaterial in SVGRenderer
SubstractiveBlending ⟶ SubtractiveBlending
2010-11-15 16:56:14 +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 696bd4715f Added another depth material test. 2010-11-15 09:12:37 +00:00
Mr.doob 7d8fd5f874 CanvasRenderer now renders MeshDepthMaterial properly (per vertex). Gouraud is one step closer :)
Cleaned up CanvasRenderer and SVGRenderer code a bit.
2010-11-15 08:50:31 +00:00
Mr.doob 05b496d822 Merge remote branch 'alteredq/materials' into materials 2010-11-15 04:16:51 +00:00
Mr.doob d2b6d7df0c Updating README's example 2010-11-15 04:16:43 +00:00
alteredq 0163e4f2f5 Added (commented out) MeshDepthMaterial support to WebGLRenderer.
It's commented out, as it breaks shader validation in current Chrome :(.

There seems to be some bug in Chrome / ANGLE making it barf when using "gl_FragCoord" in fragment shader.

Curiously, while it breaks both 9.0.576.0 dev channel and latest continuous build 9.0.583.0, it does work fine in canary build with the same version as dev channel (9.0.576.0).

Go figure. Also in Firefox 4 beta 7 it works fine.

It seems there were some recent changes in handling of "gl_FragCoord" on Windows which probably broke something when fixing other bug:

http://code.google.com/p/chromium/issues/detail?id=59762
http://code.google.com/p/angleproject/issues/detail?id=71

TODO: make isolated test case and submit bug report (if this doesn't go away in next Chrome update).
2010-11-15 04:49:28 +01:00
Mr.doob 7264105fe9 Merge remote branch 'alteredq/materials' into materials 2010-11-15 02:06:27 +00:00
Mr.doob 591c4c5bef Merging alteredq branch. 2010-11-15 02:06:18 +00:00
Mr.doob 6f58fb8e11 Compiled again just in case. 2010-11-15 02:02:45 +00:00
Mr.doob 5daf1e0192 Merge remote branch 'alteredq/materials' into materials 2010-11-15 02:01:20 +00:00
Mr.doob 10449405dd I know I can do it... 2010-11-15 02:00:29 +00:00
alteredq b6e42d54d9 Added missing MeshDepthMaterial.js 2010-11-15 02:59:04 +01:00
Mr.doob fa48600918 Trying to merge... 2010-11-15 01:58:08 +00:00
Mr.doob 5feee3839f Trying to merge... 2010-11-15 01:56:10 +00:00
alteredq b09308c238 Synced with mrdoob's materials branch.
Have to commit broken build (missing MeshDepthMaterial.js) as git doesn't want to proceed with new merge till the old one is not committed :(
2010-11-15 02:54:42 +01:00
Mr.doob 11bde7e2d3 Just realised that the tweak is not needed. 2010-11-15 01:54:00 +00:00
Mr.doob aebe898625 Forgot to commit MeshDepthMaterial 2010-11-15 01:48:36 +00:00
alteredq bfb8242928 WebGLRenderer also working.
Not all features from the new material format are implemented yet, though already now it's more powerful than the old format (you can now use  texture also in Basic and Phong materials).

Also started to retire old model format: removed old OBJ converter and meshes that it generated.

TODO:
 - take into account shading and blending parameters
 - transplant cube map support from experimental material
2010-11-15 02:29:03 +01:00
Mr.doob 98dc841aab Added MeshDepthMaterial.
Optimised Particles projection in CanvasRenderer.
2010-11-15 01:17:41 +00:00
Mr.doob 64df690cc0 SVGRenderer also working. 2010-11-13 08:20:35 +00:00
Mr.doob 22f48a731b CanvasRenderer handles textures again.
Most of the examples working.
2010-11-13 07:11:57 +00:00
Mr.doob adb275a093 Material constants and THREE.Texture 2010-11-13 05:55:09 +00:00
Mr.doob 237f165555 ParticleCircleMaterial working again with CanvasRenderer 2010-11-13 03:42:13 +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