Jelajahi Sumber

Fixed VisibleCamera's near plane.

Thanks GUI-DAT ;)
alteredq 13 tahun lalu
induk
melakukan
12bdd51aa5

+ 4 - 4
build/Three.js

@@ -728,8 +728,8 @@ THREE.LensFlare.prototype.updateLensFlares=function(){var a,b=this.lensFlares.le
 THREE.VisibleCamera=function(a){function b(a,b,d){c(a,d);c(b,d)}function c(a,b){d.lineGeometry.vertices.push(new THREE.Vertex(new THREE.Vector3));d.lineGeometry.colors.push(new THREE.Color(b));void 0===d.pointMap[a]&&(d.pointMap[a]=[]);d.pointMap[a].push(d.lineGeometry.vertices.length-1)}THREE.Object3D.call(this);var d=this;this.lineGeometry=new THREE.Geometry;this.lineMaterial=new THREE.LineBasicMaterial({color:16777215,vertexColors:THREE.FaceColors});this.pointMap={};b("n1","n2",16755200);b("n2",
 "n4",16755200);b("n4","n3",16755200);b("n3","n1",16755200);b("f1","f2",16755200);b("f2","f4",16755200);b("f4","f3",16755200);b("f3","f1",16755200);b("n1","f1",16755200);b("n2","f2",16755200);b("n3","f3",16755200);b("n4","f4",16755200);b("p","n1",16711680);b("p","n2",16711680);b("p","n3",16711680);b("p","n4",16711680);b("u1","u2",43775);b("u2","u3",43775);b("u3","u1",43775);b("c","t",16777215);b("p","c",3355443);b("cn1","cn2",3355443);b("cn3","cn4",3355443);b("cf1","cf2",3355443);b("cf3","cf4",3355443);
 this.update(a);this.lines=new THREE.Line(this.lineGeometry,this.lineMaterial,THREE.LinePieces);this.add(this.lines)};THREE.VisibleCamera.prototype=new THREE.Object3D;THREE.VisibleCamera.prototype.constructor=THREE.VisibleCamera;
-THREE.VisibleCamera.prototype.update=function(a){function b(a,b,f,g){THREE.VisibleCamera.__v.set(b,f,g);THREE.VisibleCamera.__projector.unprojectVector(THREE.VisibleCamera.__v,THREE.VisibleCamera.__c);a=c.pointMap[a];if(void 0!==a){b=0;for(f=a.length;b<f;b++)c.lineGeometry.vertices[a[b]].position.copy(THREE.VisibleCamera.__v)}}var c=this;THREE.VisibleCamera.__c.projectionMatrix.copy(a.projectionMatrix);b("c",0,0,0);b("t",0,0,1);b("n1",-1,-1,0);b("n2",1,-1,0);b("n3",-1,1,0);b("n4",1,1,0);b("f1",-1,
--1,1);b("f2",1,-1,1);b("f3",-1,1,1);b("f4",1,1,1);b("u1",0.7,1.1,0);b("u2",-0.7,1.1,0);b("u3",0,2,0);b("cf1",-1,0,1);b("cf2",1,0,1);b("cf3",0,-1,1);b("cf4",0,1,1);b("cn1",-1,0,0);b("cn2",1,0,0);b("cn3",0,-1,0);b("cn4",0,1,0);this.lineGeometry.__dirtyVertices=!0};THREE.VisibleCamera.__projector=new THREE.Projector;THREE.VisibleCamera.__v=new THREE.Vector3;THREE.VisibleCamera.__c=new THREE.Camera;
+THREE.VisibleCamera.prototype.update=function(a){function b(a,b,f,g){THREE.VisibleCamera.__v.set(b,f,g);THREE.VisibleCamera.__projector.unprojectVector(THREE.VisibleCamera.__v,THREE.VisibleCamera.__c);a=c.pointMap[a];if(void 0!==a){b=0;for(f=a.length;b<f;b++)c.lineGeometry.vertices[a[b]].position.copy(THREE.VisibleCamera.__v)}}var c=this;THREE.VisibleCamera.__c.projectionMatrix.copy(a.projectionMatrix);b("c",0,0,-1);b("t",0,0,1);b("n1",-1,-1,-1);b("n2",1,-1,-1);b("n3",-1,1,-1);b("n4",1,1,-1);b("f1",
+-1,-1,1);b("f2",1,-1,1);b("f3",-1,1,1);b("f4",1,1,1);b("u1",0.7,1.1,-1);b("u2",-0.7,1.1,-1);b("u3",0,2,-1);b("cf1",-1,0,1);b("cf2",1,0,1);b("cf3",0,-1,1);b("cf4",0,1,1);b("cn1",-1,0,-1);b("cn2",1,0,-1);b("cn3",0,-1,-1);b("cn4",0,1,-1);this.lineGeometry.__dirtyVertices=!0};THREE.VisibleCamera.__projector=new THREE.Projector;THREE.VisibleCamera.__v=new THREE.Vector3;THREE.VisibleCamera.__c=new THREE.Camera;
 THREE.LensFlarePlugin=function(){function a(a){var c=b.createProgram(),d=b.createShader(b.FRAGMENT_SHADER),e=b.createShader(b.VERTEX_SHADER);b.shaderSource(d,a.fragmentShader);b.shaderSource(e,a.vertexShader);b.compileShader(d);b.compileShader(e);b.attachShader(c,d);b.attachShader(c,e);b.linkProgram(c);return c}var b,c,d,e,f,g,h,i,l,k,n,p,o;this.init=function(q){b=q.context;c=q;d=new Float32Array(16);e=new Uint16Array(6);q=0;d[q++]=-1;d[q++]=-1;d[q++]=0;d[q++]=0;d[q++]=1;d[q++]=-1;d[q++]=1;d[q++]=
 0;d[q++]=1;d[q++]=1;d[q++]=1;d[q++]=1;d[q++]=-1;d[q++]=1;d[q++]=0;d[q++]=1;q=0;e[q++]=0;e[q++]=1;e[q++]=2;e[q++]=0;e[q++]=2;e[q++]=3;f=b.createBuffer();g=b.createBuffer();b.bindBuffer(b.ARRAY_BUFFER,f);b.bufferData(b.ARRAY_BUFFER,d,b.STATIC_DRAW);b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,g);b.bufferData(b.ELEMENT_ARRAY_BUFFER,e,b.STATIC_DRAW);h=b.createTexture();i=b.createTexture();b.bindTexture(b.TEXTURE_2D,h);b.texImage2D(b.TEXTURE_2D,0,b.RGB,16,16,0,b.RGB,b.UNSIGNED_BYTE,null);b.texParameteri(b.TEXTURE_2D,
 b.TEXTURE_WRAP_S,b.CLAMP_TO_EDGE);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_T,b.CLAMP_TO_EDGE);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,b.NEAREST);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,b.NEAREST);b.bindTexture(b.TEXTURE_2D,i);b.texImage2D(b.TEXTURE_2D,0,b.RGBA,16,16,0,b.RGBA,b.UNSIGNED_BYTE,null);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_S,b.CLAMP_TO_EDGE);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_T,b.CLAMP_TO_EDGE);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,b.NEAREST);
