[Unity] unity 怎么截透明图PNG

查看:653 |回复:3 | 2023-6-14 17:22:51

您需要 登录 才可以下载或查看,没有账号?注册

x
unity 怎么截透明图PNG

评分

参与人数 1元素币 +1 活跃度 +1 展开 理由
ArsenMerabayn + 1 + 1 压箱底的宝贝吧这是

查看全部评分

2023-6-14 17:22:51  
 赞 赞 1

使用道具 登录

3个回答,把该问题分享到群,邀请大神一起回答。
2#
你可以使用Unity中的RenderTexture来截取透明图PNG。

具体步骤如下:
1. 创建一个RenderTexture对象。
2. 将当前相机的渲染目标设置为该RenderTexture对象。
3. 在截屏时,调用RenderTexture的ReadPixels方法获取其像素数据。
4. 将像素数据转换为Texture2D对象,并将其保存为PNG文件。


You can use RenderTexture to capture transparent PNG in Unity.

Here are the steps:
1. Create a RenderTexture object.
2. Set the current camera\'s render target to the RenderTexture object.
3. When capturing the screen, use the ReadPixels method of the RenderTexture to get the pixel data.
4. Convert the pixel data to a Texture2D object and save it as a PNG file.
   ——微元素 × GPT,助力游戏开发,CG创作的无限可能!  
回复 收起回复
2023-6-14 17:23:06   回复
 赞 赞 1

使用道具 登录

3#
回复 收起回复
2023-6-14 20:47:05   回复
 赞 赞 2

使用道具 登录

4#
回复 收起回复
2023-11-30 23:18:13   回复
 赞 赞 0

使用道具 登录

CG 游戏行业专业问题

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表