From 7c7d4428f2038fc20ff9876f9cdaa52273c03f55 Mon Sep 17 00:00:00 2001 From: "Mr.doob" Date: Mon, 29 Aug 2011 05:18:25 +0200 Subject: [PATCH] Moved `src/materials/Mappings.js` inside `src/materials/Texture.js` Moved `src/materials/*Texture.js` to `src/textures/*Texture.js` --- build/Three.js | 16 ++++++++-------- build/custom/ThreeCanvas.js | 12 ++++++------ build/custom/ThreeWebGL.js | 13 ++++++------- examples/canvas_sandbox.html | 21 ++++++++++++--------- examples/misc_ubiquity_test.html | 20 +++++++++++--------- examples/webgl_geometries.html | 2 +- examples/webgl_sandbox.html | 21 ++++++++++++--------- src/materials/Mappings.js | 14 -------------- src/{materials => textures}/DataTexture.js | 0 src/{materials => textures}/Texture.js | 13 +++++++++++++ utils/build.py | 11 ++++------- 11 files changed, 73 insertions(+), 70 deletions(-) delete mode 100644 src/materials/Mappings.js rename src/{materials => textures}/DataTexture.js (100%) rename src/{materials => textures}/Texture.js (83%) diff --git a/build/Three.js b/build/Three.js index fdcc589b..95875006 100644 --- a/build/Three.js +++ b/build/Three.js @@ -84,9 +84,8 @@ THREE.Camera.prototype.update=function(b,c,e){if(this.useTarget)this.matrix.look THREE.AmbientLight.prototype.constructor=THREE.AmbientLight;THREE.DirectionalLight=function(b,c,e,f){THREE.Light.call(this,b);this.position=new THREE.Vector3(0,1,0);this.intensity=c||1;this.distance=e||0;this.castShadow=f!==void 0?f:!1};THREE.DirectionalLight.prototype=new THREE.Light;THREE.DirectionalLight.prototype.constructor=THREE.DirectionalLight;THREE.PointLight=function(b,c,e){THREE.Light.call(this,b);this.position=new THREE.Vector3;this.intensity=c||1;this.distance=e||0}; THREE.PointLight.prototype=new THREE.Light;THREE.PointLight.prototype.constructor=THREE.PointLight;THREE.SpotLight=function(b,c,e,f){THREE.Light.call(this,b);this.position=new THREE.Vector3(0,1,0);this.target=new THREE.Object3D;this.intensity=c||1;this.distance=e||0;this.castShadow=f!==void 0?f:!1};THREE.SpotLight.prototype=new THREE.Light;THREE.SpotLight.prototype.constructor=THREE.SpotLight; THREE.Material=function(b){this.id=THREE.MaterialCount++;b=b||{};this.opacity=b.opacity!==void 0?b.opacity:1;this.transparent=b.transparent!==void 0?b.transparent:!1;this.blending=b.blending!==void 0?b.blending:THREE.NormalBlending;this.depthTest=b.depthTest!==void 0?b.depthTest:!0;this.polygonOffset=b.polygonOffset!==void 0?b.polygonOffset:!1;this.polygonOffsetFactor=b.polygonOffsetFactor!==void 0?b.polygonOffsetFactor:0;this.polygonOffsetUnits=b.polygonOffsetUnits!==void 0?b.polygonOffsetUnits: -0;this.alphaTest=b.alphaTest!==void 0?b.alphaTest:0};THREE.MaterialCount=0;THREE.NoShading=0;THREE.FlatShading=1;THREE.SmoothShading=2;THREE.NoColors=0;THREE.FaceColors=1;THREE.VertexColors=2;THREE.NormalBlending=0;THREE.AdditiveBlending=1;THREE.SubtractiveBlending=2;THREE.MultiplyBlending=3;THREE.AdditiveAlphaBlending=4;THREE.CubeReflectionMapping=function(){};THREE.CubeRefractionMapping=function(){};THREE.LatitudeReflectionMapping=function(){};THREE.LatitudeRefractionMapping=function(){}; -THREE.SphericalReflectionMapping=function(){};THREE.SphericalRefractionMapping=function(){};THREE.UVMapping=function(){};THREE.LineBasicMaterial=function(b){THREE.Material.call(this,b);b=b||{};this.color=b.color!==void 0?new THREE.Color(b.color):new THREE.Color(16777215);this.linewidth=b.linewidth!==void 0?b.linewidth:1;this.linecap=b.linecap!==void 0?b.linecap:"round";this.linejoin=b.linejoin!==void 0?b.linejoin:"round";this.vertexColors=b.vertexColors?b.vertexColors:!1}; -THREE.LineBasicMaterial.prototype=new THREE.Material;THREE.LineBasicMaterial.prototype.constructor=THREE.LineBasicMaterial; +0;this.alphaTest=b.alphaTest!==void 0?b.alphaTest:0};THREE.MaterialCount=0;THREE.NoShading=0;THREE.FlatShading=1;THREE.SmoothShading=2;THREE.NoColors=0;THREE.FaceColors=1;THREE.VertexColors=2;THREE.NormalBlending=0;THREE.AdditiveBlending=1;THREE.SubtractiveBlending=2;THREE.MultiplyBlending=3;THREE.AdditiveAlphaBlending=4; +THREE.LineBasicMaterial=function(b){THREE.Material.call(this,b);b=b||{};this.color=b.color!==void 0?new THREE.Color(b.color):new THREE.Color(16777215);this.linewidth=b.linewidth!==void 0?b.linewidth:1;this.linecap=b.linecap!==void 0?b.linecap:"round";this.linejoin=b.linejoin!==void 0?b.linejoin:"round";this.vertexColors=b.vertexColors?b.vertexColors:!1};THREE.LineBasicMaterial.prototype=new THREE.Material;THREE.LineBasicMaterial.prototype.constructor=THREE.LineBasicMaterial; THREE.MeshBasicMaterial=function(b){THREE.Material.call(this,b);b=b||{};this.color=b.color!==void 0?new THREE.Color(b.color):new THREE.Color(16777215);this.map=b.map!==void 0?b.map:null;this.lightMap=b.lightMap!==void 0?b.lightMap:null;this.envMap=b.envMap!==void 0?b.envMap:null;this.combine=b.combine!==void 0?b.combine:THREE.MultiplyOperation;this.reflectivity=b.reflectivity!==void 0?b.reflectivity:1;this.refractionRatio=b.refractionRatio!==void 0?b.refractionRatio:0.98;this.shading=b.shading!== void 0?b.shading:THREE.SmoothShading;this.wireframe=b.wireframe!==void 0?b.wireframe:!1;this.wireframeLinewidth=b.wireframeLinewidth!==void 0?b.wireframeLinewidth:1;this.wireframeLinecap=b.wireframeLinecap!==void 0?b.wireframeLinecap:"round";this.wireframeLinejoin=b.wireframeLinejoin!==void 0?b.wireframeLinejoin:"round";this.vertexColors=b.vertexColors!==void 0?b.vertexColors:!1;this.skinning=b.skinning!==void 0?b.skinning:!1;this.morphTargets=b.morphTargets!==void 0?b.morphTargets:!1}; THREE.MeshBasicMaterial.prototype=new THREE.Material;THREE.MeshBasicMaterial.prototype.constructor=THREE.MeshBasicMaterial; @@ -103,11 +102,12 @@ b.fog!==void 0?b.fog:!1;this.lights=b.lights!==void 0?b.lights:!1;this.vertexCol THREE.ParticleBasicMaterial=function(b){THREE.Material.call(this,b);b=b||{};this.color=b.color!==void 0?new THREE.Color(b.color):new THREE.Color(16777215);this.map=b.map!==void 0?b.map:null;this.size=b.size!==void 0?b.size:1;this.sizeAttenuation=b.sizeAttenuation!==void 0?b.sizeAttenuation:!0;this.vertexColors=b.vertexColors!==void 0?b.vertexColors:!1};THREE.ParticleBasicMaterial.prototype=new THREE.Material;THREE.ParticleBasicMaterial.prototype.constructor=THREE.ParticleBasicMaterial; THREE.ParticleCanvasMaterial=function(b){THREE.Material.call(this,b);b=b||{};this.color=b.color!==void 0?new THREE.Color(b.color):new THREE.Color(16777215);this.program=b.program!==void 0?b.program:function(){}};THREE.ParticleCanvasMaterial.prototype=new THREE.Material;THREE.ParticleCanvasMaterial.prototype.constructor=THREE.ParticleCanvasMaterial;THREE.ParticleDOMMaterial=function(b){THREE.Material.call(this);this.domElement=b}; THREE.Texture=function(b,c,e,f,g,j){this.id=THREE.TextureCount++;this.image=b;this.mapping=c!==void 0?c:new THREE.UVMapping;this.wrapS=e!==void 0?e:THREE.ClampToEdgeWrapping;this.wrapT=f!==void 0?f:THREE.ClampToEdgeWrapping;this.magFilter=g!==void 0?g:THREE.LinearFilter;this.minFilter=j!==void 0?j:THREE.LinearMipMapLinearFilter;this.offset=new THREE.Vector2(0,0);this.repeat=new THREE.Vector2(1,1);this.needsUpdate=!1}; -THREE.Texture.prototype={constructor:THREE.Texture,clone:function(){var b=new THREE.Texture(this.image,this.mapping,this.wrapS,this.wrapT,this.magFilter,this.minFilter);b.offset.copy(this.offset);b.repeat.copy(this.repeat);return b}};THREE.TextureCount=0;THREE.MultiplyOperation=0;THREE.MixOperation=1;THREE.RepeatWrapping=0;THREE.ClampToEdgeWrapping=1;THREE.MirroredRepeatWrapping=2;THREE.NearestFilter=3;THREE.NearestMipMapNearestFilter=4;THREE.NearestMipMapLinearFilter=5;THREE.LinearFilter=6; -THREE.LinearMipMapNearestFilter=7;THREE.LinearMipMapLinearFilter=8;THREE.ByteType=9;THREE.UnsignedByteType=10;THREE.ShortType=11;THREE.UnsignedShortType=12;THREE.IntType=13;THREE.UnsignedIntType=14;THREE.FloatType=15;THREE.AlphaFormat=16;THREE.RGBFormat=17;THREE.RGBAFormat=18;THREE.LuminanceFormat=19;THREE.LuminanceAlphaFormat=20;THREE.DataTexture=function(b,c,e,f,g,j,h,k,m){THREE.Texture.call(this,null,g,j,h,k,m);this.image={data:b,width:c,height:e};this.format=f!==void 0?f:THREE.RGBAFormat}; -THREE.DataTexture.prototype=new THREE.Texture;THREE.DataTexture.prototype.constructor=THREE.DataTexture;THREE.DataTexture.prototype={clone:function(){var b=new THREE.DataTexture(this.data.slice(0),this.mapping,this.wrapS,this.wrapT,this.magFilter,this.minFilter);b.offset.copy(this.offset);b.repeat.copy(this.repeat);return b}};THREE.Particle=function(b){THREE.Object3D.call(this);this.materials=b instanceof Array?b:[b]};THREE.Particle.prototype=new THREE.Object3D; -THREE.Particle.prototype.constructor=THREE.Particle;THREE.ParticleSystem=function(b,c){THREE.Object3D.call(this);this.geometry=b;this.materials=c instanceof Array?c:[c];this.sortParticles=!1};THREE.ParticleSystem.prototype=new THREE.Object3D;THREE.ParticleSystem.prototype.constructor=THREE.ParticleSystem;THREE.Line=function(b,c,e){THREE.Object3D.call(this);this.geometry=b;this.materials=c instanceof Array?c:[c];this.type=e!=void 0?e:THREE.LineStrip};THREE.LineStrip=0;THREE.LinePieces=1; -THREE.Line.prototype=new THREE.Object3D;THREE.Line.prototype.constructor=THREE.Line; +THREE.Texture.prototype={constructor:THREE.Texture,clone:function(){var b=new THREE.Texture(this.image,this.mapping,this.wrapS,this.wrapT,this.magFilter,this.minFilter);b.offset.copy(this.offset);b.repeat.copy(this.repeat);return b}};THREE.TextureCount=0;THREE.MultiplyOperation=0;THREE.MixOperation=1;THREE.CubeReflectionMapping=function(){};THREE.CubeRefractionMapping=function(){};THREE.LatitudeReflectionMapping=function(){};THREE.LatitudeRefractionMapping=function(){}; +THREE.SphericalReflectionMapping=function(){};THREE.SphericalRefractionMapping=function(){};THREE.UVMapping=function(){};THREE.RepeatWrapping=0;THREE.ClampToEdgeWrapping=1;THREE.MirroredRepeatWrapping=2;THREE.NearestFilter=3;THREE.NearestMipMapNearestFilter=4;THREE.NearestMipMapLinearFilter=5;THREE.LinearFilter=6;THREE.LinearMipMapNearestFilter=7;THREE.LinearMipMapLinearFilter=8;THREE.ByteType=9;THREE.UnsignedByteType=10;THREE.ShortType=11;THREE.UnsignedShortType=12;THREE.IntType=13; +THREE.UnsignedIntType=14;THREE.FloatType=15;THREE.AlphaFormat=16;THREE.RGBFormat=17;THREE.RGBAFormat=18;THREE.LuminanceFormat=19;THREE.LuminanceAlphaFormat=20;THREE.DataTexture=function(b,c,e,f,g,j,h,k,m){THREE.Texture.call(this,null,g,j,h,k,m);this.image={data:b,width:c,height:e};this.format=f!==void 0?f:THREE.RGBAFormat};THREE.DataTexture.prototype=new THREE.Texture;THREE.DataTexture.prototype.constructor=THREE.DataTexture; +THREE.DataTexture.prototype={clone:function(){var b=new THREE.DataTexture(this.data.slice(0),this.mapping,this.wrapS,this.wrapT,this.magFilter,this.minFilter);b.offset.copy(this.offset);b.repeat.copy(this.repeat);return b}};THREE.Particle=function(b){THREE.Object3D.call(this);this.materials=b instanceof Array?b:[b]};THREE.Particle.prototype=new THREE.Object3D;THREE.Particle.prototype.constructor=THREE.Particle; +THREE.ParticleSystem=function(b,c){THREE.Object3D.call(this);this.geometry=b;this.materials=c instanceof Array?c:[c];this.sortParticles=!1};THREE.ParticleSystem.prototype=new THREE.Object3D;THREE.ParticleSystem.prototype.constructor=THREE.ParticleSystem;THREE.Line=function(b,c,e){THREE.Object3D.call(this);this.geometry=b;this.materials=c instanceof Array?c:[c];this.type=e!=void 0?e:THREE.LineStrip};THREE.LineStrip=0;THREE.LinePieces=1;THREE.Line.prototype=new THREE.Object3D; +THREE.Line.prototype.constructor=THREE.Line; THREE.Mesh=function(b,c){THREE.Object3D.call(this);this.geometry=b;this.materials=c&&c.length?c:[c];this.overdraw=!1;if(this.geometry&&(this.geometry.boundingSphere||this.geometry.computeBoundingSphere(),this.boundRadius=b.boundingSphere.radius,this.geometry.morphTargets.length)){this.morphTargetBase=-1;this.morphTargetForcedOrder=[];this.morphTargetInfluences=[];this.morphTargetDictionary={};for(var e=0;e - + - @@ -50,11 +49,11 @@ - - + + @@ -63,7 +62,6 @@ - @@ -75,6 +73,7 @@ + @@ -94,8 +93,11 @@ + + + @@ -106,10 +108,11 @@ - - - - + + + + + diff --git a/examples/misc_ubiquity_test.html b/examples/misc_ubiquity_test.html index 5c0c1712..0b489123 100644 --- a/examples/misc_ubiquity_test.html +++ b/examples/misc_ubiquity_test.html @@ -41,9 +41,7 @@ - - @@ -52,11 +50,11 @@ - - + + @@ -65,7 +63,6 @@ - @@ -77,6 +74,7 @@ + @@ -96,8 +94,11 @@ + + + @@ -108,10 +109,11 @@ - - - - + + + + + diff --git a/examples/webgl_geometries.html b/examples/webgl_geometries.html index 4fb6f873..ec2e0abd 100644 --- a/examples/webgl_geometries.html +++ b/examples/webgl_geometries.html @@ -51,7 +51,7 @@ scene.addLight( new THREE.AmbientLight( 0x404040 ) ); - light = new THREE.DirectionalLight( 0xffffff, 2.0 ); + light = new THREE.DirectionalLight( 0xffffff, 1 ); light.position.z = 1; scene.addLight( light ); diff --git a/examples/webgl_sandbox.html b/examples/webgl_sandbox.html index ab103874..d7e83626 100644 --- a/examples/webgl_sandbox.html +++ b/examples/webgl_sandbox.html @@ -58,9 +58,8 @@ - + - @@ -69,11 +68,11 @@ - - + + @@ -82,7 +81,6 @@ - @@ -94,6 +92,7 @@ + @@ -113,8 +112,11 @@ + + + @@ -125,10 +127,11 @@ - - - - + + + + + diff --git a/src/materials/Mappings.js b/src/materials/Mappings.js deleted file mode 100644 index b32d281d..00000000 --- a/src/materials/Mappings.js +++ /dev/null @@ -1,14 +0,0 @@ -/** - * @author mr.doob / http://mrdoob.com/ - */ - -THREE.CubeReflectionMapping = function () {}; -THREE.CubeRefractionMapping = function () {}; - -THREE.LatitudeReflectionMapping = function () {}; -THREE.LatitudeRefractionMapping = function () {}; - -THREE.SphericalReflectionMapping = function () {}; -THREE.SphericalRefractionMapping = function () {}; - -THREE.UVMapping = function () {}; diff --git a/src/materials/DataTexture.js b/src/textures/DataTexture.js similarity index 100% rename from src/materials/DataTexture.js rename to src/textures/DataTexture.js diff --git a/src/materials/Texture.js b/src/textures/Texture.js similarity index 83% rename from src/materials/Texture.js rename to src/textures/Texture.js index 279614a7..98e1b9b4 100644 --- a/src/materials/Texture.js +++ b/src/textures/Texture.js @@ -47,6 +47,19 @@ THREE.TextureCount = 0; THREE.MultiplyOperation = 0; THREE.MixOperation = 1; +// Mapping modes + +THREE.CubeReflectionMapping = function () {}; +THREE.CubeRefractionMapping = function () {}; + +THREE.LatitudeReflectionMapping = function () {}; +THREE.LatitudeRefractionMapping = function () {}; + +THREE.SphericalReflectionMapping = function () {}; +THREE.SphericalRefractionMapping = function () {}; + +THREE.UVMapping = function () {}; + // Wrapping modes THREE.RepeatWrapping = 0; diff --git a/utils/build.py b/utils/build.py index 70f41545..3c3d0582 100644 --- a/utils/build.py +++ b/utils/build.py @@ -37,7 +37,6 @@ COMMON_FILES = [ 'lights/PointLight.js', 'lights/SpotLight.js', 'materials/Material.js', -'materials/Mappings.js', 'materials/LineBasicMaterial.js', 'materials/MeshBasicMaterial.js', 'materials/MeshLambertMaterial.js', @@ -49,8 +48,8 @@ COMMON_FILES = [ 'materials/ParticleBasicMaterial.js', 'materials/ParticleCanvasMaterial.js', 'materials/ParticleDOMMaterial.js', -'materials/Texture.js', -'materials/DataTexture.js', +'textures/Texture.js', +'textures/DataTexture.js', 'objects/Particle.js', 'objects/ParticleSystem.js', 'objects/Line.js', @@ -144,7 +143,6 @@ CANVAS_FILES = [ 'lights/DirectionalLight.js', 'lights/PointLight.js', 'materials/Material.js', -'materials/Mappings.js', 'materials/LineBasicMaterial.js', 'materials/MeshBasicMaterial.js', 'materials/MeshLambertMaterial.js', @@ -154,7 +152,7 @@ CANVAS_FILES = [ 'materials/MeshFaceMaterial.js', 'materials/ParticleBasicMaterial.js', 'materials/ParticleCanvasMaterial.js', -'materials/Texture.js', +'textures/Texture.js', 'objects/Particle.js', 'objects/Line.js', 'objects/Mesh.js', @@ -268,7 +266,6 @@ WEBGL_FILES = [ 'lights/PointLight.js', 'lights/SpotLight.js', 'materials/Material.js', -'materials/Mappings.js', 'materials/LineBasicMaterial.js', 'materials/MeshBasicMaterial.js', 'materials/MeshLambertMaterial.js', @@ -278,7 +275,7 @@ WEBGL_FILES = [ 'materials/MeshFaceMaterial.js', 'materials/MeshShaderMaterial.js', 'materials/ParticleBasicMaterial.js', -'materials/Texture.js', +'textures/Texture.js', 'objects/Particle.js', 'objects/ParticleSystem.js', 'objects/Line.js',