标签:#Shader

Posts

· 2019-07-08 · * Unity * Shader *

A shader for showing progress in sin-wave style.

· 2017-12-10 · * Unity * Shader * WOW *

Simulate warlock's spell - Incinerate in world of warcraft:

Construct the mesh and update it each frame

Initialize vertices of mesh
var vertices = new Vector3[(SEGMENTS_COUNT + 1) * 2];

for (var i = 0; i < vertices.Length; i++) {
	vertices [i] = transform.position;
}
· 2017-11-29 · * Unity * Shader * CGSL *

Sometimes we get some really wonderful effect rendered by other type of shader like glsl.

So before rewriting glsl shader to unity vertex/fragment shader, we must know the convert rules:

vec2            -> float2
vec3            -> float3
vec4            -> float4

texture2D       -> tex2D
textureCube     -> texCUBE
mat2            -> float2x2
fract           -> frac

iGlobalTime     -> _Time.y
· 2017-11-01 · * Unity * Shader *
Shader "_Game/WebCamStyle"
{
	Properties
	{
		_MainTex ("Texture", 2D) = "white" {}
		_CoverTex ("Texture", 2D) = "black" {}
		_FlipStyle("Flip Style",Range(-5,5)) = 0
	}
	SubShader
	{
		Tags
		{ 
			"Queue"="Transparent"