Commit Graph
2182 Commits
Author SHA1 Message Date
Mr.doob caabab07f3 Lines can be treated as Objects 2011-10-23 14:18:57 +02:00
Mr.doob ec00f298be CanvasRenderer and SVGRenderer using single-material system.
Also moved `.overdraw` to Material.
Code is much simpler now :)
2011-10-23 13:50:55 +02:00
Mr.doob 806ecdfc04 Merge remote-tracking branch 'alteredq/experimental_shading_materials' into dev 2011-10-23 12:34:56 +02:00
Mr.doob 6b151b552e Merging with @alteredq's experimental branches. 2011-10-23 12:34:46 +02:00
Mr.doob 20c96f52e9 Reverted changes, starting again. 2011-10-23 10:04:28 +02:00
alteredq 5edfb12697 Added "autoUpdateObjects" flag to WebGLRenderer.
This is to be able to skip redundant updates in multipass rendering (like for shadow maps or dynamic cube maps).

Also reshuffled initWebGLObjects calls to have just a single update in a basic scenario of shadow map pass followed by scene render.

Still need to solve somehow potential redundant updates in EffectComposer (which can mix multiple scenes).
2011-10-21 18:12:05 +02:00
alteredq 103154d293 Removing some cruft in WebGLRenderer. 2011-10-21 16:25:26 +02:00
alteredq 965b199de2 And some more strict equality checking. 2011-10-21 14:13:44 +02:00
alteredq f166079dcc More strict equality checking.
Just for the sake of consistency, when object properties are not involved performance difference is negligible.
2011-10-21 13:42:28 +02:00
alteredq b410a7804a Small change in setObjectFaces.
These little buggers were costing 3.35% of the total time in performance test.
2011-10-21 13:05:07 +02:00
alteredq b0aae55ed8 Cleaned up a bit buffers handling in WebGLRenderer. 2011-10-21 11:17:05 +02:00
alteredq 81b60ea2f6 All WebGL examples working with array-less materials.
Noticeable difference: can't anymore assign Material references to faces directly - "face.materials" became "face.materialIndex". Materials have to go to "geometry.materials" array (to which "face.materialIndex" points). This is necessary to allow run-time changing of face materials (this indirection used to be done by arrays).

Some casualties:

- multi-materials example, this functionality isn't possible anymore
- had to simplify LOD Text examples as LODs don't handle groups (used to fake multi-materials)
- multi-materials sphere in materials example can't have faces with undefined materials (this may be fixable I guess, when there'll be some real use-case)
- scene format still has materials arrays, only the last material will be used (except when there are face materials, then materials from JSON will be used, as before)

Other renderers and their corresponding examples were not touched yet.

WebGLRenderer still needs some prettification, some things don't make sense anymore without arrays, code can be cleaned up further.
2011-10-21 06:18:59 +02:00
alteredq 05b3db4dca Experimenting with array-less materials.
Do not use for anything, this is just snapshot of a test in progress. I solved quite a few issues, but many things are still clumsy and broken.
2011-10-21 03:06:06 +02:00
alteredq 32ba5a562a Blender exporter seems to work fine with new Blender 2.60 ;) 2011-10-20 22:26:44 +02:00
alteredq b4f89f4b78 Experimenting with Phong computed fully in fragment shader. Added new point lights test.
New per-pixel Phong code is enabled by setting `perPixel` parameter in Phong material.

This version is able to light single untesselated quad correctly.

Also it doesn't have point lights number limitation caused by varyings, all lights pass just through uniforms.

Performance wise it seems surprisingly quite similar to old version (stress test is ~6 fps faster with new version, though I guess for different use cases / GPUs it can differ).
2011-10-19 02:11:44 +02:00
alteredq 2253592365 Added "metal" parameter to Phong. Added new materials test.
Metal makes specular term multiplicative (default is additive). This is to be able to have textured materials that do not have diffuse color, just a specular one, to get metallic look (additive specular gives plastic look).
2011-10-18 16:05:03 +02:00
alteredq 1e7e75e29c Fixed cubemapped sphere shadow in shading testbed. 2011-10-18 01:14:55 +02:00
alteredq 841865d422 Tweaked cars materials. 2011-10-18 00:47:56 +02:00
alteredq 9968b7dc07 Changed ambient handling for Phong and Lambert materials.
Removed diffuse color influence on ambient term in Phong. This was causing texture disappearance when diffuse color was black.

