Cubemap.CreateExternalTexture

Switch to Manual
public static Cubemap CreateExternalTexture (int width, TextureFormat format, bool mipmap, IntPtr nativeTex);

Parameters

size该立方体贴图每个面的宽度和高度都应相同。
format底层立方体贴图对象的格式。
mipmap该立方体贴图是否有 Mipmap?
nativeTex原生立方体贴图纹理对象。

Description

使用外部创建的原生立方体贴图对象创建一个 Unity 立方体贴图。

This method is mostly useful for native code plugins that create platform specific cubemap texture objects outside of Unity, and need to use these cubemaps in Unity Scenes.

传递到 CreateExternalTexture 的参数应与该纹理的实际值匹配;底层纹理应为立方体贴图(2D 纹理将不起作用)。

Direct3D 类设备上的原生纹理对象是一个指向基本类型的指针,可通过该指针创建纹理 (D3D11 上为 ID3D11ShaderResourceView)。在 OpenGL/OpenGL ES 上为 GLuint。在 Metal 上为 id<MTLTexture>。

另请参阅:UpdateExternalTextureTexture.GetNativeTexturePtr