Unity5 怎么把Mesh渲染成ugui rendertexturee

Unity5 怎么把Mesh渲染成RenderTexture_百度知道
Unity5 怎么把Mesh渲染成RenderTexture
把RenderTexture的图形UITexture,就能通过NGUI的Clip对UITexture进行裁剪用一个相机单独照射3D模型和粒子,把相机的图形映射到RenderTexture上
来自团队:
其他类似问题
为您推荐:
mesh的相关知识
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁11764人阅读
Unity3D(15)
1. 写在前面前几天看了cgcookie的一个,学习了下怎么根据已有人物模型制作一个仿版的NPC人物,感觉挺好玩的,整理一下放到博客里!先看一下教程里面的最终效果。是不是很像个幽灵~下面是我在自己的工程中实验的结果。中间是游戏角色,两遍两个就是NPC啦。这种技术得到的效果和贴图关系很大,所以如果效果不好再画一张贴图吧2. 实现实现非常简单,一共包含三个部分:改变Mesh材质,给Mesh添加Particle,最后添加闪烁的脚本2.1 改变Mesh材质首先新建一个空白对象,可以命名为holo_character,给它添加Mesh Filter和Mesh Render组件。将原模型的Mesh赋值给上述Mesh Filter组件。然后新建一个材质,并赋值给Mesh Render组件来替换原来的模型材质。新的材质使用Particles/Additive的Shader,贴图属性中使用这个NPC的贴图,也也可以直接使用原模型的材质贴图。材质颜色可以根据喜好自行调节。面板设置如下:如果你的模型包含多个Mesh,例如头和身体是分开的,那么对每个部分都做如上操作就行了。现在你的NPC应该看起来幽灵化了。2.2 给Mesh添加Particle给holo_character依次添加Mesh Particle Emitter、Particle Animator和Particle Render组件。将上一步新建的材质赋值给Particle Render中的材质对象。到了这里基本外观就出来了。然后,可以根据需要调整相应的参数来得到想要的效果。例如,可以调整Mesh Particle Emitter中的Min Size,Max Size来调整粒子的大小,调整MinEnergy和Max Energy来调整每个粒子的持续时间,调整Min Emission和Max Emission来调整同一时间粒子的个数等。2.3 添加闪烁脚本最后,为了让这个NPC看起来更像一个幽灵,我们添加一个闪烁的脚本。这个脚本的主要原理就是控制材质的透明度,非常简单。新建一个脚本FlickeringScript.cs。代码如下:using UnityE
using System.C
public class FlickeringScript : MonoBehaviour {
// Use this for initialization
void Start () {
color = renderer.material.GetColor(&_TintColor&);
StartCoroutine(WaitForColor());
IEnumerator WaitForColor() {
while (true) {
yield return new WaitForSeconds(Random.Range(0.0f, 0.1f));
color.a = Random.Range(0.0f, 0.5f);
renderer.material.SetColor(&_TintColor&, color);
}将上述代码添加到holo_character。3. 最后的话这是一种很tricky的做法,可以通过调整粒子效果来得到不同类型的NPC,例如火焰性等等。还有一点要说明,如果你的模型绑定了骨骼动画的,那么模型上应该会自动绑定Skin Mesh Render组件,而且模型又是标准的T型,如下图这样,那么可以变通一下,NPC也使用Skin Mesh Render来播放动画,不至于让NPC一直都是伸展着胳膊的。。。但是这样添加粒子时使用Mesh Particle Emitter就没有用了。如果这样,我们可以自行调整粒子效果,得到其他的效果也是不错的~最后,如果您觉得本文对您有所帮助,请帮小女子投一票吧!谢谢~
参考知识库
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:1260135次
积分:12429
积分:12429
排名:第720名
原创:114篇
转载:20篇
译文:21篇
评论:1879条
我叫乐乐,程序媛一枚,就读于上海交通大学软件学院,研究生,数字媒体方向。喜欢用计算机来绘制各种五彩缤纷的画面~欢迎访问我的和 :)
邮件:lelefeng1992 # gmail DOT com
PS:为防止垃圾邮件,请自行转换为正确格式哦~
阅读:49209
阅读:22347
文章:45篇
阅读:504192
(2)(1)(3)(1)(2)(2)(1)(1)(2)(2)(4)(2)(3)(6)(3)(8)(5)(6)(3)(6)(5)(7)(1)(2)(8)(1)(4)(5)(4)(3)(15)(2)(3)(27)(5)Navigation
Unity Account
You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio.
, March 18, 2014 in
Today, at the biggest show in the game development industry, we threw the veil off of
This release is about combining all perspectives of game development together. We’re adding crazy fancy middleware to Unity, helping you out with your business, optimizing the engine dramatically, creating better workflows and filling gaps where we knew we could do better.
You will be blown away.
Unity 5.0 ushers in the 64-bit era, we’re upgrading PhysX to the newest and most powerful 3.3, and a new multithreaded job scheduler will be introduced so that you can light all the cores on fire.
But the biggest thing of Unity 5.0 is our new physically-based unified shading system (example screenshot below) and the new Geomerics’
real-time global illumination engine.
If you haven’t heard of Enlighten yet, it’s the most advanced lighting system the games industry knows and is used for some of the most beautiful games today, across many art styles. For examples, just take look at Battlefield 4 or Plants vs Zombies: Garden Warfare both.
The lighting workflow is made even more incredible by the first-ever in-editor real-time lightmap previews based on Imagination’s PowerVR Ray Tracing technology. Artists receive near instantaneous feedback on changes to lighting in-scene while lightmap baking completes in the background meaning artists can keep playing and refining without interruption.
Game visuals often get the most glory, but without the backing of incredible sound, the best of game designs falls flat. That’s why Unity 5.0 is introducing a completely overhauled sound system, which is much more robust and has visual tools for sound designers. The entire audio pipeline was ripped out and reconstructed to be more flexible and efficient. The first huge addition to this pipeline is our awesome Audio Mixer providing the power to create highly complex and dynamic soundscapes in game.
There are a load of other improvements as well. Several big changes to Mecanim like StateMachine Behaviors make the tools even more incredible. NavMeshes get an upgrade, SpeedTree is integrated, and a set of 2D physics effectors add important changes that affect a wide variety of developers.
Unity 5 will also introduce our Unity Cloud integration, a big part of our new focus on helping developers succeed beyond phases of game construction and in the crowded and competitive landscape of mobile games. It’s integrated, easy to use, and gives developers the tools to cross-promote their games with other developers via interstitial ads.
But that’s not where it stops, not by a long shot. Unity has long been one of the leading engines for games on the web and it’s a position we take seriously. That’s why we’re finally announcing the work we’ve been doing with Mozilla to get WebGL and asm.js support in Unity. The results are already pretty awesome. In fact, we’ll have a nice shiny playable WebGL demo of Dead Trigger 2 (big thanks to our friends at Madfinger!) at GDC, so make sure to drop by and take a look! WebGL deployment will be available as an add-on in Unity 5.
And, as you’d expect, Unity 5 is available now for pre-order from the . You can also feel free to . Those who pre-order Unity Pro 5 will also receive Unity Pro 4.
Btw. if you were wondering, the new GUI system is getting really close and it’ll be included in Unity 4.6, which will also be the last major update in the Unity 4 cycle.
Related posts
, August 1, 2016
, July 28, 2016
, June 5, 2016
, March 15, 2016
Categories
Subscribe to all posts
Subscribe to Asset Store
Subscribe to Case Study
Subscribe to Community
Subscribe to Events
Subscribe to Rants & Raves
Subscribe to Services
Subscribe to Technology
Subscribe to Unity Ads
Subscribe to Unity Analytics
Popular posts
Quick links
About Unity
Get Unity news
I agree to the
and the processing and use of my information
Nearly there...
To start receiving news from Unity Technologies, click on the link we've sent to your e-mail account.
Something went wrong, please try again.
Copyright & 2016 Unity Technologies二次元同好交流新大陆
扫码下载App
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!&&|&&
勇往直前,永不后退,努力觅食,建造属于自己的淫(鹰)窝
LOFTER精选
网易考拉推荐
用微信&&“扫一扫”
将文章分享到朋友圈。
用易信&&“扫一扫”
将文章分享到朋友圈。
阅读(12149)|
用微信&&“扫一扫”
将文章分享到朋友圈。
用易信&&“扫一扫”
将文章分享到朋友圈。
历史上的今天
在LOFTER的更多文章
loftPermalink:'',
id:'fks_',
blogTitle:'unity性能优化',
blogAbstract:'1. CPU Usage&&',
blogTag:'unity',
blogUrl:'blog/static/',
isPublished:1,
istop:false,
modifyTime:0,
publishTime:6,
permalink:'blog/static/',
commentCount:1,
mainCommentCount:1,
recommendCount:2,
bsrk:-100,
publisherId:0,
recomBlogHome:false,
currentRecomBlog:false,
attachmentsFileIds:[],
groupInfo:{},
friendstatus:'none',
followstatus:'unFollow',
pubSucc:'',
visitorProvince:'',
visitorCity:'',
visitorNewUser:false,
postAddInfo:{},
mset:'000',
remindgoodnightblog:false,
isBlackVisitor:false,
isShowYodaoAd:false,
hostIntro:'勇往直前,永不后退,努力觅食,建造属于自己的淫(鹰)窝',
hmcon:'1',
selfRecomBlogCount:'0',
lofter_single:''
{list a as x}
{if x.moveFrom=='wap'}
{elseif x.moveFrom=='iphone'}
{elseif x.moveFrom=='android'}
{elseif x.moveFrom=='mobile'}
${a.selfIntro|escape}{if great260}${suplement}{/if}
{list a as x}
推荐过这篇日志的人:
{list a as x}
{if !!b&&b.length>0}
他们还推荐了:
{list b as y}
转载记录:
{list d as x}
{list a as x}
{list a as x}
{list a as x}
{list a as x}
{if x_index>4}{break}{/if}
${fn2(x.publishTime,'yyyy-MM-dd HH:mm:ss')}
{list a as x}
{if !!(blogDetail.preBlogPermalink)}
{if !!(blogDetail.nextBlogPermalink)}
{list a as x}
{if defined('newslist')&&newslist.length>0}
{list newslist as x}
{if x_index>7}{break}{/if}
{list a as x}
{var first_option =}
{list x.voteDetailList as voteToOption}
{if voteToOption==1}
{if first_option==false},{/if}&&“${b[voteToOption_index]}”&&
{if (x.role!="-1") },“我是${c[x.role]}”&&{/if}
&&&&&&&&${fn1(x.voteTime)}
{if x.userName==''}{/if}
网易公司版权所有&&
{list x.l as y}
{if defined('wl')}
{list wl as x}{/list}

我要回帖

更多关于 cocos rendertexture 的文章

 

随机推荐