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项目,逐步进 ...
随机推荐
- JSTL定制标签 - 递归标签显示属性结构
- ios - block数据的回调
block在代理,kvo中传递数据效率最高 实现原理 控制器B想传递数据给控制器A.通过在B控制器中创建Block类型的类,创建方法,方法参数是刚才创建的block类型的变量.在方法实现的内部调用参数 ...
- JAVA:NIO初步了解
简介: Java NIO(New IO)是一个可以替代标准Java IO API的IO API(从Java 1.4开始),Java NIO提供了与标准IO不同的IO工作方式. Java NIO: Ch ...
- 夺命雷公狗-----React---6--props多属性的传递
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- 【final】站立会议---11.27
名称:nice! 组长:李权 成员:于淼 刘芳芳韩媛媛 宫丽君 时间:11月27日 13:00 项目内容:约跑app(约吧) 地点:传媒西楼220室 内容: 新任务的分配 1.李权分配任务 2.韩媛 ...
- 转:SVN服务器搭建和使用(三)
http://www.cnblogs.com/xiaobaihome/archive/2012/03/20/2407610.html 接下来,试试用TortoiseSVN修改文件,添加文件,删除文件, ...
- eclipse启动时虚拟机初始内存配置
eclipse启动时虚拟机初始内存配置: -Xms256M -Xmx512M -XX:PermSize=256m -XX:MaxPermSize=512m
- CI框架区分前后台
基于官网 CodeIgniter-3.1.2版本修改 1.复制根目录下的 index.php 文件,重名为 admin.php .index.php用作前台入口:admin.php用作后台入口. 打 ...
- imx6Q rtl8188etv Android4.3 驱动调试记录
vim kernel_imx/arch/arm/configs/imx6s_{yourdevice}_android_defconfig CONFIG_CFG80211=y CONFIG_MAC802 ...
- Sprint第二个冲刺(第八天)
一.Sprint介绍 任务进度: 二.Sprint周期 看板: 燃尽图: