Changeset 5397 for nanovis/branches
- Timestamp:
- May 2, 2015 3:19:17 AM (9 years ago)
- Location:
- nanovis/branches/1.2
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
nanovis/branches/1.2/ParticleAdvectionShader.cpp
r4904 r5397 27 27 28 28 void 29 ParticleAdvectionShader::bind(unsigned int texID, unsigned int initPosTexID )29 ParticleAdvectionShader::bind(unsigned int texID, unsigned int initPosTexID, bool init) 30 30 { 31 31 setFPTextureParameter("pos_tex", texID); … … 34 34 35 35 setFPParameter1f("timestep", _timeStep); 36 setFPParameter1f("max", _max);36 setFPParameter1f("max", init ? 0 : _max); 37 37 setFPParameter3f("scale", _scale.x, _scale.y, _scale.z); 38 38 -
nanovis/branches/1.2/ParticleAdvectionShader.h
r4904 r5397 20 20 virtual ~ParticleAdvectionShader(); 21 21 22 virtual void bind(unsigned int texID, unsigned int initPosTexID );22 virtual void bind(unsigned int texID, unsigned int initPosTexID, bool init); 23 23 24 24 virtual void unbind(); -
nanovis/branches/1.2/ParticleRenderer.cpp
r5373 r5397 261 261 glLoadIdentity(); 262 262 263 _advectionShader->bind(_psysTex[tex], _initPosTex );263 _advectionShader->bind(_psysTex[tex], _initPosTex, _psysFrame == 0); 264 264 265 265 draw_quad(_psysWidth, _psysHeight, _psysWidth, _psysHeight); -
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.