Log in or register to post comments

[UWP] BackgroundPlaneBehaviour material texture contains no data

May 9, 2018 - 4:15am #1

Vuforia SDK Version: 7.1.31 -

Description with steps to reproduce:

Description: When trying to access the background plane material texture on UWP, the texture always contains no data. This will not be the case in the editor in Windows. I have even installed Unity on the target device and run it through the editor, and the texture does contain data. Only once the app is built for UWP does the texture contain no data.

Reproduction:

  • Create a canvas with a raw image on it
  • Access the background plane material through BackgroundPlaneBehaviour.Material.mainTexture
  • Create a new Texture2D and set the pixels to the pixels of the texture of the background plane
  • Set the raw image texture to this newly created texture
  • Build the app for UWP and run it.
  • The texture will contain no data and appear blank.

Here is code that I have used to reproduce it:

// Store the background texture as a texture 2D
Texture2D backgroundPlaneTexture = (Texture2D)backgroundPlaneBehaviour.Material.mainTexture;

// Create a new texture2D from the background texture
Texture2D texture = new Texture2D(backgroundPlaneTexture.width, backgroundPlaneTexture.height);
texture.SetPixels(backgroundPlaneTexture.GetPixels());
texture.Apply();

// Apply the texture to the raw image for visualisation of the problem
if (texture)
{ 
    ImageCapture.texture = texture;
}

Development OS (Mac OS X, Windows, Linux): Windows -

Mobile OS and Version: UWP, Version 10, Build 17134 -

Mobile Device Manufacturer and Model name: Microsoft Surface Pro 4 -

Do the Vuforia Sample Applications show the same behavior?: N/A

Log in or register to post comments