Ignore:
Timestamp:
Feb 1, 2014 11:38:35 PM (7 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.

File:
1 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);
Note: See TracChangeset for help on using the changeset viewer.