VideoFrameTexture.html 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <!DOCTYPE html>
  2. <html lang="zh">
  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:VideoTexture] &rarr;
  11. <h1>视频帧纹理([name])</h1>
  12. <p class="desc">
  13. 此类可用作定义视频数据的另一种方式。与 `VideoTexture` 类似,[name] 不需要使用 `HTMLVideoElement` 实例,而是需要通过 [page:.setFrame setFrame]() 手动定义每一帧。
  14. 此模块的一个典型用例是使用 WebCodecs API 解码视频帧。
  15. </p>
  16. <h2>代码示例</h2>
  17. <code>
  18. const texture = new THREE.VideoFrameTexture();
  19. texture.setFrame( frame );
  20. </code>
  21. <h2>例子</h2>
  22. <p>
  23. [example:webgpu_video_frame video / frame]
  24. </p>
  25. <h2>构造函数</h2>
  26. <h3>
  27. [name]( [param:Constant mapping], [param:Constant wrapS],
  28. [param:Constant wrapT], [param:Constant magFilter], [param:Constant minFilter],
  29. [param:Constant format], [param:Constant type], [param:Number anisotropy] )
  30. </h3>
  31. <p>
  32. [page:Constant mapping] -- 纹理贴图将被如何应用(映射)到物体上,它是[page:Textures THREE.UVMapping]中的对象类型。
  33. 请参阅[page:Textures mapping constants](映射模式常量)来了解其他选项。<br />
  34. [page:Constant wrapS] -- 默认值是[page:Textures THREE.ClampToEdgeWrapping].
  35. 请参阅[page:Textures wrap mode constants](包裹模式常量)来了解其他选项。<br />
  36. [page:Constant wrapT] -- 默认值是[page:Textures THREE.ClampToEdgeWrapping].
  37. 请参阅[page:Textures wrap mode constants](包裹模式常量)来了解其他选项。<br />
  38. [page:Constant magFilter] -- 当一个纹素覆盖大于一个像素时,贴图将如何采样。
  39. 其默认值为[page:Textures THREE.LinearFilter]。请参阅[page:Textures magnification filter constants](放大滤镜常量)来了解其它选项。<br />
  40. [page:Constant minFilter] -- 当一个纹素覆盖小于一个像素时,贴图将如何采样。
  41. 其默认值为[page:Textures THREE.LinearFilter]。请参阅[page:Textures minification filter constants](缩小滤镜常量)来了解其它选项。<br />
  42. [page:Constant format] -- 默认值是 [page:Textures THREE.RGBAFormat]。
  43. 请参阅[page:Textures format constants](格式常量)来了解各个选项。<br />
  44. [page:Constant type] -- 默认值是 [page:Textures THREE.UnsignedByteType].
  45. 请参阅[page:Textures type constants](类型常量)来了解其他选项。<br />
  46. [page:Number anisotropy] -- 沿着轴,通过具有最高纹素密度的像素的采样数。
  47. 默认情况下,这个值为 `1`。设置一个较高的值将会比基本的mipmap产生更清晰的效果,代价是需要使用更多纹理样本。
  48. 使用[page:WebGLrenderer.getMaxAnisotropy renderer.getMaxAnisotropy]() 来查询GPU中各向异性的最大有效值;这个值通常是2的幂。<br /><br />
  49. </p>
  50. <h2>属性</h2>
  51. <p>共有属性请参见其基类[page:VideoTexture VideoTexture]。</p>
  52. <h3>[property:Boolean isVideoFrameTexture]</h3>
  53. <p>只读属性,用于检查给定对象是否为 [name] 类型。</p>
  54. <h2>方法</h2>
  55. <p>共有方法请参见其基类 [page:VideoTexture VideoTexture]。</p>
  56. <h3>[method:undefined setFrame]( [param:VideoFrame frame] )</h3>
  57. <p>
  58. 设置视频的当前帧。这将自动更新纹理,以便数据可用于渲染。
  59. </p>
  60. <h2>源码</h2>
  61. <p>
  62. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  63. </p>
  64. </body>
  65. </html>
粤ICP备19079148号