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项目,逐步进 ...
随机推荐
- 微信公众平台开发(26) ACCESS TOKEN
本文介绍微信公众平台下Access Token的概念及获取方法. 一.Access Token access_token是公众号的全局唯一票据,公众号调用各接口时都需使用access_token.正常 ...
- php +html5 websocket 聊天室
针对内容比较长出错,修改后的解码函数 和 加码函数 原文请看上一篇 http://yixun.yxsss.com/yw3104.html function uncode($str,$key){ $ma ...
- DuiLib学习笔记4——布局
有了前面三篇的基础,现在可以开始布局了. 首先任何布局都必须包含在<Window></Window>标签内,跟<html></html>很像. DuiL ...
- GIS简单计算Helper类
using System; using ESRI.ArcGIS.Client.Geometry; namespace GISProject.Extensions { /// <summary&g ...
- ubuntu 下安装 wxpython2.8
echo "deb http://archive.ubuntu.com/ubuntu wily main universe" | sudo tee /etc/apt/sources ...
- 使用 robotframework 自动化测试系列 一 -----简介
robotframework 是自动化测试框架. Robot Framework是一款python编写的功能自动化测试框架.具备良好的可扩展性,支持关键字驱动,可以同时测试多种类型的客户端或者接口,可 ...
- Java Map 集合类简介
作者:Jack Shirazi 了解最常用的集合类型之一 Map 的基础知识以及如何针对您应用程序特有的数据优化 Map. 本文相关下载: · Jack 的 HashMap 测试 · Oracle ...
- struts2数据校验与国际化
数据校验: Action里的validate()方法能校验action类所有的方法,如果有错,如:addFieldError,会自动返回到workflow校验拦截器不向下继续进行,不用return i ...
- ftp 530 This FTP serveris anonymous only,
引用:http://blog.sina.com.cn/s/blog_7e16680c01018ox1.html 三.遇到的问题 1.只允许匿名用户登录 现象:ftp连接过程中,提示输入用户名,输入本机 ...
- JSP-12-使用过滤器和监听器
1 什么是过滤器及其工作方式 向Web应用程序的请求和响应添加功能的Web组建 过滤器可以统一的集中处理请求和响应 15.2 过滤器的实现 新建 filter ,注意此时是在 src中建立的(同cla ...