Changeset 5397 for nanovis/branches/1.2/shaders/update_pos.cg
- Timestamp:
- May 2, 2015 3:19:17 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
nanovis/branches/1.2/shaders/update_pos.cg
r4904 r5397 24 24 float time = pos.w; 25 25 26 if (max > 0) { 26 27 #ifdef EXPIRE 27 time -= timestep;28 time -= timestep; 28 29 29 // Lifetime ended? 30 if (time < 0) { 31 return texRECT(init_pos_tex, uv); 30 // Lifetime ended? 31 if (time < 0) { 32 return texRECT(init_pos_tex, uv); 33 } 34 #endif 35 //reconstruct negative value 36 float4 vel = float4(tex3D(vel_tex, pos.xyz).yzw, 0.0) * 2.0 - float4(1.0, 1.0, 1.0, 0.0); 37 vel = vel * max; 38 //vel *= float4(scale, 1); 39 ret = pos + (vel * timestep); 40 } else { 41 ret = pos; 32 42 } 33 #endif34 35 //reconstruct negative value36 float4 vel = float4(tex3D(vel_tex, pos.xyz).yzw, 0.0) * 2.0 - float4(1.0, 1.0, 1.0, 0.0f);37 vel = vel * max;38 //vel *= float4(scale, 1);39 ret = pos + (vel * timestep);40 43 41 44 //not drawing if the particle is out of bound
Note: See TracChangeset
for help on using the changeset viewer.