Changeset 4167


Ignore:
Timestamp:
Feb 1, 2014, 11:38:35 PM (11 years ago)
Author:
ldelgass
Message:

Texture environment is not part of texture object stored state, so don't set
environment mode before loading textures, should be done at render time.

Location:
trunk/packages/vizservers/nanovis
Files:
6 edited

Legend:

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

    r3630 r4167  
    5656    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
    5757    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
    58     glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
    59 
    6058    glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, NPN, NPN, 0,
    6159                 GL_RGBA, GL_UNSIGNED_BYTE, NULL);
     
    6462    //render buffer for projecting 3D velocity onto a 2D plane
    6563    glGenFramebuffersEXT(1, &_velFbo);
     64    glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, _velFbo);
     65
    6666    glGenTextures(1, &_sliceVectorTex);
    67 
    68     glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, _velFbo);
    69 
    7067    glBindTexture(GL_TEXTURE_RECTANGLE_ARB, _sliceVectorTex);
    7168    glTexParameterf(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
     
    7370    glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
    7471    glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
    75 
    7672    glTexImage2D(GL_TEXTURE_RECTANGLE_ARB, 0, GL_RGBA32F_ARB, _size, _size,
    7773                 0, GL_RGBA, GL_FLOAT, NULL);
     
    8278    //render buffer for the convolution
    8379    glGenFramebuffersEXT(1, &_fbo);
     80    glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, _fbo);
     81
     82    //initialize color texture for lic
    8483    glGenTextures(1, &_colorTex);
    85 
    86     glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, _fbo);
    87 
    88     //initialize color texture for lic
    8984    glBindTexture(GL_TEXTURE_2D, _colorTex);
    9085    glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
    9186    glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
    92     glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
    93 
     87    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
     88    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
    9489    glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB8, _width, _height, 0,
    9590                 GL_RGB, GL_UNSIGNED_BYTE, NULL);
     
    209204    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
    210205    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
    211     //glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_BLEND);
    212206    glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, NMESH, NMESH, 0, GL_RGBA,
    213207                 GL_UNSIGNED_BYTE, mag);
     
    328322    glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, _fbo);
    329323
    330     glPushAttrib(GL_VIEWPORT_BIT | GL_ENABLE_BIT | GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
     324    glPushAttrib(GL_VIEWPORT_BIT | GL_ENABLE_BIT | GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_TEXTURE_BIT);
    331325
    332326    glMatrixMode(GL_PROJECTION);
     
    352346    glEnable(GL_TEXTURE_2D);
    353347    glBindTexture(GL_TEXTURE_2D, _patternTex);
     348    glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
    354349    _sa = 0.01;
    355350 
     
    435430    //draw line integral convolution quad
    436431
    437     glPushAttrib(GL_ENABLE_BIT | GL_LIGHTING_BIT);
     432    glPushAttrib(GL_ENABLE_BIT | GL_LIGHTING_BIT | GL_TEXTURE_BIT);
    438433    glBindTexture(GL_TEXTURE_2D, _colorTex);
     434    glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
    439435    glEnable(GL_TEXTURE_2D);
    440436    //glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE);
  • trunk/packages/vizservers/nanovis/ParticleSystem.cpp

    r3618 r4167  
    16281628            glPointParameterfARB(GL_POINT_SIZE_MIN_ARB, 1.0f);
    16291629            glPointParameterfARB(GL_POINT_SIZE_MAX_ARB, 100.0f);
    1630             glTexEnvf(GL_POINT_SPRITE_ARB, GL_COORD_REPLACE_ARB, GL_TRUE);
     1630            glTexEnvi(GL_POINT_SPRITE_ARB, GL_COORD_REPLACE_ARB, GL_TRUE);
    16311631
    16321632            cgGLBindProgram(_particleVP);
     
    16831683            glBindTexture(GL_TEXTURE_2D, ::SpotTexID);
    16841684            glEnable(GL_TEXTURE_2D);
    1685             //glPointParameterfARB( GL_POINT_FADE_THRESHOLD_SIZE_ARB, 60.0f );
    1686             glPointParameterfARB( GL_POINT_FADE_THRESHOLD_SIZE_ARB, 0.0f );
    1687 
    1688             glPointParameterfARB( GL_POINT_SIZE_MIN_ARB, 1.0f);
    1689             glPointParameterfARB( GL_POINT_SIZE_MAX_ARB, 100.0f);
    1690             glTexEnvf( GL_POINT_SPRITE_ARB, GL_COORD_REPLACE_ARB, GL_TRUE );
     1685            //glPointParameterfARB(GL_POINT_FADE_THRESHOLD_SIZE_ARB, 60.0f);
     1686            glPointParameterfARB(GL_POINT_FADE_THRESHOLD_SIZE_ARB, 0.0f);
     1687
     1688            glPointParameterfARB(GL_POINT_SIZE_MIN_ARB, 1.0f);
     1689            glPointParameterfARB(GL_POINT_SIZE_MAX_ARB, 100.0f);
     1690            glTexEnvi(GL_POINT_SPRITE_ARB, GL_COORD_REPLACE_ARB, GL_TRUE);
    16911691
    16921692            glEnableClientState(GL_VERTEX_ARRAY);
  • trunk/packages/vizservers/nanovis/PointSetRenderer.cpp

    r3627 r4167  
    7979    glPointParameterfARB(GL_POINT_SIZE_MAX_ARB, 100);
    8080#ifdef USE_TEXTURE
    81     glTexEnvf(GL_POINT_SPRITE_ARB, GL_COORD_REPLACE_ARB, GL_TRUE);
     81    glTexEnvi(GL_POINT_SPRITE_ARB, GL_COORD_REPLACE_ARB, GL_TRUE);
    8282#endif
    8383
     
    120120#ifdef USE_TEXTURE
    121121    _pointTexture->activate();
    122     glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
     122    glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
    123123#endif
    124124
     
    158158
    159159#ifdef USE_TEXTURE
    160     glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
     160    glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
    161161    _pointTexture->deactivate();
    162162#endif
  • trunk/packages/vizservers/nanovis/VelocityArrowsSlice.cpp

    r3875 r4167  
    408408        _arrowsTex->activate();
    409409        glEnable(GL_TEXTURE_2D);
    410         glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
     410        glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
    411411
    412412        GLfloat atten[] = {1, 0, 0};
     
    415415        glPointParameterfARB(GL_POINT_SIZE_MIN_ARB, 1.0f);
    416416        glPointParameterfARB(GL_POINT_SIZE_MAX_ARB, _maxPointSize);
    417         glTexEnvf(GL_POINT_SPRITE_ARB, GL_COORD_REPLACE_ARB, GL_TRUE);
     417        glTexEnvi(GL_POINT_SPRITE_ARB, GL_COORD_REPLACE_ARB, GL_TRUE);
    418418
    419419        // FIXME: This vertex shader won't compile with ARB_vertex_program,
     
    456456
    457457        glActiveTexture(GL_TEXTURE0);
    458         glTexEnvf(GL_POINT_SPRITE_ARB, GL_COORD_REPLACE_ARB, GL_FALSE);
     458        glTexEnvi(GL_POINT_SPRITE_ARB, GL_COORD_REPLACE_ARB, GL_FALSE);
    459459        _arrowsTex->deactivate();
    460460    }
  • trunk/packages/vizservers/nanovis/nanovis.cpp

    r3935 r4167  
    334334    glGenTextures(1, &_finalColorTex);
    335335    glBindTexture(GL_TEXTURE_2D, _finalColorTex);
    336 
    337     glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
    338     glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
    339     glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
    340 
     336    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
     337    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
    341338#if defined(HAVE_FLOAT_TEXTURES) && defined(USE_HALF_FLOAT)
    342339    glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA16F_ARB, winWidth, winHeight, 0,
     
    408405    glGenTextures(1, &_finalColorTex);
    409406    glBindTexture(GL_TEXTURE_2D, _finalColorTex);
    410 
    411407    glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
    412408    glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
    413     glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
    414 
    415409#if defined(HAVE_FLOAT_TEXTURES) && defined(USE_HALF_FLOAT)
    416410    glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA16F_ARB, winWidth, winHeight, 0,
  • trunk/packages/vizservers/nanovis/util/Fonts.cpp

    r4164 r4167  
    7979Fonts::begin()
    8080{
    81     glPushAttrib(GL_TRANSFORM_BIT | GL_ENABLE_BIT);
     81    glPushAttrib(GL_TRANSFORM_BIT | GL_ENABLE_BIT | GL_TEXTURE_BIT);
    8282    glEnable(GL_TEXTURE_2D);
    8383    glBindTexture(GL_TEXTURE_2D, _fonts[_fontIndex]._fontTextureID);
     
    9494    glLoadIdentity();
    9595
    96 #if 0
    97     glDisable(GL_BLEND);
    98     glEnable(GL_DEPTH_TEST);
    99 #else
    10096    glEnable(GL_BLEND);
    10197    glDisable(GL_DEPTH_TEST);
    102 #endif
    10398}
    10499
Note: See TracChangeset for help on using the changeset viewer.