1. 30 12月, 2010 1 次提交
  2. 29 12月, 2010 2 次提交
    • A
      Moved MeshBasicMaterial out of ubershader. · 3cabd118
      alteredq 提交于
      None of the demos seem to be slower, some are noticeably faster (especially terrain).
      
      I suspect biggest performance gain comes from conditional include of environment mapping: if it's not used, it doesn't go into shader at all.
      3cabd118
    • A
      Refactored uniforms cloning into separate file so that it can be reused also... · 0fe464c9
      alteredq 提交于
      Refactored uniforms cloning into separate file so that it can be reused also for MeshShaderMaterials.
      
      Also changed MeshShaderMaterial demos to show how to use cloning. For these particular demos uniforms cloning is not really necessary as they use only one instance of shader material, but for example, if there were two normal mapped models in one scene, each model would need separate material with own uniforms.
      0fe464c9
  3. 28 12月, 2010 2 次提交
  4. 27 12月, 2010 7 次提交
  5. 26 12月, 2010 5 次提交
    • A
      Resurrected exponential fog as FogExp2. · fb7788f0
      alteredq 提交于
      For the moment, only one type of fog is baked into shader, depending on scene.fog initial value.
      
      If use case arise for dynamic fog type switching, this could be changed, though than both fogs would need to be computed all the time :S.
      fb7788f0
    • A
      Added diffuse map to normal map shader. Changed Lee Perry-Smith demo to use normal map shader. · 6e91de5d
      alteredq 提交于
      Diffuse map and ambient occlusion maps are now optional in normal map shader.
      
      By default, both are disabled, so they need to be enabled explicitly like this:
      
          uniforms[ "enableAO" ].value = true;
          uniforms[ "enableDiffuse" ].value = true;
      6e91de5d
    • A
      Added clear color parameter to WebGLRenderer constructor, also added setClearColor API call. · 255c042b
      alteredq 提交于
      This allows to work around ANGLE antialiasing issue appearing when compositing WebGL framebuffer with transparent background color with HTML canvas element background (while keeping antialiasing on).
      
      WebGLRenderer constructor now takes JSON object with few optional parameters:
      
          renderer = new THREE.WebGLRenderer { scene: scene,
                                               antialias: true,
                                               clearColor: 0x000000,
                                               clearAlpha: 0 };
      
      Here is how to change clear color in runtime:
      
          renderer.setClearColor( 0xff0000, 1 );
      255c042b
    • M
      Cleaned up CanvasRenderer/MeshDepthMaterial code. · e46346c9
      Mr.doob 提交于
      Moved near/far values from MeshDepthMaterial to Camera (CanvasRenderer/WebGLRenderer/WebGLRenderer2).
      e46346c9
    • M
      WebGLRenderer2: Added env_map (SphericalReflectionMapping). · 0c3e69cc
      Mr.doob 提交于
      Eventually I'll have to continue in the experimental branch. Want to give it a go to the ColorPass/TexturePass material API. The color + map + env_map setup feels too limiting...
      
      Now that I have more knowledge of WebGL and shaders, this is how the ColorPass/TexturePass API looks like:
      
      	var material = [
      
      		new THREE.MeshLambertMaterial( [
      
      			new THREE.ColorPass( 0xff0000, 1, THREE.NormalBlending ),
      			new THREE.TexturePass( new Texture( <image>, new THREE.UVMapping() ), 0.5, THREE.NormalBlending ),
      			new THREE.TexturePass( new Texture( [ <image>, <image>, <image>, <image>, <image>, <image> ], new THREE.CubeRefractionMapping() ), 1, THREE.SubtractiveBlending ),
      			new THREE.ColorPass( 0x0000ff, 1, THREE.AdditiveBlending )
      
      		], { blending: THREE.NormalBlending } ),
      
      		new THREE.MeshBasicMaterial( [
      
      			new THREE.ColorPass( 0xff0000, 1 ),
      
      		], { blending: THREE.AdditiveBlending, wireframe: true } ),
      
      		new THREE.MeshPhongMaterial( [
      
      			new THREE.ColorPass( 0xff0000, 1 ),
      
      		], { ambient: 0x000000, specular: 0xbbaa99, shininess: 50, blending: THREE.NormalBlending } );
      
      	];
      
      Makes things a bit longer but I think it's more intuitive this way (and pretty powerful). However, the simplest material would be like this:
      
      	var material = new THREE.MeshBasicMaterial( new THREE.ColorPass( 0xff0000 ) );
      
      Mhh... Now I don't know whether they should called `*Pass`, or `*Layer`...
      0c3e69cc
  6. 25 12月, 2010 3 次提交
  7. 24 12月, 2010 2 次提交
    • M
      WebGLRenderer2: Added antialias parameter to constructor. Removed `if` from... · f2b21b5b
      Mr.doob 提交于
      WebGLRenderer2: Added antialias parameter to constructor. Removed `if` from shader, using `fog *` instead.
      f2b21b5b
    • A
      Added antialiasing parameter to WebGLRenderer constructor. · 323228ac
      alteredq 提交于
      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.
      323228ac
  8. 22 12月, 2010 1 次提交
    • M
      Added Terrain + Fog demo. · 93d55298
      Mr.doob 提交于
      WebGLRenderer2: Fixed a possible issue when modifying scene parameters and having only one program (thx alteredq)
      93d55298
  9. 21 12月, 2010 8 次提交
  10. 20 12月, 2010 2 次提交
  11. 19 12月, 2010 1 次提交
  12. 18 12月, 2010 5 次提交
  13. 17 12月, 2010 1 次提交