CanvasTexture.html 3.0 KB

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