@@ -741,8 +741,8 @@ h);b.copyTexImage2D(b.TEXTURE_2D,0,b.RGB,F.x-8,F.y-8,16,16,0);b.uniform1i(K.rend
 c.setBlending(j.blending),c.setTexture(j.texture,1),b.drawElements(b.TRIANGLES,6,b.UNSIGNED_SHORT,0)}b.enable(b.CULL_FACE);b.enable(b.DEPTH_TEST);b.depthMask(!0)}}};
 THREE.ShadowMapPlugin=function(){var a,b,c,d,e=new THREE.Frustum,f=new THREE.Matrix4;this.init=function(e){a=e.context;b=e;var e=THREE.ShaderLib.depthRGBA,f=THREE.UniformsUtils.clone(e.uniforms);c=new THREE.ShaderMaterial({fragmentShader:e.fragmentShader,vertexShader:e.vertexShader,uniforms:f});d=new THREE.ShaderMaterial({fragmentShader:e.fragmentShader,vertexShader:e.vertexShader,uniforms:f,morphTargets:!0});c._shadowPass=!0;d._shadowPass=!0};this.render=function(a,c){b.shadowMapEnabled&&b.shadowMapAutoUpdate&&
 this.update(a,c)};this.update=function(g){var h,i,l,k,n,p,o,q,m,r=g.lights;a.clearColor(1,1,1,1);a.disable(a.BLEND);b.shadowMapCullFrontFaces&&a.cullFace(a.FRONT);b.setDepthTest(!0);for(h=0,i=r.length;h<i;h++)if(q=r[h],q.castShadow&&q instanceof THREE.SpotLight){if(!q.shadowMap)q.shadowMap=new THREE.WebGLRenderTarget(q.shadowMapWidth,q.shadowMapHeight,{minFilter:THREE.LinearFilter,magFilter:THREE.LinearFilter,format:THREE.RGBAFormat}),q.shadowMapSize=new THREE.Vector2(q.shadowMapWidth,q.shadowMapHeight),
-q.shadowCamera=new THREE.PerspectiveCamera(q.shadowCameraFov,q.shadowMapWidth/q.shadowMapHeight,q.shadowCameraNear,q.shadowCameraFar),q.shadowMatrix=new THREE.Matrix4,g.add(q.shadowCamera),b.autoUpdateScene&&g.updateMatrixWorld();if(q.shadowCameraVisible&&!q.visibleCamera)q.visibleCamera=new THREE.VisibleCamera(q.shadowCamera),q.shadowCamera.add(q.visibleCamera);l=q.shadowMap;k=q.shadowMatrix;n=q.shadowCamera;n.position.copy(q.position);n.lookAt(q.target.position);n.matrixWorldInverse.getInverse(n.matrixWorld);
-if(q.visibleCamera)q.visibleCamera.lines.visible=q.shadowCameraVisible;q.shadowCameraVisible&&q.visibleCamera.update(q.shadowCamera);k.set(0.5,0,0,0.5,0,0.5,0,0.5,0,0,0.5,0.5,0,0,0,1);k.multiplySelf(n.projectionMatrix);k.multiplySelf(n.matrixWorldInverse);if(!n._viewMatrixArray)n._viewMatrixArray=new Float32Array(16);n.matrixWorldInverse.flattenToArray(n._viewMatrixArray);if(!n._projectionMatrixArray)n._projectionMatrixArray=new Float32Array(16);n.projectionMatrix.flattenToArray(n._projectionMatrixArray);
+q.shadowCamera=new THREE.PerspectiveCamera(q.shadowCameraFov,q.shadowMapWidth/q.shadowMapHeight,q.shadowCameraNear,q.shadowCameraFar),q.shadowMatrix=new THREE.Matrix4,g.add(q.shadowCamera),b.autoUpdateScene&&g.updateMatrixWorld();if(q.shadowCameraVisible&&!q.visibleCamera)q.visibleCamera=new THREE.VisibleCamera(q.shadowCamera),q.shadowCamera.add(q.visibleCamera);l=q.shadowMap;k=q.shadowMatrix;n=q.shadowCamera;n.position.copy(q.matrixWorld.getPosition());n.lookAt(q.target.matrixWorld.getPosition());
+n.matrixWorldInverse.getInverse(n.matrixWorld);if(q.visibleCamera)q.visibleCamera.lines.visible=q.shadowCameraVisible;q.shadowCameraVisible&&q.visibleCamera.update(q.shadowCamera);k.set(0.5,0,0,0.5,0,0.5,0,0.5,0,0,0.5,0.5,0,0,0,1);k.multiplySelf(n.projectionMatrix);k.multiplySelf(n.matrixWorldInverse);if(!n._viewMatrixArray)n._viewMatrixArray=new Float32Array(16);n.matrixWorldInverse.flattenToArray(n._viewMatrixArray);if(!n._projectionMatrixArray)n._projectionMatrixArray=new Float32Array(16);n.projectionMatrix.flattenToArray(n._projectionMatrixArray);
 f.multiply(n.projectionMatrix,n.matrixWorldInverse);e.setFromMatrix(f);b.setRenderTarget(l);b.clear();m=g.__webglObjects;for(l=0,k=m.length;l<k;l++)if(p=m[l],q=p.object,p.render=!1,q.visible&&q.castShadow&&(!(q instanceof THREE.Mesh)||!q.frustumCulled||e.contains(q)))q.matrixWorld.flattenToArray(q._objectMatrixArray),q._modelViewMatrix.multiplyToArray(n.matrixWorldInverse,q.matrixWorld,q._modelViewMatrixArray),p.render=!0;for(l=0,k=m.length;l<k;l++)if(p=m[l],p.render)q=p.object,p=p.buffer,b.setObjectFaces(q),
 o=q.customDepthMaterial?q.customDepthMaterial:q.geometry.morphTargets.length?d:c,p instanceof THREE.BufferGeometry?b.renderBufferDirect(n,r,null,o,p,q):b.renderBuffer(n,r,null,o,p,q);m=g.__webglObjectsImmediate;for(l=0,k=m.length;l<k;l++)p=m[l],q=p.object,q.visible&&q.castShadow&&(q.matrixAutoUpdate&&q.matrixWorld.flattenToArray(q._objectMatrixArray),q._modelViewMatrix.multiplyToArray(n.matrixWorldInverse,q.matrixWorld,q._modelViewMatrixArray),b.renderImmediateObject(n,r,null,c,q))}g=b.getClearColor();
 h=b.getClearAlpha();a.clearColor(g.r,g.g,g.b,h);a.enable(a.BLEND);b.shadowMapCullFrontFaces&&a.cullFace(a.BACK)}};

