我使用

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

则结果就正常了。

不知道为啥。

最新文章

  1. error CS0117: `UnityEditor.EditorUtility' does not contain a definition for `GetAssetPreview'
  2. mysql删除二进制日志文件
  3. canvas 绘制 矩形 圆形
  4. DevExpress LookUpEdit和ComboBoxEdit部分用法
  5. 对 cloudwu 简单的 cstring 进行简单解析
  6. Lisp使用Lambda语法
  7. CAF(C++ actor framework)(序列化之类,无需序列化,直接传)(二)
  8. careercup-树与图 4.4
  9. 严重: Exception starting filter struts2 --Unable to load configuration
  10. 必须掌握的JavaScript基本知识
  11. android 代码动态创建视图
  12. 解析HTML
  13. 安卓Toast自定义及防止重复显示
  14. Leetcode_154_Find Minimum in Rotated Sorted Array
  15. mysql 字符编码
  16. 解析$(this).data('type');
  17. 常用的Date对象和Math对象方法
  18. kafka_2.10-0.8.1.1.tgz的1或3节点集群的下载、安装和配置(图文详细教程)绝对干货
  19. 【转】重装win7后,所有USB接口无法使用(鼠标、键盘、U盘)
  20. Loitor_产品(一)

热门文章

  1. Ajax中的eval函数的用法
  2. jQuery Transit
  3. Unity3D ShaderLab 漫反射卷积光照模型
  4. pscp详解
  5. Gitlab. Disable user creation on welcome page
  6. Qt的quit(),exit()以及close()事件捕获
  7. Dubbo_Admin安装
  8. CentOS6编译装载nbd模块
  9. Java字符串null相加
  10. ubuntu基本配置