Changeset 5397 for nanovis/branches


Ignore:
Timestamp:
May 2, 2015, 6:19:17 AM (4 years ago)
Author:
ldelgass
Message:

Hand merge fix for flow reset

Location:
nanovis/branches/1.2
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • nanovis/branches/1.2/ParticleAdvectionShader.cpp

    r4904 r5397  
    2727
    2828void
    29 ParticleAdvectionShader::bind(unsigned int texID, unsigned int initPosTexID)
     29ParticleAdvectionShader::bind(unsigned int texID, unsigned int initPosTexID, bool init)
    3030{
    3131    setFPTextureParameter("pos_tex", texID);
     
    3434
    3535    setFPParameter1f("timestep", _timeStep);
    36     setFPParameter1f("max", _max);
     36    setFPParameter1f("max", init ? 0 : _max);
    3737    setFPParameter3f("scale", _scale.x, _scale.y, _scale.z);
    3838
  • nanovis/branches/1.2/ParticleAdvectionShader.h

    r4904 r5397  
    2020    virtual ~ParticleAdvectionShader();
    2121
    22     virtual void bind(unsigned int texID, unsigned int initPosTexID);
     22    virtual void bind(unsigned int texID, unsigned int initPosTexID, bool init);
    2323
    2424    virtual void unbind();
  • nanovis/branches/1.2/ParticleRenderer.cpp

    r5373 r5397  
    261261    glLoadIdentity();
    262262
    263     _advectionShader->bind(_psysTex[tex], _initPosTex);
     263    _advectionShader->bind(_psysTex[tex], _initPosTex, _psysFrame == 0);
    264264
    265265    draw_quad(_psysWidth, _psysHeight, _psysWidth, _psysHeight);
  • nanovis/branches/1.2/shaders/update_pos.cg

    r4904 r5397  
    2424    float time = pos.w;
    2525
     26    if (max > 0) {
    2627#ifdef EXPIRE
    27     time -= timestep;
     28        time -= timestep;
    2829
    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;
    3242    }
    33 #endif
    34 
    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.0f);
    37     vel = vel * max;
    38     //vel *= float4(scale, 1);
    39     ret = pos + (vel * timestep);
    4043
    4144    //not drawing if the particle is out of bound
Note: See TracChangeset for help on using the changeset viewer.