簡易shader實踐記錄4 流光效果

2021-09-29 22:18:07 字數 2203 閱讀 8708

分享乙個流光效果

"流光貼圖", 2d)

="white"

[materialtoggle] _wualpha (

"黑白流光圖無alpha時勾選", float )

= 0 _liuguang_color (

"流光_color", color)

=(0.5,0.5,0.5,1)

_liuguang_qiangdu (

"流光強度", float )

= 3 _uvscale (

"uv縮放", range(0, 1))

= 0.3

[materialtoggle] _aniuvscale (

"uv縮放動畫", float )

= 0.3

_liuguang_speed (

"動畫速度", float )

= 5 _liuguang_mask (

"二次_mask(給流光更複雜的遮罩)", 2d)

="white"

_uvniuqu (

"uv扭曲", 2d)

="white"

_niuqu_qiangdu (

"扭曲強度", float )

= 0 [hideininspector]_cutoff (

"alpha cutoff", range(0,1))

= 0.5

}subshader

pass

blend srcalpha oneminussrcalpha

zwrite off

cgprogram

#pragma vertex vert

#pragma fragment frag

#define unity_pass_forwardbase

#include "unitycg.cginc"

#pragma multi_compile_fwdbase

#pragma exclude_renderers xbox360 xboxone ps3 ps4 psp2

#pragma target 3.0

uniform float4 _timeeditor;

uniform sampler2d _maintex; uniform float4 _maintex_st;

uniform float4 _tintcolor;

uniform sampler2d _liuguang; uniform float4 _liuguang_st;

uniform float4 _liuguang_color;

uniform float _liuguang_qiangdu;

uniform fixed _liuguang_speed;

uniform fixed _wualpha;

uniform sampler2d _uvniuqu; uniform float4 _uvniuqu_st;

uniform fixed _niuqu_qiangdu;

uniform fixed _aniuvscale;

uniform fixed _uvscale;

uniform sampler2d _liuguang_mask; uniform float4 _liuguang_mask_st;

struct vertexinput

; struct vertexoutput

; vertexoutput vert (vertexinput v)

float4 frag(vertexoutput i)

: color

endcg

}} fallback "diffuse"

}

Shader 常用記錄

shaderlab 屬性型別和cg變數型別關率 關鍵字 color,vector cg float3 half4 fixed4 關鍵字 range,float cg float half,fixed 關鍵字 2d cg sampler2d 關鍵字 cube cg samplercube 關鍵字 3d...

Zookeeper簡易實踐操作

1.解壓zookeeper tar zvxf zookeeper安裝包所在路徑 c zookeeper解壓後所在路徑 2.修改名字 mv 帶版本號zookeeper的路徑 改名字為zookeeper的路徑 3.建立目錄 建立data和logs目錄 在 zookeeper 的安裝目錄下建立 dxccd...

Unity 流光shader 記錄分享

shader custom datafloweffect specular specular color 1,1,1,1 gloss gloss range 0 255 20.0 flowtex flow tex a 2d black flowcolor flow color rgba color ...