Show
Ignore:
Timestamp:
10/21/14 17:10:27 (4 days ago)
Author:
robert
Message:

Added shaders to support experimental shader based displacement mapping technique osgTerrain::ShaderTerrain?.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/src/osgVolume/VolumeScene.cpp

    r14021 r14044  
    102102        if (viewport) 
    103103        { 
    104             textureWidth = viewport->width(); 
    105             textureHeight = viewport->height(); 
     104            textureWidth = static_cast<int>(viewport->width()); 
     105            textureHeight = static_cast<int>(viewport->height()); 
    106106        } 
    107107 
     
    210210        OSG_NOTICE<<"Creating ViewData"<<std::endl; 
    211211 
    212         unsigned textureWidth = 512; 
    213         unsigned textureHeight = 512; 
     212        int textureWidth = 512; 
     213        int textureHeight = 512; 
    214214 
    215215        osg::Viewport* viewport = cv->getCurrentRenderStage()->getViewport(); 
    216216        if (viewport) 
    217217        { 
    218             textureWidth = viewport->width(); 
    219             textureHeight = viewport->height(); 
     218            textureWidth = static_cast<int>(viewport->width()); 
     219            textureHeight = static_cast<int>(viewport->height()); 
    220220        } 
    221221 
     
    365365        viewData->_viewportDimensionsUniform->set(osg::Vec4(viewport->x(), viewport->y(), viewport->width(),viewport->height())); 
    366366 
    367         if (viewport->width() != viewData->_colorTexture->getTextureWidth() || 
    368             viewport->height() != viewData->_colorTexture->getTextureHeight()) 
    369         { 
    370             OSG_NOTICE<<"Need to change texture size to "<<viewport->width()<<", "<< viewport->height()<<std::endl; 
    371             viewData->_colorTexture->setTextureSize(viewport->width(), viewport->height()); 
     367        int textureWidth = static_cast<int>(viewport->width()); 
     368        int textureHeight = static_cast<int>(viewport->height()); 
     369 
     370        if (textureWidth != viewData->_colorTexture->getTextureWidth() || 
     371            textureHeight != viewData->_colorTexture->getTextureHeight()) 
     372        { 
     373            OSG_NOTICE<<"Need to change texture size to "<<textureWidth<<", "<< textureHeight<<std::endl; 
     374            viewData->_colorTexture->setTextureSize(textureWidth, textureHeight); 
    372375            viewData->_colorTexture->dirtyTextureObject(); 
    373             viewData->_depthTexture->setTextureSize(viewport->width(), viewport->height()); 
     376            viewData->_depthTexture->setTextureSize(textureWidth, textureHeight); 
    374377            viewData->_depthTexture->dirtyTextureObject(); 
    375             viewData->_rttCamera->setViewport(0, 0, viewport->width(), viewport->height()); 
     378            viewData->_rttCamera->setViewport(0, 0, textureWidth, textureHeight); 
    376379            if (viewData->_rttCamera->getRenderingCache()) 
    377380            {