| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- <!DOCTYPE html>
- <html lang="zh">
- <head>
- <meta charset="utf-8" />
- <base href="../../../" />
- <script src="page.js"></script>
- <link type="text/css" rel="stylesheet" href="page.css" />
- </head>
- <body>
- <h1>纹理源([name])</h1>
- <p class="desc">
- 表示纹理的数据源。
- </p>
- <h2>构造函数</h2>
- <h3>[name]( [param:Any data] )</h3>
- <p>
- [page:Any data] -- 纹理的数据定义。默认值为 `null`。
- </p>
- <h2>属性</h2>
- <h3>[property:Any data]</h3>
- <p>
- 纹理的实际数据。此属性的类型取决于使用此实例的纹理。
- </p>
- <h3>[property:Boolean isCubeTexture]</h3>
- <p>
- 只读属性,用于检查给定对象是否为[name]类型。
- </p>
- <h3>[property:Boolean needsUpdate]</h3>
- <p>
- 当该属性设置为 `true` 时,引擎会为纹理分配内存(如果需要),并在下次使用源时触发实际纹理上传到 GPU。
- </p>
- <h3>[property:Boolean dataReady]</h3>
- <p>
- 此属性仅在 [page:.needUpdate] 设置为 `true` 时有效,并可更好地控制纹理数据的处理方式。
- 当 `dataReady` 设置为 `false` 时,引擎会执行内存分配(如有必要),但不会将数据传输到 GPU 内存中。默认值为 `true`。
- </p>
- <h3>[property:String uuid]</h3>
- <p>
- 该对象实例的 [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID]。
- 这个值是自动分配的,因此不应当对其进行编辑。
- </p>
- <h3>[property:Integer version]</h3>
- <p>
- 从 *0* 开始,计算 [page:Source.needsUpdate .needsUpdate] 设置为 *true* 的次数。
- </p>
- <h2>方法</h2>
- <h3>[method:Object toJSON]( [param:Object meta] )</h3>
- <p>
- meta -- 包含元数据的可选对象。<br />
- 将数据源转换为 three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format]。
- </p>
- <h2>源代码</h2>
- <p>
- [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
- </p>
- </body>
- </html>
|