unity, Graphics.Blit (null, null, mat,0);
2024-09-21 09:21:36
我使用
Graphics.Blit (null, finalRT, mat);
合成出一张finalRT,然后将finalRT用在editor脚本的OnInspector中使用
Graphics.DrawTexture(rect,finalRT,mat2);
进行绘制,结果发现inspector面板中finalRT显示结果是错的,而且在游戏场景中用到finalRT作为纹理的物体纹理也变错了。
但是如果我屏蔽掉Graphics.DrawTexture(rect,finalRT,mat2),则游戏场景中用finalRT作为纹理的对象不会变错,但是当然,我在inspector中就看不到finalRT的预览了。
通过试验发现,如果在Graphics.Blit (null, finalRT, mat)后面紧跟着加一句:
#if UNITY_EDITOR
Graphics.Blit (null, null, mat,0);//if i want to draw finalRT with a shader in editor script, i must write this line, why?
# endif
则结果就正常了。
不知道为啥。
最新文章
- error CS0117: `UnityEditor.EditorUtility' does not contain a definition for `GetAssetPreview'
- mysql删除二进制日志文件
- canvas 绘制 矩形 圆形
- DevExpress LookUpEdit和ComboBoxEdit部分用法
- 对 cloudwu 简单的 cstring 进行简单解析
- Lisp使用Lambda语法
- CAF(C++ actor framework)(序列化之类,无需序列化,直接传)(二)
- careercup-树与图 4.4
- 严重: Exception starting filter struts2 --Unable to load configuration
- 必须掌握的JavaScript基本知识
- android 代码动态创建视图
- 解析HTML
- 安卓Toast自定义及防止重复显示
- Leetcode_154_Find Minimum in Rotated Sorted Array
- mysql 字符编码
- 解析$(this).data('type');
- 常用的Date对象和Math对象方法
- kafka_2.10-0.8.1.1.tgz的1或3节点集群的下载、安装和配置(图文详细教程)绝对干货
- 【转】重装win7后,所有USB接口无法使用(鼠标、键盘、U盘)
- Loitor_产品(一)