public Texture2D GetRealityTexture() { if (realityTexture == null) { // Create a texture realityTexture = new Texture2D( ApiLimits.IMAGE_PROCESSING_WIDTH, ApiLimits.IMAGE_PROCESSING_HEIGHT, TextureFormat.RGBA32, false); // Set point filtering just so we can see the pixels clearly realityTexture.filterMode = FilterMode.Point; // Call Apply() so it's actually uploaded to the GPU realityTexture.Apply(); // Pass texture pointer to the plugin. bridge.SetManagedCameraTexture( realityTexture.GetNativeTexturePtr(), realityTexture.width, realityTexture.height); } return(realityTexture); }