Support All : light probe, 透贴剔除(clip) , 中枪散红。。
来源:互联网 发布:angry bird go要网络吗 编辑:程序博客网 时间:2024/06/07 18:08
Shader "Custom/SupportAll" {
Properties {
_MainTex ("Texture", 2D) = "white" {}
_AdjustColor("Adjust Color",Color)=(0,0,0,1)
_Pow ("Pow", Range(7.0,10.0)) = 8.0
_Cutoff ("Alpha cutoff", Range(0,1)) = 0.5
}
SubShader {
Tags { "RenderType" = "Opaque" }
Cull Off
CGPROGRAM
#pragma surface surf Lambert vertex:vert
float4 _AdjustColor;
float _Pow;
float _Cutoff;
struct Input {
float2 uv_MainTex;
//float3 customColor;
float amount:TEXCOORD1;
};
void vert (inout appdata_full v, out Input o) {
UNITY_INITIALIZE_OUTPUT(Input,o);
float3 nm;
nm = mul (UNITY_MATRIX_IT_MV, float4(v.normal,0)).xyz;
o.amount = saturate((nm.x*nm.x + nm.y*nm.y - nm.z*nm.z*0.2));
//o.customColor = abs(v.normal);
o.amount =pow(o.amount,_Pow);
}
sampler2D _MainTex;
void surf (Input IN, inout SurfaceOutput o) {
fixed4 f4=tex2D (_MainTex, IN.uv_MainTex);
o.Albedo = f4.rgb;
o.Albedo=lerp(f4.rgb,_AdjustColor.rgb,IN.amount);
o.Alpha=f4.a;
clip(o.Alpha-_Cutoff);
// o.Albedo *= IN.customColor;
}
ENDCG
}
Fallback "Diffuse"
}
Properties {
_MainTex ("Texture", 2D) = "white" {}
_AdjustColor("Adjust Color",Color)=(0,0,0,1)
_Pow ("Pow", Range(7.0,10.0)) = 8.0
_Cutoff ("Alpha cutoff", Range(0,1)) = 0.5
}
SubShader {
Tags { "RenderType" = "Opaque" }
Cull Off
CGPROGRAM
#pragma surface surf Lambert vertex:vert
float4 _AdjustColor;
float _Pow;
float _Cutoff;
struct Input {
float2 uv_MainTex;
//float3 customColor;
float amount:TEXCOORD1;
};
void vert (inout appdata_full v, out Input o) {
UNITY_INITIALIZE_OUTPUT(Input,o);
float3 nm;
nm = mul (UNITY_MATRIX_IT_MV, float4(v.normal,0)).xyz;
o.amount = saturate((nm.x*nm.x + nm.y*nm.y - nm.z*nm.z*0.2));
//o.customColor = abs(v.normal);
o.amount =pow(o.amount,_Pow);
}
sampler2D _MainTex;
void surf (Input IN, inout SurfaceOutput o) {
fixed4 f4=tex2D (_MainTex, IN.uv_MainTex);
o.Albedo = f4.rgb;
o.Albedo=lerp(f4.rgb,_AdjustColor.rgb,IN.amount);
o.Alpha=f4.a;
clip(o.Alpha-_Cutoff);
// o.Albedo *= IN.customColor;
}
ENDCG
}
Fallback "Diffuse"
}
0 0
- Support All : light probe, 透贴剔除(clip) , 中枪散红。。
- unity遮挡提示,中枪散红,综合。。
- Unity 之 Light : Light Probe
- unity shader实现中枪散红效果,(参考别人算法)
- 光照探针 (light probe)
- Light Probe Proxy Volume component
- Tetrahedron based light probe interpolation(基于四面体的Light Probe插值)
- Unity 3D笔记——Light Probe
- unity3d Light Probe Group图解超详细使用方法
- 淺談Unity 5.4新功能:Light Probe Proxy Volume
- unity3d Light Probe Group图解超详细使用方法
- clip
- clip
- probe
- 剔除
- Light OJ 1085 - All Possible Increasing Subsequences
- boss1接受light probe影响且能 cut off 且能 不透
- 我的Unity 3D之旅——杂记之LightMapping和Light Probe
- MyEclispse快捷键
- Linux系统编程:文件的读取写入
- nyoj836画图
- sdfghjkl
- asdcvbnm
- Support All : light probe, 透贴剔除(clip) , 中枪散红。。
- sdfgjkl
- dsfghj
- dfghjkl
- sdfghj
- dfghj/fdghjk,l
- 宣传部V迷
- Android 截屏——调用adb命令&系统API
- 深V吃饱没