浏览代码

Brought back bloom.

Also updated GUI-DAT (didn't help with recent Chrome compositing bugs, though this is Chrome Windows issue), added FileAPI to Detector and fixed aspect ratio bug in WebGLRenderer.
alteredq 14 年之前
父节点
当前提交
c61f89ba14

+ 1 - 1
build/Three.js

@@ -189,7 +189,7 @@ v.addPoint(y.positionScreen.x,y.positionScreen.y);if(E.instersects(v)){ga=0;for(
 A.positionScreen.x*=q;A.positionScreen.y*=-x;v.addPoint(u.positionScreen.x,u.positionScreen.y);v.addPoint(t.positionScreen.x,t.positionScreen.y);v.addPoint(y.positionScreen.x,y.positionScreen.y);v.addPoint(A.positionScreen.x,A.positionScreen.y);if(E.instersects(v)){ga=0;for(aa=R.meshMaterials.length;ga<aa;){ia=R.meshMaterials[ga++];if(ia instanceof THREE.MeshFaceMaterial){la=0;for(ma=R.faceMaterials.length;la<ma;)(ia=R.faceMaterials[la++])&&b(u,t,y,A,R,ia,ha)}else ia&&b(u,t,y,A,R,ia,ha)}}}}}};
 THREE.WebGLRenderer=function(a){function c(l,z,p){var m,o,B,C=l.vertices,G=C.length,Q=l.colors,H=Q.length,O=l.__vertexArray,ka=l.__colorArray,ja=l.__sortArray,qa=l.__dirtyVertices,ra=l.__dirtyColors;if(p.sortParticles){xa.multiplySelf(p.matrixWorld);for(m=0;m<G;m++){o=C[m].position;la.copy(o);xa.multiplyVector3(la);ja[m]=[la.z,m]}ja.sort(function(na,oa){return oa[0]-na[0]});for(m=0;m<G;m++){o=C[ja[m][1]].position;B=m*3;O[B]=o.x;O[B+1]=o.y;O[B+2]=o.z}for(m=0;m<H;m++){B=m*3;color=Q[ja[m][1]];ka[B]=
 color.r;ka[B+1]=color.g;ka[B+2]=color.b}}else{if(qa)for(m=0;m<G;m++){o=C[m].position;B=m*3;O[B]=o.x;O[B+1]=o.y;O[B+2]=o.z}if(ra)for(m=0;m<H;m++){color=Q[m];B=m*3;ka[B]=color.r;ka[B+1]=color.g;ka[B+2]=color.b}}if(qa||p.sortParticles){f.bindBuffer(f.ARRAY_BUFFER,l.__webGLVertexBuffer);f.bufferData(f.ARRAY_BUFFER,O,z)}if(ra||p.sortParticles){f.bindBuffer(f.ARRAY_BUFFER,l.__webGLColorBuffer);f.bufferData(f.ARRAY_BUFFER,ka,z)}}function b(l,z){l.fragmentShader=z.fragmentShader;l.vertexShader=z.vertexShader;
-l.uniforms=Uniforms.clone(z.uniforms)}function d(l,z,p,m,o){m.program||ca.initMaterial(m,z,p,o);var B=m.program,C=B.uniforms,G=m.uniforms;if(B!=V){f.useProgram(B);V=B;f.uniformMatrix4fv(C.projectionMatrix,!1,ga)}if(p&&(m instanceof THREE.MeshBasicMaterial||m instanceof THREE.MeshLambertMaterial||m instanceof THREE.MeshPhongMaterial||m instanceof THREE.LineBasicMaterial||m instanceof THREE.ParticleBasicMaterial)){G.fogColor.value.setHex(p.color.hex);if(p instanceof THREE.Fog){G.fogNear.value=p.near;
+l.uniforms=Uniforms.clone(z.uniforms)}function d(l,z,p,m,o){m.program||ca.initMaterial(m,z,p,o);var B=m.program,C=B.uniforms,G=m.uniforms;if(B!=V){f.useProgram(B);V=B}f.uniformMatrix4fv(C.projectionMatrix,!1,ga);if(p&&(m instanceof THREE.MeshBasicMaterial||m instanceof THREE.MeshLambertMaterial||m instanceof THREE.MeshPhongMaterial||m instanceof THREE.LineBasicMaterial||m instanceof THREE.ParticleBasicMaterial)){G.fogColor.value.setHex(p.color.hex);if(p instanceof THREE.Fog){G.fogNear.value=p.near;
 G.fogFar.value=p.far}else if(p instanceof THREE.FogExp2)G.fogDensity.value=p.density}if(m instanceof THREE.MeshPhongMaterial||m instanceof THREE.MeshLambertMaterial){var Q,H,O=0,ka=0,ja=0,qa,ra,na,oa=ma,Ia=oa.directional.colors,P=oa.directional.positions,Fa=oa.point.colors,Da=oa.point.positions,Ea=0,W=0;p=H=H=0;for(Q=z.length;p<Q;p++){H=z[p];qa=H.color;ra=H.position;na=H.intensity;if(H instanceof THREE.AmbientLight){O+=qa.r;ka+=qa.g;ja+=qa.b}else if(H instanceof THREE.DirectionalLight){H=Ea*3;Ia[H]=
 qa.r*na;Ia[H+1]=qa.g*na;Ia[H+2]=qa.b*na;P[H]=ra.x;P[H+1]=ra.y;P[H+2]=ra.z;Ea+=1}else if(H instanceof THREE.PointLight){H=W*3;Fa[H]=qa.r*na;Fa[H+1]=qa.g*na;Fa[H+2]=qa.b*na;Da[H]=ra.x;Da[H+1]=ra.y;Da[H+2]=ra.z;W+=1}}for(p=Ea*3;p<Ia.length;p++)Ia[p]=0;for(p=W*3;p<Fa.length;p++)Fa[p]=0;oa.point.length=W;oa.directional.length=Ea;oa.ambient[0]=O;oa.ambient[1]=ka;oa.ambient[2]=ja;z=ma;G.enableLighting.value=z.directional.length+z.point.length;G.ambientLightColor.value=z.ambient;G.directionalLightColor.value=
 z.directional.colors;G.directionalLightDirection.value=z.directional.positions;G.pointLightColor.value=z.point.colors;G.pointLightPosition.value=z.point.positions}if(m instanceof THREE.MeshBasicMaterial||m instanceof THREE.MeshLambertMaterial||m instanceof THREE.MeshPhongMaterial){G.diffuse.value.setRGB(m.color.r*m.opacity,m.color.g*m.opacity,m.color.b*m.opacity);G.opacity.value=m.opacity;G.map.texture=m.map;G.lightMap.texture=m.lightMap;G.envMap.texture=m.envMap;G.reflectivity.value=m.reflectivity;

+ 1 - 1
build/custom/ThreeWebGL.js

@@ -120,7 +120,7 @@ THREE.Scene.prototype.addObject=THREE.Scene.prototype.addChild;THREE.Scene.proto
 THREE.SoundRenderer=function(){this.volume=1;this.domElement=document.createElement("div");this.domElement.id="THREESound";this.cameraPosition=new THREE.Vector3;this.soundPosition=new THREE.Vector3;this.render=function(a,b,d){d&&a.update(undefined,!1,b);d=a.sounds;var e,g=d.length;for(e=0;e<g;e++){a=d[e];this.soundPosition.set(a.matrixWorld.n14,a.matrixWorld.n24,a.matrixWorld.n34);this.soundPosition.subSelf(b.position);if(a.isPlaying&&a.isLoaded){a.isAddedToDOM||a.addToDOM(this.domElement);a.calculateVolumeAndPan(this.soundPosition)}}}};
 THREE.WebGLRenderer=function(a){function b(f,j,l){var h,i,t,p=f.vertices,s=p.length,A=f.colors,r=A.length,v=f.__vertexArray,J=f.__colorArray,P=f.__sortArray,N=f.__dirtyVertices,I=f.__dirtyColors;if(l.sortParticles){Ga.multiplySelf(l.matrixWorld);for(h=0;h<s;h++){i=p[h].position;Ba.copy(i);Ga.multiplyVector3(Ba);P[h]=[Ba.z,h]}P.sort(function(K,G){return G[0]-K[0]});for(h=0;h<s;h++){i=p[P[h][1]].position;t=h*3;v[t]=i.x;v[t+1]=i.y;v[t+2]=i.z}for(h=0;h<r;h++){t=h*3;color=A[P[h][1]];J[t]=color.r;J[t+1]=
 color.g;J[t+2]=color.b}}else{if(N)for(h=0;h<s;h++){i=p[h].position;t=h*3;v[t]=i.x;v[t+1]=i.y;v[t+2]=i.z}if(I)for(h=0;h<r;h++){color=A[h];t=h*3;J[t]=color.r;J[t+1]=color.g;J[t+2]=color.b}}if(N||l.sortParticles){c.bindBuffer(c.ARRAY_BUFFER,f.__webGLVertexBuffer);c.bufferData(c.ARRAY_BUFFER,v,j)}if(I||l.sortParticles){c.bindBuffer(c.ARRAY_BUFFER,f.__webGLColorBuffer);c.bufferData(c.ARRAY_BUFFER,J,j)}}function d(f,j){f.fragmentShader=j.fragmentShader;f.vertexShader=j.vertexShader;f.uniforms=Uniforms.clone(j.uniforms)}
-function e(f,j,l,h,i){h.program||ta.initMaterial(h,j,l,i);var t=h.program,p=t.uniforms,s=h.uniforms;if(t!=na){c.useProgram(t);na=t;c.uniformMatrix4fv(p.projectionMatrix,!1,Pa)}if(l&&(h instanceof THREE.MeshBasicMaterial||h instanceof THREE.MeshLambertMaterial||h instanceof THREE.MeshPhongMaterial||h instanceof THREE.LineBasicMaterial||h instanceof THREE.ParticleBasicMaterial)){s.fogColor.value.setHex(l.color.hex);if(l instanceof THREE.Fog){s.fogNear.value=l.near;s.fogFar.value=l.far}else if(l instanceof
+function e(f,j,l,h,i){h.program||ta.initMaterial(h,j,l,i);var t=h.program,p=t.uniforms,s=h.uniforms;if(t!=na){c.useProgram(t);na=t}c.uniformMatrix4fv(p.projectionMatrix,!1,Pa);if(l&&(h instanceof THREE.MeshBasicMaterial||h instanceof THREE.MeshLambertMaterial||h instanceof THREE.MeshPhongMaterial||h instanceof THREE.LineBasicMaterial||h instanceof THREE.ParticleBasicMaterial)){s.fogColor.value.setHex(l.color.hex);if(l instanceof THREE.Fog){s.fogNear.value=l.near;s.fogFar.value=l.far}else if(l instanceof
 THREE.FogExp2)s.fogDensity.value=l.density}if(h instanceof THREE.MeshPhongMaterial||h instanceof THREE.MeshLambertMaterial){var A,r,v=0,J=0,P=0,N,I,K,G=Qa,ha=G.directional.colors,u=G.directional.positions,da=G.point.colors,ba=G.point.positions,ga=0,y=0;l=r=r=0;for(A=j.length;l<A;l++){r=j[l];N=r.color;I=r.position;K=r.intensity;if(r instanceof THREE.AmbientLight){v+=N.r;J+=N.g;P+=N.b}else if(r instanceof THREE.DirectionalLight){r=ga*3;ha[r]=N.r*K;ha[r+1]=N.g*K;ha[r+2]=N.b*K;u[r]=I.x;u[r+1]=I.y;u[r+
 2]=I.z;ga+=1}else if(r instanceof THREE.PointLight){r=y*3;da[r]=N.r*K;da[r+1]=N.g*K;da[r+2]=N.b*K;ba[r]=I.x;ba[r+1]=I.y;ba[r+2]=I.z;y+=1}}for(l=ga*3;l<ha.length;l++)ha[l]=0;for(l=y*3;l<da.length;l++)da[l]=0;G.point.length=y;G.directional.length=ga;G.ambient[0]=v;G.ambient[1]=J;G.ambient[2]=P;j=Qa;s.enableLighting.value=j.directional.length+j.point.length;s.ambientLightColor.value=j.ambient;s.directionalLightColor.value=j.directional.colors;s.directionalLightDirection.value=j.directional.positions;
 s.pointLightColor.value=j.point.colors;s.pointLightPosition.value=j.point.positions}if(h instanceof THREE.MeshBasicMaterial||h instanceof THREE.MeshLambertMaterial||h instanceof THREE.MeshPhongMaterial){s.diffuse.value.setRGB(h.color.r*h.opacity,h.color.g*h.opacity,h.color.b*h.opacity);s.opacity.value=h.opacity;s.map.texture=h.map;s.lightMap.texture=h.lightMap;s.envMap.texture=h.envMap;s.reflectivity.value=h.reflectivity;s.refractionRatio.value=h.refractionRatio;s.combine.value=h.combine;s.useRefract.value=

+ 80 - 84
examples/js/gui/gui.css

@@ -1,170 +1,166 @@
 #guidat { 
-	position: fixed;
-	top: 0; 
-	right: 0;
-	width: auto;
-	z-index: 1001;
-	text-align: right;
+    position: fixed;
+    top: 0; 
+    right: 0;
+    width: auto;
+    z-index: 1001;
+    text-align: right;
 }
 
 .guidat { 
-	color: #fff;
-	opacity: 0.97;
-	text-align: left;
-	float: right;
-	margin-right: 20px;
-	margin-bottom: 20px;
-	background-color: #fff;
+    color: #fff;
+    opacity: 0.97;
+    text-align: left;
+    float: right;
+    margin-right: 20px;
+    margin-bottom: 20px;
+    background-color: #fff;
 }
 
 .guidat,
 .guidat input { 
-	font: 9.5px Lucida Grande, sans-serif;
+    font: 9.5px Lucida Grande, sans-serif;
 }
 
 .guidat-controllers { 
-	height: 300px;
-	overflow-y: auto;
-	overflow-x: hidden;
-	background-color: rgba(0,0,0,0.1);
-	/*
-	-moz-transition: height .2s ease-out;
-	-webkit-transition: height .2s ease-out;
-	transition: height .2s ease-out;
-	*/
+    height: 300px;
+    overflow-y: auto;
+    overflow-x: hidden;
+    background-color: rgba(0,0,0,0.1);
 }
 
 a.guidat-toggle { 
-	text-decoration: none;
-	cursor: pointer;
-	color: #fff;
-	background-color: #222;
-	text-align: center;
-	display: block;
-	padding: 5px;
+    text-decoration: none;
+    cursor: pointer;
+    color: #fff;
+    background-color: #222;
+    text-align: center;
+    display: block;
+    padding: 5px;
 
 }
 
 a.guidat-toggle:hover { 
-	background-color: #000;
+    background-color: #000;
 }
 
 .guidat-controller { 
-	padding: 3px;
-	height: 25px;
-	clear: left;
-	border-bottom: 1px solid #222;
-	background-color: #111;
+    padding: 3px;
+    height: 25px;
+    clear: left;
+    border-bottom: 1px solid #222;
+    background-color: #111;
 }
 
 .guidat-controller,
 .guidat-controller input,
 .guidat-slider-bg,
 .guidat-slider-fg { 
-	-moz-transition: background-color 0.15s linear;
-	-webkit-transition: background-color 0.15s linear;
-	transition: background-color 0.15s linear;
+    -moz-transition: background-color 0.15s linear;
+    -webkit-transition: background-color 0.15s linear;
+    transition: background-color 0.15s linear;
 }
 
 .guidat-controller.boolean:hover,
 .guidat-controller.function:hover {
-	background-color: #000;
+    background-color: #000;
 }
 
 .guidat-controller input { 
-	float: right;
-	outline: none;
-	border: 0;
-	padding: 4px;
-	margin-top: 2px;
-	background-color: #222;
+    float: right;
+    outline: none;
+    border: 0;
+    padding: 4px;
+    margin-top: 2px;
+    background-color: #222;
 }
 
 
 .guidat-controller select {
-	margin-top: 4px;
-	float: right;
+    margin-top: 4px;
+    float: right;
 }
 
-.guidat-controller input:hover { 
-	background-color: #444;
+.guidat-controller input:hover.
+.guidat-controller.number.active { 
+    background-color: #444;
 }
 
 .guidat-controller input:focus { 
-	background-color: #555;
+    background-color: #555;
 }
 
 .guidat-controller.number { 
-	border-left: 5px solid #00aeff ;
+    border-left: 5px solid #00aeff ;
 }
 
 .guidat-controller.string { 
-	border-left: 5px solid #1ed36f;
+    border-left: 5px solid #1ed36f;
 }
 
 .guidat-controller.string input { 
-	border: 0;
-	color: #1ed36f;
-	margin-right: 2px;
-	width: 148px;
+    border: 0;
+    color: #1ed36f;
+    margin-right: 2px;
+    width: 148px;
 }
 
 .guidat-controller.boolean { 
-	border-left: 5px solid #54396e;
+    border-left: 5px solid #54396e;
 }
 
 .guidat-controller.function { 
-	border-left: 5px solid #e61d5f;
+    border-left: 5px solid #e61d5f;
 }
 
 .guidat-controller.number input[type=text] {
-	width: 35px;
-	margin-left: 5px;
-	margin-right: 2px;
-	color: #00aeff;
+    width: 35px;
+    margin-left: 5px;
+    margin-right: 2px;
+    color: #00aeff;
 }
 
 .guidat .guidat-controller.boolean input { 
-	margin-top: 6px;
-	margin-right: 2px;
-	font-size: 20px;
+    margin-top: 6px;
+    margin-right: 2px;
+    font-size: 20px;
 }
 
 .guidat-controller:last-child {
-	border-bottom: none;
-	-webkit-box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.5);
-	-moz-box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.5);
-	box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.5);
+    border-bottom: none;
+    -webkit-box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.5);
+    -moz-box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.5);
+    box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.5);
 }
 
 .guidat-propertyname { 
-	padding: 5px;
-	padding-top: 7px;
-	cursor: default;
-	display: inline-block;
+    padding: 5px;
+    padding-top: 7px;
+    cursor: default;
+    display: inline-block;
 }
 
 
 .guidat-slider-bg:hover,
 .guidat-slider-bg.active {
-	background-color: #444;
+    background-color: #444;
 }
 
 .guidat-slider-bg:hover .guidat-slider-fg, 
 .guidat-slider-bg.active .guidat-slider-fg { 
-	background-color: #52c8ff;
+    background-color: #52c8ff;
 }
 
 .guidat-slider-bg { 
-	background-color: #222;
-	cursor: ew-resize;
-	width: 40%;
-	margin-top: 2px;
-	float: right;
-	height: 21px;
+    background-color: #222;
+    cursor: ew-resize;
+    width: 40%;
+    margin-top: 2px;
+    float: right;
+    height: 21px;
 }
 
 .guidat-slider-fg { 
-	background-color: #00aeff;
-	height: 20px;
+    background-color: #00aeff;
+    height: 20px;
 }

文件差异内容过多而无法显示
+ 523 - 493
examples/js/gui/gui.full.js


+ 29 - 27
examples/js/gui/gui.min.js

@@ -1,34 +1,36 @@
-var GUI=function(){var a=this,b=[],d=[],e=true,j,k,h=0;a=this;var l=false,n=280,o=false,i,f,q=0,s;this.domElement=document.createElement("div");this.domElement.setAttribute("class","guidat");this.domElement.style.width=n+"px";var p=document.createElement("div");p.setAttribute("class","guidat-controllers");p.addEventListener("DOMMouseScroll",function(c){var g=this.scrollTop;if(c.wheelDelta)g+=c.wheelDelta;else if(c.detail)g+=c.detail;c.preventDefault&&c.preventDefault();c.returnValue=false;p.scrollTop=
-g},false);p.style.height="0px";var r=document.createElement("a");r.setAttribute("class","guidat-toggle");r.setAttribute("href","#");r.innerHTML="Show Controls";var u=false,C=0,v=false,w,y,x,z,D=function(c){y=w;z=x;w=c.pageY;x=c.pageX;c=w-y;if(!l)if(c>0){l=true;h=i=1;r.innerHTML=f||"Hide Controls"}else return;var g=z-x;if(c>0&&h>k){var m=GUI.map(h,k,k+100,1,0);c*=m}u=true;C+=c;dragDisplacementX+=g;i+=c;n+=g;h+=c;p.style.height=i+"px";n=GUI.constrain(n,240,500);a.domElement.style.width=n+"px";A()};
-r.addEventListener("mousedown",function(c){y=w=c.pageY;z=x=c.pageX;v=true;c.preventDefault();dragDisplacementX=C=0;document.addEventListener("mousemove",D,false);return false},false);r.addEventListener("click",function(c){c.preventDefault();return false},false);document.addEventListener("mouseup",function(c){if(v&&!u){a.toggle();a.domElement.style.width=n+1+"px";setTimeout(function(){a.domElement.style.width=n+"px"},1)}if(v&&u){if(dragDisplacementX==0){a.domElement.style.width=n+1+"px";setTimeout(function(){a.domElement.style.width=
-n+"px"},1)}if(i>k){clearTimeout(s);i=q=k;t()}else if(p.children.length>=1){var g=p.children[0].offsetHeight;clearTimeout(s);q=Math.round(h/g)*g-1;if(q<=0){a.hide();i=g*2}else{i=q;t()}}}document.removeEventListener("mousemove",D,false);c.preventDefault();return v=u=false},false);this.domElement.appendChild(p);this.domElement.appendChild(r);if(GUI.autoPlace){if(GUI.autoPlaceContainer==null){GUI.autoPlaceContainer=document.createElement("div");GUI.autoPlaceContainer.setAttribute("id","guidat");document.body.appendChild(GUI.autoPlaceContainer)}GUI.autoPlaceContainer.appendChild(this.domElement)}this.autoListenIntervalTime=
-1E3/60;var E=function(){j=setInterval(function(){a.listen()},this.autoListenIntervalTime)};this.__defineSetter__("autoListen",function(c){if(e=c)d.length>0&&E();else clearInterval(j)});this.__defineGetter__("autoListen",function(){return e});this.listenTo=function(c){d.length==0&&E();d.push(c)};this.unlistenTo=function(c){for(var g=0;g<d.length;g++)d[g]==c&&d.splice(g,1);d.length<=0&&clearInterval(j)};this.listen=function(c){c=c||d;for(var g in c)c[g].updateDisplay()};this.listenAll=function(){this.listen(b)};
-this.autoListen=true;var F=function(c,g){for(var m in b)if(b[m].object==c&&b[m].propertyName==g)return true;return false},G=function(c,g){function m(){return c.apply(this,g)}m.prototype=c.prototype;return new m};this.add=function(){var c=arguments[0],g=arguments[1];F(c,g);var m=c[g];if(m==undefined)GUI.error(c+' either has no property "'+g+'", or the property is inaccessible.');else{c=typeof m;m=I[c];if(m==undefined)GUI.error('Cannot create controller for data type "'+c+'"');else{for(var H=[this],
-B=0;B<arguments.length;B++)H.push(arguments[B]);if(m=G(m,H)){p.appendChild(m.domElement);b.push(m);GUI.allControllers.push(m);if(c!="function"&&GUI.saveIndex<GUI.savedValues.length){m.setValue(GUI.savedValues[GUI.saveIndex]);GUI.saveIndex++}A();o||(i=k);return m}else GUI.error('Error creating controller for "'+g+'".')}}};var A=function(){k=0;for(var c in b)k+=b[c].domElement.offsetHeight;p.style.overflowY=k-1>i?"auto":"hidden"},I={number:GUI.NumberController,string:GUI.StringController,"boolean":GUI.BooleanController,
-"function":GUI.FunctionController};F=function(c,g){for(var m in b)if(b[m].object==c&&b[m].propertyName==g)return true;return false};G=function(c,g){function m(){return c.apply(this,g)}m.prototype=c.prototype;return new m};this.reset=function(){};this.toggle=function(){l?this.hide():this.show()};this.show=function(){r.innerHTML=f||"Hide Controls";q=i;clearTimeout(s);t();l=true};this.hide=function(){r.innerHTML=f||"Show Controls";q=0;clearTimeout(s);t();l=false};this.name=function(c){f=c;r.innerHTML=
-c};this.appearanceVars=function(){return[l,n,i,p.scrollTop]};var t=function(){h+=(q-h)*0.6;if(Math.abs(h-q)<1)h=q;else s=setTimeout(t,1E3/30);p.style.height=Math.round(h)+"px";A()};if(GUI.guiIndex<GUI.savedAppearanceVars.length){n=parseInt(GUI.savedAppearanceVars[GUI.guiIndex][1]);a.domElement.style.width=n+"px";i=parseInt(GUI.savedAppearanceVars[GUI.guiIndex][2]);o=true;if(eval(GUI.savedAppearanceVars[GUI.guiIndex][0])==true){h=i;var J=GUI.savedAppearanceVars[GUI.guiIndex][3];setTimeout(function(){p.scrollTop=
-J},0);if(GUI.scrollTop>-1)document.body.scrollTop=GUI.scrollTop;q=i;this.show()}GUI.guiIndex++}GUI.allGuis.push(this)};GUI.autoPlace=true;GUI.autoPlaceContainer=null;GUI.allControllers=[];GUI.allGuis=[];GUI.saveURL=function(){title=window.location;url=GUI.replaceGetVar("saveString",GUI.getSaveString());window.location=url};GUI.scrollTop=-1;
-GUI.load=function(a){a=a.split(",");var b=parseInt(a[0]);GUI.scrollTop=parseInt(a[1]);for(var d=0;d<b;d++){var e=a.splice(2,4);GUI.savedAppearanceVars.push(e)}GUI.savedValues=a.splice(2,a.length)};GUI.savedValues=[];GUI.savedAppearanceVars=[];
-GUI.getSaveString=function(){var a=[];a.push(GUI.allGuis.length);a.push(document.body.scrollTop);for(var b in GUI.allGuis)for(var d=GUI.allGuis[b].appearanceVars(),e=0;e<d.length;e++)a.push(d[e]);for(b in GUI.allControllers)if(GUI.allControllers[b].type!="function"){d=GUI.allControllers[b].getValue();if(GUI.allControllers[b].type=="number")d=GUI.roundToDecimal(d,4);a.push(d)}return a.join(",")};
-GUI.getVarFromURL=function(a){for(var b,d=window.location.href.slice(window.location.href.indexOf("?")+1).split("&"),e=0;e<d.length;e++){b=d[e].split("=");if(b!=undefined)if(b[0]==a)return b[1]}return null};
-GUI.replaceGetVar=function(a,b){for(var d,e=window.location.href,j=window.location.href.slice(window.location.href.indexOf("?")+1).split("&"),k=0;k<j.length;k++){d=j[k].split("=");if(d!=undefined)if(d[0]==a)return e.replace(d[1],b)}if(window.location.href.indexOf("?")!=-1)return e+"&"+a+"="+b;return e+"?"+a+"="+b};GUI.saveIndex=0;GUI.guiIndex=0;GUI.showSaveString=function(){alert(GUI.getSaveString())};
-GUI.makeUnselectable=function(a){a.onselectstart=function(){return false};a.style.MozUserSelect="none";a.style.KhtmlUserSelect="none";a.unselectable="on"};GUI.makeSelectable=function(a){a.onselectstart=function(){};a.style.MozUserSelect="auto";a.style.KhtmlUserSelect="auto";a.unselectable="off"};GUI.map=function(a,b,d,e,j){return a=e+(j-e)*((a-b)/(d-b))};GUI.constrain=function(a,b,d){if(a<b)a=b;else if(a>d)a=d;return a};
+var GUI=function(){var a=this,b=[],d=[],f=true,m,k,h=0;a=this;var n=false,i=280,o=false,g,p,e=0,s;this.domElement=document.createElement("div");this.domElement.setAttribute("class","guidat");this.domElement.style.width=i+"px";var q=document.createElement("div");q.setAttribute("class","guidat-controllers");q.addEventListener("DOMMouseScroll",function(c){var j=this.scrollTop;if(c.wheelDelta)j+=c.wheelDelta;else if(c.detail)j+=c.detail;c.preventDefault&&c.preventDefault();c.returnValue=false;q.scrollTop=
+j},false);q.style.height="0px";var r=document.createElement("a");r.setAttribute("class","guidat-toggle");r.setAttribute("href","#");r.innerHTML="Show Controls";var u=false,C=0,v=false,w,y,x,z,D=function(c){y=w;z=x;w=c.pageY;x=c.pageX;c=w-y;if(!n)if(c>0){n=true;h=g=1;r.innerHTML=p||"Hide Controls"}else return;var j=z-x;if(c>0&&h>k){var l=GUI.map(h,k,k+100,1,0);c*=l}u=true;C+=c;dragDisplacementX+=j;g+=c;i+=j;h+=c;q.style.height=g+"px";i=GUI.constrain(i,240,500);a.domElement.style.width=i+"px";A()};
+r.addEventListener("mousedown",function(c){y=w=c.pageY;z=x=c.pageX;v=true;c.preventDefault();dragDisplacementX=C=0;document.addEventListener("mousemove",D,false);return false},false);r.addEventListener("click",function(c){c.preventDefault();return false},false);document.addEventListener("mouseup",function(c){v&&!u&&a.toggle();if(v&&u){dragDisplacementX==0&&E();if(g>k){clearTimeout(s);g=e=k;t()}else if(q.children.length>=1){var j=q.children[0].offsetHeight;clearTimeout(s);e=Math.round(h/j)*j-1;if(e<=
+0){a.hide();g=j*2}else{g=e;t()}}}document.removeEventListener("mousemove",D,false);c.preventDefault();return v=u=false},false);this.domElement.appendChild(q);this.domElement.appendChild(r);if(GUI.autoPlace){if(GUI.autoPlaceContainer==null){GUI.autoPlaceContainer=document.createElement("div");GUI.autoPlaceContainer.setAttribute("id","guidat");document.body.appendChild(GUI.autoPlaceContainer)}GUI.autoPlaceContainer.appendChild(this.domElement)}this.autoListenIntervalTime=1E3/60;var F=function(){m=setInterval(function(){a.listen()},
+this.autoListenIntervalTime)};this.__defineSetter__("autoListen",function(c){if(f=c)d.length>0&&F();else clearInterval(m)});this.__defineGetter__("autoListen",function(){return f});this.listenTo=function(c){d.length==0&&F();d.push(c)};this.unlistenTo=function(c){for(var j=0;j<d.length;j++)d[j]==c&&d.splice(j,1);d.length<=0&&clearInterval(m)};this.listen=function(c){c=c||d;for(var j in c)c[j].updateDisplay()};this.listenAll=function(){this.listen(b)};this.autoListen=true;var G=function(c,j){for(var l in b)if(b[l].object==
+c&&b[l].propertyName==j)return true;return false},H=function(c,j){function l(){return c.apply(this,j)}l.prototype=c.prototype;return new l};this.add=function(){var c=arguments[0],j=arguments[1];G(c,j);var l=c[j];if(l==undefined)GUI.error(c+' either has no property "'+j+'", or the property is inaccessible.');else{c=typeof l;l=J[c];if(l==undefined)GUI.error('Cannot create controller for data type "'+c+'"');else{for(var I=[this],B=0;B<arguments.length;B++)I.push(arguments[B]);if(l=H(l,I)){q.appendChild(l.domElement);
+b.push(l);GUI.allControllers.push(l);if(c!="function"&&GUI.saveIndex<GUI.savedValues.length){l.setValue(GUI.savedValues[GUI.saveIndex]);GUI.saveIndex++}A();o||(g=k);return l}else GUI.error('Error creating controller for "'+j+'".')}}};var A=function(){k=0;for(var c in b)k+=b[c].domElement.offsetHeight;q.style.overflowY=k-1>g?"auto":"hidden"},J={number:GUI.NumberController,string:GUI.StringController,"boolean":GUI.BooleanController,"function":GUI.FunctionController};G=function(c,j){for(var l in b)if(b[l].object==
+c&&b[l].propertyName==j)return true;return false};H=function(c,j){function l(){return c.apply(this,j)}l.prototype=c.prototype;return new l};this.reset=function(){};this.toggle=function(){n?this.hide():this.show()};this.show=function(){r.innerHTML=p||"Hide Controls";e=g;clearTimeout(s);t();n=true};this.hide=function(){r.innerHTML=p||"Show Controls";e=0;clearTimeout(s);t();n=false};this.name=function(c){p=c;r.innerHTML=c};this.appearanceVars=function(){return[n,i,g,q.scrollTop]};var t=function(){h+=
+(e-h)*0.6;if(Math.abs(h-e)<1){h=e;E()}else s=setTimeout(t,1E3/30);q.style.height=Math.round(h)+"px";A()},E=function(){a.domElement.style.width=i+1+"px";setTimeout(function(){a.domElement.style.width=i+"px"},1)};if(GUI.guiIndex<GUI.savedAppearanceVars.length){i=parseInt(GUI.savedAppearanceVars[GUI.guiIndex][1]);a.domElement.style.width=i+"px";g=parseInt(GUI.savedAppearanceVars[GUI.guiIndex][2]);o=true;if(eval(GUI.savedAppearanceVars[GUI.guiIndex][0])==true){h=g;var K=GUI.savedAppearanceVars[GUI.guiIndex][3];
+setTimeout(function(){q.scrollTop=K},0);if(GUI.scrollTop>-1)document.body.scrollTop=GUI.scrollTop;e=g;this.show()}GUI.guiIndex++}GUI.allGuis.push(this);GUI.allGuis.length==1&&window.addEventListener("keyup",function(c){c.keyCode==72&&GUI.toggleHide()},false)};GUI.hidden=false;GUI.autoPlace=true;GUI.autoPlaceContainer=null;GUI.allControllers=[];GUI.allGuis=[];GUI.toggleHide=function(){GUI.hidden?GUI.show():GUI.hide()};
+GUI.show=function(){GUI.hidden=false;for(var a in GUI.allGuis)GUI.allGuis[a].domElement.style.display="block"};GUI.hide=function(){GUI.hidden=true;for(var a in GUI.allGuis)GUI.allGuis[a].domElement.style.display="none"};GUI.saveURL=function(){var a=GUI.replaceGetVar("saveString",GUI.getSaveString());window.location=a};GUI.scrollTop=-1;
+GUI.load=function(a){a=a.split(",");var b=parseInt(a[0]);GUI.scrollTop=parseInt(a[1]);for(var d=0;d<b;d++){var f=a.splice(2,4);GUI.savedAppearanceVars.push(f)}GUI.savedValues=a.splice(2,a.length)};GUI.savedValues=[];GUI.savedAppearanceVars=[];
+GUI.getSaveString=function(){var a=[],b;a.push(GUI.allGuis.length);a.push(document.body.scrollTop);for(b in GUI.allGuis)for(var d=GUI.allGuis[b].appearanceVars(),f=0;f<d.length;f++)a.push(d[f]);for(b in GUI.allControllers)if(GUI.allControllers[b].type!="function"){d=GUI.allControllers[b].getValue();if(GUI.allControllers[b].type=="number")d=GUI.roundToDecimal(d,4);a.push(d)}return a.join(",")};
+GUI.getVarFromURL=function(a){for(var b,d=window.location.href.slice(window.location.href.indexOf("?")+1).split("&"),f=0;f<d.length;f++){b=d[f].split("=");if(b!=undefined)if(b[0]==a)return b[1]}return null};
+GUI.replaceGetVar=function(a,b){for(var d,f=window.location.href,m=window.location.href.slice(window.location.href.indexOf("?")+1).split("&"),k=0;k<m.length;k++){d=m[k].split("=");if(d!=undefined)if(d[0]==a)return f.replace(d[1],b)}if(window.location.href.indexOf("?")!=-1)return f+"&"+a+"="+b;return f+"?"+a+"="+b};GUI.saveIndex=0;GUI.guiIndex=0;GUI.showSaveString=function(){alert(GUI.getSaveString())};
+GUI.makeUnselectable=function(a){a.onselectstart=function(){return false};a.style.MozUserSelect="none";a.style.KhtmlUserSelect="none";a.unselectable="on"};GUI.makeSelectable=function(a){a.onselectstart=function(){};a.style.MozUserSelect="auto";a.style.KhtmlUserSelect="auto";a.unselectable="off"};GUI.map=function(a,b,d,f,m){return f+(m-f)*((a-b)/(d-b))};GUI.constrain=function(a,b,d){if(a<b)a=b;else if(a>d)a=d;return a};
 GUI.error=function(a){typeof console.error=="function"&&console.error("[GUI ERROR] "+a)};GUI.roundToDecimal=function(a,b){var d=Math.pow(10,b);return Math.round(a*d)/d};GUI.extendController=function(a){a.prototype=new GUI.Controller;a.prototype.constructor=a};GUI.getVarFromURL("saveString")!=null&&GUI.load(GUI.getVarFromURL("saveString"));
-GUI.Slider=function(a,b,d,e,j){b=b;d=d;e=e;var k=false,h=this;this.domElement=document.createElement("div");this.domElement.setAttribute("class","guidat-slider-bg");this.fg=document.createElement("div");this.fg.setAttribute("class","guidat-slider-fg");this.domElement.appendChild(this.fg);this.__defineSetter__("value",function(o){this.fg.style.width=GUI.map(o,b,d,0,100)+"%"});var l=function(o){if(k){var i;i=h.domElement;var f=curtop=0;if(i.offsetParent){do{f+=i.offsetLeft;curtop+=i.offsetTop}while(i=
-i.offsetParent);i=[f,curtop]}else i=void 0;o=GUI.map(o.pageX,i[0],i[0]+h.domElement.offsetWidth,b,d);o=Math.round(o/e)*e;a.setValue(o)}};this.domElement.addEventListener("mousedown",function(o){k=true;h.domElement.setAttribute("class","guidat-slider-bg active");h.fg.setAttribute("class","guidat-slider-fg active");l(o);document.addEventListener("mouseup",n,false)},false);var n=function(){h.domElement.setAttribute("class","guidat-slider-bg");h.fg.setAttribute("class","guidat-slider-fg");k=false;a.finishChangeFunction!=
-null&&a.finishChangeFunction.call(this,a.getValue());document.removeEventListener("mouseup",n,false)};document.addEventListener("mousemove",l,false);this.value=j};
+GUI.Slider=function(a,b,d,f,m){var k=false,h=this;this.domElement=document.createElement("div");this.domElement.setAttribute("class","guidat-slider-bg");this.fg=document.createElement("div");this.fg.setAttribute("class","guidat-slider-fg");this.domElement.appendChild(this.fg);var n=function(g){if(k){var p=o(h.domElement);g=GUI.map(g.pageX,p[0],p[0]+h.domElement.offsetWidth,b,d);g=Math.round(g/f)*f;a.setValue(g)}};this.domElement.addEventListener("mousedown",function(g){k=true;h.domElement.className+=
+" active";h.fg.className+=" active";a.domElement.className+=" active";n(g);document.addEventListener("mouseup",i,false)},false);var i=function(){h.domElement.className=h.domElement.className.replace(" active","");h.fg.className=h.fg.className.replace(" active","");a.domElement.className=a.domElement.className.replace(" active","");k=false;a.finishChangeFunction!=null&&a.finishChangeFunction.call(this,a.getValue());document.removeEventListener("mouseup",i,false)},o=function(g){var p=0,e=0;if(g.offsetParent){do{p+=
+g.offsetLeft;e+=g.offsetTop}while(g=g.offsetParent);return[p,e]}};this.__defineSetter__("value",function(g){this.fg.style.width=GUI.map(g,b,d,0,100)+"%"});n=function(g){if(k){var p=o(h.domElement);g=GUI.map(g.pageX,p[0],p[0]+h.domElement.offsetWidth,b,d);g=Math.round(g/f)*f;a.setValue(g)}};this.domElement.addEventListener("mousedown",function(g){k=true;h.domElement.setAttribute("class","guidat-slider-bg active");h.fg.setAttribute("class","guidat-slider-fg active");n(g);document.addEventListener("mouseup",
+i,false)},false);i=function(){h.domElement.setAttribute("class","guidat-slider-bg");h.fg.setAttribute("class","guidat-slider-fg");k=false;a.finishChangeFunction!=null&&a.finishChangeFunction.call(this,a.getValue());document.removeEventListener("mouseup",i,false)};document.addEventListener("mousemove",n,false);this.value=m};
 GUI.Controller=function(){this.parent=arguments[0];this.object=arguments[1];this.propertyName=arguments[2];if(arguments.length>0)this.initialValue=this.propertyName[this.object];this.domElement=document.createElement("div");this.domElement.setAttribute("class","guidat-controller "+this.type);this.propertyNameElement=document.createElement("span");this.propertyNameElement.setAttribute("class","guidat-propertyname");this.name(this.propertyName);this.domElement.appendChild(this.propertyNameElement);
 GUI.makeUnselectable(this.domElement)};GUI.Controller.prototype.changeFunction=null;GUI.Controller.prototype.finishChangeFunction=null;GUI.Controller.prototype.name=function(a){this.propertyNameElement.innerHTML=a;return this};GUI.Controller.prototype.reset=function(){this.setValue(this.initialValue);return this};GUI.Controller.prototype.listen=function(){this.parent.listenTo(this);return this};GUI.Controller.prototype.unlisten=function(){this.parent.unlistenTo(this);return this};
 GUI.Controller.prototype.setValue=function(a){this.object[this.propertyName]=a;this.changeFunction!=null&&this.changeFunction.call(this,a);this.updateDisplay();return this};GUI.Controller.prototype.getValue=function(){return this.object[this.propertyName]};GUI.Controller.prototype.updateDisplay=function(){};GUI.Controller.prototype.onChange=function(a){this.changeFunction=a;return this};GUI.Controller.prototype.onFinishChange=function(a){this.finishChangeFunction=a;return this};
-GUI.Controller.prototype.options=function(){var a=this,b=document.createElement("select");if(arguments.length==1){var d=arguments[0],e;for(e in d){var j=document.createElement("option");j.innerHTML=e;j.setAttribute("value",d[e]);b.appendChild(j)}}else for(e=0;e<arguments.length;e++){j=document.createElement("option");j.innerHTML=arguments[e];j.setAttribute("value",arguments[e]);b.appendChild(j)}b.addEventListener("change",function(){a.setValue(this.value);a.finishChangeFunction!=null&&a.finishChangeFunction.call(this,
-a.getValue())});a.domElement.appendChild(b);return this};
+GUI.Controller.prototype.options=function(){var a=this,b=document.createElement("select");if(arguments.length==1){var d=arguments[0],f;for(f in d){var m=document.createElement("option");m.innerHTML=f;m.setAttribute("value",d[f]);b.appendChild(m)}}else for(f=0;f<arguments.length;f++){m=document.createElement("option");m.innerHTML=arguments[f];m.setAttribute("value",arguments[f]);b.appendChild(m)}b.addEventListener("change",function(){a.setValue(this.value);a.finishChangeFunction!=null&&a.finishChangeFunction.call(this,
+a.getValue())},false);a.domElement.appendChild(b);return this};
 GUI.BooleanController=function(){this.type="boolean";GUI.Controller.apply(this,arguments);var a=this,b=document.createElement("input");b.setAttribute("type","checkbox");this.domElement.addEventListener("click",function(d){b.checked=!b.checked;d.preventDefault();a.setValue(b.checked)},false);b.addEventListener("mouseup",function(){b.checked=!b.checked},false);this.domElement.style.cursor="pointer";this.propertyNameElement.style.cursor="pointer";this.domElement.appendChild(b);this.updateDisplay=function(){b.checked=
-a.getValue()};this.setValue=function(d){if(typeof d!="boolean")try{d=eval(d)}catch(e){}return GUI.Controller.prototype.setValue.call(this,d)}};GUI.extendController(GUI.BooleanController);
+a.getValue()};this.setValue=function(d){if(typeof d!="boolean")try{d=eval(d)}catch(f){}return GUI.Controller.prototype.setValue.call(this,d)}};GUI.extendController(GUI.BooleanController);
 GUI.FunctionController=function(){this.type="function";var a=this;GUI.Controller.apply(this,arguments);this.domElement.addEventListener("click",function(){a.fire()},false);this.domElement.style.cursor="pointer";this.propertyNameElement.style.cursor="pointer";var b=null;this.onFire=function(d){b=d;return this};this.fire=function(){b!=null&&b.call(this);a.object[a.propertyName].call(a.object)}};GUI.extendController(GUI.FunctionController);
-GUI.NumberController=function(){this.type="number";GUI.Controller.apply(this,arguments);var a=this,b=false,d=false,e=py=0,j=arguments[3],k=arguments[4],h=arguments[5];h||(h=j!=undefined&&k!=undefined?(k-j)*0.01:1);var l=document.createElement("input");l.setAttribute("id",this.propertyName);l.setAttribute("type","text");l.setAttribute("value",this.getValue());h&&l.setAttribute("step",h);this.domElement.appendChild(l);var n;if(j!=undefined&&k!=undefined){n=new GUI.Slider(this,j,k,h,this.getValue());
-this.domElement.appendChild(n.domElement)}l.addEventListener("blur",function(){var f=parseFloat(this.value);console.log(f);isNaN(f)||a.setValue(f)},false);l.addEventListener("mousewheel",function(f){f.preventDefault();a.setValue(a.getValue()+Math.abs(f.wheelDeltaY)/f.wheelDeltaY*h);return false},false);l.addEventListener("mousedown",function(f){py=e=f.pageY;d=true;document.addEventListener("mousemove",i,false);document.addEventListener("mouseup",o,false)},false);l.addEventListener("keydown",function(f){switch(f.keyCode){case 38:f=
-a.getValue()+h;a.setValue(f);break;case 40:f=a.getValue()-h;a.setValue(f)}},false);var o=function(){document.removeEventListener("mousemove",i,false);GUI.makeSelectable(a.parent.domElement);GUI.makeSelectable(l);if(d&&!b){l.focus();l.select()}d=b=false;a.finishChangeFunction!=null&&a.finishChangeFunction.call(this,a.getValue());document.removeEventListener("mouseup",o,false)},i=function(f){b=true;f.preventDefault();GUI.makeUnselectable(a.parent.domElement);GUI.makeUnselectable(l);py=e;e=f.pageY;f=
-py-e;f=a.getValue()+f*h;a.setValue(f);return false};this.options=function(){a.noSlider();a.domElement.removeChild(l);return GUI.Controller.prototype.options.apply(this,arguments)};this.noSlider=function(){n&&a.domElement.removeChild(n.domElement);return this};this.setValue=function(f){f=parseFloat(f);if(j!=undefined&&f<=j)f=j;else if(k!=undefined&&f>=k)f=k;return GUI.Controller.prototype.setValue.call(this,f)};this.updateDisplay=function(){l.value=GUI.roundToDecimal(a.getValue(),4);if(n)n.value=a.getValue()}};
-GUI.extendController(GUI.NumberController);
-GUI.StringController=function(){this.type="string";var a=this;GUI.Controller.apply(this,arguments);var b=document.createElement("input"),d=this.getValue();b.setAttribute("value",d);b.setAttribute("spellcheck","false");this.domElement.addEventListener("mouseup",function(){b.focus();b.select()},false);b.addEventListener("keyup",function(e){e.keyCode==13&&a.finishChangeFunction!=null&&a.finishChangeFunction.call(this,a.getValue());a.setValue(b.value)},false);b.addEventListener("blur",function(){a.finishChangeFunction!=
+GUI.NumberController=function(){this.type="number";GUI.Controller.apply(this,arguments);var a=this,b=false,d=false,f=0,m=0,k=arguments[3],h=arguments[4],n=arguments[5];n||(n=k!=undefined&&h!=undefined?(h-k)*0.01:1);var i=document.createElement("input");i.setAttribute("id",this.propertyName);i.setAttribute("type","text");i.setAttribute("value",this.getValue());n&&i.setAttribute("step",n);this.domElement.appendChild(i);var o;if(k!=undefined&&h!=undefined){o=new GUI.Slider(this,k,h,n,this.getValue());
+this.domElement.appendChild(o.domElement)}i.addEventListener("blur",function(){var e=parseFloat(this.value);isNaN(e)||a.setValue(e)},false);i.addEventListener("mousewheel",function(e){e.preventDefault();a.setValue(a.getValue()+Math.abs(e.wheelDeltaY)/e.wheelDeltaY*n);return false},false);i.addEventListener("mousedown",function(e){m=f=e.pageY;d=true;document.addEventListener("mousemove",p,false);document.addEventListener("mouseup",g,false)},false);i.addEventListener("keydown",function(e){switch(e.keyCode){case 13:e=
+parseFloat(this.value);a.setValue(e);break;case 38:e=a.getValue()+n;a.setValue(e);break;case 40:e=a.getValue()-n;a.setValue(e)}},false);var g=function(){document.removeEventListener("mousemove",p,false);GUI.makeSelectable(a.parent.domElement);GUI.makeSelectable(i);if(d&&!b){i.focus();i.select()}if(o)o.domElement.className=o.domElement.className.replace(" active","");d=b=false;a.finishChangeFunction!=null&&a.finishChangeFunction.call(this,a.getValue());document.removeEventListener("mouseup",g,false)},
+p=function(e){b=true;e.preventDefault();GUI.makeUnselectable(a.parent.domElement);GUI.makeUnselectable(i);if(o)o.domElement.className+=" active";m=f;f=e.pageY;e=m-f;e=a.getValue()+e*n;a.setValue(e);return false};this.options=function(){a.noSlider();a.domElement.removeChild(i);return GUI.Controller.prototype.options.apply(this,arguments)};this.noSlider=function(){o&&a.domElement.removeChild(o.domElement);return this};this.setValue=function(e){e=parseFloat(e);if(k!=undefined&&e<=k)e=k;else if(h!=undefined&&
+e>=h)e=h;return GUI.Controller.prototype.setValue.call(this,e)};this.updateDisplay=function(){i.value=GUI.roundToDecimal(a.getValue(),4);if(o)o.value=a.getValue()}};GUI.extendController(GUI.NumberController);
+GUI.StringController=function(){this.type="string";var a=this;GUI.Controller.apply(this,arguments);var b=document.createElement("input"),d=this.getValue();b.setAttribute("value",d);b.setAttribute("spellcheck","false");this.domElement.addEventListener("mouseup",function(){b.focus();b.select()},false);b.addEventListener("keyup",function(f){f.keyCode==13&&a.finishChangeFunction!=null&&a.finishChangeFunction.call(this,a.getValue());a.setValue(b.value)},false);b.addEventListener("blur",function(){a.finishChangeFunction!=
 null&&a.finishChangeFunction.call(this,a.getValue())},false);this.updateDisplay=function(){b.value=a.getValue()};this.options=function(){a.domElement.removeChild(b);return GUI.Controller.prototype.options.apply(this,arguments)};this.domElement.appendChild(b)};GUI.extendController(GUI.StringController);

+ 3 - 3
examples/misc_sound.html

@@ -235,14 +235,14 @@
 					postprocessing.materialConvolution.uniforms.tDiffuse.texture = postprocessing.rtTexture1;
 					postprocessing.materialConvolution.uniforms.uImageIncrement.value = postprocessing.blurx;
 
-					renderer.render( postprocessing.scene, postprocessing.camera, postprocessing.rtTexture2 );
+					renderer.render( postprocessing.scene, postprocessing.camera, postprocessing.rtTexture2, true );
 
 					// Render quad with blured scene into texture (convolution pass 2)
 
 					postprocessing.materialConvolution.uniforms.tDiffuse.texture = postprocessing.rtTexture2;
 					postprocessing.materialConvolution.uniforms.uImageIncrement.value = postprocessing.blury;
 
-					renderer.render( postprocessing.scene, postprocessing.camera, postprocessing.rtTexture3 );
+					renderer.render( postprocessing.scene, postprocessing.camera, postprocessing.rtTexture3, true );
 
 					// Render original scene with superimposed blur to texture
 
@@ -251,7 +251,7 @@
 					postprocessing.materialScreen.uniforms.tDiffuse.texture = postprocessing.rtTexture3;
 					postprocessing.materialScreen.uniforms.opacity.value = 1.3;
 
-					renderer.render( postprocessing.scene, postprocessing.camera, postprocessing.rtTexture1 );
+					renderer.render( postprocessing.scene, postprocessing.camera, postprocessing.rtTexture1, false );
 
 					// Render to screen
 

+ 3 - 3
examples/webgl_lines_colors.html

@@ -307,14 +307,14 @@
 				materialConvolution.uniforms.tDiffuse.texture = rtTexture1;
 				materialConvolution.uniforms.uImageIncrement.value = blurx;
 
-				renderer.render( sceneScreen, cameraOrtho, rtTexture2 );
+				renderer.render( sceneScreen, cameraOrtho, rtTexture2, true );
 
 				// Render quad with blured scene into texture (convolution pass 2)
 
 				materialConvolution.uniforms.tDiffuse.texture = rtTexture2;
 				materialConvolution.uniforms.uImageIncrement.value = blury;
 
-				renderer.render( sceneScreen, cameraOrtho, rtTexture3 );
+				renderer.render( sceneScreen, cameraOrtho, rtTexture3, true );
 
 				// Render original scene with superimposed blur to texture
 
@@ -323,7 +323,7 @@
 				materialScreen.uniforms.tDiffuse.texture = rtTexture3;
 				materialScreen.uniforms.opacity.value = 1.3;
 
-				renderer.render( sceneScreen, cameraOrtho, rtTexture1 );
+				renderer.render( sceneScreen, cameraOrtho, rtTexture1, false );
 
 				// Render to screen
 

+ 3 - 3
examples/webgl_materials_video.html

@@ -337,14 +337,14 @@
 					postprocessing.materialConvolution.uniforms.tDiffuse.texture = postprocessing.rtTexture1;
 					postprocessing.materialConvolution.uniforms.uImageIncrement.value = postprocessing.blurx;
 
-					renderer.render( postprocessing.scene, postprocessing.camera, postprocessing.rtTexture2 );
+					renderer.render( postprocessing.scene, postprocessing.camera, postprocessing.rtTexture2, true );
 
 					// Render quad with blured scene into texture (convolution pass 2)
 
 					postprocessing.materialConvolution.uniforms.tDiffuse.texture = postprocessing.rtTexture2;
 					postprocessing.materialConvolution.uniforms.uImageIncrement.value = postprocessing.blury;
 
-					renderer.render( postprocessing.scene, postprocessing.camera, postprocessing.rtTexture3 );
+					renderer.render( postprocessing.scene, postprocessing.camera, postprocessing.rtTexture3, true );
 
 					// Render original scene with superimposed blur to texture
 
@@ -353,7 +353,7 @@
 					postprocessing.materialScreen.uniforms.tDiffuse.texture = postprocessing.rtTexture3;
 					postprocessing.materialScreen.uniforms.opacity.value = 1.3;
 
-					renderer.render( postprocessing.scene, postprocessing.camera, postprocessing.rtTexture1 );
+					renderer.render( postprocessing.scene, postprocessing.camera, postprocessing.rtTexture1, false );
 
 					// Render to screen
 

+ 4 - 4
examples/webgl_postprocessing.html

@@ -284,20 +284,20 @@
 
 				// model
 
-				renderer.render( sceneModel, cameraPerspective, rtTexture1 );
+				renderer.render( sceneModel, cameraPerspective, rtTexture1, false );
 
 				// Render quad with blured scene into texture (convolution pass 1)
 
 				quadScreen.materials = [ materialConvolution ];
 				materialConvolution.uniforms.tDiffuse.texture = rtTexture1;
 				materialConvolution.uniforms.uImageIncrement.value = blurx;
-				renderer.render( sceneScreen, cameraOrtho, rtTexture2 );
+				renderer.render( sceneScreen, cameraOrtho, rtTexture2, true );
 
 				// Render quad with blured scene into texture (convolution pass 2)
 
 				materialConvolution.uniforms.tDiffuse.texture = rtTexture2;
 				materialConvolution.uniforms.uImageIncrement.value = blury;
-				renderer.render( sceneScreen, cameraOrtho, rtTexture3 );
+				renderer.render( sceneScreen, cameraOrtho, rtTexture3, true );
 
 				// Render original scene with superimposed blur into texture
 
@@ -305,7 +305,7 @@
 
 				materialScreen.uniforms.tDiffuse.texture = rtTexture3;
 				materialScreen.uniforms.opacity.value = 1.0;
-				renderer.render( sceneScreen, cameraOrtho, rtTexture1 );
+				renderer.render( sceneScreen, cameraOrtho, rtTexture1, false );
 
 				// Render final scene to the screen with film shader
 

+ 3 - 3
examples/webgl_ribbons.html

@@ -332,14 +332,14 @@
 					postprocessing.materialConvolution.uniforms.tDiffuse.texture = postprocessing.rtTexture1;
 					postprocessing.materialConvolution.uniforms.uImageIncrement.value = postprocessing.blurx;
 
-					renderer.render( postprocessing.scene, postprocessing.camera, postprocessing.rtTexture2 );
+					renderer.render( postprocessing.scene, postprocessing.camera, postprocessing.rtTexture2, true );
 
 					// Render quad with blured scene into texture (convolution pass 2)
 
 					postprocessing.materialConvolution.uniforms.tDiffuse.texture = postprocessing.rtTexture2;
 					postprocessing.materialConvolution.uniforms.uImageIncrement.value = postprocessing.blury;
 
-					renderer.render( postprocessing.scene, postprocessing.camera, postprocessing.rtTexture3 );
+					renderer.render( postprocessing.scene, postprocessing.camera, postprocessing.rtTexture3, true );
 
 					// Render original scene with superimposed blur to texture
 
@@ -348,7 +348,7 @@
 					postprocessing.materialScreen.uniforms.tDiffuse.texture = postprocessing.rtTexture3;
 					postprocessing.materialScreen.uniforms.opacity.value = 1.2;
 
-					renderer.render( postprocessing.scene, postprocessing.camera, postprocessing.rtTexture1 );
+					renderer.render( postprocessing.scene, postprocessing.camera, postprocessing.rtTexture1, false );
 
 					// Render to screen
 

+ 2 - 1
src/renderers/WebGLRenderer.js

@@ -1442,10 +1442,11 @@ THREE.WebGLRenderer = function ( parameters ) {
 			_gl.useProgram( program );
 			_oldProgram = program;
 
-			_gl.uniformMatrix4fv( p_uniforms.projectionMatrix, false, _projectionMatrixArray );
 
 		}
 
+		_gl.uniformMatrix4fv( p_uniforms.projectionMatrix, false, _projectionMatrixArray );
+
 		// refresh uniforms common to several materials
 
 		if ( fog && (

部分文件因为文件数量过多而无法显示