u3d 自带的default-fx particle builder在哪

 上传我的文档
 下载
 收藏
||精品,全是精品||有任何问题请发站内信息!本店资源来源于互联网,版权为原作者所有,请下载试用者二十四小时后删除,试用后请购买正版的资源。若侵犯到您的版权, 请提出指正, 我们将立即删除。
 下载此文档
正在努力加载中...
Unity3D 3.5 自带的寻路组件介绍
下载积分:1000
内容提示:Unity3D 3.5 自带的寻路组件介绍
文档格式:DOC|
浏览次数:14|
上传日期: 09:06:58|
文档星级:
该用户还上传了这些文档
Unity3D 3.5 自带的寻路组件介绍
官方公共微信Explaining Unity Sprite-Default Shader - Game Development Stack Exchange
to customize your list.
Game Development Stack Exchange is a question and answer site for professional and independent game developers. J it only takes a minute:
Here's how it works:
Anybody can ask a question
Anybody can answer
The best answers are voted up and rise to the top
I would like to know why we would use alpha blending in that shader for just rendering a sprite, which is just a texture ?
What is tint color ?
Why we multiply the alpha value by the color here ?
fixed4 c = tex2D(_MainTex, IN.texcoord) * IN. // why ?
c.rgb *= c.a; // why ?
Shader "Sprites/Default"
Properties
[PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {}
_Color ("Tint", Color) = (1,1,1,1)
[MaterialToggle] PixelSnap ("Pixel snap", Float) = 0
"Queue"="Transparent"
"IgnoreProjector"="True"
"RenderType"="Transparent"
"PreviewType"="Plane"
"CanUseSpriteAtlas"="True"
Lighting Off
ZWrite Off
Fog { Mode Off }
Blend One OneMinusSrcAlpha
#pragma vertex vert
#pragma fragment frag
#pragma multi_compile DUMMY PIXELSNAP_ON
#include "UnityCG.cginc"
struct appdata_t
float4 vertex
: POSITION;
float4 color
float2 texcoord : TEXCOORD0;
struct v2f
float4 vertex
: SV_POSITION;
fixed4 color
half2 texcoord
: TEXCOORD0;
v2f vert(appdata_t IN)
OUT.vertex = mul(UNITY_MATRIX_MVP, IN.vertex);
OUT.texcoord = IN.
OUT.color = IN.color * _C
#ifdef PIXELSNAP_ON
OUT.vertex = UnityPixelSnap (OUT.vertex);
return OUT;
sampler2D _MainT
fixed4 frag(v2f IN) : SV_Target
fixed4 c = tex2D(_MainTex, IN.texcoord) * IN.
c.rgb *= c.a;
The "tint" color is a color that gets modulated (multiplied) with the texture color. This color is used with sprites for effects like making the player sprite blink red when hit by an enemy. To do so, you could set the tint to red when the player gets hit and leave it red for a couple frames, them restore it to white. Do that repeatedly for a few seconds and you'd have a blink effect for your sprite.
Multiplying the texture's RGB with the A could be used to give you a fade in/out effect. The alpha channel in the RGBA is a normalized value in the [0,1] range, so if you were to multiply the RGB with an alpha of say 0.2, you would get a very dark sprite. Multiply it by 1 and you will get the texture color as it is. You could get this same effect by multiplying the color with a back/white tint, BTW.
Finally, alpha blending should be on to ensure that sprites that have transparent areas get drawn properly. Most sprites have transparencies, so blending is required, otherwise the transparencies would be draw as if they where filled with some color. If you are sure you don't have transparencies in your sprites, then alpha blending could be safely disabled.
Your Answer
Sign up or
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Post as a guest
By posting your answer, you agree to the
Not the answer you're looking for?
Browse other questions tagged
Game Development Stack Exchange works best with JavaScript enabledUnity3D 3.5 自带的寻路组件介绍_百度文库
两大类热门资源免费畅读
续费一年阅读会员,立省24元!
Unity3D 3.5 自带的寻路组件介绍
上传于||文档简介
&&U​n​i​t​yD​ . ​自​带​的​寻​路​组​件​介​绍
阅读已结束,如果下载本文需要使用0下载券
想免费下载更多文档?
定制HR最喜欢的简历
你可能喜欢

我要回帖

更多关于 u3d particle system 的文章

 

随机推荐