Moved caelum resources into the right place in the repo, instead of having cmake make redundant copies. Also fixed file modes/line endings.
@ -1,93 +1,93 @@
|
|||||||
#include "sky.hpp"
|
#include "sky.hpp"
|
||||||
#include "Caelum.h"
|
#include "Caelum.h"
|
||||||
|
|
||||||
namespace MWRender
|
namespace MWRender
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
// Implements a Caelum sky with default settings.
|
// Implements a Caelum sky with default settings.
|
||||||
//
|
//
|
||||||
// Note: this is intended as a temporary solution to provide some form of
|
// Note: this is intended as a temporary solution to provide some form of
|
||||||
// sky rendering. This code will obviously need significant tailoring to
|
// sky rendering. This code will obviously need significant tailoring to
|
||||||
// support fidelity with Morrowind's rendering. Before doing major work
|
// support fidelity with Morrowind's rendering. Before doing major work
|
||||||
// on this class, more research should be done to determine whether
|
// on this class, more research should be done to determine whether
|
||||||
// Caelum or another plug-in such as SkyX would be best for the long-term.
|
// Caelum or another plug-in such as SkyX would be best for the long-term.
|
||||||
//
|
//
|
||||||
class CaelumManager : public SkyManager
|
class CaelumManager : public SkyManager
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
Caelum::CaelumSystem* mpCaelumSystem;
|
Caelum::CaelumSystem* mpCaelumSystem;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CaelumManager (Ogre::RenderWindow* pRenderWindow,
|
CaelumManager (Ogre::RenderWindow* pRenderWindow,
|
||||||
Ogre::Camera* pCamera);
|
Ogre::Camera* pCamera);
|
||||||
virtual ~CaelumManager ();
|
virtual ~CaelumManager ();
|
||||||
};
|
};
|
||||||
|
|
||||||
CaelumManager::CaelumManager (Ogre::RenderWindow* pRenderWindow,
|
CaelumManager::CaelumManager (Ogre::RenderWindow* pRenderWindow,
|
||||||
Ogre::Camera* pCamera)
|
Ogre::Camera* pCamera)
|
||||||
: mpCaelumSystem (NULL)
|
: mpCaelumSystem (NULL)
|
||||||
{
|
{
|
||||||
using namespace Ogre;
|
using namespace Ogre;
|
||||||
using namespace Caelum;
|
using namespace Caelum;
|
||||||
|
|
||||||
assert(pCamera);
|
assert(pCamera);
|
||||||
assert(pRenderWindow);
|
assert(pRenderWindow);
|
||||||
|
|
||||||
// Load the Caelum resources
|
// Load the Caelum resources
|
||||||
//
|
//
|
||||||
ResourceGroupManager::getSingleton().addResourceLocation("resources\\caelum", "FileSystem", "Caelum");
|
ResourceGroupManager::getSingleton().addResourceLocation("resources/caelum", "FileSystem", "Caelum");
|
||||||
ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
|
ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
|
||||||
|
|
||||||
// Load the Caelum resources
|
// Load the Caelum resources
|
||||||
//
|
//
|
||||||
Ogre::SceneManager* pScene = pCamera->getSceneManager();
|
Ogre::SceneManager* pScene = pCamera->getSceneManager();
|
||||||
Caelum::CaelumSystem::CaelumComponent componentMask = CaelumSystem::CAELUM_COMPONENTS_DEFAULT;
|
Caelum::CaelumSystem::CaelumComponent componentMask = CaelumSystem::CAELUM_COMPONENTS_DEFAULT;
|
||||||
mpCaelumSystem = new Caelum::CaelumSystem (Root::getSingletonPtr(), pScene, componentMask);
|
mpCaelumSystem = new Caelum::CaelumSystem (Root::getSingletonPtr(), pScene, componentMask);
|
||||||
|
|
||||||
// Set time acceleration.
|
// Set time acceleration.
|
||||||
mpCaelumSystem->getUniversalClock()->setTimeScale(128);
|
mpCaelumSystem->getUniversalClock()->setTimeScale(128);
|
||||||
|
|
||||||
// Disable fog since OpenMW is handling OGRE fog elsewhere
|
// Disable fog since OpenMW is handling OGRE fog elsewhere
|
||||||
mpCaelumSystem->setManageSceneFog(false);
|
mpCaelumSystem->setManageSceneFog(false);
|
||||||
|
|
||||||
// Change the camera far distance to make sure the sky is not clipped
|
// Change the camera far distance to make sure the sky is not clipped
|
||||||
pCamera->setFarClipDistance(50000);
|
pCamera->setFarClipDistance(50000);
|
||||||
|
|
||||||
// Register Caelum as an OGRE listener
|
// Register Caelum as an OGRE listener
|
||||||
pRenderWindow->addListener(mpCaelumSystem);
|
pRenderWindow->addListener(mpCaelumSystem);
|
||||||
Root::getSingletonPtr()->addFrameListener(mpCaelumSystem);
|
Root::getSingletonPtr()->addFrameListener(mpCaelumSystem);
|
||||||
}
|
}
|
||||||
|
|
||||||
CaelumManager::~CaelumManager()
|
CaelumManager::~CaelumManager()
|
||||||
{
|
{
|
||||||
if (mpCaelumSystem)
|
if (mpCaelumSystem)
|
||||||
mpCaelumSystem->shutdown (false);
|
mpCaelumSystem->shutdown (false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Creates and connects the sky rendering component to OGRE.
|
/// Creates and connects the sky rendering component to OGRE.
|
||||||
///
|
///
|
||||||
/// \return NULL on failure.
|
/// \return NULL on failure.
|
||||||
///
|
///
|
||||||
SkyManager* SkyManager::create (Ogre::RenderWindow* pRenderWindow,
|
SkyManager* SkyManager::create (Ogre::RenderWindow* pRenderWindow,
|
||||||
Ogre::Camera* pCamera)
|
Ogre::Camera* pCamera)
|
||||||
{
|
{
|
||||||
SkyManager* pSkyManager = NULL;
|
SkyManager* pSkyManager = NULL;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
pSkyManager = new CaelumManager(pRenderWindow, pCamera);
|
pSkyManager = new CaelumManager(pRenderWindow, pCamera);
|
||||||
}
|
}
|
||||||
catch (Ogre::Exception& e)
|
catch (Ogre::Exception& e)
|
||||||
{
|
{
|
||||||
std::cout << "\nOGRE Exception when attempting to add sky: "
|
std::cout << "\nOGRE Exception when attempting to add sky: "
|
||||||
<< e.getFullDescription().c_str() << std::endl;
|
<< e.getFullDescription().c_str() << std::endl;
|
||||||
}
|
}
|
||||||
catch (std::exception& e)
|
catch (std::exception& e)
|
||||||
{
|
{
|
||||||
std::cout << "\nException when attempting to add sky: "
|
std::cout << "\nException when attempting to add sky: "
|
||||||
<< e.what() << std::endl;
|
<< e.what() << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
return pSkyManager;
|
return pSkyManager;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,57 +1,10 @@
|
|||||||
project(Caelum)
|
project(Caelum)
|
||||||
|
|
||||||
ADD_DEFINITIONS(-DCAELUM_LIB)
|
ADD_DEFINITIONS(-DCAELUM_LIB)
|
||||||
INCLUDE_DIRECTORIES( ${CMAKE_HOME_DIRECTORY}/extern/caelum/include )
|
INCLUDE_DIRECTORIES( ${CMAKE_HOME_DIRECTORY}/extern/caelum/include )
|
||||||
|
|
||||||
file(GLOB_RECURSE CAELUM_SRC src/*)
|
file(GLOB_RECURSE CAELUM_SRC src/*)
|
||||||
file(GLOB_RECURSE CAELUM_HDR include/*)
|
file(GLOB_RECURSE CAELUM_HDR include/*)
|
||||||
|
|
||||||
set(SOURCES ${CAELUM_SRC} ${CAELUM_HDR})
|
set(SOURCES ${CAELUM_SRC} ${CAELUM_HDR})
|
||||||
add_library(caelum STATIC ${SOURCES})
|
add_library(caelum STATIC ${SOURCES})
|
||||||
|
|
||||||
#
|
|
||||||
# Resources
|
|
||||||
#
|
|
||||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/AtmosphereDepth.png "${OpenMW_BINARY_DIR}/resources/caelum/AtmosphereDepth.png" COPYONLY)
|
|
||||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/CaelumGroundFog.cg "${OpenMW_BINARY_DIR}/resources/caelum/CaelumGroundFog.cg" COPYONLY)
|
|
||||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/CaelumLayeredClouds.cg "${OpenMW_BINARY_DIR}/resources/caelum/CaelumLayeredClouds.cg" COPYONLY)
|
|
||||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/CaelumPhaseMoon.cg "${OpenMW_BINARY_DIR}/resources/caelum/CaelumPhaseMoon.cg" COPYONLY)
|
|
||||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/CaelumPointStarfield.cg "${OpenMW_BINARY_DIR}/resources/caelum/CaelumPointStarfield.cg" COPYONLY)
|
|
||||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/CaelumSkyDome.cg "${OpenMW_BINARY_DIR}/resources/caelum/CaelumSkyDome.cg" COPYONLY)
|
|
||||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/CloudCoverLookup.png "${OpenMW_BINARY_DIR}/resources/caelum/CloudCoverLookup.png" COPYONLY)
|
|
||||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/DepthComposer.cg "${OpenMW_BINARY_DIR}/resources/caelum/DepthComposer.cg" COPYONLY)
|
|
||||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/DepthComposer.compositor "${OpenMW_BINARY_DIR}/resources/caelum/DepthComposer.compositor" COPYONLY)
|
|
||||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/DepthComposer.material "${OpenMW_BINARY_DIR}/resources/caelum/DepthComposer.material" COPYONLY)
|
|
||||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/DepthRender.program "${OpenMW_BINARY_DIR}/resources/caelum/DepthRender.program" COPYONLY)
|
|
||||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/EarthClearSky2.png "${OpenMW_BINARY_DIR}/resources/caelum/EarthClearSky2.png" COPYONLY)
|
|
||||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/GroundFog.material "${OpenMW_BINARY_DIR}/resources/caelum/GroundFog.material" COPYONLY)
|
|
||||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/GroundFog.program "${OpenMW_BINARY_DIR}/resources/caelum/GroundFog.program" COPYONLY)
|
|
||||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/Haze.program "${OpenMW_BINARY_DIR}/resources/caelum/Haze.program" COPYONLY)
|
|
||||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/LayeredClouds.material "${OpenMW_BINARY_DIR}/resources/caelum/LayeredClouds.material" COPYONLY)
|
|
||||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/MinimalCompositorVP.cg "${OpenMW_BINARY_DIR}/resources/caelum/MinimalCompositorVP.cg" COPYONLY)
|
|
||||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/MinimalCompositorVP.program "${OpenMW_BINARY_DIR}/resources/caelum/MinimalCompositorVP.program" COPYONLY)
|
|
||||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/moon.material "${OpenMW_BINARY_DIR}/resources/caelum/moon.material" COPYONLY)
|
|
||||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/moon_disc.dds "${OpenMW_BINARY_DIR}/resources/caelum/moon_disc.dds" COPYONLY)
|
|
||||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/noise1.dds "${OpenMW_BINARY_DIR}/resources/caelum/noise1.dds" COPYONLY)
|
|
||||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/noise2.dds "${OpenMW_BINARY_DIR}/resources/caelum/noise2.dds" COPYONLY)
|
|
||||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/noise3.dds "${OpenMW_BINARY_DIR}/resources/caelum/noise3.dds" COPYONLY)
|
|
||||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/noise4.dds "${OpenMW_BINARY_DIR}/resources/caelum/noise4.dds" COPYONLY)
|
|
||||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/PointStarfield.material "${OpenMW_BINARY_DIR}/resources/caelum/PointStarfield.material" COPYONLY)
|
|
||||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/Precipitation.cg "${OpenMW_BINARY_DIR}/resources/caelum/Precipitation.cg" COPYONLY)
|
|
||||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/Precipitation.compositor "${OpenMW_BINARY_DIR}/resources/caelum/Precipitation.compositor" COPYONLY)
|
|
||||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/Precipitation.material "${OpenMW_BINARY_DIR}/resources/caelum/Precipitation.material" COPYONLY)
|
|
||||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/precipitation_drizzle.png "${OpenMW_BINARY_DIR}/resources/caelum/precipitation_drizzle.png" COPYONLY)
|
|
||||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/precipitation_hail.png "${OpenMW_BINARY_DIR}/resources/caelum/precipitation_hail.png" COPYONLY)
|
|
||||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/precipitation_icecrystals.png "${OpenMW_BINARY_DIR}/resources/caelum/precipitation_icecrystals.png" COPYONLY)
|
|
||||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/precipitation_icepellets.png "${OpenMW_BINARY_DIR}/resources/caelum/precipitation_icepellets.png" COPYONLY)
|
|
||||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/precipitation_rain.png "${OpenMW_BINARY_DIR}/resources/caelum/precipitation_rain.png" COPYONLY)
|
|
||||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/precipitation_smallhail.png "${OpenMW_BINARY_DIR}/resources/caelum/precipitation_smallhail.png" COPYONLY)
|
|
||||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/precipitation_snow.png "${OpenMW_BINARY_DIR}/resources/caelum/precipitation_snow.png" COPYONLY)
|
|
||||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/precipitation_snowgrains.png "${OpenMW_BINARY_DIR}/resources/caelum/precipitation_snowgrains.png" COPYONLY)
|
|
||||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/SkyDome.material "${OpenMW_BINARY_DIR}/resources/caelum/SkyDome.material" COPYONLY)
|
|
||||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/sphere.mesh "${OpenMW_BINARY_DIR}/resources/caelum/sphere.mesh" COPYONLY)
|
|
||||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/Starfield.jpg "${OpenMW_BINARY_DIR}/resources/caelum/Starfield.jpg" COPYONLY)
|
|
||||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/Starfield.material "${OpenMW_BINARY_DIR}/resources/caelum/Starfield.material" COPYONLY)
|
|
||||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/Sun.material "${OpenMW_BINARY_DIR}/resources/caelum/Sun.material" COPYONLY)
|
|
||||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/SunGradient.png "${OpenMW_BINARY_DIR}/resources/caelum/SunGradient.png" COPYONLY)
|
|
||||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/sun_disc.png "${OpenMW_BINARY_DIR}/resources/caelum/sun_disc.png" COPYONLY)
|
|
||||||
|
Before Width: | Height: | Size: 220 B After Width: | Height: | Size: 220 B |
Before Width: | Height: | Size: 262 B After Width: | Height: | Size: 262 B |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 462 KiB After Width: | Height: | Size: 462 KiB |
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 569 KiB After Width: | Height: | Size: 569 KiB |
Before Width: | Height: | Size: 347 KiB After Width: | Height: | Size: 347 KiB |
Before Width: | Height: | Size: 429 KiB After Width: | Height: | Size: 429 KiB |
Before Width: | Height: | Size: 423 KiB After Width: | Height: | Size: 423 KiB |
Before Width: | Height: | Size: 440 KiB After Width: | Height: | Size: 440 KiB |
Before Width: | Height: | Size: 390 KiB After Width: | Height: | Size: 390 KiB |
Before Width: | Height: | Size: 426 KiB After Width: | Height: | Size: 426 KiB |
Before Width: | Height: | Size: 479 KiB After Width: | Height: | Size: 479 KiB |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |