| diff --git a/src/osgOcean/CMakeLists.txt b/src/osgOcean/CMakeLists.txt |
| index 29b55b0..b79a92f 100644 |
| --- a/src/osgOcean/CMakeLists.txt |
| +++ b/src/osgOcean/CMakeLists.txt |
| @@ -145,10 +145,10 @@ INSTALL( |
| |
| INSTALL( |
| FILES ${SHADER_FILES} |
| - DESTINATION ${CMAKE_INSTALL_PREFIX}/bin/resources/shaders |
| + DESTINATION ${CMAKE_INSTALL_PREFIX}/share/osgOcean/shaders |
| ) |
| |
| INSTALL( |
| FILES ${TEXTURE_FILES} |
| - DESTINATION ${CMAKE_INSTALL_PREFIX}/bin/resources/textures |
| + DESTINATION ${CMAKE_INSTALL_PREFIX}/share/osgOcean/textures |
| ) |
| diff --git a/src/osgOcean/DistortionSurface.cpp b/src/osgOcean/DistortionSurface.cpp |
| index 9d30b4e..7bd9d52 100644 |
| --- a/src/osgOcean/DistortionSurface.cpp |
| +++ b/src/osgOcean/DistortionSurface.cpp |
| @@ -86,8 +84,8 @@ void DistortionSurface::build( const osg::Vec3f& corner, const osg::Vec2f& dims, |
| |
| osg::Program* DistortionSurface::createShader(void) |
| { |
| - static const char osgOcean_water_distortion_vert_file[] = "osgOcean_water_distortion.vert"; |
| - static const char osgOcean_water_distortion_frag_file[] = "osgOcean_water_distortion.frag"; |
| + static const char osgOcean_water_distortion_vert_file[] = "osgOcean/shaders/osgOcean_water_distortion.vert"; |
| + static const char osgOcean_water_distortion_frag_file[] = "osgOcean/shaders/osgOcean_water_distortion.frag"; |
| |
| return ShaderManager::instance().createProgram("distortion_surface", |
| osgOcean_water_distortion_vert_file, osgOcean_water_distortion_frag_file, |
| @@ -106,28 +104,20 @@ void DistortionSurface::update( const double& dt ) |
| |
| void DistortionSurface::addResourcePaths(void) |
| { |
| - const std::string shaderPath = "resources/shaders/"; |
| - const std::string texturePath = "resources/textures/"; |
| + const std::string resourcePath = "../share/"; |
| |
| osgDB::FilePathList& pathList = osgDB::Registry::instance()->getDataFilePathList(); |
| |
| - bool shaderPathPresent = false; |
| - bool texturePathPresent = false; |
| + bool resourcePathPresent = false; |
| |
| for(unsigned int i = 0; i < pathList.size(); ++i ) |
| { |
| - if( pathList.at(i).compare(shaderPath) == 0 ) |
| - shaderPathPresent = true; |
| - |
| - if( pathList.at(i).compare(texturePath) == 0 ) |
| - texturePathPresent = true; |
| + if( pathList.at(i).compare(resourcePath) == 0 ) |
| + resourcePathPresent = true; |
| } |
| |
| - if(!texturePathPresent) |
| - pathList.push_back(texturePath); |
| - |
| - if(!shaderPathPresent) |
| - pathList.push_back(shaderPath); |
| + if(!resourcePathPresent) |
| + pathList.push_front(resourcePath); |
| } |
| |
| // -------------------------------------------- |
| diff --git a/src/osgOcean/FFTOceanSurface.cpp b/src/osgOcean/FFTOceanSurface.cpp |
| index bf11ed8..f1df992 100644 |
| --- a/src/osgOcean/FFTOceanSurface.cpp |
| +++ b/src/osgOcean/FFTOceanSurface.cpp |
| @@ -110,7 +110,7 @@ void FFTOceanSurface::initStateSet( void ) |
| |
| if( _useCrestFoam ) |
| { |
| - osg::Texture2D* foam_tex = createTexture("sea_foam.png", osg::Texture::REPEAT ); |
| + osg::Texture2D* foam_tex = createTexture("osgOcean/textures/sea_foam.png", osg::Texture::REPEAT ); |
| if (ShaderManager::instance().areShadersEnabled()) |
| _stateset->setTextureAttributeAndModes( FOAM_MAP, foam_tex, osg::StateAttribute::ON ); |
| } |
| @@ -1038,8 +1038,8 @@ osg::Vec3f FFTOceanSurface::computeNoiseCoords(float noiseSize, const osg::Vec2f |
| |
| osg::Program* FFTOceanSurface::createShader(void) |
| { |
| - static const char osgOcean_ocean_surface_vert_file[] = "osgOcean_ocean_surface.vert"; |
| - static const char osgOcean_ocean_surface_frag_file[] = "osgOcean_ocean_surface.frag"; |
| + static const char osgOcean_ocean_surface_vert_file[] = "osgOcean/shaders/osgOcean_ocean_surface.vert"; |
| + static const char osgOcean_ocean_surface_frag_file[] = "osgOcean/shaders/osgOcean_ocean_surface.frag"; |
| |
| osg::Program* program = |
| ShaderManager::instance().createProgram("ocean_surface", |
| diff --git a/src/osgOcean/FFTOceanSurfaceVBO.cpp b/src/osgOcean/FFTOceanSurfaceVBO.cpp |
| index c444596..5453586 100644 |
| --- a/src/osgOcean/FFTOceanSurfaceVBO.cpp |
| +++ b/src/osgOcean/FFTOceanSurfaceVBO.cpp |
| @@ -124,7 +124,7 @@ void FFTOceanSurfaceVBO::initStateSet( void ) |
| |
| if( _useCrestFoam ) |
| { |
| - osg::Texture2D* foam_tex = createTexture("sea_foam.png", osg::Texture::REPEAT ); |
| + osg::Texture2D* foam_tex = createTexture("osgOcean/textures/sea_foam.png", osg::Texture::REPEAT ); |
| if (ShaderManager::instance().areShadersEnabled()) |
| _stateset->setTextureAttributeAndModes( FOAM_MAP, foam_tex, osg::StateAttribute::ON | |
| osg::StateAttribute::PROTECTED); |
| @@ -631,8 +631,8 @@ osg::Vec3f FFTOceanSurfaceVBO::computeNoiseCoords(float noiseSize, const osg::Ve |
| |
| osg::Program* FFTOceanSurfaceVBO::createShader(void) |
| { |
| - static const char osgOcean_ocean_surface_vert_file[] = "osgOcean_ocean_surface_vbo.vert"; |
| - static const char osgOcean_ocean_surface_frag_file[] = "osgOcean_ocean_surface.frag"; |
| + static const char osgOcean_ocean_surface_vert_file[] = "osgOcean/shaders/osgOcean_ocean_surface_vbo.vert"; |
| + static const char osgOcean_ocean_surface_frag_file[] = "osgOcean/shaders/osgOcean_ocean_surface.frag"; |
| |
| osg::Program* program = |
| ShaderManager::instance().createProgram("ocean_surface", |
| diff --git a/src/osgOcean/GodRayBlendSurface.cpp b/src/osgOcean/GodRayBlendSurface.cpp |
| index dbf51da..634f945 100644 |
| --- a/src/osgOcean/GodRayBlendSurface.cpp |
| +++ b/src/osgOcean/GodRayBlendSurface.cpp |
| @@ -95,8 +95,8 @@ void GodRayBlendSurface::build( const osg::Vec3f& corner, const osg::Vec2f& dims |
| |
| osg::Program* GodRayBlendSurface::createShader(void) |
| { |
| - static const char osgOcean_godray_screen_blend_vert_file[] = "osgOcean_godray_screen_blend.vert"; |
| - static const char osgOcean_godray_screen_blend_frag_file[] = "osgOcean_godray_screen_blend.frag"; |
| + static const char osgOcean_godray_screen_blend_vert_file[] = "osgOcean/shaders/osgOcean_godray_screen_blend.vert"; |
| + static const char osgOcean_godray_screen_blend_frag_file[] = "osgOcean/shaders/osgOcean_godray_screen_blend.frag"; |
| |
| return ShaderManager::instance().createProgram( "godray_blend", |
| osgOcean_godray_screen_blend_vert_file, osgOcean_godray_screen_blend_frag_file, |
| diff --git a/src/osgOcean/GodRays.cpp b/src/osgOcean/GodRays.cpp |
| index 18cf2f2..69d7300 100644 |
| --- a/src/osgOcean/GodRays.cpp |
| +++ b/src/osgOcean/GodRays.cpp |
| @@ -197,7 +197,7 @@ osg::Geometry* GodRays::createRayShafts(void) |
| |
| osg::Geometry* GodRays::createGlareQuad(void) |
| { |
| - osg::ref_ptr<osg::Image> glareImage = osgDB::readImageFile("sun_glare.png"); |
| + osg::ref_ptr<osg::Image> glareImage = osgDB::readImageFile("osgOcean/textures/sun_glare.png"); |
| |
| if( !glareImage.valid() ) |
| return NULL; |
| @@ -329,8 +329,8 @@ osg::Vec3f GodRays::refract( const float ratio, const osg::Vec3f& I, const osg:: |
| |
| osg::Program* GodRays::createGodRayProgram( void ) |
| { |
| - static const char osgOcean_godrays_vert_file[] = "osgOcean_godrays.vert"; |
| - static const char osgOcean_godrays_frag_file[] = "osgOcean_godrays.frag"; |
| + static const char osgOcean_godrays_vert_file[] = "osgOcean/shaders/osgOcean_godrays.vert"; |
| + static const char osgOcean_godrays_frag_file[] = "osgOcean/shaders/osgOcean_godrays.frag"; |
| |
| return ShaderManager::instance().createProgram("godrays_shader", |
| osgOcean_godrays_vert_file, osgOcean_godrays_frag_file, |
| @@ -342,8 +342,8 @@ osg::Program* GodRays::createGodRayProgram( void ) |
| |
| osg::Program* GodRays::createGodRayGlareProgram( void ) |
| { |
| - static const char osgOcean_godray_glare_vert_file[] = "osgOcean_godray_glare.vert"; |
| - static const char osgOcean_godray_glare_frag_file[] = "osgOcean_godray_glare.frag"; |
| + static const char osgOcean_godray_glare_vert_file[] = "osgOcean/shaders/osgOcean_godray_glare.vert"; |
| + static const char osgOcean_godray_glare_frag_file[] = "osgOcean/shaders/osgOcean_godray_glare.frag"; |
| |
| return ShaderManager::instance().createProgram("godray_glare", |
| osgOcean_godray_glare_vert_file, osgOcean_godray_glare_frag_file, |
| diff --git a/src/osgOcean/OceanScene.cpp b/src/osgOcean/OceanScene.cpp |
| index d6ddc42..8bfaa9d 100644 |
| --- a/src/osgOcean/OceanScene.cpp |
| +++ b/src/osgOcean/OceanScene.cpp |
| @@ -701,8 +697,8 @@ void OceanScene::ViewData::init( OceanScene *oceanScene, osgUtil::CullVisitor * |
| _heightmapCamera->setCullMask( _oceanScene->_heightmapMask ); |
| _heightmapCamera->setCullCallback( new CameraCullCallback(_oceanScene.get()) ); |
| |
| - static const char osgOcean_heightmap_vert_file[] = "osgOcean_heightmap.vert"; |
| - static const char osgOcean_heightmap_frag_file[] = "osgOcean_heightmap.frag"; |
| + static const char osgOcean_heightmap_vert_file[] = "osgOcean/shaders/osgOcean_heightmap.vert"; |
| + static const char osgOcean_heightmap_frag_file[] = "osgOcean/shaders/osgOcean_heightmap.frag"; |
| |
| osg::ref_ptr<osg::Program> program = ShaderManager::instance().createProgram( "heightmap", |
| osgOcean_heightmap_vert_file, osgOcean_heightmap_frag_file, |
| @@ -1123,9 +1119,9 @@ osg::Camera* OceanScene::downsamplePass(osg::TextureRectangle* colorBuffer, |
| osg::TextureRectangle* outputTexture, |
| bool isGlareEffect ) |
| { |
| - static const char osgOcean_downsample_vert_file[] = "osgOcean_downsample.vert"; |
| - static const char osgOcean_downsample_frag_file[] = "osgOcean_downsample.frag"; |
| - static const char osgOcean_downsample_glare_frag_file[] = "osgOcean_downsample_glare.frag"; |
| + static const char osgOcean_downsample_vert_file[] = "osgOcean/shaders/osgOcean_downsample.vert"; |
| + static const char osgOcean_downsample_frag_file[] = "osgOcean/shaders/osgOcean_downsample.frag"; |
| + static const char osgOcean_downsample_glare_frag_file[] = "osgOcean/shaders/osgOcean_downsample_glare.frag"; |
| |
| osg::Vec2s lowResDims = _screenDims/4; |
| |
| @@ -1173,9 +1169,9 @@ osg::Camera* OceanScene::downsamplePass(osg::TextureRectangle* colorBuffer, |
| |
| osg::Camera* OceanScene::gaussianPass( osg::TextureRectangle* inputTexture, osg::TextureRectangle* outputTexture, bool isXAxis ) |
| { |
| - static const char osgOcean_gaussian_vert_file[] = "osgOcean_gaussian.vert"; |
| - static const char osgOcean_gaussian1_frag_file[] = "osgOcean_gaussian1.frag"; |
| - static const char osgOcean_gaussian2_frag_file[] = "osgOcean_gaussian2.frag"; |
| + static const char osgOcean_gaussian_vert_file[] = "osgOcean/shaders/osgOcean_gaussian.vert"; |
| + static const char osgOcean_gaussian1_frag_file[] = "osgOcean/shaders/osgOcean_gaussian1.frag"; |
| + static const char osgOcean_gaussian2_frag_file[] = "osgOcean/shaders/osgOcean_gaussian2.frag"; |
| |
| osg::Vec2s lowResDims = _screenDims/4.f; |
| |
| @@ -1220,8 +1216,8 @@ osg::Camera* OceanScene::dofCombinerPass(osg::TextureRectangle* fullscreenTextur |
| osg::TextureRectangle* blurTexture, |
| osg::TextureRectangle* outputTexture ) |
| { |
| - static const char osgOcean_dof_combiner_vert_file[] = "osgOcean_dof_combiner.vert"; |
| - static const char osgOcean_dof_combiner_frag_file[] = "osgOcean_dof_combiner.frag"; |
| + static const char osgOcean_dof_combiner_vert_file[] = "osgOcean/shaders/osgOcean_dof_combiner.vert"; |
| + static const char osgOcean_dof_combiner_frag_file[] = "osgOcean/shaders/osgOcean_dof_combiner.frag"; |
| |
| osg::Vec2f screenRes( (float)_screenDims.x(), (float)_screenDims.y() ); |
| osg::Vec2f invScreenRes( 1.f / (float)_screenDims.x(), 1.f / (float)_screenDims.y() ); |
| @@ -1279,8 +1275,8 @@ osg::Camera* OceanScene::glarePass(osg::TextureRectangle* streakInput, |
| int pass, |
| osg::Vec2f direction ) |
| { |
| - static const char osgOcean_streak_vert_file[] = "osgOcean_streak.vert"; |
| - static const char osgOcean_streak_frag_file[] = "osgOcean_streak.frag"; |
| + static const char osgOcean_streak_vert_file[] = "osgOcean/shaders/osgOcean_streak.vert"; |
| + static const char osgOcean_streak_frag_file[] = "osgOcean/shaders/osgOcean_streak.frag"; |
| |
| osg::Vec2s lowResDims = _screenDims / 4; |
| |
| @@ -1328,8 +1324,8 @@ osg::Camera* OceanScene::glareCombinerPass( osg::TextureRectangle* fullscreenTex |
| |
| osg::Geode* quad = createScreenQuad( _screenDims, _screenDims ); |
| |
| - static const char osgOcean_glare_composite_vert_file[] = "osgOcean_glare_composite.vert"; |
| - static const char osgOcean_glare_composite_frag_file[] = "osgOcean_glare_composite.frag"; |
| + static const char osgOcean_glare_composite_vert_file[] = "osgOcean/shaders/osgOcean_glare_composite.vert"; |
| + static const char osgOcean_glare_composite_frag_file[] = "osgOcean/shaders/osgOcean_glare_composite.frag"; |
| |
| osg::Program* program = |
| ShaderManager::instance().createProgram( "glare_composite", |
| @@ -1401,38 +1397,30 @@ osg::Geode* OceanScene::createScreenQuad( const osg::Vec2s& dims, const osg::Vec |
| |
| osg::Program* OceanScene::createDefaultSceneShader(void) |
| { |
| - static const char osgOcean_ocean_scene_vert_file[] = "osgOcean_ocean_scene.vert"; |
| - static const char osgOcean_ocean_scene_frag_file[] = "osgOcean_ocean_scene.frag"; |
| + static const char osgOcean_ocean_scene_vert_file[] = "osgOcean/shaders/osgOcean_ocean_scene.vert"; |
| + static const char osgOcean_ocean_scene_frag_file[] = "osgOcean/shaders/osgOcean_ocean_scene.frag"; |
| |
| return ShaderManager::instance().createProgram("scene_shader", |
| osgOcean_ocean_scene_vert_file, osgOcean_ocean_scene_frag_file, |
| osgOcean_ocean_scene_vert, osgOcean_ocean_scene_frag); |
| } |
| |
| void OceanScene::addResourcePaths(void) |
| { |
| - const std::string shaderPath = "resources/shaders/"; |
| - const std::string texturePath = "resources/textures/"; |
| + const std::string resourcePath = "../share/"; |
| |
| osgDB::FilePathList& pathList = osgDB::Registry::instance()->getDataFilePathList(); |
| |
| - bool shaderPathPresent = false; |
| - bool texturePathPresent = false; |
| + bool resourcePathPresent = false; |
| |
| for(unsigned int i = 0; i < pathList.size(); ++i ) |
| { |
| - if( pathList.at(i).compare(shaderPath) == 0 ) |
| - shaderPathPresent = true; |
| - |
| - if( pathList.at(i).compare(texturePath) == 0 ) |
| - texturePathPresent = true; |
| + if( pathList.at(i).compare(resourcePath) == 0 ) |
| + resourcePathPresent = true; |
| } |
| |
| - if(!texturePathPresent) |
| - pathList.push_back(texturePath); |
| - |
| - if(!shaderPathPresent) |
| - pathList.push_back(shaderPath); |
| + if(!resourcePathPresent) |
| + pathList.push_front(resourcePath); |
| } |
| |
| // ------------------------------- |
| diff --git a/src/osgOcean/OceanTechnique.cpp b/src/osgOcean/OceanTechnique.cpp |
| index 325715e..ab48a00 100644 |
| --- a/src/osgOcean/OceanTechnique.cpp |
| +++ b/src/osgOcean/OceanTechnique.cpp |
| @@ -83,28 +83,20 @@ bool OceanTechnique::isVisible( osgUtil::CullVisitor& cv, bool eyeAboveWater ) |
| |
| void OceanTechnique::addResourcePaths(void) |
| { |
| - const std::string shaderPath = "resources/shaders/"; |
| - const std::string texturePath = "resources/textures/"; |
| + const std::string resourcePath = "../share/"; |
| |
| osgDB::FilePathList& pathList = osgDB::Registry::instance()->getDataFilePathList(); |
| |
| - bool shaderPathPresent = false; |
| - bool texturePathPresent = false; |
| + bool resourcePathPresent = false; |
| |
| for(unsigned int i = 0; i < pathList.size(); ++i ) |
| { |
| - if( pathList.at(i).compare(shaderPath) == 0 ) |
| - shaderPathPresent = true; |
| - |
| - if( pathList.at(i).compare(texturePath) == 0 ) |
| - texturePathPresent = true; |
| + if( pathList.at(i).compare(resourcePath) == 0 ) |
| + resourcePathPresent = true; |
| } |
| |
| - if(!texturePathPresent) |
| - pathList.push_back(texturePath); |
| - |
| - if(!shaderPathPresent) |
| - pathList.push_back(shaderPath); |
| + if(!resourcePathPresent) |
| + pathList.push_front(resourcePath); |
| } |
| |
| // -------------------------------------------------------- |
| diff --git a/src/osgOcean/SiltEffect.cpp b/src/osgOcean/SiltEffect.cpp |
| index 7ab41cd..6ad4b6c 100644 |
| --- a/src/osgOcean/SiltEffect.cpp |
| +++ b/src/osgOcean/SiltEffect.cpp |
| @@ -442,8 +442,8 @@ void SiltEffect::setUpGeometries(unsigned int numParticles) |
| |
| _quadStateSet->setRenderBinDetails(quadRenderBin,"DepthSortedBin"); |
| |
| - static const char osgOcean_silt_quads_vert_file[] = "osgOcean_silt_quads.vert"; |
| - static const char osgOcean_silt_quads_frag_file[] = "osgOcean_silt_quads.frag"; |
| + static const char osgOcean_silt_quads_vert_file[] = "osgOcean/shaders/osgOcean_silt_quads.vert"; |
| + static const char osgOcean_silt_quads_frag_file[] = "osgOcean/shaders/osgOcean_silt_quads.frag"; |
| |
| osg::Program* program = |
| ShaderManager::instance().createProgram("silt_quads", |
| @@ -456,8 +456,8 @@ void SiltEffect::setUpGeometries(unsigned int numParticles) |
| { |
| _pointStateSet = new osg::StateSet; |
| |
| - static const char osgOcean_silt_points_vert_file[] = "osgOcean_silt_points.vert"; |
| - static const char osgOcean_silt_points_frag_file[] = "osgOcean_silt_points.frag"; |
| + static const char osgOcean_silt_points_vert_file[] = "osgOcean/shaders/osgOcean_silt_points.vert"; |
| + static const char osgOcean_silt_points_frag_file[] = "osgOcean/shaders/osgOcean_silt_points.frag"; |
| |
| osg::Program* program = |
| ShaderManager::instance().createProgram("silt_point", |
| diff --git a/src/oceanExample/CMakeLists.txt b/src/oceanExample/CMakeLists.txt |
| index 09ae9f4..0873244 100644 |
| --- a/src/oceanExample/CMakeLists.txt |
| +++ b/src/oceanExample/CMakeLists.txt |
| @@ -106,32 +106,32 @@ |
| |
| INSTALL( |
| FILES ${SKYBOX_TEXTURES_1} |
| - DESTINATION ${CMAKE_INSTALL_PREFIX}/bin/resources/textures/sky_clear |
| + DESTINATION ${CMAKE_INSTALL_PREFIX}/share/osgOcean/textures/sky_clear |
| ) |
| |
| INSTALL( |
| FILES ${SKYBOX_TEXTURES_2} |
| - DESTINATION ${CMAKE_INSTALL_PREFIX}/bin/resources/textures/sky_dusk |
| + DESTINATION ${CMAKE_INSTALL_PREFIX}/share/osgOcean/textures/sky_dusk |
| ) |
| |
| INSTALL( |
| FILES ${SKYBOX_TEXTURES_3} |
| - DESTINATION ${CMAKE_INSTALL_PREFIX}/bin/resources/textures/sky_fair_cloudy |
| + DESTINATION ${CMAKE_INSTALL_PREFIX}/share/osgOcean/textures/sky_fair_cloudy |
| ) |
| |
| INSTALL( |
| FILES ${EXAMPLE_SHADERS} |
| - DESTINATION ${CMAKE_INSTALL_PREFIX}/bin/resources/shaders |
| + DESTINATION ${CMAKE_INSTALL_PREFIX}/share/osgOcean/shaders |
| ) |
| |
| INSTALL( |
| FILES ${ISLAND_RESOURCES} |
| - DESTINATION ${CMAKE_INSTALL_PREFIX}/bin/resources/island |
| + DESTINATION ${CMAKE_INSTALL_PREFIX}/share/osgOcean/island |
| ) |
| |
| INSTALL( |
| FILES ${BOAT_RESOURCES} |
| - DESTINATION ${CMAKE_INSTALL_PREFIX}/bin/resources/boat |
| + DESTINATION ${CMAKE_INSTALL_PREFIX}/share/osgOcean/boat |
| ) |
| |
| |
| diff --git a/src/oceanExample/application.cpp b/src/oceanExample/application.cpp |
| index 09ae9f4..0873244 100644 |
| --- a/src/oceanExample/application.cpp |
| +++ b/src/oceanExample/application.cpp |
| @@ -224,7 +224,7 @@ |
| |
| if (!disableShaders) |
| { |
| - osg::Shader* vs = osgDB::readShaderFile(osg::Shader::VERTEX,"osgOcean_ocean_scene_lispsm.vert"); |
| + osg::Shader* vs = osgDB::readShaderFile(osg::Shader::VERTEX,"osgOcean/shaders/osgOcean_ocean_scene_lispsm.vert"); |
| osg::ref_ptr<osg::Program> program = new osg::Program; |
| |
| if (vs) |
| @@ -236,7 +236,7 @@ |
| osg::notify(osg::WARN) << "osgOcean: Could not read shader from file: osgOcean_ocean_scene_lispsm.vert" << std::endl; |
| } |
| |
| - osg::Shader* fs = osgDB::readShaderFile(osg::Shader::FRAGMENT,"osgOcean_ocean_scene_lispsm.frag"); |
| + osg::Shader* fs = osgDB::readShaderFile(osg::Shader::FRAGMENT,"osgOcean/shaders/osgOcean_ocean_scene_lispsm.frag"); |
| |
| if (fs) |
| { |
| @@ -253,7 +253,7 @@ |
| } |
| |
| osg::Program* sceneProgram = osgOcean::ShaderManager::instance().createProgram("scene_shader", |
| - "osgOcean_ocean_scene_lispsm.vert", "osgOcean_ocean_scene_lispsm.frag", "", ""); |
| + "osgOcean/shaders/osgOcean_ocean_scene_lispsm.vert", "osgOcean/shaders/osgOcean_ocean_scene_lispsm.frag", "", ""); |
| scene->getOceanScene()->setDefaultSceneShader(sceneProgram); |
| } |
| |
| @@ -300,8 +300,8 @@ |
| |
| if (testCollision) |
| { |
| - osgDB::Registry::instance()->getDataFilePathList().push_back("resources/boat"); |
| - const std::string filename = "boat.3ds"; |
| + osgDB::Registry::instance()->getDataFilePathList().push_back("../share"); |
| + const std::string filename = "osgOcean/boat/boat.3ds"; |
| osg::ref_ptr<osg::Node> boat = osgDB::readNodeFile(filename); |
| |
| if(boat.valid()) |
| diff --git a/src/oceanExample/Scene.cpp b/src/oceanExample/Scene.cpp |
| index 09ae9f4..0873244 100644 |
| --- a/src/oceanExample/Scene.cpp |
| +++ b/src/oceanExample/Scene.cpp |
| @@ -309,8 +309,8 @@ |
| // The custom shader is needed to add multi-texturing and bump mapping to the terrain. |
| osg::Node* Scene::loadIslands(const std::string& terrain_shader_basename) |
| { |
| - osgDB::Registry::instance()->getDataFilePathList().push_back("resources/island"); |
| - const std::string filename = "islands.ive"; |
| + osgDB::Registry::instance()->getDataFilePathList().push_back("../share"); |
| + const std::string filename = "osgOcean/island/islands.ive"; |
| osg::ref_ptr<osg::Node> island = osgDB::readNodeFile(filename); |
| |
| if(!island.valid()){ |
| @@ -319,8 +319,8 @@ osg::Node* Scene::loadIslands(const std::string& terrain_shader_basename) |
| } |
| |
| #ifdef USE_CUSTOM_SHADER |
| - const std::string terrain_vertex = terrain_shader_basename + ".vert"; |
| - const std::string terrain_fragment = terrain_shader_basename + ".frag"; |
| + const std::string terrain_vertex = "osgOcean/shaders/" + terrain_shader_basename + ".vert"; |
| + const std::string terrain_fragment = "osgOcean/shaders/" + terrain_shader_basename + ".frag"; |
| |
| osg::Program* program = osgOcean::ShaderManager::instance().createProgram("terrain", terrain_vertex, terrain_fragment, "", "" ); |
| if(program) program->addBindAttribLocation("aTangent", 6); |
| @@ -352,12 +352,12 @@ |
| |
| std::string filenames[6]; |
| |
| - filenames[POS_X] = "resources/textures/" + dir + "/east.png"; |
| - filenames[NEG_X] = "resources/textures/" + dir + "/west.png"; |
| - filenames[POS_Z] = "resources/textures/" + dir + "/north.png"; |
| - filenames[NEG_Z] = "resources/textures/" + dir + "/south.png"; |
| - filenames[POS_Y] = "resources/textures/" + dir + "/down.png"; |
| - filenames[NEG_Y] = "resources/textures/" + dir + "/up.png"; |
| + filenames[POS_X] = "osgOcean/textures/" + dir + "/east.png"; |
| + filenames[NEG_X] = "osgOcean/textures/" + dir + "/west.png"; |
| + filenames[POS_Z] = "osgOcean/textures/" + dir + "/north.png"; |
| + filenames[NEG_Z] = "osgOcean/textures/" + dir + "/south.png"; |
| + filenames[POS_Y] = "osgOcean/textures/" + dir + "/down.png"; |
| + filenames[NEG_Y] = "osgOcean/textures/" + dir + "/up.png"; |
| |
| osg::ref_ptr<osg::TextureCubeMap> cubeMap = new osg::TextureCubeMap; |
| cubeMap->setInternalFormat(GL_RGBA); |