Revision: 1512
http://rigsofrods.svn.sourceforge.net/rigsofrods/?rev=1512&view=rev
Author: rorthomas
Date: 2010-08-13 15:40:21 +0000 (Fri, 13 Aug 2010)
Log Message:
-----------
added rtshader system
Modified Paths:
--------------
trunk/CMakeDependenciesConfig.txt
trunk/source/main/CMakeLists.txt
trunk/source/main/RigsOfRods.cpp
trunk/source/main/RigsOfRods.h
Added Paths:
-----------
trunk/bin/resources/rtshader.zip
Modified: trunk/CMakeDependenciesConfig.txt
===================================================================
--- trunk/CMakeDependenciesConfig.txt 2010-08-11 09:44:05 UTC (rev 1511)
+++ trunk/CMakeDependenciesConfig.txt 2010-08-13 15:40:21 UTC (rev 1512)
@@ -44,6 +44,10 @@
set(Ogre_Paging_LIBRARY_DIRS "${ROR_DEPENDENCIES_DIR}/lib"
CACHE PATH "The ogre Paging lib path to use")
set(Ogre_Paging_LIBRARIES "OgrePaging" CACHE STRING "The ogre
Paging lib to link against")
+ set(Ogre_RTShader_INCLUDE_DIRS
"${ROR_DEPENDENCIES_DIR}/include/Ogre/RTShaderSystem" CACHE PATH "The ogre
RTShaderSystem include path to use")
+ set(Ogre_RTShader_LIBRARY_DIRS "${ROR_DEPENDENCIES_DIR}/lib"
CACHE PATH "The ogre RTShaderSystem lib path to use")
+ set(Ogre_RTShader_LIBRARIES "OgreRTShaderSystem" CACHE STRING
"The ogre RTShaderSystem lib to link against")
+
set(Ois_INCLUDE_DIRS "${ROR_DEPENDENCIES_DIR}/include/ois"
CACHE PATH "The OIS include path to use")
set(Ois_LIBRARY_DIRS "${ROR_DEPENDENCIES_DIR}/lib" CACHE PATH
"The OIS lib path to use")
set(Ois_LIBRARIES "ois" CACHE STRING "The ogre lib to link
against")
Added: trunk/bin/resources/rtshader.zip
===================================================================
(Binary files differ)
Property changes on: trunk/bin/resources/rtshader.zip
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Modified: trunk/source/main/CMakeLists.txt
===================================================================
--- trunk/source/main/CMakeLists.txt 2010-08-11 09:44:05 UTC (rev 1511)
+++ trunk/source/main/CMakeLists.txt 2010-08-13 15:40:21 UTC (rev 1512)
@@ -47,6 +47,8 @@
link_directories (${Ogre_Terrain_LIBRARY_DIRS})
include_directories(${Ogre_Paging_INCLUDE_DIRS})
link_directories (${Ogre_Paging_LIBRARY_DIRS})
+include_directories(${Ogre_RTShader_INCLUDE_DIRS})
+link_directories (${Ogre_RTShader_LIBRARY_DIRS})
include_directories(${Ois_INCLUDE_DIRS})
link_directories (${Ois_LIBRARY_DIRS})
@@ -75,6 +77,6 @@
endif(ROR_FEAT_TIMING)
add_executable(RoR ${HEADER_FILES} ${SOURCE_FILES})
-target_link_libraries(RoR ${Ogre_LIBRARIES} ${Ogre_Terrain_LIBRARIES}
${Ogre_Paging_LIBRARIES} ${Ois_LIBRARIES} ${OS_LIBS} ${optional_libs})
+target_link_libraries(RoR ${Ogre_LIBRARIES} ${Ogre_Terrain_LIBRARIES}
${Ogre_Paging_LIBRARIES} ${Ogre_RTShader_LIBRARIES} ${Ois_LIBRARIES} ${OS_LIBS}
${optional_libs})
windows_hacks(RoR)
Modified: trunk/source/main/RigsOfRods.cpp
===================================================================
--- trunk/source/main/RigsOfRods.cpp 2010-08-11 09:44:05 UTC (rev 1511)
+++ trunk/source/main/RigsOfRods.cpp 2010-08-13 15:40:21 UTC (rev 1512)
@@ -22,6 +22,8 @@
#include "language.h"
#include "errorutils.h"
+#include "OgreRTShaderSystem.h"
+
RigsOfRods::RigsOfRods(Ogre::String name, unsigned int hwnd) :
mRoot(0),
mCamera(0),
@@ -75,17 +77,6 @@
#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
dirsep="\\";
#endif
- /*
- // old buildmode (non-zip mode)
- if (buildmode)
- {
- if (name==String("textures"))
-
ResourceGroupManager::getSingleton().addResourceLocation(SETTINGS.getSetting("Resources
Path")+name+dirsep+"temp", "FileSystem", group);
- else
-
ResourceGroupManager::getSingleton().addResourceLocation(SETTINGS.getSetting("Resources
Path")+name, "FileSystem", group);
- }
- */
-
ResourceGroupManager::getSingleton().addResourceLocation(SETTINGS.getSetting("Resources
Path")+name+".zip", "Zip", group, true);
}
@@ -143,51 +134,51 @@
loadMainResource("OgreCore", "Bootstrap");
//main game resources
LogManager::getSingleton().logMessage("Loading main resources");
- loadMainResource("airfoils",
ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
- loadMainResource("materials",
ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
- loadMainResource("meshes",
ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
- loadMainResource("overlays",
ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
- loadMainResource("particles",
ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
- loadMainResource("mygui",
ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
- loadMainResource("layouts",
ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
- loadMainResource("scripts",
ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
- loadMainResource("textures",
ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
- loadMainResource("flags",
ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
- loadMainResource("icons",
ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
+ loadMainResource("airfoils");
+ loadMainResource("materials");
+ loadMainResource("meshes");
+ loadMainResource("overlays");
+ loadMainResource("particles");
+ loadMainResource("mygui");
+ loadMainResource("layouts");
+ loadMainResource("scripts");
+ loadMainResource("textures");
+ loadMainResource("flags");
+ loadMainResource("icons");
// optional ones
if (SETTINGS.getSetting("3D Sound renderer") != "No sound")
- loadMainResource("sounds",
ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
+ loadMainResource("sounds");
if (SETTINGS.getSetting("Sky effects") == "Caelum (best looking,
slower)")
- loadMainResource("caelum",
ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
+ loadMainResource("caelum");
if(SETTINGS.getSetting("Hydrax") == "Yes")
loadMainResource("hydrax", "Hydrax"); // special resourcegroup
required!
if(SETTINGS.getSetting("Vegetation") != "None (fastest)")
- loadMainResource("paged",
ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
+ loadMainResource("paged");
if(SETTINGS.getSetting("HDR") == "Yes")
- loadMainResource("hdr",
ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
+ loadMainResource("hdr");
if(SETTINGS.getSetting("DOF") == "Yes")
- loadMainResource("dof",
ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
+ loadMainResource("dof");
if(SETTINGS.getSetting("Glow") == "Yes")
- loadMainResource("glow",
ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
+ loadMainResource("glow");
if(SETTINGS.getSetting("Motion blur") == "Yes")
- loadMainResource("blur",
ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
+ loadMainResource("blur");
if(SETTINGS.getSetting("HeatHaze") == "Yes")
- loadMainResource("heathaze",
ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
+ loadMainResource("heathaze");
if (SETTINGS.getSetting("Sunburn")!="Yes")
- loadMainResource("sunburn",
ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
+ loadMainResource("sunburn");
if (SETTINGS.getSetting("Shadow technique")=="Parallel-split Shadow
Maps")
- loadMainResource("pssm",
ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
+ loadMainResource("pssm");
//streams path, to be processed later by the cache system
LogManager::getSingleton().logMessage("Loading filesystems");
@@ -241,6 +232,9 @@
mSceneMgr = mRoot->createSceneManager(ST_EXTERIOR_CLOSE);
}
+ // create RTShader System
+ initRTShaderSystem();
+
//CREATE CAMERA
LogManager::getSingleton().logMessage("Creating camera");
// Create the camera
@@ -321,6 +315,24 @@
return true;
}
+void RigsOfRods::initRTShaderSystem()
+{
+ if(!Ogre::RTShader::ShaderGenerator::initialize())
+ return;
+
+ // Grab the shader generator pointer.
+ Ogre::RTShader::ShaderGenerator *mShaderGenerator =
Ogre::RTShader::ShaderGenerator::getSingletonPtr();
+
+ // Add the shader libs resource location.
+ loadMainResource("rtshader");
+
+ // Set shader cache path.
+ mShaderGenerator->setShaderCachePath(SETTINGS.getSetting("User
Path")+"cache");
+
+ // Set the scene manager.
+ mShaderGenerator->addSceneManager(mSceneMgr);
+}
+
void RigsOfRods::createScene(void)
{
String tft=SETTINGS.getSetting("Texture Filtering");
Modified: trunk/source/main/RigsOfRods.h
===================================================================
--- trunk/source/main/RigsOfRods.h 2010-08-11 09:44:05 UTC (rev 1511)
+++ trunk/source/main/RigsOfRods.h 2010-08-13 15:40:21 UTC (rev 1512)
@@ -87,8 +87,9 @@
SpinControlOverlayElementFactory* spinfact;
#endif
- void loadMainResource(String name, String group);
+ void loadMainResource(String name, String
group=ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
+ void initRTShaderSystem();
// create scene
void createScene(void);
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
This SF.net email is sponsored by
Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev
_______________________________________________
Rigsofrods-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rigsofrods-devel