Creating Materials at runtime And Issue of Shader.Find()
Creating Materials at runtime
http://forum.unity3d.com/threads/create-materials-at-runtime.72952/
//通过Shader.Find()创建材质
floor.renderer.material = new Material (Shader.Find(" Diffuse"));
//设置材质参数
floor.renderer.material.SetTextureScale("Tiling", new Vector2(,));
floor.renderer.material.mainTexture = Resources.Load("Floor") as Texture2D;
Shader.Find()
http://docs.unity3d.com/ScriptReference/Shader.Find.html
Shader.Find()
需要注意的问题是,如果Shader是自己写的,则必须放置在Resources下面,否则在Android/iOS环境下,则会出现找不到Shader的问题。
When building a player, a shader will only be included if it is assigned to a material that is used in any scene or if the shader is placed in a "Resources" folder.
We should put the custom shaders into the 'Resources/Shaders/' folder, otherwise, when we built an android apk, shit happens.
Creating Materials at runtime And Issue of Shader.Find()的更多相关文章
- creating normals from alpha/heightmap inside a shader
http://www.polycount.com/forum/showthread.php?t=117185 I am making some custom terrain shaders with ...
- Libgdx New 3D API 教程之 -- Libgdx中使用Materials
This blog is a chinese version of xoppa's Libgdx new 3D api tutorial. For English version, please re ...
- 关于Unity中顶点片元Shader实例
补充 float4 fixed4 _Time 1: float4是内置向量 (x, y, z, w); float4 a; 访问单独成员a.x, a.y, a.z, a.w;2: fixed4 是内置 ...
- AssetBundleMaster_ReadMe_EN
Before we start use it, you'd better import it to an empty project, following the ReadMe to learn th ...
- Deploying JRE (Native Plug-in) for Windows Clients in Oracle E-Business Suite Release 12 (文档 ID 393931.1)
In This Document Section 1: Overview Section 2: Pre-Upgrade Steps Section 3: Upgrade and Configurati ...
- selenium2自动化测试学习笔记(二)
chromedriver报错问题解决了,真是无语 是因为chromedriver与浏览器版本不一致 http://chromedriver.storage.googleapis.com/index.h ...
- chromedriver与chrome最新版本对应表
如果需要看到最新版的chromedriver和chrome版本对应问题,点击http://npm.taobao.org/mirrors/chromedriver/,点击最新版本的chromedrive ...
- centos 无界面安装selenium+chrome+chromedirver的设置
配了一中午的,好不容易正好记录下. 1.我的centos的位数 输入rpm -q centos-release 结果:centos-release-7-4.1708.el7.centos.x86_64 ...
- 使用CEF(二)— 基于VS2019编写一个简单CEF样例
使用CEF(二)- 基于VS2019编写一个简单CEF样例 在这一节中,本人将会在Windows下使用VS2019创建一个空白的C++Windows Desktop Application项目,逐步进 ...
随机推荐
- 变量在SSIS包中的使用
2010~2011年经常使用SSIS包采集加工数据,后来换了工作就很少使用.最近又开始用那玩意采集数据,努力回想之前是怎样操作的,网上各种找各种纠结.趁这次使用记录下日常操作步骤,以备以后不时之需. ...
- 前向后瞻正则表达式及其JS例子
定义 x(?=y) 匹配'x'仅仅当'x'后面跟着'y'.这种叫做正向肯定查找. 比如,/Jack(?=Sprat)/会匹配到'Jack'仅仅当它后面跟着'Sprat'./Jack(?=Sprat|F ...
- 安装eclipse的hadoop开发环境
eclipse:安装路径/usr/local/eclipse hadoop-2.5.2 /usr/local/hadoop/hadoop-2.5.2 hadoop2x-eclipse-plugin-m ...
- c++11 auto unique_ptr 等
c++11 条款21:尽量使用std::make_unique和std::make_shared而不直接使用new c++11 条款18: 使用std::unique_ptr来进行独享所有权的资源管理 ...
- 修改远程桌面端口号.bat
@color 0A @title 修改远程桌面端口号 by wjshan0808 @echo off echo 请输入端口号 set /p port= reg add "HKLM\SYSTE ...
- windows磁盘分区
windows 下对磁盘进行分区吗,如何调整大小. N的输入单位为GB,输出单位为MB; (N-1)4+1024N;
- 关于spring-servlet.xml cannot be opened because it does not exist的解决
右键项目---->properties--->Java Build Path--->source--->Add Folder --->选择conf文件夹
- 如何清除PL/SQL中的缓存
每次查询前清空缓存10g以上:alter system flush buffer_cache;9i:ALTER SESSION SET EVENTS 'immediate trace name flu ...
- mysql 乱码问题
A.mysql设置 1.service mysql stop 2.sudo vim /etc/mysql/my.cnf 在[mysqld]中添加下面两行 character_set_server = ...
- 解决secureCRT数据库里没有找到防火墙 '无'问题
中文版的secureCRT由于汉化的问题(把null翻译成无了),导致每次打开都会有个防火墙的错误提示:数据库里没有找到防火墙 '无' 此会话将尝试不通过防火墙进行连接.出现这个错误的原因是在secu ...