+ 2 - 2
build/custom/ThreeExtras.js

@@ -374,8 +374,8 @@ THREE.LensFlare.prototype.updateLensFlares=function(){var a,b=this.lensFlares.le
 THREE.VisibleCamera=function(a){function b(a,b,d){c(a,d);c(b,d)}function c(a,b){d.lineGeometry.vertices.push(new THREE.Vertex(new THREE.Vector3));d.lineGeometry.colors.push(new THREE.Color(b));void 0===d.pointMap[a]&&(d.pointMap[a]=[]);d.pointMap[a].push(d.lineGeometry.vertices.length-1)}THREE.Object3D.call(this);var d=this;this.lineGeometry=new THREE.Geometry;this.lineMaterial=new THREE.LineBasicMaterial({color:16777215,vertexColors:THREE.FaceColors});this.pointMap={};b("n1","n2",16755200);b("n2",
 "n4",16755200);b("n4","n3",16755200);b("n3","n1",16755200);b("f1","f2",16755200);b("f2","f4",16755200);b("f4","f3",16755200);b("f3","f1",16755200);b("n1","f1",16755200);b("n2","f2",16755200);b("n3","f3",16755200);b("n4","f4",16755200);b("p","n1",16711680);b("p","n2",16711680);b("p","n3",16711680);b("p","n4",16711680);b("u1","u2",43775);b("u2","u3",43775);b("u3","u1",43775);b("c","t",16777215);b("p","c",3355443);b("cn1","cn2",3355443);b("cn3","cn4",3355443);b("cf1","cf2",3355443);b("cf3","cf4",3355443);
 this.update(a);this.lines=new THREE.Line(this.lineGeometry,this.lineMaterial,THREE.LinePieces);this.add(this.lines)};THREE.VisibleCamera.prototype=new THREE.Object3D;THREE.VisibleCamera.prototype.constructor=THREE.VisibleCamera;
-THREE.VisibleCamera.prototype.update=function(a){function b(a,b,g,e){THREE.VisibleCamera.__v.set(b,g,e);THREE.VisibleCamera.__projector.unprojectVector(THREE.VisibleCamera.__v,THREE.VisibleCamera.__c);a=c.pointMap[a];if(void 0!==a){b=0;for(g=a.length;b<g;b++)c.lineGeometry.vertices[a[b]].position.copy(THREE.VisibleCamera.__v)}}var c=this;THREE.VisibleCamera.__c.projectionMatrix.copy(a.projectionMatrix);b("c",0,0,0);b("t",0,0,1);b("n1",-1,-1,0);b("n2",1,-1,0);b("n3",-1,1,0);b("n4",1,1,0);b("f1",-1,
--1,1);b("f2",1,-1,1);b("f3",-1,1,1);b("f4",1,1,1);b("u1",0.7,1.1,0);b("u2",-0.7,1.1,0);b("u3",0,2,0);b("cf1",-1,0,1);b("cf2",1,0,1);b("cf3",0,-1,1);b("cf4",0,1,1);b("cn1",-1,0,0);b("cn2",1,0,0);b("cn3",0,-1,0);b("cn4",0,1,0);this.lineGeometry.__dirtyVertices=!0};THREE.VisibleCamera.__projector=new THREE.Projector;THREE.VisibleCamera.__v=new THREE.Vector3;THREE.VisibleCamera.__c=new THREE.Camera;
+THREE.VisibleCamera.prototype.update=function(a){function b(a,b,g,e){THREE.VisibleCamera.__v.set(b,g,e);THREE.VisibleCamera.__projector.unprojectVector(THREE.VisibleCamera.__v,THREE.VisibleCamera.__c);a=c.pointMap[a];if(void 0!==a){b=0;for(g=a.length;b<g;b++)c.lineGeometry.vertices[a[b]].position.copy(THREE.VisibleCamera.__v)}}var c=this;THREE.VisibleCamera.__c.projectionMatrix.copy(a.projectionMatrix);b("c",0,0,-1);b("t",0,0,1);b("n1",-1,-1,-1);b("n2",1,-1,-1);b("n3",-1,1,-1);b("n4",1,1,-1);b("f1",
+-1,-1,1);b("f2",1,-1,1);b("f3",-1,1,1);b("f4",1,1,1);b("u1",0.7,1.1,-1);b("u2",-0.7,1.1,-1);b("u3",0,2,-1);b("cf1",-1,0,1);b("cf2",1,0,1);b("cf3",0,-1,1);b("cf4",0,1,1);b("cn1",-1,0,-1);b("cn2",1,0,-1);b("cn3",0,-1,-1);b("cn4",0,1,-1);this.lineGeometry.__dirtyVertices=!0};THREE.VisibleCamera.__projector=new THREE.Projector;THREE.VisibleCamera.__v=new THREE.Vector3;THREE.VisibleCamera.__c=new THREE.Camera;
 THREE.LensFlarePlugin=function(){function a(a){var c=b.createProgram(),d=b.createShader(b.FRAGMENT_SHADER),e=b.createShader(b.VERTEX_SHADER);b.shaderSource(d,a.fragmentShader);b.shaderSource(e,a.vertexShader);b.compileShader(d);b.compileShader(e);b.attachShader(c,d);b.attachShader(c,e);b.linkProgram(c);return c}var b,c,d,f,g,e,h,i,k,j,m,p,n;this.init=function(l){b=l.context;c=l;d=new Float32Array(16);f=new Uint16Array(6);l=0;d[l++]=-1;d[l++]=-1;d[l++]=0;d[l++]=0;d[l++]=1;d[l++]=-1;d[l++]=1;d[l++]=
 0;d[l++]=1;d[l++]=1;d[l++]=1;d[l++]=1;d[l++]=-1;d[l++]=1;d[l++]=0;d[l++]=1;l=0;f[l++]=0;f[l++]=1;f[l++]=2;f[l++]=0;f[l++]=2;f[l++]=3;g=b.createBuffer();e=b.createBuffer();b.bindBuffer(b.ARRAY_BUFFER,g);b.bufferData(b.ARRAY_BUFFER,d,b.STATIC_DRAW);b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,e);b.bufferData(b.ELEMENT_ARRAY_BUFFER,f,b.STATIC_DRAW);h=b.createTexture();i=b.createTexture();b.bindTexture(b.TEXTURE_2D,h);b.texImage2D(b.TEXTURE_2D,0,b.RGB,16,16,0,b.RGB,b.UNSIGNED_BYTE,null);b.texParameteri(b.TEXTURE_2D,
 b.TEXTURE_WRAP_S,b.CLAMP_TO_EDGE);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_T,b.CLAMP_TO_EDGE);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,b.NEAREST);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,b.NEAREST);b.bindTexture(b.TEXTURE_2D,i);b.texImage2D(b.TEXTURE_2D,0,b.RGBA,16,16,0,b.RGBA,b.UNSIGNED_BYTE,null);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_S,b.CLAMP_TO_EDGE);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_T,b.CLAMP_TO_EDGE);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,b.NEAREST);

