Unity将RenderTexture转化为Texture2D
来源:互联网 发布:成塔软件 编辑:程序博客网 时间:2024/05/22 01:53
RenderTexture和Texture2D同样继承于Texture,两者都可以和Texture之间相互转化,但是两者之间却不能简单的进行强制转换,我们可以通过以下方式将RenderTexture转化为Texture2D:
int width = renderTexture.width;int height = renderTexture.height;Texture2D texture2D = new Texture2D(width, height, TextureFormat.ARGB32, false);RenderTexture.active = renderTexture;texture2D.ReadPixels(new Rect(0, 0, width, height), 0, 0);texture2D.Apply();
0 0
- Unity将RenderTexture转化为Texture2D
- Unity将RenderTexture转化为Texture2D
- 将Gif图转换成Unity Texture2D
- Unity在运行时,将Texture2D转换成Sprite格式
- Unity Texture2D缩放
- unity源码解析Texture2D
- 关于Unity 的 RenderTexture
- Unity将RenderTexture转成一张图片并剪裁保存到本地
- 将Ip转化为十进制数字,将十进制数字转化为Ip
- 将bmp 转化为avi
- 将体能转化为智能
- 将字符串转化为日期
- 将数字转化为中文
- 将数字转化为中文
- 将DateRead转化为DataSet
- 将数字转化为中文
- 将汉字转化为字母
- 将IntPtr转化为byte[]
- struts2.5 使用感叹号和通配符实现动态方法调用无效的问题及解决!
- <上机练习>
- super关键字
- c++(13)处理类型--类型别名
- 搭建tomcat+Maven
- Unity将RenderTexture转化为Texture2D
- 【follow】BZOJ1015: [JSOI2008]星球大战starwar
- spring 注解
- 网络编程之Reactor 模式
- React Native 常用功能【调用QQ聊天 调用拨号】
- 第三周项目-2求集合并集
- Python 多继承
- AM335X的资源链接
- 如何自己编写Makefile(简单介绍)