Commit Graph
732 Commits
Author SHA1 Message Date
alteredq 09571ee3d0 Partially merged szimek's pull request
https://github.com/mrdoob/three.js/pull/97
2011-01-23 19:22:49 +01:00
alteredq 679bbec701 Merge remote branch 'remotes/astrodud/master' 2011-01-23 18:49:01 +01:00
alteredq 8f133abd30 Added HDR texture example. 2011-01-23 18:39:14 +01:00
astrodud 6a5ad65104 created _m33 class member (moved out of Matrix4) and modified THREE.Matrix4.makeInvert3x3() call accordingly, as with WebGLRenderer 2011-01-19 21:09:57 -08:00
astrodud 2319f227f3 created _m33 class member (moved out of Matrix4) and modified THREE.Matrix4.makeInvert3x3() call accordingly 2011-01-19 21:00:58 -08:00
astrodud b9c654633c removed object lookups in transpose() 2011-01-19 20:59:48 -08:00
astrodud 1bb5e6003a * memory and speed optimizations in Matrix4.flatten()
* memory and speed optimizations in Matrix4.makeInvert3x3() (moved Matrix4.m33 to WebGLRenderer._m33 since it is
  only used there and only for a single Matrix4)
2011-01-19 20:58:13 -08:00
astrodud 0b19cd3c75 one fewer Matrix4 created in Projector.unProjectVector 2011-01-19 20:35:06 -08:00
alteredq 3e36fed048 Merged astrodud's pull request. 2011-01-19 09:06:50 +01:00
astrodud 67be8c84a1 small bug fix in the new Matrix4.rotationAxisAngleMatrix 2011-01-18 21:42:09 -08:00
Mr.doob 740407b46e Trailing spaces clean up. 2011-01-19 04:49:48 +00:00
alteredq 8a26198b41 Updated also WebGLRenderer2 to show quads in wireframe. 2011-01-18 20:39:10 +01:00
alteredq 969490ddba Merged astrodud's pull request. 2011-01-18 16:56:56 +01:00
alteredq 5665864605 Merge remote branch 'remotes/astrodud/master' 2011-01-18 16:53:25 +01:00
astrodud 6c071233d6 This is the Object3D.js code as it *should* have been committed 2011-01-18 05:35:32 -08:00
alteredq 5e99c7b8f7 Simplified Matrix4: reused code from setters in creators. 2011-01-18 10:26:11 +01:00
alteredq 8f29cf0324 Prettified formatting of new Matrix4 set methods and also fixed implied globals in setRotAxis. 2011-01-18 10:03:11 +01:00
Mr.doob 41c692828f Trailing spaces clean up. 2011-01-18 08:18:11 +00:00
Mr.doob 5accd0cfd7 Brought back Object3D.rotationMatrix (Projector still uses it). 2011-01-18 07:29:39 +00:00
Mr.doob ecedea4be1 Updated builds. 2011-01-18 07:06:07 +00:00
astrodud 2a7262ccd9 Merge https://github.com/mrdoob/three.js 2011-01-17 22:57:03 -08:00
astrodud c9706f85bf Optimized Object3D.updateMatrix to (1) cut down where possible on new Matrix4 allocation, (2) only compute
rotation/scale matrices if needed (if no rotation, no need t compute); and (3) no longer require
storage of translationMatrix or scaleMatrix (1 per object). Uses a single tmpMatrix instead.
2011-01-17 22:27:32 -08:00
astrodud d8f6d06edf oops - fixed but in setRotX 2011-01-17 22:09:03 -08:00
Mr.doob 89ecf225d0 Merge remote branch 'alteredq/master' 2011-01-18 05:48:57 +00:00
Mr.doob 0b8323f426 Removed hatching commented code from ShaderUtils. 2011-01-18 05:48:50 +00:00
astrodud 17ab97545e added Matrix4 "setter" functions: setTranslation, setScale, setRotX, setRotY, setRotZ, setRotAxis; to be used in optimizing Object3D.updateMatrix. 2011-01-17 21:45:05 -08:00
astrodud 22a1502174 slight speedup in Matrix4.makeInvert by cutting down object lookups 2011-01-17 21:42:05 -08:00
astrodud 151ff4394e slight speedup in Matrix4.rotationAngleAxisMatrix by cutting down object lookups and redundant multiplications 2011-01-17 21:41:13 -08:00
astrodud f3fd1bcfe6 slight speedup in Matrix4.determinant by cutting down object lookups 2011-01-17 21:38:56 -08:00
alteredq fde0754383 Refactored camera translation so that it doesn't create new vectors. 2011-01-17 21:35:43 +01:00
alteredq d1514ca6a7 Refactored lights handling in WebGLRenderer.
This should be the last place where new arrays were created in "render".

Chrome memory now seems stable.

Firefox still grows like mad, though this used to be like this also with other demos (simply setting random values to existing arrays does this).

Seems like Mozilla folks themselves struggle with this:

http://www.flickr.com/photos/11280278@N04/5363335103/in/photostream/
2011-01-17 20:22:46 +01:00
alteredq e54d9519d0 Changed wireframe rendering in WebGLRenderer to show quads.
See discussion here:

