Commit Graph
250 Commits
Author SHA1 Message Date
Mr.doob a030086cf5 texture.loaded = truetexture.image.loaded = true 2010-12-06 10:09:50 +00:00
Mr.doob e7f5f3865a Fixed WebGL Wrappings.
Added WebGL Texture Filters.
2010-12-06 08:50:28 +00:00
alteredq a395e120c3 Updated WebGLRenderer and corresponding examples to work with new Texture API. 2010-12-04 19:53:30 +01: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 aa50e7eec3 Created Mapping classes 2010-12-04 10:32:55 +00:00
Mr.doob ef2243bdb3 Merge remote branch 'alteredq/master' 2010-12-03 16:10:53 +00:00
Mr.doob 5573f95417 Added Geometry::computeVertexNormals.
Maybe `Geometry::computeNormals` should be renamed to `Geometry::computeFaceNormals`?
2010-12-03 16:10:37 +00:00
alteredq 9b80eab891 Merge remote branch 'remotes/upstream/master' 2010-12-03 13:32:37 +01:00
alteredq a1d68ddba3 Fixed bug(s) causing broken Fresnel demo.
As suspected, this was caused by incorrect shader state management when switching between multiple shaders (thanks Firefox for verbose warnings).

Also, testing WebGL performance is very tricky. You can get different performance depending on the state of browsers / system (messed up state can be 10-66% slower):

1. freshly started Chrome can be much faster than Chrome that already ran few WebGL demos (which are now closed)
2. demo opened in new Chrome tab can be faster than demo reloaded in the same tab
3. even demos opened and closed in Firefox can slow down Chrome demos

