Changeset 5717


Ignore:
Timestamp:
Jun 17, 2015, 2:14:44 AM (9 years ago)
Author:
ldelgass
Message:

Downsample volume if dims exceed hardware limits

Location:
nanovis/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • nanovis/trunk/VtkDataSetReader.cpp

    r5672 r5717  
    147147        print(dataSet);
    148148
    149         int maxDim = 64;
    150 
    151149        resampledDataSet = vtkImageData::SafeDownCast(dataSet.GetPointer());
    152150        if (resampledDataSet != NULL) {
    153151            // Have a uniform grid, check if we need to resample
    154152#ifdef DOWNSAMPLE_DATA
     153            int maxDim = 64;
     154#else
     155            // This is the hardware limit
     156            int maxDim = NanoVis::max3dTextureSize;
     157#endif
    155158            if (resampledDataSet->GetDimensions()[0] > maxDim ||
    156159                resampledDataSet->GetDimensions()[1] > maxDim ||
     
    158161                resampledDataSet = resampleVTKDataSet(dataSet, maxDim);
    159162            }
    160 #endif
    161163        } else {
     164            int maxDim = 64;
    162165            resampledDataSet = resampleVTKDataSet(dataSet, maxDim);
    163166        }
  • nanovis/trunk/nanovis.cpp

    r5716 r5717  
    7777Camera *NanoVis::_camera = NULL;
    7878RenderContext *NanoVis::renderContext = NULL;
     79GLint NanoVis::max3dTextureSize = 2048;
    7980
    8081NanoVis::TransferFunctionHashmap NanoVis::tfTable;
     
    539540    _camera = new Camera(0, 0, winWidth, winHeight);
    540541
     542    glGetIntegerv(GL_MAX_3D_TEXTURE_SIZE, &max3dTextureSize);
     543    TRACE("Max 3D texture dim: %d", max3dTextureSize);
     544
    541545    glEnable(GL_TEXTURE_2D);
    542546    glShadeModel(GL_FLAT);
  • nanovis/trunk/nanovis.h

    r5716 r5717  
    139139    static util::Fonts *fonts;
    140140    static graphics::RenderContext *renderContext;
     141    static GLint max3dTextureSize;
    141142
    142143    static TransferFunctionHashmap tfTable; ///< maps transfunc name to TransferFunction object
Note: See TracChangeset for help on using the changeset viewer.