https://github.com/mrdoob/three.js/issues#issue/92
2011-01-17 18:44:09 +01:00
alteredq 08f6ceef15 Small optimizations to matrix math.
For the moment just things that are executed every frame in WebGLRenderer.render.

Continuing with quest to minimize creation of new data structures. Should instead create per class/object structures and just reuse them (as gman does in ThreeD). Main goal is to avoid annoying garbage collection pauses.

Let's hope it didn't break something (could be if some code was dependent on cloning of return values of "flatten" or "makeInvert3x3", though from what I checked these are just used to set typed arrays uniforms).
2011-01-17 16:09:26 +01:00
alteredq e37223a849 Synced with mrdoob's branch. 2011-01-17 08:25:42 +01:00
Mr.doob 28e18bcf2c Added texture/disturb.jpg 2011-01-17 00:00:38 +00:00
astrodud a62dc97e60 added LathedObject to build script for extras options 2011-01-16 15:27:19 -08:00
astrodud ebd21f962b GeometryUtils.merge should obey object2.autoUpdateMatrix 2011-01-16 15:26:00 -08:00
alteredq d110c49c2f Added support for flipSided mesh property to WebGLRenderer.
Also doesn't seem to decrease performance so far (though most of demos have small number of objects).
2011-01-16 21:46:23 +01:00
alteredq 271ba6c524 Added support for "doubleSided" mesh property to WebGLRenderer.
Testing on current examples didn't show any noticeable performance degradation when enabling / disabling culling for every object in every frame.

"FlipSided" property could be probably done in very similar way, just setting "gl.frontFace( gl.CCW )" or "gl.frontFace( gl.CW )"
2011-01-16 15:10:58 +01:00
alteredq 6668440006 Cleaned bit postprocessing example code. 2011-01-16 14:35:17 +01:00
alteredq d50863908c Small improvements in postprocessing example.
Alternating convolution pass textures aspect ratio and using linear magnification filtering leads to less artefacts.
2011-01-16 11:51:56 +01:00
alteredq 61e0bf0289 Synced with mrdoob's branch. 2011-01-16 03:07:56 +01:00
timk 1fbe2bfdbf CanvasRenderer::setSize didn't clear _contextGlobalAlpha et al 2011-01-16 00:43:51 +01:00
alteredq a03f714244 Added postprocessing example.
For this had to extend WebGLRenderer a bit:

- MeshShaderMaterial now can take non-specific float array uniforms as "fv1"
  (there is already "fv" type for array of 3-item-vectors, which probably should be renamed to "fv3" to be consistent)

- render method has yet another parameter "clear" for clearing newly set framebuffer (defaults to true).
  This is a bit hackish but it seems necessary to control this somehow. I didn't manage to replicate
  desired behavior just with autoClear.

- another dirty thing is accessing GL context from the application side:
    renderer.context.disable( renderer.context.DEPTH_TEST );

    This should be refactored somehow, wrapped in some API call.
2011-01-15 02:20:47 +01:00
alteredq 6cc1016477 Testing rendering to full-screen texture.
Requires to turn off mipmapping to be able to use non-power of two texture.

Effect of texture size on performance is noticeable, also there is no antialiasing (default in Chrome is I think 4x multisampling).

So I guess full-screen postprocessing will be quite costly :(. That's the price of WebGL always running at full-blown high resolution.

This could be somehow mitigated by faking lower resolutions via smaller texture, though I guess it still wouldn't be the same as having lower resolution set by GPU driver (this is a major help with performance in games - I never run full 1680 x 1050).
2011-01-14 15:16:14 +01:00
alteredq 7c9fe8ff82 Another update of render-to-texture example and related bugfix.
Rendering proper 3d object into the texture uncovered another issue - framebuffer had to be cleared after switching.

Texture is still flipped :( (original scene has small red torus on the top)

This is proving to be rather tricky. Yet again I tried to handle image coordinate mess in a proper way (UNPACK_FLIP_Y_WEBGL as texture parameter and non-inverted UVs), fixing hacks across the codebase.

This did indeed help with render-to-texture flipping, but instead it created really ugly problems with both normal map and minecraft AO demos. So back to square one :(
2011-01-14 12:39:57 +01:00
alteredq 707dc9d0a0 Refactored render-to-texture example.
Still flipped, though at least now it's consistent.
2011-01-14 02:05:16 +01:00
alteredq 916401fd96 Updated render-to-texture example so that it's easier to check texture orientation. 2011-01-14 00:51:26 +01:00
alteredq 9bc383e1ed Fixed discrepancy between ANGLE and OpenGL when rendering to texture.
Had to set viewport to make it work in OpenGL.

Also made it easier to see texture orientation in the example.

Now it's visible that there is indeed flipping. At least now it's consistent ;).
2011-01-13 22:10:38 +01:00
alteredq cee7205670 Added simple render-to-texture example.
Something is broken as OpenGL shows different result than ANGLE :(

Though this time it's ANGLE which seems correct.
2011-01-13 17:04:36 +01:00