[Unity] TextureSource leads to black image on Android
Hi,
the following setup leads to a problem when setting a texture (video) as Image.Source programmatically:
Unity 5.6.0p1
Noesis 2
Android (Problem appears when deployed to an Android device)
An Image becomes black when setting a Texture as Image.Source on Android with Noesis 2
-> the same setup works fine in the Unity Editor
-> it works fine in the Unity Editor AND on the device using Noesis 1.2.6f5
To wrap it up: It only didn't work using Noesis2 on the Android device - We tried different devices and rendered the texture on a cube to check if it's okay.
the following setup leads to a problem when setting a texture (video) as Image.Source programmatically
Code: Select all
img.Source = new TextureSource(tex);
Unity 5.6.0p1
Noesis 2
Android (Problem appears when deployed to an Android device)
An Image becomes black when setting a Texture as Image.Source on Android with Noesis 2
-> the same setup works fine in the Unity Editor
-> it works fine in the Unity Editor AND on the device using Noesis 1.2.6f5
To wrap it up: It only didn't work using Noesis2 on the Android device - We tried different devices and rendered the texture on a cube to check if it's okay.
-
sfernandez
Site Admin
- Posts: 3154
- Joined:
Re: [Unity] TextureSource leads to black image on Android
Hi,
I tested the following sample in android and it worked fine:
Could you please try it? If it works we will add more complexity to see when it starts to fail.
I tested the following sample in android and it worked fine:
Code: Select all
<Grid
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Image x:Name="image" Margin="100"/>
</Grid>
Code: Select all
using UnityEngine;
public class TestBehavior : MonoBehaviour
{
void Start ()
{
var tex = Resources.Load<Texture2D>("Images/melon1"); // or any other image from your project
var gui = GetComponent<NoesisView>();
var image = (Noesis.Image)gui.Content.FindName("image");
image.Source = new Noesis.TextureSource(tex);
}
}
Re: [Unity] TextureSource leads to black image on Android
Hi,
I tested your sample which also leads to a black screen on our test device (Samsung Galaxy Tab 4 7.0 http://www.gsmarena.com/samsung_galaxy_ ... 0-6251.php).
Further I got the following error from the Android log:
It works fine on devices which support OpenGLES 3 (tested it on an ASUS Nexus 7 (2013) and on a Samsung I9505 Galaxy S4).
After some testing I found out it depends on the image import settings if it's completely black on the OpenGLES2 device:
- "Generate Mip Maps" unchecked -> black image
- "Generate Mip Maps" checked -> image distorted and flipped
I uploaded the screenshots and the original image to: https://www.dropbox.com/sh/0hal8rss7sd1 ... sB9Ra?dl=0
I tested your sample which also leads to a black screen on our test device (Samsung Galaxy Tab 4 7.0 http://www.gsmarena.com/samsung_galaxy_ ... 0-6251.php).
Further I got the following error from the Android log:
Code: Select all
04-24 09:18:15.456: E/Unity(4941): (Filename: ./Runtime/GfxDevice/opengles/GfxDeviceGLES.cpp Line: 371)
04-24 09:18:15.466: E/Unity(4941): OPENGL NATIVE PLUG-IN ERROR: GL_INVALID_ENUM: enum argument out of range
After some testing I found out it depends on the image import settings if it's completely black on the OpenGLES2 device:
- "Generate Mip Maps" unchecked -> black image
- "Generate Mip Maps" checked -> image distorted and flipped
I uploaded the screenshots and the original image to: https://www.dropbox.com/sh/0hal8rss7sd1 ... sB9Ra?dl=0
Re: [Unity] TextureSource leads to black image on Android
Does the texture work in Unity without using Noesis? Because, this error seems to indicate that the problem is located in Unity itself. And in fact, we no longer create textures, we reuse the handles created by Unity.
Code: Select all
(Filename: ./Runtime/GfxDevice/opengles/GfxDeviceGLES.cpp Line: 371)
Re: [Unity] TextureSource leads to black image on Android
The texture works fine in Unity (and on the OpenGLES2 device), I tried the texture as Sprite as well as setting the texture in code:
Seems the error message I posted isn't directly related to this issue.
Code: Select all
Cube.GetComponent<Renderer>().material.mainTexture = tex;
Seems the error message I posted isn't directly related to this issue.
Re: [Unity] TextureSource leads to black image on Android
Could you create a ticket so that we can send you a debug version of Noesis? (you already created #0001060 but this seems a different problem although probably related).
Re: [Unity] TextureSource leads to black image on Android
Issue created (https://bugs.noesisengine.com/view.php?id=1062) if someone wants to track the progress.
Who is online
Users browsing this forum: Ahrefs [Bot] and 2 guests