This suggests that browsers do not clean GPU state properly :(
2010-12-03 13:25:59 +01:00
Mr.doob ed5a9b91a5 Synced materials examples with live version.
Added irc channel info in README.
2010-12-02 19:14:01 +00:00
Mr.doob 584a8440fd Merging with alteredq's branch. 2010-12-02 17:24:56 +00:00
Mr.doob 59304d8a6e Matrix4.transformVector3 ⟶ Matrix4.multiplyVector3
Matrix4.transformVector4 ⟶ Matrix4.multiplyVector4
2010-12-02 17:19:23 +00:00
Mr.doob 2929d5a345 GeometryUtils::merge were not copying centroid/normal/material. 2010-12-02 13:40:04 +00:00
Mr.doob 1d7a14733b ReflectionMapping working with MeshBasicMaterial/CanvasRenderer \:D/
TODO: Add computeVertexNormals on geometry so any object can use it.
2010-12-01 17:49:02 +00:00
Mr.doob 7441b1de59 Implemented gero3's Matrix4.transformVector3 optimisation ( http://jsperf.com/diff-in-speed-for-three-js ). 2010-12-01 16:00:13 +00:00
Mr.doob 6a257e8141 Merge remote branch 'alteredq/master' 2010-12-01 14:11:11 +00:00
Mr.doob 84c262d6c6 Adding support for ReflectionMapping (Spherical) to CanvasRenderer. Not done yet... 2010-12-01 14:10:51 +00:00
alteredq b25a003ded Merge remote branch 'remotes/upstream/master' 2010-12-01 12:48:49 +01:00
Mr.doob 0f52ae5a9b Added ImageUtils::loadTexture. 2010-12-01 08:51:50 +00:00
alteredq c1cb8e9067 Added handling of 2d textures in MeshShaderMaterial. 2010-12-01 09:38:52 +01:00
alteredq 0f9184888a Refactored common code for cube texture setting into separate setCubeTexture function. 2010-12-01 09:24:25 +01:00
Mr.doob f9f7d3645f Merging with alteredq's branch. 2010-11-30 17:22:20 +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 47d6116179 Merging with alteredq's branch. 2010-11-30 16:48:33 +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 195d9a3820 Merge remote branch 'alteredq/master' 2010-11-30 15:48:52 +00:00
Mr.doob 5ee46bd973 Some Matrix4 optimisations... 2010-11-30 15:48:40 +00:00
alteredq de9b681204 Added forgotten MeshShaderMaterial.js Oops :# 2010-11-30 15:25:53 +01:00
Mr.doob 67250c69d9 Merging with alteredq's branch. 2010-11-30 05:06:46 +00:00
Mr.doob dde35ca06e Minor changes.
Trying to catch a bug with SmoothShading material objects with no vertexNormals.
2010-11-30 04:56:50 +00:00
alteredq d502ccef1d Moved binary files load progress reporting to Loader.js. Added load progress reporting to demos with larger meshes.
To be used like this:

    var loader = new THREE.Loader( true );
    container.appendChild( loader.statusDomElement );

    loader.loadBinary( url, function( geometry ) { createScene( geometry ) }, path );

    function createScene( geometry ) {
        ...

        loader.statusDomElement.style.display = "none";

    }
2010-11-30 02:21:22 +01:00
alteredq 14bccd81ea Synced with mrdoob's branch. 2010-11-30 00:01:42 +01:00
alteredq 45b3ceb7df Added MeshShaderMaterial (and Fresnel shader as its first example).
MeshShaderMaterial is still work in progress, expect changes.

Nice side effect of WebGLRenderer refactoring: optimized one significant bottleneck (with noticeable effect on framerate in some demos), typed arrays corresponding to matrix uniforms are now set (instead of being created anew in each frame).

Also created fully full build, with all extras included. This helps with deployment, especially when multiple versions of Three have to coexist in the same folder structure (got burned on this few times already).
2010-11-29 23:44:33 +01:00
Mr.doob 011b123a6e ReflectionMapReflectionMapping
`RefractionMap` ⟶ `RefractionMapping`
2010-11-28 09:47:37 +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
Mr.doob 724870d5f1 Crappy/Temporal WebGLRenderer Reflection/Refraction Chromatic Dispersion hack. (Just for kicks) 2010-11-26 21:06:59 +00:00
Mr.doob b913baa6f0 Code clean up and minor optimisations. 2010-11-26 07:58:44 +00:00
Mr.doob 2c50ad366b Merge remote branch 'alteredq/master' 2010-11-26 02:12:00 +00:00
Mr.doob f5f9becaf1 Minor tweaks. 2010-11-26 02:11:31 +00:00
alteredq 38dacb0d1e Some small refactoring in WebGLRenderer.
There shouldn't be any change in functionality, just moved code around and clarified comments.
2010-11-26 00:28:04 +01:00
alteredq e1f885fbf0 Made 2d textures reusable in WebGLRenderer.
2d texture encapsulates bitmap, wrapping and minifying/magnification parameters.

Which reminds me, maybe also minifying/magnification options should be parameters in Texture object.

Though as defaults are "best" (LINEAR / LINEAR_MIPMAP_LINEAR = trilinear filtering), this would make sense just for special use cases like when trying to achieve "retro" look (like in Minecraft, http://gregs-blog.com/2008/01/14/how-to-turn-off-bilinear-filtering-in-opengl/ ;).
2010-11-25 22:24:21 +01:00
alteredq 06e64013d9 Fixed bug in SceneUtils. 2010-11-25 04:26:24 +01:00
alteredq 812af5dc93 Merge remote branch 'remotes/upstream/master' 2010-11-24 22:40:28 +01:00
alteredq e5ddb133a5 Added load progress callback to binary loader.
Turns out it is working better over the real web than on localhost (where it seems loading is too fast for Chrome to pick up UI changes, so it queues them and shows them all just after loading is already finished).

Still not working properly - getting length of full content, this seems to be unreliable across browser / server combination.

Instead passing to callback JSON object with both total and loaded bytes, so this can be handled in the application layer:

{ total: bytes_total, loaded: bytes_loaded }

To be used e.g. like this:

loader.loadBinary( url, function( geometry ) { createScene( geometry ) }, path, updateProgress );

function updateProgress( progress ) {

    var message = "Loaded ";

    if ( progress.total ) {

        message += ( 100 * progress.loaded / progress.total ).toFixed(0) + "%";

    } else {

        message += ( progress.loaded / 1000 ).toFixed(2) + " KB";

    }

    $( "status" ).innerHTML = message;

}
2010-11-24 22:38:41 +01:00
Mr.doob 158f2e71c9 Merge remote branch 'alteredq/master' 2010-11-24 07:22:14 +00:00
Mr.doob 14eb44a279 ParticleBasicMaterial with a map attached are back on CanvasRenderer.
Added a simple example for that.
2010-11-24 07:22:06 +00:00
alteredq ec13438bb7 Merge remote branch 'remotes/upstream/master' 2010-11-24 06:03:44 +01:00
alteredq aaf569936b More sane object removal from WebGLRenderer.
Not anymore automatic, but also much less wasteful.

Has to be called in tandem with scene object removal:

    scene.removeObject( object );
    webglRenderer.removeObject( scene, object );
2010-11-24 06:01:38 +01:00
Mr.doob cd41fc1e07 Merge remote branch 'alteredq/master' 2010-11-24 04:26:26 +00:00