Преглед изворни кода

Fixed wrong GL parameter name.

alteredq пре 13 година
родитељ
комит
efee731b4c
3 измењених фајлова са 4 додато и 4 уклоњено
  1. 1 1
      build/Three.js
  2. 1 1
      build/custom/ThreeWebGL.js
  3. 2 2
      src/renderers/WebGLRenderer.js

+ 1 - 1
build/Three.js

@@ -262,7 +262,7 @@ case THREE.UnsignedShortType:return j.UNSIGNED_SHORT;case THREE.IntType:return j
 "mediump",A=void 0!==a.alpha?a.alpha:!0,F=void 0!==a.premultipliedAlpha?a.premultipliedAlpha:!0,J=void 0!==a.antialias?a.antialias:!1,K=void 0!==a.stencil?a.stencil:!0,Z=void 0!==a.preserveDrawingBuffer?a.preserveDrawingBuffer:!1,L=void 0!==a.clearColor?new THREE.Color(a.clearColor):new THREE.Color(0),O=void 0!==a.clearAlpha?a.clearAlpha:0,M=void 0!==a.maxLights?a.maxLights:4;this.domElement=D;this.context=null;this.autoUpdateScene=this.autoUpdateObjects=this.sortObjects=this.autoClearStencil=this.autoClearDepth=
 this.autoClearColor=this.autoClear=!0;this.shadowMapEnabled=this.physicallyBasedShading=this.gammaOutput=this.gammaInput=!1;this.shadowMapCullFrontFaces=this.shadowMapSoft=this.shadowMapAutoUpdate=!0;this.maxMorphTargets=8;this.autoScaleCubemaps=!0;this.renderPluginsPre=[];this.renderPluginsPost=[];this.info={memory:{programs:0,geometries:0,textures:0},render:{calls:0,vertices:0,faces:0,points:0}};var H=this,j,V=[],y=null,E=null,Q=-1,S=null,aa=0,ja=null,ga=null,T=null,ba=null,$=null,da=null,ha=null,
 Qa=null,ka=null,Ba=0,Ga=0,Ia=0,za=0,Ua=0,jb=0,cb=new THREE.Frustum,Sa=new THREE.Matrix4,Va=new THREE.Vector4,Ya=new THREE.Vector3,Ca={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[]}};j=function(){var a;try{if(!(a=D.getContext("experimental-webgl",{alpha:A,premultipliedAlpha:F,antialias:J,stencil:K,preserveDrawingBuffer:Z})))throw"Error creating WebGL context.";console.log(navigator.userAgent+" | "+a.getParameter(a.VERSION)+" | "+a.getParameter(a.VENDOR)+
-" | "+a.getParameter(a.RENDERER)+" | "+a.getParameter(a.SHADING_LANGUAGE_VERSION))}catch(b){console.error(b)}return a}();j.clearColor(0,0,0,1);j.clearDepth(1);j.clearStencil(0);j.enable(j.DEPTH_TEST);j.depthFunc(j.LEQUAL);j.frontFace(j.CCW);j.cullFace(j.BACK);j.enable(j.CULL_FACE);j.enable(j.BLEND);j.blendEquation(j.FUNC_ADD);j.blendFunc(j.SRC_ALPHA,j.ONE_MINUS_SRC_ALPHA);j.clearColor(L.r,L.g,L.b,O);this.context=j;var ya=j.getParameter(j.MAX_VERTEX_TEXTURE_IMAGE_UNITS);j.getParameter(j.TEXTURE_SIZE);
+" | "+a.getParameter(a.RENDERER)+" | "+a.getParameter(a.SHADING_LANGUAGE_VERSION))}catch(b){console.error(b)}return a}();j.clearColor(0,0,0,1);j.clearDepth(1);j.clearStencil(0);j.enable(j.DEPTH_TEST);j.depthFunc(j.LEQUAL);j.frontFace(j.CCW);j.cullFace(j.BACK);j.enable(j.CULL_FACE);j.enable(j.BLEND);j.blendEquation(j.FUNC_ADD);j.blendFunc(j.SRC_ALPHA,j.ONE_MINUS_SRC_ALPHA);j.clearColor(L.r,L.g,L.b,O);this.context=j;var ya=j.getParameter(j.MAX_VERTEX_TEXTURE_IMAGE_UNITS);j.getParameter(j.MAX_TEXTURE_SIZE);
 var la=j.getParameter(j.MAX_CUBE_MAP_TEXTURE_SIZE);this.getContext=function(){return j};this.supportsVertexTextures=function(){return 0<ya};this.setSize=function(a,b){D.width=a;D.height=b;this.setViewport(0,0,D.width,D.height)};this.setViewport=function(a,b,c,d){Ba=a;Ga=b;Ia=c;za=d;j.viewport(Ba,Ga,Ia,za)};this.setScissor=function(a,b,c,d){j.scissor(a,b,c,d)};this.enableScissorTest=function(a){a?j.enable(j.SCISSOR_TEST):j.disable(j.SCISSOR_TEST)};this.setClearColorHex=function(a,b){L.setHex(a);O=
 b;j.clearColor(L.r,L.g,L.b,O)};this.setClearColor=function(a,b){L.copy(a);O=b;j.clearColor(L.r,L.g,L.b,O)};this.getClearColor=function(){return L};this.getClearAlpha=function(){return O};this.clear=function(a,b,c){var d=0;if(void 0===a||a)d|=j.COLOR_BUFFER_BIT;if(void 0===b||b)d|=j.DEPTH_BUFFER_BIT;if(void 0===c||c)d|=j.STENCIL_BUFFER_BIT;j.clear(d)};this.clearTarget=function(a,b,c,d){this.setRenderTarget(a);this.clear(b,c,d)};this.addPostPlugin=function(a){a.init(this);this.renderPluginsPost.push(a)};
 this.addPrePlugin=function(a){a.init(this);this.renderPluginsPre.push(a)};this.deallocateObject=function(a){if(a.__webglInit)if(a.__webglInit=!1,delete a._modelViewMatrix,delete a._normalMatrixArray,delete a._modelViewMatrixArray,delete a._objectMatrixArray,a instanceof THREE.Mesh)for(var b in a.geometry.geometryGroups){var c=a.geometry.geometryGroups[b];j.deleteBuffer(c.__webglVertexBuffer);j.deleteBuffer(c.__webglNormalBuffer);j.deleteBuffer(c.__webglTangentBuffer);j.deleteBuffer(c.__webglColorBuffer);

+ 1 - 1
build/custom/ThreeWebGL.js

@@ -217,7 +217,7 @@ case THREE.UnsignedShortType:return g.UNSIGNED_SHORT;case THREE.IntType:return g
 this.autoClearColor=this.autoClear=!0;this.shadowMapEnabled=this.physicallyBasedShading=this.gammaOutput=this.gammaInput=!1;this.shadowMapCullFrontFaces=this.shadowMapSoft=this.shadowMapAutoUpdate=!0;this.maxMorphTargets=8;this.autoScaleCubemaps=!0;this.renderPluginsPre=[];this.renderPluginsPost=[];this.info={memory:{programs:0,geometries:0,textures:0},render:{calls:0,vertices:0,faces:0,points:0}};var D=this,g,lb=[],Z=null,oa=null,Q=-1,L=null,qa=0,va=null,ba=null,ya=null,Ca=null,Ma=null,mb=null,Sa=
 null,Pa=null,Na=null,zb=0,Fb=0,Pb=0,Ab=0,bc=0,cc=0,Gb=new THREE.Frustum,Ta=new THREE.Matrix4,Ua=new THREE.Vector4,Ia=new THREE.Vector3,dc={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[]}};g=function(){var a;try{if(!(a=H.getContext("experimental-webgl",{alpha:M,premultipliedAlpha:N,antialias:I,stencil:ia,preserveDrawingBuffer:ua})))throw"Error creating WebGL context.";console.log(navigator.userAgent+" | "+a.getParameter(a.VERSION)+
 " | "+a.getParameter(a.VENDOR)+" | "+a.getParameter(a.RENDERER)+" | "+a.getParameter(a.SHADING_LANGUAGE_VERSION))}catch(b){console.error(b)}return a}();g.clearColor(0,0,0,1);g.clearDepth(1);g.clearStencil(0);g.enable(g.DEPTH_TEST);g.depthFunc(g.LEQUAL);g.frontFace(g.CCW);g.cullFace(g.BACK);g.enable(g.CULL_FACE);g.enable(g.BLEND);g.blendEquation(g.FUNC_ADD);g.blendFunc(g.SRC_ALPHA,g.ONE_MINUS_SRC_ALPHA);g.clearColor(S.r,S.g,S.b,$);this.context=g;var ec=g.getParameter(g.MAX_VERTEX_TEXTURE_IMAGE_UNITS);
-g.getParameter(g.TEXTURE_SIZE);var tc=g.getParameter(g.MAX_CUBE_MAP_TEXTURE_SIZE);this.getContext=function(){return g};this.supportsVertexTextures=function(){return 0<ec};this.setSize=function(a,b){H.width=a;H.height=b;this.setViewport(0,0,H.width,H.height)};this.setViewport=function(a,b,c,d){zb=a;Fb=b;Pb=c;Ab=d;g.viewport(zb,Fb,Pb,Ab)};this.setScissor=function(a,b,c,d){g.scissor(a,b,c,d)};this.enableScissorTest=function(a){a?g.enable(g.SCISSOR_TEST):g.disable(g.SCISSOR_TEST)};this.setClearColorHex=
+g.getParameter(g.MAX_TEXTURE_SIZE);var tc=g.getParameter(g.MAX_CUBE_MAP_TEXTURE_SIZE);this.getContext=function(){return g};this.supportsVertexTextures=function(){return 0<ec};this.setSize=function(a,b){H.width=a;H.height=b;this.setViewport(0,0,H.width,H.height)};this.setViewport=function(a,b,c,d){zb=a;Fb=b;Pb=c;Ab=d;g.viewport(zb,Fb,Pb,Ab)};this.setScissor=function(a,b,c,d){g.scissor(a,b,c,d)};this.enableScissorTest=function(a){a?g.enable(g.SCISSOR_TEST):g.disable(g.SCISSOR_TEST)};this.setClearColorHex=
 function(a,b){S.setHex(a);$=b;g.clearColor(S.r,S.g,S.b,$)};this.setClearColor=function(a,b){S.copy(a);$=b;g.clearColor(S.r,S.g,S.b,$)};this.getClearColor=function(){return S};this.getClearAlpha=function(){return $};this.clear=function(a,b,c){var d=0;if(void 0===a||a)d|=g.COLOR_BUFFER_BIT;if(void 0===b||b)d|=g.DEPTH_BUFFER_BIT;if(void 0===c||c)d|=g.STENCIL_BUFFER_BIT;g.clear(d)};this.clearTarget=function(a,b,c,d){this.setRenderTarget(a);this.clear(b,c,d)};this.addPostPlugin=function(a){a.init(this);
 this.renderPluginsPost.push(a)};this.addPrePlugin=function(a){a.init(this);this.renderPluginsPre.push(a)};this.deallocateObject=function(a){if(a.__webglInit)if(a.__webglInit=!1,delete a._modelViewMatrix,delete a._normalMatrixArray,delete a._modelViewMatrixArray,delete a._objectMatrixArray,a instanceof THREE.Mesh)for(var b in a.geometry.geometryGroups){var c=a.geometry.geometryGroups[b];g.deleteBuffer(c.__webglVertexBuffer);g.deleteBuffer(c.__webglNormalBuffer);g.deleteBuffer(c.__webglTangentBuffer);
 g.deleteBuffer(c.__webglColorBuffer);g.deleteBuffer(c.__webglUVBuffer);g.deleteBuffer(c.__webglUV2Buffer);g.deleteBuffer(c.__webglSkinVertexABuffer);g.deleteBuffer(c.__webglSkinVertexBBuffer);g.deleteBuffer(c.__webglSkinIndicesBuffer);g.deleteBuffer(c.__webglSkinWeightsBuffer);g.deleteBuffer(c.__webglFaceBuffer);g.deleteBuffer(c.__webglLineBuffer);if(c.numMorphTargets)for(var d=0,e=c.numMorphTargets;d<e;d++)g.deleteBuffer(c.__webglMorphTargetsBuffers[d]);if(c.__webglCustomAttributesList)for(d in d=

+ 2 - 2
src/renderers/WebGLRenderer.js

@@ -162,7 +162,7 @@ THREE.WebGLRenderer = function ( parameters ) {
 	// GPU capabilities
 
 	var _maxVertexTextures = _gl.getParameter( _gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS ),
-	_maxTextureSize = _gl.getParameter( _gl.TEXTURE_SIZE ),
+	_maxTextureSize = _gl.getParameter( _gl.MAX_TEXTURE_SIZE ),
 	_maxCubemapSize = _gl.getParameter( _gl.MAX_CUBE_MAP_TEXTURE_SIZE );
 
 	// API
@@ -4589,7 +4589,7 @@ THREE.WebGLRenderer = function ( parameters ) {
 				}
 
 				_gl.uniform3fv( location, uniform._array );
-				
+
 			// array of THREE.Vector4
 
 			} else if( type == "v4v" ) {