Commit Graph
265 Commits
Author SHA1 Message Date
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
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 044a98c8ce Added WASD + strafing to minecraft AO demo.
Thanks to Paul Irish for gist:

https://gist.github.com/a9ce964c4dcd08aee976/63562a89d78d44b3a96e37dd361e1a65f51cb559
2010-12-14 00:51:01 +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 4225330065 WebGLRenderer2:
Added textures
2010-12-13 10:36:38 +00:00
Mr.doob 3af0b0fd16 WebGLRenderer2:
Added MeshNormalMaterial.
Moved mColor * mOpacity computation to the shader.
2010-12-13 09:08:04 +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
Mr.doob bf495aa486 Yet another geometry optimisation to the minecraft demo.
Added `lights_pointlight_smooth` example. To be used for tracking browser improvements affecting that technique.
2010-12-12 09:35:00 +00:00
alteredq 9e5017a2ed Another minecraft demo optimization: creating only one material per unique texture.
This also reduces number of VBOs. There aren't many of them anyways, but it's always nice to have less ;)
2010-12-10 19:08:27 +01:00
alteredq e3c9b9d045 Optimized minecraft demo: removed rest of unseen faces.
It did seem to help quite a bit ;)
2010-12-10 15:59:25 +01:00
Mr.doob 2a8abb5531 Implemented gero3 Rectangle optimisations. 2010-12-10 11:04:51 +00:00
Mr.doob cee1d4832f Merge remote branch 'alteredq/master' 2010-12-09 13:33:36 +00:00
Mr.doob 7aeaa8c663 Added translateX( amount ) and translateZ( amount ) to Camera. 2010-12-09 12:37:57 +00:00
alteredq ac5276b41f Added normal + ambient occlusion + displacement mapping demo.
A lot of things going on in this commit:

- added tangents computation for geometries
    - mesh must have UV coordinates
    - to be called explicitly once geometry is loaded like this: geometry.computeTangents()
    - tangents are stored in Vertex objects
    - quads are not solved properly (though workaround hack seems to work at least somehow, as far as each vertex appears at least somewhere)

- extended VBOs in WebGLRenderer to include tangent streams (when available)

- added "normal" shader to ShaderUtils (to be used with MeshShaderMaterial)
   - Blinn-Phong with one directional and one point light (7 varyings gone, just one spare)
   - normal maps are in tangent space
   - displacement maps use simple luminance value (could be changed if better precision is needed)

- displacement mapping uses vertex texture fetch
    - this requires GPU with Shader Model 3.0
    - not currently supported in ANGLE
    - for this, added "supportsVertexTextures" method to WebGLRenderer API, so that application can handle this
2010-12-09 12:27:49 +01:00
Mr.doob 01ffc10ea3 webgl terrain demo look slightly improved. 2010-12-09 09:17:54 +00:00
Mr.doob 10e21dde88 Geometry::computeNormalsGeometry::computeFaceNormals 2010-12-08 15:59:10 +00:00
alteredq 1053ab2444 Made WebGL terrain demo work in Firefox 4.
Firefox doesn't like Typed Array constructors without explicit sizes.

Also in Firefox there were some weird artefacts in Perlin noise when using Int8Array (patterns were repeated across diagonal lines).
2010-12-07 19:50:40 +01:00
Mr.doob 4290307b48 Optimised WebGL terrain demo. 2010-12-07 13:33:20 +00:00
Mr.doob 3f7ed6f939 Right ⇆ Left 2010-12-07 12:43:11 +00:00
Mr.doob 2dcbde4d69 Added webgl terrain example. 2010-12-07 09:13:32 +00:00
alteredq c8ee1c5dc2 Merge remote branch 'remotes/upstream/master' 2010-12-06 16:00:53 +01:00
alteredq 52ef987a79 Small optimization to Minecraft demo: not drawing bottom faces.
For this extended Cube primitive with "sides" parameter.

You can use it to switch off cube faces like this:

    var cube = new Cube( 100, 100, 100, 1, 1, materials, false, { ny: false } );

Default is all six faces on => { px: true, nx: true, py: true, ny: true, pz: true, nz: true }
2010-12-06 15:58:55 +01:00
Mr.doob e829542744 Restored the correct illumination for the Minecraft demo. 2010-12-06 14:30:59 +00:00
alteredq a0e29d1c67 Oops, texture pack attribution got lost in merge. 2010-12-06 14:58:31 +01:00
alteredq 89cd9198dd Fixed a subtle bug in texture parameters (with missing mapping, all other parameters were shifted).
Thanks again Firefox for verbose WebGL warnings.
2010-12-06 14:51:15 +01:00
alteredq 4dfadc00d5 Merge remote branch 'remotes/upstream/master' 2010-12-06 14:21:31 +01:00
alteredq 3410028458 Made Minecraft demo working in Firefox. 2010-12-06 14:16:37 +01:00
Mr.doob 6f898f9fba Updated texture pack for Minecraft demo. 2010-12-06 13:14:22 +00:00
alteredq 7bc909bc04 Merge remote branch 'remotes/upstream/master' 2010-12-06 14:01:19 +01:00
Mr.doob 12ce3e945b Added minecraft demo. 2010-12-06 12:21:34 +00:00
alteredq 508d22f296 Synced with mrdoob's branch. 2010-12-06 11:48:40 +01:00
Mr.doob a030086cf5 texture.loaded = truetexture.image.loaded = true 2010-12-06 10:09:50 +00:00
Mr.doob f0cb056812 Cleaning up unused files. 2010-12-06 06:40:55 +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
Mr.doob 201a4d7b5b Fixed ubiquity test example. 2010-12-05 04:08:48 +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 69f3072e05 Added canvas spherical reflection demo.
Need to test this on IE9... :)_
2010-12-03 16:37:43 +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 d0138282ba Now that WebGLRenderer does VBO per geometry I guess we don't need that GeometryUtils.merge there. Makes loading much faster too.
Fresnel demo has a weird artifact now... As if the cubemap was smaller than the far of the camera?
2010-12-02 17:38:41 +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 d29e94ca97 Updated materials (canvas) example. 2010-12-01 17:55:20 +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 93c9bb3486 Because CanvasRenderer now checks if map.loaded == true (following WebGLRenderer behaviour) some examples got broken. 2010-12-01 16:11:28 +00:00