首页 > 移动平台 > 详细

Unity RenderTexture 当作为 Camera.targetTexture 时,在某些安卓手机或模拟器无法显示

时间:2020-12-19 21:28:26      阅读:293      评论:0      收藏:0      [点我收藏+]

Camera.clearFlags 必须为 CameraClearFlags.Depth ,CameraClearFlags.Nothing 时会不显示

using UnityEngine;
using UnityEngine.UI;

public class Test:MonoBehaviour{
	
	public RawImage rawImage;
	public Camera cam;

	private RenderTexture m_renderTexture;
	
	private void Start(){
		m_renderTexture=new RenderTexture(512,512,16,RenderTextureFormat.ARGB32);

		rawImage.texture=m_renderTexture;
		cam.targetTexture=m_renderTexture;
		//必须为 CameraClearFlags.Depth ,CameraClearFlags.Nothing 时会不显示
		cam.clearFlags=CameraClearFlags.Depth;
	}
}

Unity RenderTexture 当作为 Camera.targetTexture 时,在某些安卓手机或模拟器无法显示

原文:https://www.cnblogs.com/kingBook/p/14160483.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!