+ 2 - 2
build/custom/ThreeWebGL.js

@@ -349,8 +349,8 @@ THREE.triTable=new Int32Array([-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0
 THREE.VisibleCamera=function(a){function b(a,b,d){c(a,d);c(b,d)}function c(a,b){d.lineGeometry.vertices.push(new THREE.Vertex(new THREE.Vector3));d.lineGeometry.colors.push(new THREE.Color(b));void 0===d.pointMap[a]&&(d.pointMap[a]=[]);d.pointMap[a].push(d.lineGeometry.vertices.length-1)}THREE.Object3D.call(this);var d=this;this.lineGeometry=new THREE.Geometry;this.lineMaterial=new THREE.LineBasicMaterial({color:16777215,vertexColors:THREE.FaceColors});this.pointMap={};b("n1","n2",16755200);b("n2",
 "n4",16755200);b("n4","n3",16755200);b("n3","n1",16755200);b("f1","f2",16755200);b("f2","f4",16755200);b("f4","f3",16755200);b("f3","f1",16755200);b("n1","f1",16755200);b("n2","f2",16755200);b("n3","f3",16755200);b("n4","f4",16755200);b("p","n1",16711680);b("p","n2",16711680);b("p","n3",16711680);b("p","n4",16711680);b("u1","u2",43775);b("u2","u3",43775);b("u3","u1",43775);b("c","t",16777215);b("p","c",3355443);b("cn1","cn2",3355443);b("cn3","cn4",3355443);b("cf1","cf2",3355443);b("cf3","cf4",3355443);
 this.update(a);this.lines=new THREE.Line(this.lineGeometry,this.lineMaterial,THREE.LinePieces);this.add(this.lines)};THREE.VisibleCamera.prototype=new THREE.Object3D;THREE.VisibleCamera.prototype.constructor=THREE.VisibleCamera;
-THREE.VisibleCamera.prototype.update=function(a){function b(a,b,g,h){THREE.VisibleCamera.__v.set(b,g,h);THREE.VisibleCamera.__projector.unprojectVector(THREE.VisibleCamera.__v,THREE.VisibleCamera.__c);a=c.pointMap[a];if(void 0!==a){b=0;for(g=a.length;b<g;b++)c.lineGeometry.vertices[a[b]].position.copy(THREE.VisibleCamera.__v)}}var c=this;THREE.VisibleCamera.__c.projectionMatrix.copy(a.projectionMatrix);b("c",0,0,0);b("t",0,0,1);b("n1",-1,-1,0);b("n2",1,-1,0);b("n3",-1,1,0);b("n4",1,1,0);b("f1",-1,
--1,1);b("f2",1,-1,1);b("f3",-1,1,1);b("f4",1,1,1);b("u1",0.7,1.1,0);b("u2",-0.7,1.1,0);b("u3",0,2,0);b("cf1",-1,0,1);b("cf2",1,0,1);b("cf3",0,-1,1);b("cf4",0,1,1);b("cn1",-1,0,0);b("cn2",1,0,0);b("cn3",0,-1,0);b("cn4",0,1,0);this.lineGeometry.__dirtyVertices=!0};THREE.VisibleCamera.__projector=new THREE.Projector;THREE.VisibleCamera.__v=new THREE.Vector3;THREE.VisibleCamera.__c=new THREE.Camera;
+THREE.VisibleCamera.prototype.update=function(a){function b(a,b,g,h){THREE.VisibleCamera.__v.set(b,g,h);THREE.VisibleCamera.__projector.unprojectVector(THREE.VisibleCamera.__v,THREE.VisibleCamera.__c);a=c.pointMap[a];if(void 0!==a){b=0;for(g=a.length;b<g;b++)c.lineGeometry.vertices[a[b]].position.copy(THREE.VisibleCamera.__v)}}var c=this;THREE.VisibleCamera.__c.projectionMatrix.copy(a.projectionMatrix);b("c",0,0,-1);b("t",0,0,1);b("n1",-1,-1,-1);b("n2",1,-1,-1);b("n3",-1,1,-1);b("n4",1,1,-1);b("f1",
+-1,-1,1);b("f2",1,-1,1);b("f3",-1,1,1);b("f4",1,1,1);b("u1",0.7,1.1,-1);b("u2",-0.7,1.1,-1);b("u3",0,2,-1);b("cf1",-1,0,1);b("cf2",1,0,1);b("cf3",0,-1,1);b("cf4",0,1,1);b("cn1",-1,0,-1);b("cn2",1,0,-1);b("cn3",0,-1,-1);b("cn4",0,1,-1);this.lineGeometry.__dirtyVertices=!0};THREE.VisibleCamera.__projector=new THREE.Projector;THREE.VisibleCamera.__v=new THREE.Vector3;THREE.VisibleCamera.__c=new THREE.Camera;
 THREE.LensFlarePlugin=function(){function a(a){var c=b.createProgram(),d=b.createShader(b.FRAGMENT_SHADER),e=b.createShader(b.VERTEX_SHADER);b.shaderSource(d,a.fragmentShader);b.shaderSource(e,a.vertexShader);b.compileShader(d);b.compileShader(e);b.attachShader(c,d);b.attachShader(c,e);b.linkProgram(c);return c}var b,c,d,e,g,h,i,k,m,j,n,o,p;this.init=function(l){b=l.context;c=l;d=new Float32Array(16);e=new Uint16Array(6);l=0;d[l++]=-1;d[l++]=-1;d[l++]=0;d[l++]=0;d[l++]=1;d[l++]=-1;d[l++]=1;d[l++]=
 0;d[l++]=1;d[l++]=1;d[l++]=1;d[l++]=1;d[l++]=-1;d[l++]=1;d[l++]=0;d[l++]=1;l=0;e[l++]=0;e[l++]=1;e[l++]=2;e[l++]=0;e[l++]=2;e[l++]=3;g=b.createBuffer();h=b.createBuffer();b.bindBuffer(b.ARRAY_BUFFER,g);b.bufferData(b.ARRAY_BUFFER,d,b.STATIC_DRAW);b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,h);b.bufferData(b.ELEMENT_ARRAY_BUFFER,e,b.STATIC_DRAW);i=b.createTexture();k=b.createTexture();b.bindTexture(b.TEXTURE_2D,i);b.texImage2D(b.TEXTURE_2D,0,b.RGB,16,16,0,b.RGB,b.UNSIGNED_BYTE,null);b.texParameteri(b.TEXTURE_2D,
 b.TEXTURE_WRAP_S,b.CLAMP_TO_EDGE);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_T,b.CLAMP_TO_EDGE);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,b.NEAREST);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,b.NEAREST);b.bindTexture(b.TEXTURE_2D,k);b.texImage2D(b.TEXTURE_2D,0,b.RGBA,16,16,0,b.RGBA,b.UNSIGNED_BYTE,null);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_S,b.CLAMP_TO_EDGE);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_T,b.CLAMP_TO_EDGE);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,b.NEAREST);

+ 4 - 0
examples/webgl_camera.html

@@ -77,6 +77,10 @@
 				mesh2.position.y = 150;
 				mesh.add( mesh2 );
 
+				var mesh3 = new THREE.Mesh( new THREE.SphereGeometry( 5, 16, 8 ), new THREE.MeshBasicMaterial( { color: 0x0000ff, wireframe: true } ) );
+				mesh3.position.z = -150;
+				camera2.add( mesh3 );
+
 				//
 
 				var x, y, z, geo = new THREE.Geometry();

+ 2 - 2
examples/webgl_shading_physical.html

@@ -446,14 +446,14 @@
 
 				});
 
-				gui.add( shadowConfig, 'shadowCameraNear', 1, 1000 ).onChange( function() {
+				gui.add( shadowConfig, 'shadowCameraNear', 1, 1500 ).onChange( function() {
 
 					sunLight.shadowCamera.near = shadowConfig.shadowCameraNear;
 					sunLight.shadowCamera.updateProjectionMatrix();
 
 				});
 
-				gui.add( shadowConfig, 'shadowCameraFar', 1001, 5000 ).onChange( function() {
+				gui.add( shadowConfig, 'shadowCameraFar', 1501, 5000 ).onChange( function() {
 
 					sunLight.shadowCamera.far = shadowConfig.shadowCameraFar;
 					sunLight.shadowCamera.updateProjectionMatrix();

+ 13 - 13
src/extras/objects/VisibleCamera.js

@@ -114,15 +114,15 @@ THREE.VisibleCamera.prototype.update = function ( camera ) {
 
 	// center / target
 
-	setPoint( "c", 0, 0, 0 );
-	setPoint( "t", 0, 0, 1 );
+	setPoint( "c", 0, 0, -1 );
+	setPoint( "t", 0, 0,  1 );
 
 	// near
 
-	setPoint( "n1", -w, -h, 0 );
-	setPoint( "n2",  w, -h, 0 );
-	setPoint( "n3", -w,  h, 0 );
-	setPoint( "n4",  w,  h, 0 );
+	setPoint( "n1", -w, -h, -1 );
+	setPoint( "n2",  w, -h, -1 );
+	setPoint( "n3", -w,  h, -1 );
+	setPoint( "n4",  w,  h, -1 );
 
 	// far
 
@@ -133,9 +133,9 @@ THREE.VisibleCamera.prototype.update = function ( camera ) {
 
 	// up
 
-	setPoint( "u1",  w * 0.7, h * 1.1, 0 );
-	setPoint( "u2", -w * 0.7, h * 1.1, 0 );
-	setPoint( "u3",        0, h * 2,   0 );
+	setPoint( "u1",  w * 0.7, h * 1.1, -1 );
+	setPoint( "u2", -w * 0.7, h * 1.1, -1 );
+	setPoint( "u3",        0, h * 2,   -1 );
 
 	// cross
 
@@ -144,10 +144,10 @@ THREE.VisibleCamera.prototype.update = function ( camera ) {
 	setPoint( "cf3",  0, -h, 1 );
 	setPoint( "cf4",  0,  h, 1 );
 
-	setPoint( "cn1", -w,  0, 0 );
-	setPoint( "cn2",  w,  0, 0 );
-	setPoint( "cn3",  0, -h, 0 );
-	setPoint( "cn4",  0,  h, 0 );
+	setPoint( "cn1", -w,  0, -1 );
+	setPoint( "cn2",  w,  0, -1 );
+	setPoint( "cn3",  0, -h, -1 );
+	setPoint( "cn4",  0,  h, -1 );
 
 	function setPoint( point, x, y, z ) {