Ignore:
Timestamp:
Aug 20, 2013 5:52:39 PM (11 years ago)
Author:
ldelgass
Message:

Add config.h option USE_ARB_PROGRAMS, which will use ARB_vertex/fragment_program
extensions as the Cg compile target instead of NV_vertex_program3 and
NV_fragment_program2. Note that glyph texture style rendering in flows will not
work if this define is set (however, the default style is line arrows which will
work).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/vizservers/nanovis/VelocityArrowsSlice.cpp

    r3630 r3875  
    6565    _queryVelocityFP.loadFragmentProgram("queryvelocity.cg");
    6666
    67     _particleShader.loadVertexProgram("velocityslicevp.cg");
    68     _particleShader.loadFragmentProgram("velocityslicefp.cg");
     67    // Delay loading of shaders only required for glyph style rendering
     68    if (_renderMode == GLYPHS) {
     69        _particleShader.loadVertexProgram("velocityslicevp.cg");
     70        _particleShader.loadFragmentProgram("velocityslicefp.cg");
     71    }
    6972
    7073    createRenderTarget();
     
    362365                    continue;
    363366                }
    364                 if (length > 1.0e-6) {
     367                if (length > 0.0) {
    365368                    Vector3f vnorm = vel.normalize();
    366369                    Vector3f rotationAxis = refVec.cross(vnorm);
     
    414417        glTexEnvf(GL_POINT_SPRITE_ARB, GL_COORD_REPLACE_ARB, GL_TRUE);
    415418
     419        // FIXME: This vertex shader won't compile with ARB_vertex_program,
     420        // so it should use GLSL
     421        if (!_particleShader.isVertexProgramLoaded()) {
     422            _particleShader.loadVertexProgram("velocityslicevp.cg");
     423        }
     424        if (!_particleShader.isFragmentProgramLoaded()) {
     425            _particleShader.loadFragmentProgram("velocityslicefp.cg");
     426        }
     427
    416428        _particleShader.bind();
    417429        _particleShader.setVPTextureParameter("vfield", _vectorFieldGraphicsID);
     
    458470    Vector3f bmin, bmax;
    459471    volume->getBounds(bmin, bmax);
    460     _origin = bmin;
     472    _origin.set(bmin.x, bmin.y, bmin.z);
    461473    _scale.set(bmax.x-bmin.x, bmax.y-bmin.y, bmax.z-bmin.z);
    462474
Note: See TracChangeset for help on using the changeset viewer.