Texture.js 1.6 KB

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