CanvasTexture.html 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <base href="../../../" />
  6. <script src="page.js"></script>
  7. <link type="text/css" rel="stylesheet" href="page.css" />
  8. </head>
  9. <body>
  10. [page:Texture] &rarr;
  11. <h1>[name]</h1>
  12. <p class="desc">
  13. Creates a texture from a canvas element.<br /><br />
  14. This is almost the same as the base [page:Texture Texture] class, except
  15. that it sets [page:Texture.needsUpdate needsUpdate] to `true` immediately.
  16. </p>
  17. <h2>Constructor</h2>
  18. <h3>
  19. [name]( [param:HTMLElement canvas], [param:Constant mapping],
  20. [param:Constant wrapS], [param:Constant wrapT], [param:Constant magFilter],
  21. [param:Constant minFilter], [param:Constant format],
  22. [param:Constant type], [param:Number anisotropy] )
  23. </h3>
  24. <p>
  25. [page:HTMLElement canvas] -- The HTML canvas element from which to load
  26. the texture. <br />
  27. [page:Constant mapping] -- How the image is applied to the object. An
  28. object type of [page:Textures THREE.UVMapping]. See [page:Textures mapping constants] for other choices.<br />
  29. [page:Constant wrapS] -- The default is [page:Textures THREE.ClampToEdgeWrapping].
  30. See [page:Textures wrap mode constants] for
  31. other choices.<br />
  32. [page:Constant wrapT] -- The default is [page:Textures THREE.ClampToEdgeWrapping].
  33. See [page:Textures wrap mode constants] for
  34. other choices.<br />
  35. [page:Constant magFilter] -- How the texture is sampled when a texel
  36. covers more than one pixel. The default is [page:Textures THREE.LinearFilter].
  37. See [page:Textures magnification filter constants]
  38. for other choices.<br />
  39. [page:Constant minFilter] -- How the texture is sampled when a texel
  40. covers less than one pixel. The default is [page:Textures THREE.LinearMipmapLinearFilter].
  41. See [page:Textures minification filter constants] for other choices.<br />
  42. [page:Constant format] -- The format used in the texture. See
  43. [page:Textures format constants] for other choices.<br />
  44. [page:Constant type] -- Default is [page:Textures THREE.UnsignedByteType].
  45. See [page:Textures type constants] for other choices.<br />
  46. [page:Number anisotropy] -- The number of samples taken along the axis
  47. through the pixel that has the highest density of texels. By default, this
  48. value is `1`. A higher value gives a less blurry result than a basic mipmap,
  49. at the cost of more texture samples being used. Use
  50. [page:WebGLrenderer.getMaxAnisotropy renderer.getMaxAnisotropy]() to find
  51. the maximum valid anisotropy value for the GPU; this value is usually a
  52. power of 2.<br /><br />
  53. </p>
  54. <h2>Properties</h2>
  55. <p>See the base [page:Texture Texture] class for common properties.</p>
  56. <h3>[property:Boolean isCanvasTexture]</h3>
  57. <p>Read-only flag to check if a given object is of type [name].</p>
  58. <h3>[property:Boolean needsUpdate]</h3>
  59. <p>True by default. This is required so that the canvas data is loaded.</p>
  60. <h2>Methods</h2>
  61. <p>See the base [page:Texture Texture] class for common methods.</p>
  62. <h2>Source</h2>
  63. <p>
  64. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  65. </p>
  66. </body>
  67. </html>