分享乙個雙面透明逐漸顯示的shader,
大致效果如下圖:
隨著攝像頭不斷靠近顏色越來約明顯,優化攝像機對物體裁剪顯示比較突兀
shader**如下:
shader "custom/dtscircle"
_alphascale("alpha scale",range(0,1)) =1
_fadedistancenear("near fadeout dist(view space)",float) = 0.3
_fadedistancefar("far fadeout dist(view space)",float) = 1000
}subshader
pass
cull front
zwrite off
blend srcalpha oneminussrcalpha
cgprogram
#pragma vertex vert
#pragma fragment frag
#include "lighting.cginc"
#include "unitycg.cginc"
fixed4 _color;
sampler2d _maintex;
float4 _maintex_st;
fixed _alphascale;
struct a2v
;float _fadedistancenear;
float _fadedistancefar;
struct v2f;
v2f vert(a2v v)
fixed4 frag(v2f i):sv_target
endcg
}pass
cull back
zwrite off
blend srcalpha oneminussrcalpha
cgprogram
#pragma vertex vert
#pragma fragment frag
#include "lighting.cginc"
#include "unitycg.cginc"
fixed4 _color;
sampler2d _maintex;
float4 _maintex_st;
fixed _alphascale;
struct a2v
;float _fadedistancenear;
float _fadedistancefar;
struct v2f;
v2f vert(a2v v)
fixed4 frag(v2f i):sv_target
endcg}}
fallback "transparent/vertexlit"
}
記乙個簡單的保護if 的sh指令碼
真是坑爹,就下面的sh,竟然也寫了很久!if pwd usr xx bin tomcat then echo rstall is not allowed in current dir pwd return fi.bin rstmst.sh tomcat bb bin rstns.sh if 的語法真...
乙個使TEdit透明的例子
unit bktransparentedit inte ce uses windows,messages,sysutils,classes,graphics,controls,forms,dialogs,stdctrls const twm bkinvalidate wm user 1 type t...
分享乙個前輩的NPOIhelper
即拿即用 using npoi.hpsf using npoi.hssf.usermodel using npoi.ss.usermodel using npoi.ss.util 下面是主要方法 public class npoihelper datatable匯出到excel的memorystre...