You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unity Version : Unity2020.3.18
ARFoundation Version : 4.2.1
ARCore XR Plugin 4.2.1
Platform : Android
I Get the ARCamera Image Real-time, Render to a RenderTexture, then ReadPixels from the RenderTexture ,and set to a RawImage , unfortunately, the RawImage flickers color .
follow is my code:
`
public Camera cam;
public RawImage img;
private Texture2D renderResult = null;
public RenderTexture camRT;
#region GPU
private RenderTexture mRenderTexture;
private void Update()
{
if (mRenderTexture == null)
{
RenderTextureDescriptor renderTextureDes = new RenderTextureDescriptor(480, 640, RenderTextureFormat.BGRA32);
mRenderTexture = RenderTexture.GetTemporary(renderTextureDes);
}
cam.targetTexture = mRenderTexture;
cam.Render();
RenderTexture.active = mRenderTexture;
if (renderResult == null)
renderResult = new Texture2D(480, 640, TextureFormat.RGB24, false);
renderResult.ReadPixels(new Rect(0, 0, mRenderTexture.width, mRenderTexture.height), 0, 0);
renderResult.Apply();
img.texture = renderResult;
cam.targetTexture = null;
RenderTexture.active = null;
}
#endregion`
it like flicker every few frames . It's too strange . and it works fine on ios devices. just error on android devices . has anyone had this problem? and how to solve this problem?
i take some photos :
The text was updated successfully, but these errors were encountered:
@tdmowrer please helps me . This problem has puzzled me for a long time. thanks a lot !
hasionerin
changed the title
[Bug]Render the ARCamera screen to a RenderTexture, Set RenderTexture to a RawImage , flickers color
[Bug] Get the ARCamera image to a RenderTexture, ReadPixels from the RenderTexture then set to a RawImage , flickers color ???
Jun 14, 2022
Unity Version : Unity2020.3.18
ARFoundation Version : 4.2.1
ARCore XR Plugin 4.2.1
Platform : Android
I Get the ARCamera Image Real-time, Render to a RenderTexture, then ReadPixels from the RenderTexture ,and set to a RawImage , unfortunately, the RawImage flickers color .
follow is my code:
`
it like flicker every few frames . It's too strange . and it works fine on ios devices. just error on android devices . has anyone had this problem? and how to solve this problem?
i take some photos :
The text was updated successfully, but these errors were encountered: