-
RenderTexture 当作为 Camera.targetTexture 时,在某些安卓手机或模拟器无法显示
Camera.clearFlags 必须为 CameraClearFlags.Depth ,CameraClearFlags.Nothing 时会不显示 -
RenderTexture转Texture2D
/// <summary> RenderTexture转Texture2D </summary>
private Texture2D RenderTexture2Texture2D(RenderTexture rt){
RenderTexture preRT=RenderTexture.active;
RenderTexture.active=rt;
Texture2D tex=new Texture2D(rt.width,rt.height,TextureFormat.ARGB32,false);
tex.ReadPixels(new Rect(0,0,rt.width,rt.height),0,0);
tex.Apply();
RenderTexture.active=preRT;
return tex;
}