Commit Graph
921 Commits
Author SHA1 Message Date
Mr.doob d313693509 Merge remote branch 'alteredq/master' 2011-01-09 11:52:33 +00:00
alteredq 5273e091d1 Merge remote branch 'remotes/upstream/master' 2011-01-09 07:38:22 +01:00
astrodud 6fc34c9693 OK, replaced transformVector3 function with Matrix4.muliplyVector 2011-01-08 22:37:21 -08:00
alteredq bc9cf2be75 Fixed scene check bug in allocateLights in WebGLRenderer.
Also some refactoring of initWebGLObjects slipped in this commit.
2011-01-09 07:37:20 +01:00
astrodud cd252fa3c2 forgot to add transformVector3 function (used by LatheObject.js) 2011-01-08 21:41:27 -08:00
Mr.doob d5a2122598 Merge remote branch 'alteredq/master' 2011-01-09 02:47:06 +00:00
Mr.doob 5153379a5b Merge remote branch 'astrodud/master' 2011-01-09 02:46:56 +00: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
astrodud ea9492b882 added LathedObject which creates a geometry by rotating a set of Vertices around the z axis. UV mapping is supported. See http://astrodud.isgreat.org/asteroids for an example. 2011-01-07 21:47:37 -08:00
alteredq 2c2b9b81bf Optimized line strip example. 2011-01-08 05:27:35 +01:00
alteredq bbe2a3bf56 Refactored handling of continuous lines: now they are rendered using LINE_STRIP primitive. Added example for this.
Also renamed associated constant to THREE.LineStrip (was THREE.LineContinuous).
2011-01-08 01:15:01 +01:00
alteredq f90bc532c4 Fixed stats widget appearance issues that appeared with recent Chrome updates.
Unfortunately performance issues are still there and now already trickled down also to dev channel :(

I wonder what they did - fps numbers look more or less ok, problem is more with subtle yet very annoying choppiness. Like if somewhere suddenly bandwidth / memory is getting trashed.
2011-01-06 23:25:43 +01:00
alteredq ef9bdf6b77 Small WebGLRenderer optimization: skip setting of uniforms which don't exist in shader program. 2011-01-06 02:57:05 +01:00
alteredq a783870b61 Refactored OBJ converter demo not to have separate materials per each sphere.
Also first time I noticed issues with stats widget in latest Chrome canary 10.0.624.0 / Chromium continuous build 10.0.629.0:

 - it doesn't show in demos with mixed canvas / WebGL content (OBJ converter demo, lights test)
 - simply just adding it can significantly decrease performance (OBJ converter demo is choppy when invisible stats element exists)
 - in some demos it has different transparency (Walt cubemap demo)

Looks like with some Chrome update in last few days we hit some new compositing or 2d canvas issue (both OpenGL and ANGLE versions share the same issues).
2011-01-06 02:23:27 +01:00
Alex Schworer 3b9d05563f close style tag 2011-01-05 16:50:05 -08:00
alteredq 99bbc4880b Fixed bug in shader demo.
Texture wrapping had to be "repeat".
2011-01-04 08:05:28 +01:00
alteredq fb63495caf How to use 2d shaders as procedural animated textures.
Still some bug with textured one :(
2011-01-04 07:42:17 +01:00
alteredq 8ea0f27602 Refactored lines grid in materials_gl example. 2011-01-04 05:14:10 +01:00
alteredq 92c0c8c42f Merge remote branch 'remotes/upstream/master' 2011-01-04 04:52:53 +01:00
alteredq 548c331519 Added crude lines support to WebGLRenderer.
As expected, performance of one-to-one conversion from CanvasRenderer was horrible, so I had to change a bit how lines are handled.

Line object now has "type" property:

    - default type is "THREE.LineContinuous" which should behave as before: geometry represents one continuous line (v0 ... vn)

    - new option is "THREE.LinePieces" which tells renderer that geometry represents collection of individual line segments (v0,v1) ... (vn-1, vn)

(one Line object corresponds to one VBO)

(same limitations as with meshes - once VBO is baked, no changes are possible except object transforms - scale / rotation / position)
2011-01-04 04:38:25 +01:00
Mr.doob 1a96d32bd9 Added divideSelf to Vector3. 2011-01-03 19:42:47 +00:00
alteredq 1bf91db7b9 Refactored Loader so that models can have mixed faces with and without texture coordinates.
Trick was to first initialize triangles / quads with UVs, so that indices match.
2011-01-03 18:34:35 +01:00
alteredq a8416bc8c1 Fixed implied globals in WebGLRenderer lights rgb init. 2011-01-02 21:01:01 +01:00
alteredq 771674d705 Refactored Loader parameters to allow optional separate paths for texture and binary files.
loader.loadAscii and loader.loadBinary now take just one parameter with following properties:

    - model (required)
    - callback (required)
    - texture_path (optional: if not specified, textures will be assumed to be in the same folder as JS model file)
    - bin_path (optional: if not specified, binary file will be assumed to be in the same folder as JS model file)

Example use:

    loader.loadBinary( { model: "model.js", bin_path: "path/bin", texture_path: "path/img",
                         callback: function( geometry ) { createScene( geometry ) } } );
2011-01-02 19:52:40 +01:00
Mr.doob c186b37be3 Pushed revision to 32.
Updated README.
r32
2010-12-31 17:59:11 +00:00
Mr.doob a964d27b72 Wrong repository =_= 2010-12-31 04:44:06 +00:00
Mr.doob f8e223258b testing... (data seems to be broken?) 2010-12-31 04:43:18 +00:00
alteredq ab360240dc Refactored common uniforms out from basic / lambert / phong shaders into UniformsLib. 2010-12-31 03:19:47 +01:00
alteredq ecad27eb11 Moved MeshPhongMaterial onto common shader builder machinery, ubershader is no more.
Code is still rough around edges (it can be made nicer), though it should already produce one-to-one results with ubershader.

Side-effect is that scene is no longer required as WebGLRenderer constructor parameter. Shader programs are now constructed upon first frame render and only then scene lights are examined.
2010-12-31 00:33:39 +01:00
alteredq 8ed9a9c403 Fixed shader demo to work with Firefox. 2010-12-30 01:11:47 +01:00
alteredq ae60091a58 Small refactoring in WebGLRenderer. 2010-12-30 00:55:54 +01:00
alteredq dad635b64c Merged mrdoob's changes. 2010-12-30 00:18:31 +01:00
Mr.doob 9b755e827f Added "v2" uniform type to WebGLRenderer.
Added a shader demo (as in using only 2 triangles).
2010-12-29 23:09:59 +00:00
alteredq 06a977384d Synced with mrdoob's branch. 2010-12-30 00:01:06 +01:00
alteredq 6cfcdd1501 Moved MeshPhongMaterial out of ubershader.
One more to go ;)

Mess / code duplicities are temporary, hopefully they will go away once also Phong uses the same machinery.
2010-12-29 23:42:13 +01:00
Szymon Nowak 5c8a089669 Fixed implied globals and added few missing semicolons 2010-12-29 17:32:03 +01:00
Mr.doob 05dbe81dfa Merge remote branch 'alteredq/master' 2010-12-29 03:25:37 +00:00
Mr.doob 041054283a Messing with a new terrain generator demo. 2010-12-29 03:22:30 +00:00
alteredq 3cabd11849 Moved MeshBasicMaterial out of ubershader.
None of the demos seem to be slower, some are noticeably faster (especially terrain).

I suspect biggest performance gain comes from conditional include of environment mapping: if it's not used, it doesn't go into shader at all.
2010-12-28 21:50:57 +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 ecdbb2ef91 Fixed broken uniforms cloning. Fixed broken uqbiquity test.
TODO: start using uniforms cloning also for MeshShaderMaterials.
2010-12-28 14:33:52 +01:00
Mr.doob 513563117b Added method setClearColor( color, opacity ) to CanvasRenderer. 2010-12-28 01:18:43 +00:00
Mr.doob 42fa72eca7 Updated README with new WebGL demos. 2010-12-27 20:06:23 +00:00
Mr.doob 674613a7ab Yet some minor tweaks to the normalmap2 demo. 2010-12-27 01:26:08 +00:00
Mr.doob 3488a53798 Recompiled builds.
Re-tweaked normalmap2 demo.
2010-12-27 01:22:48 +00:00
Mr.doob 385ce31b00 Merge remote branch 'alteredq/master' 2010-12-27 01:18:00 +00:00
Mr.doob ebaa3ae392 I knew it wasn't going to work. 2010-12-27 01:17:52 +00:00
Mr.doob 7e1321d084 Trying to avoid merge conflicts... I'm sure it's not going to work... 2010-12-27 01:16:14 +00:00
alteredq b5ac3abbb6 Fixed tangents generation for quads. 2010-12-27 02:11:19 +01:00
Mr.doob 897a2938c5 Merged with alteredq's normal shader improvements.
Tweaked normalmap2 demo parameters.
2010-12-27 01:08:29 +00:00