Version: 2018.2
public IntPtr GetNativeIndexBufferPtr ();

戻り値

IntPtr 基底のグラフィックス API インデックスバッファへのポインター

説明

インデックスバッファへのネイティブ (規定のグラフィックス API) ポインターを探します。

Use this function to retrieve a pointer/handle corresponding to the Mesh index buffer, as it is represented in the native graphics API. This can be used to enable Mesh manipulation from native code plugins.

Index buffer data is either 16 or 32 bit per index, depending on indexFormat. The layout of the index buffer otherwise depends on the MeshTopology that is used (see SetIndices). The most common case is Meshes composed of triangle lists, which have index buffers with three indices per triangle.

The type of data returned depends on the underlying graphics API:
- IDirect3DIndexBuffer9 on D3D9
- ID3D11Buffer on D3D11
- ID3D12Resource on D3D12
- buffer "name" (as GLuint) on OpenGL/ES
- id<MTLBuffer> on Metal


For most use cases (when writing Mesh data from native code), you need to mark the Mesh as "dynamic" (see MarkDynamic) before getting the native buffer pointer. Generally this switches the buffers to be CPU-writable.

マルチスレッドレンダリングをしようするときにこの関数を呼び出しすると、レンダリングはレンダリングスレッド (速度の遅い操作) と同期します。そのため、必要なバッファポインターをイニシャライゼ―ション時にのみ設定するのが効率的です。

See Also: Native code plugins, GetNativeVertexBufferPtr, SetIndices.

Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961