Made Lambert more similar to Phong: now it also has ambient color parameter. Before ambient light was affecting Lambert as if ambient color was always 0xffffff.
2011-10-18 00:05:09 +02:00
Mr.doob 330ab77836 WIP WebGLRenderer refactoring 2011-10-16 11:36:09 +02:00
alteredq a8869f9e5b Quick and dirty hack to get WebGLRenderer working with new scene graph.
This is not supposed to be "proper" solution (for example this doesn't solve removing of objects), but at least some WebGL examples are working now.
2011-10-15 20:13:36 +02:00
alteredq 093fbbe334 Merge remote-tracking branch 'remotes/mrdoob/dev' into dev
WebGL part of this branch is completely broken. Do not use. This is for further merging.
2011-10-15 18:37:59 +02:00
Mr.doob 6742f8e4a4 Merge remote-tracking branch 'sirlantis/patch-1' into dev 2011-10-15 09:01:58 +02:00
Mr.doob d2b8a07822 Changed ColladaLoader so it doesn't create extra Object3Ds for each mesh.
Updated Stats.
2011-10-15 09:00:41 +02:00
alteredq 937d200899 Updated help in OBJ converter to reflect new loaders API. 2011-10-15 03:35:59 +02:00
alteredq 0fee925afe Refactored UTF8Loader to follow JSONLoader / BinaryLoader APIs. 2011-10-15 02:52:59 +02:00
alteredq 0284cb950a Refactored BinaryLoader to follow new JSONLoader style simpler API.
Also updated corresponding examples.
2011-10-15 02:25:25 +02:00
alteredq 942a6c89c9 Updated Clock to be more compatible with Timer (now uses seconds and getDelta API).
Lots of code got cleaner with seconds, seems we used them before all around.

Also changed examples that didn't need deltas to simple Date.now() plus some more examples cleaning, trying to get rid of obsolescence warnings.
2011-10-15 00:57:50 +02:00
alteredq 41eb500677 Refactored custom attributes handling to use lists to remove massive bottleneck.
Apparently iterating over object properties is dangerous even if that code path is not executed.

Stress-testing particles buffers setting showed 60% performance increase (in Chrome) even when there were no custom attributes (and thus custom attributes handling code behind "if ( customAttributes )" was never executed).

I suspect this may be caused by some V8 optimization heuristics.
2011-10-14 18:53:07 +02:00
Marcel Jackwerth b6e6624a1d Added missing minus sign. 2011-10-14 19:46:29 +03:00
Marcel Jackwerth d49f2d3281 Always use shortest path for Quaternion.slerp (also see: http://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions/slerp/ Other Issues, Inverting Quaternions) 2011-10-14 18:54:44 +03:00
alteredq f74782b61f Refactored RollControls, FlyControls and PathControls to use externally supplied time delta. 2011-10-14 05:44:12 +02:00
alteredq 093f17f38c Refactored FirstPersonControls to use externally supplied time delta.
Changed few examples to use this.
2011-10-13 22:09:25 +02:00
alteredq f1f744f0ba First attempt at Clock object.
Got tired of redoing deltas all the time. Not sure about API or implementation details, but so far seems to be useful.

In future, we could for example have clocks that are slower / faster than realtime, or fixed step based.
2011-10-13 21:46:08 +02:00
alteredq 9902cbbf2d Experimenting with Date.now(). Updated builds. 2011-10-13 20:17:21 +02:00
alteredq 42544a0f29 Moved GeometryUtils.random16 => Math.random16 2011-10-13 18:03:05 +02:00
alteredq 89bddf3827 Moved "extras/MathUtils" to "core/Math" (thanks to @mrdoob). 2011-10-13 17:50:16 +02:00
Mr.doob 61dca43a51 Merge branch 'master' into dev 2011-10-13 05:12:17 +02:00
Mr.doob 3433b49cba Beautified usage example. r45 2011-10-13 05:12:01 +02:00
alteredq 59f0e645a4 Refactored shadowmap example to use MorphAnimMesh. 2011-10-13 05:02:16 +02:00
Mr.doob 8a92374fd0 Merge branch 'master' into dev 2011-10-13 04:34:12 +02:00
Mr.doob 77d7a999af Somehow the trails example got deleted... ? 2011-10-13 04:34:00 +02:00
alteredq 912b697530 Added forgotten sittingBox.js animated model. 2011-10-12 23:16:09 +02:00
alteredq 8d417f595e Replaced extra clamp and map_linear functions with MathUtils versions. 2011-10-12 16:00:53 +02:00
alteredq 15c899b46f Added renderer.shadowMapAutoUpdate parameter.
This is for being able to render shadowmap just once per frame - all dynamic cubemap faces and full scene can share the same shadowmap (at least until we don't have camera-specific fine-tuned shadowmaps).
2011-10-12 14:05:30 +02:00
alteredq ae22b78c2c Added MorphAnimMesh. Added MathUtils.
Added morph to rendering testbed.
Simplified shadowmap shader snippet gamma handling.
2011-10-12 13:41:36 +02:00
alteredq 55e2337404 Added day/night toggle to rendering testbed. 2011-10-12 11:42:00 +02:00
Mr.doob 0cc9b95e1e Merge branch 'master' into dev 2011-10-12 05:50:09 +02:00
Mr.doob 44730f9324 Adding "Lights" to featured projects list. 2011-10-12 05:49:38 +02:00
Mr.doob 698c15fdce Tab fix. 2011-10-12 05:47:00 +02:00