?? normalrect.fp
字號:
!!FP1.0
#here compute the normal of a vector which in a 2d Texture
#add all elements together into ONE element
#HERE Texture Unit----RECT, just ONE channel
DECLARE TexOffset ={0,0,0,0};
#sample the current position (i,j)
TEX R0, f[WPOS], TEX0, RECT;
#sample the (i+W/2,j)
ADD R1, f[WPOS], TexOffset.xwww;
TEX R1, R1, TEX0, RECT;
ADD R0, R0, R1;
#sample the (i,j+W/2)
ADD R1, f[WPOS], TexOffset.wxww;
TEX R1, R1, TEX0, RECT;
ADD R0, R1, R0;
#sample the (i+W/2, j+W/2)
ADD R1, f[WPOS], TexOffset.xxww;
TEX R1, R1, TEX0, RECT;
#sum 4 positions together in 1 channel
ADD o[COLR], R1, R0;
#If in 4 Channels, we need to sum RGBA components together
#ADD R2, R1, R0;
#ADD R2.x, R2.x,R2.y;
#ADD R2.x, R2.x,R2.z;
#ADD o[COLR], R2.x,R2.w;
END
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -