Texture.js 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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.needsUpdate = false;
  14. };
  15. THREE.Texture.prototype = {
  16. clone: function () {
  17. return new THREE.Texture( this.image, this.mapping, this.wrapS, this.wrapT, this.magFilter, this.minFilter );
  18. }
  19. };
  20. THREE.MultiplyOperation = 0;
  21. THREE.MixOperation = 1;
  22. // Wrapping modes
  23. THREE.RepeatWrapping = 0;
  24. THREE.ClampToEdgeWrapping = 1;
  25. THREE.MirroredRepeatWrapping = 2;
  26. // Filters
  27. THREE.NearestFilter = 3;
  28. THREE.NearestMipMapNearestFilter = 4;
  29. THREE.NearestMipMapLinearFilter = 5;
  30. THREE.LinearFilter = 6;
  31. THREE.LinearMipMapNearestFilter = 7;
  32. THREE.LinearMipMapLinearFilter = 8;
  33. // Types
  34. THREE.ByteType = 9;
  35. THREE.UnsignedByteType = 10;
  36. THREE.ShortType = 11;
  37. THREE.UnsignedShortType = 12;
  38. THREE.IntType = 13;
  39. THREE.UnsignedIntType = 14;
  40. THREE.FloatType = 15;
  41. // Formats
  42. THREE.AlphaFormat = 16;
  43. THREE.RGBFormat = 17;
  44. THREE.RGBAFormat = 18;
  45. THREE.LuminanceFormat = 19;
  46. THREE.LuminanceAlphaFormat = 20;