Commit Graph
172 Commits
Author SHA1 Message Date
Mr.doob e46346c9ba Cleaned up CanvasRenderer/MeshDepthMaterial code.
Moved near/far values from MeshDepthMaterial to Camera (CanvasRenderer/WebGLRenderer/WebGLRenderer2).
2010-12-25 18:14:10 +00:00
Mr.doob fbf26158fb Fog( color, density )Fog( color, near, far ) 2010-12-24 22:15:45 +00:00
Mr.doob bffdc03cf1 *.material*.materials 2010-12-24 21:24:58 +00:00
alteredq 323228ac72 Added antialiasing parameter to WebGLRenderer constructor.
This is a workaround for Chrome ANGLE antialiasing issue manifested in geometry_terrain_fog demo:

http://twitpic.com/3iftyh

Problem happens in Chrome ANGLE when geometry is rendered with the same color as canvas background - then instead of expected nothing to be seen, there is a faint white outline at geometry borders.

This issue is not specific to fog, even just rendering geometry with MeshBasicMaterial having the same color as background produces the same outline.

TODO: create isolated test case and file ANGLE / Chromium bug.
2010-12-23 22:23:56 +01:00
Mr.doob c39eca33ee Projector::projectScene now does a first pass through Projector::projectObject (which does frustum culling and object sorting).
So now CanvasRenderer and SVGRenderer feature frustum culling too.
2010-12-21 14:07:23 +00:00
alteredq 2c1e6a1368 Forgot to remove hardcoded fog color in shader. 2010-12-21 01:38:39 +01:00
alteredq 76a56f2f5c First attempt at fog ;)
For the moment, it works just on Basic / Lambert / Phong materials.

Fog must be added to the scene before initialization of WebGLRenderer and scene must be passed to WebGLRenderer constructor (like for lights).

I don't know yet how to solve properly MeshShaderMaterial & co :(
2010-12-21 01:22:44 +01:00
Mr.doob 02f81a26f4 Merging with alteredq's branch. 2010-12-20 22:16:04 +00:00
Mr.doob 5e2c480b89 Implemented Frustum checking to Projector::projectObjects (thanks errynp)
Added `boundingBox`, `boundingSphere` and `computeBoundingSphere` to Geometry.
2010-12-20 00:28:31 +00:00
Mr.doob c13377d736 Added crappy grass WebGL example.
Added `sortElements` boolean (true by default) to `CanvasRenderer` and `SVGRenderer`. Also added `sortObjects` boolean but not being used yet.
2010-12-19 20:07:08 +00:00
Mr.doob a648315604 WebGLRenderer2 finally handles big geometries ^^
Projector sort boolean is now required (CanvasRenderer and SVGRenderer updated).
2010-12-18 22:57:58 +00:00
alteredq 5e74c741c1 Retired MeshCubeMaterial: replaced it with MeshShaderMaterial "cube" defined in ShaderUtils.
Instant performance boost in all cube mapping demos ;)

With panoramas there were insane amounts of unnecessary computations done in fragment shader - basically every pixel on the screen was computing the whole ubershader - ouch ouch ouch!

This was the lowest hanging fruit, still some more performance can be gained by removing other stuff from ubershader.

Big thanks to mrdoob for starting to question sanity of ubershader ;)
2010-12-18 02:48:59 +01:00
alteredq 3faf6566e3 Experimenting with Fresnel demo using just MeshShaderMaterials.
Instant performance boost by 50% ;).
2010-12-18 01:56:12 +01:00
alteredq d14ed35ae5 Synced with mrdoob's branch. 2010-12-18 01:39:51 +01:00
alteredq 2163691b59 Fixed subtle yet brutal bug also known as "don't mess with streams" ;)
This one kept me puzzled for days. Premature optimization is indeed evil.

