www.pudn.com > DemoFluid2D.zip > smBuoyance2D.psh
!!FP1.0
#Tex0----Current Velocity
#Tex0.x---u
#Tex0.y---v
#Tex0.z---ro
#Tex0.w---T
DECLARE TexPARA = {0,0,0,0};
#main variables
TEX R0, f[WPOS], TEX0, RECT;
MUL R1.y, R0.z, TexPARA.x;
SUB R2.y, R0.w, TexPARA.z;
MUL R2, R2, TexPARA.y;
ADD R1, R1, R2;
#force
TEX R0, f[WPOS], TEX1, RECT;
#HERE, for the reason of 2D problem, so just modify the y component of force
ADD o[COLR], R0, R1;
END