Texture.js 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /**
  2. * @author mr.doob / http://mrdoob.com/
  3. * @author alteredq / http://alteredqualia.com/
  4. * @author szimek / https://github.com/szimek/
  5. */
  6. THREE.Texture = function ( image, mapping, wrapS, wrapT, magFilter, minFilter ) {
  7. this.image = image;
  8. this.mapping = mapping !== undefined ? mapping : new THREE.UVMapping();
  9. this.wrapS = wrapS !== undefined ? wrapS : THREE.ClampToEdgeWrapping;
  10. this.wrapT = wrapT !== undefined ? wrapT : THREE.ClampToEdgeWrapping;
  11. this.magFilter = magFilter !== undefined ? magFilter : THREE.LinearFilter;
  12. this.minFilter = minFilter !== undefined ? minFilter : THREE.LinearMipMapLinearFilter;
  13. this.offset = new THREE.Vector2( 0, 0 );
  14. this.repeat = new THREE.Vector2( 1, 1 );
  15. this.needsUpdate = false;
  16. };
  17. THREE.Texture.prototype = {
  18. constructor: THREE.Texture,
  19. clone: function () {
  20. return new THREE.Texture( this.image, this.mapping, this.wrapS, this.wrapT, this.magFilter, this.minFilter );
  21. }
  22. };
  23. THREE.MultiplyOperation = 0;
  24. THREE.MixOperation = 1;
  25. // Wrapping modes
  26. THREE.RepeatWrapping = 0;
  27. THREE.ClampToEdgeWrapping = 1;
  28. THREE.MirroredRepeatWrapping = 2;
  29. // Filters
  30. THREE.NearestFilter = 3;
  31. THREE.NearestMipMapNearestFilter = 4;
  32. THREE.NearestMipMapLinearFilter = 5;
  33. THREE.LinearFilter = 6;
  34. THREE.LinearMipMapNearestFilter = 7;
  35. THREE.LinearMipMapLinearFilter = 8;
  36. // Types
  37. THREE.ByteType = 9;
  38. THREE.UnsignedByteType = 10;
  39. THREE.ShortType = 11;
  40. THREE.UnsignedShortType = 12;
  41. THREE.IntType = 13;
  42. THREE.UnsignedIntType = 14;
  43. THREE.FloatType = 15;
  44. // Formats
  45. THREE.AlphaFormat = 16;
  46. THREE.RGBFormat = 17;
  47. THREE.RGBAFormat = 18;
  48. THREE.LuminanceFormat = 19;
  49. THREE.LuminanceAlphaFormat = 20;
粤ICP备19079148号