這篇文章主要為大家展示了“OpenGL Shader如何實(shí)現(xiàn)等待標(biāo)識(shí)效果”,內(nèi)容簡(jiǎn)而易懂,條理清晰,希望能夠幫助大家解決疑惑,下面讓小編帶領(lǐng)大家一起研究并學(xué)習(xí)一下“OpenGL Shader如何實(shí)現(xiàn)等待標(biāo)識(shí)效果”這篇文章吧。
我們提供的服務(wù)有:成都網(wǎng)站設(shè)計(jì)、網(wǎng)站制作、外貿(mào)營(yíng)銷(xiāo)網(wǎng)站建設(shè)、微信公眾號(hào)開(kāi)發(fā)、網(wǎng)站優(yōu)化、網(wǎng)站認(rèn)證、前鋒ssl等。為上1000家企事業(yè)單位解決了網(wǎng)站和推廣的問(wèn)題。提供周到的售前咨詢和貼心的售后服務(wù),是有科學(xué)管理、有技術(shù)的前鋒網(wǎng)站制作公司
結(jié)果如下:

代碼:
Shader "stalendp/waitIcons" {
CGINCLUDE
#include "UnityCG.cginc"
#pragma target 3.0
struct v2f {
float4 pos:SV_POSITION;
float2 uv : TEXCOORD0;
};
v2f vert(appdata_base v) {
v2f o;
o.pos = mul (UNITY_MATRIX_MVP, v.vertex);
o.uv = v.texcoord.xy;
return o;
}
fixed calcDot(fixed a, fixed ca, fixed2 uv) {
a /= 57.295779513;
ca /= 57.295779513;
fixed tt = 180/57.295779513;
uv = (fixed2(cos(a), sin(a)) * 0.2+ uv)*10;
fixed adit = tt*2*step(tt, a-ca);
fixed r = 1-step(ca + adit, a);
r *= lerp(0.2, -1, saturate((ca-a+adit)/25))*2;
return smoothstep(r-0.2, r, length(uv.xy));
}
fixed4 frag(v2f input) : COLOR0 {
float2 uv = input.uv.xy - float2(0.5);
float rx = fmod(uv.x, 0.4);
float ry = fmod(uv.y, 0.4);
float mx = step(0.4, abs(uv.x));
float my = step(0.4, abs(uv.y));
float alpha = 1- mx*my*step(0.1, length(half2(rx,ry)));
alpha*=0.9;
fixed4 foreColor = fixed4(1);
fixed4 bgColor = fixed4(fixed3(0.4),alpha);
fixed4 result = bgColor;
fixed ca = fmod(_Time.y, 2)*180;
bgColor = lerp(foreColor, bgColor, calcDot(0, ca, uv));
bgColor = lerp(foreColor, bgColor, calcDot(30, ca, uv));
bgColor = lerp(foreColor, bgColor, calcDot(60, ca, uv));
bgColor = lerp(foreColor, bgColor, calcDot(90, ca, uv));
bgColor = lerp(foreColor, bgColor, calcDot(120, ca, uv));
bgColor = lerp(foreColor, bgColor, calcDot(150, ca, uv));
bgColor = lerp(foreColor, bgColor, calcDot(180, ca, uv));
bgColor = lerp(foreColor, bgColor, calcDot(210, ca, uv));
bgColor = lerp(foreColor, bgColor, calcDot(240, ca, uv));
bgColor = lerp(foreColor, bgColor, calcDot(270, ca, uv));
bgColor = lerp(foreColor, bgColor, calcDot(300, ca, uv));
bgColor = lerp(foreColor, bgColor, calcDot(330, ca, uv));
return bgColor;
}
ENDCG
SubShader {
LOD 200
Tags {"Queue" = "Transparent"}
ZWrite Off
Blend SrcAlpha OneMinusSrcAlpha
Pass {
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#pragma fragmentoption ARB_precision_hint_fastest
ENDCG
}
}
FallBack Off
}以上是“OpenGL Shader如何實(shí)現(xiàn)等待標(biāo)識(shí)效果”這篇文章的所有內(nèi)容,感謝各位的閱讀!相信大家都有了一定的了解,希望分享的內(nèi)容對(duì)大家有所幫助,如果還想學(xué)習(xí)更多知識(shí),歡迎關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道!
文章題目:OpenGLShader如何實(shí)現(xiàn)等待標(biāo)識(shí)效果
文章網(wǎng)址:http://chinadenli.net/article22/jijjjc.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站排名、網(wǎng)站改版、軟件開(kāi)發(fā)、關(guān)鍵詞優(yōu)化、標(biāo)簽優(yōu)化、建站公司
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)