Manifestation was that MeshShaderMaterial mysteriously didn't work depending on what was going on elsewhere in the scene. I think mrdoob's problem with "basic" shader was caused by this bug.
2010-12-18 01:32:54 +01:00
Mr.doob 15262507bd Added a sort parameter to Projector.projectObjects and Projector.projectScene. 2010-12-17 22:27:18 +00:00
alteredq 3b54505959 Synced with mrdoob's branch. 2010-12-17 22:02:46 +01:00
Mr.doob fca3aec67d Fixed Projector::projectObjects. 2010-12-17 19:49:23 +00:00
Mr.doob 3b54cf7918 Projector now checks for object.visible before projecting (alteredq: better late than never :P)
WebGLRenderer2 now uses Projector too (projecting objects + sorting, to slightly avoid transparency sorting glitches).
2010-12-17 11:05:53 +00:00
alteredq 39c7e8da57 Synced with mrdoob's branch. 2010-12-17 00:39:02 +01:00
Mr.doob f50f42dde1 Commented out Mesh::normalizeUVs. Needs to be handled in the CanvasRenderer directly.
Added a check in `Scene` to make sure the avoid duplicate objects.
WebGLRenderer2: In the process of handling > 65535
2010-12-15 14:36:42 +00:00
alteredq 5e9bce8385 Synced with mrdoob's branch. 2010-12-14 14:12:36 +01:00
Mr.doob 5f0b6876e6 Optimised Minecraft AO demo (removing more unseen sides).
Made 0xffffff the default color on all materials (0xeeeeee was making the AO a bit darker).
2010-12-14 10:39:48 +00:00
alteredq 8e53294e62 Synced with mrdoob's branch. 2010-12-14 02:35:23 +01:00
alteredq 45f47b89b7 Added minecraft fake ambient occlusion demo.
For some reason it doesn't work with the current Chrome canary (10.0.607.0) when using ANGLE :(.

Also OBJ converter demo is having problems with generated tiled texture in latest canary, so it looks like some bug was introduced in ANGLE's handling of UVs (baked AO relies on "zoomed" UVs).

Need to investigate more, maybe file a bug report.
2010-12-14 00:17:53 +01:00
Mr.doob d3a56f3f35 Yet again that misterious behaviour where stuff gets pasted in weird places. Long time without experiencing it... 2010-12-12 21:42:08 +00:00
Mr.doob b84bca3bb0 WebGLRenderer optimisation: flattening camera matrices just once per render, it was doing it once per object before.
WebGLRenderer2: Trying to re-create WebGLRenderer from scratch... Creating a program per material instead of just one for everything. Seems to be 3x faster by now...
2010-12-12 21:22:25 +00:00
alteredq 0c1851393d Added check for normals in shader when rendering VBOs. 2010-12-12 16:52:50 +01:00
alteredq feb349a794 Synced with mrdoob's branch. 2010-12-10 16:02:38 +01:00
alteredq c0055eec7a Synced with mrdoob's branch. 2010-12-10 13:14:15 +01:00
Mr.doob e3fd761786 Optimised CanvasRenderer::getGradientTexture. 2010-12-10 12:13:13 +00:00
Mr.doob 8a31cd8d98 Implemented gero3 normalToComponent optimisation. 2010-12-10 11:45:14 +00:00
Mr.doob e85a0605e8 Updated build. 2010-12-10 11:06:19 +00:00
Mr.doob 5b0714c370 Updated build. 2010-12-09 17:26:23 +00:00
Mr.doob 389b74f9fc Updated builds. 2010-12-09 13:35:25 +00:00
Mr.doob e538e30a2a Adding alteredq's builds (crappy way to merge I know, but works). 2010-12-09 13:33:29 +00:00
Mr.doob 7aeaa8c663 Added translateX( amount ) and translateZ( amount ) to Camera. 2010-12-09 12:37:57 +00:00
Mr.doob b13b9164b7 THREE.Matrix4()THREE.Matrix4( n11, n12, n13, n14, n21, n22, n23, n24, n31, n32, n33, n34, n41, n42, n43, n44 ) 2010-12-09 08:02:21 +00:00
Mr.doob 10e21dde88 Geometry::computeNormalsGeometry::computeFaceNormals 2010-12-08 15:59:10 +00:00
alteredq 508d22f296 Synced with mrdoob's branch. 2010-12-06 11:48:40 +01:00
Mr.doob a9e185aa70 Updated README includes.
Pushed revision number to 31.
2010-12-06 10:32:38 +00:00
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
Mr.doob fecd2f3a39 python build.py --includes generate a includes.js for easy copy/pasting
TODO: Would be nice if `buildIncludes()` would reuse `buildCommon()` array.
2010-12-06 06:29:05 +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
alteredq c91aac5d5c Synced with mrdoob's branch. 2010-12-03 20:29:43 +01:00
Mr.doob 315bc5ad3e Updated build. 2010-12-03 16:13:04 +00: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 584a8440fd Merging with alteredq's branch. 2010-12-02 17:24:56 +00:00