Index: code/trunk/Tutorial/CMakeLists.txt
===================================================================
--- code/trunk/Tutorial/CMakeLists.txt	(revision 43)
+++ code/trunk/Tutorial/CMakeLists.txt	(revision 44)
@@ -1,12 +1,49 @@
-PROJECT (Tutorial)
+PROJECT(Tutorial)
 
-SET (MAIN_SRC main.cpp ExampleApplication.h ExampleFrameListener.h ExampleLoadingBar.h )
+#force-set the compile on tardis machines, as default points to g++-3.3
+IF (UNIX)
+  FIND_PROGRAM(UNAME_CMD "uname"
+	PATHS "/usr/bin /bin")
+  EXECUTE_PROCESS(
+	COMMAND "${UNAME_CMD}" "-n"
+	RESULT_VARIABLE UNAME_RV
+	ERROR_VARIABLE UNAME_EV
+	OUTPUT_VARIABLE UNAME_OV)
+#MESSAGE("Print: UNAME_RV ${UNAME_RV}")
+  IF (NOT "${UNAME_RV}" STREQUAL "0")
+	MESSAGE("ERROR: Unable to find uname. System cannot be marked as
+	Tardis if needed.")
+  ENDIF (NOT "${UNAME_RV}" STREQUAL "0")
+  #STRING(REGEX MATCH "tardis" UNAME_OV "${UNAME_OV}")
+  IF ("${UNAME_OV}" MATCHES "tardis")
+    SET (IS_TARDIS "tardis")
+  ENDIF ("${UNAME_OV}" MATCHES "tardis")
+  #MESSAGE("Print: UNAME_OV ${UNAME_OV}")
+  IF (IS_TARDIS)
+  MESSAGE("System is a TARDIS: Setting Compiler to g++-3.4.3")
+  SET(CMAKE_CXX_COMPILER "g++-3.4.3")
+  ENDIF(IS_TARDIS)
+ENDIF (UNIX)
 
-ADD_EXECUTABLE (main ${MAIN_SRC})
+SET(SRC_FILES src/main.cpp)
 
-# find OGRE
-FIND_LIBRARY (OGRE_LIBS NAMES OGRE
-  PATH /usr/lib /usr/local/lib)
-IF (OGRE_LIBS)
-  TARGET_ADD_LIBRARY (main OGRE_LIBS)
-ENDIF (OGRE_LIBS)
+SET(INC_FILES src/ExampleApplication.h  src/ExampleFrameListener.h  src/ExampleLoadingBar.h)
+
+#This sets where to look for "Find*.cmake" files
+SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
+#Performs the search and sets the variables
+FIND_PACKAGE(OGRE)
+FIND_PACKAGE(OIS)
+
+#Sets the search paths for the linking
+LINK_DIRECTORIES(${OGRE_LIB_DIR} ${OIS_LIB_DIR})
+#Sets the search path for include files
+INCLUDE_DIRECTORIES(${OGRE_INCLUDE_DIR} ${OIS_INCLUDE_DIR})
+
+#Creates an executable
+ADD_EXECUTABLE(main ${SRC_FILES} ${INC_FILES})
+#Links the executable against Ogre
+TARGET_LINK_LIBRARIES(main ${OGRE_LIBRARIES} ${OIS_LIBRARIES})
+
+#Sets the install path
+INSTALL(TARGETS main DESTINATION bin)
Index: code/trunk/Tutorial/ExampleApplication.h
===================================================================
--- code/trunk/Tutorial/ExampleApplication.h	(revision 43)
+++ 	(revision )
@@ -1,257 +1,0 @@
-/*
------------------------------------------------------------------------------
-This source file is part of OGRE
-(Object-oriented Graphics Rendering Engine)
-For the latest info, see http://www.ogre3d.org/
-
-Copyright (c) 2000-2006 Torus Knot Software Ltd
-Also see acknowledgements in Readme.html
-
-You may use this sample code for anything you like, it is not covered by the
-LGPL like the rest of the engine.
------------------------------------------------------------------------------
-*/
-/*
------------------------------------------------------------------------------
-Filename:    ExampleApplication.h
-Description: Base class for all the OGRE examples
------------------------------------------------------------------------------
-*/
-
-#ifndef __ExampleApplication_H__
-#define __ExampleApplication_H__
-
-#include "Ogre.h"
-#include "OgreConfigFile.h"
-#include "ExampleFrameListener.h"
-
-#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
-#include <CoreFoundation/CoreFoundation.h>
-
-// This function will locate the path to our application on OS X,
-// unlike windows you can not rely on the curent working directory
-// for locating your configuration files and resources.
-std::string macBundlePath()
-{
-    char path[1024];
-    CFBundleRef mainBundle = CFBundleGetMainBundle();
-    assert(mainBundle);
-
-    CFURLRef mainBundleURL = CFBundleCopyBundleURL(mainBundle);
-    assert(mainBundleURL);
-
-    CFStringRef cfStringRef = CFURLCopyFileSystemPath( mainBundleURL, kCFURLPOSIXPathStyle);
-    assert(cfStringRef);
-
-    CFStringGetCString(cfStringRef, path, 1024, kCFStringEncodingASCII);
-
-    CFRelease(mainBundleURL);
-    CFRelease(cfStringRef);
-
-    return std::string(path);
-}
-#endif
-
-using namespace Ogre;
-
-/** Base class which manages the standard startup of an Ogre application.
-    Designed to be subclassed for specific examples if required.
-*/
-class ExampleApplication
-{
-public:
-    /// Standard constructor
-    ExampleApplication()
-    {
-        mFrameListener = 0;
-        mRoot = 0;
-		// Provide a nice cross platform solution for locating the configuration files
-		// On windows files are searched for in the current working directory, on OS X however
-		// you must provide the full path, the helper function macBundlePath does this for us.
-#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
-		mResourcePath = macBundlePath() + "/Contents/Resources/";
-#else
-		mResourcePath = "";
-#endif
-    }
-    /// Standard destructor
-    virtual ~ExampleApplication()
-    {
-        if (mFrameListener)
-            delete mFrameListener;
-        if (mRoot)
-            delete mRoot;
-    }
-
-    /// Start the example
-    virtual void go(void)
-    {
-        if (!setup())
-            return;
-
-        mRoot->startRendering();
-
-        // clean up
-        destroyScene();
-    }
-
-protected:
-    Root *mRoot;
-    Camera* mCamera;
-    SceneManager* mSceneMgr;
-    ExampleFrameListener* mFrameListener;
-    RenderWindow* mWindow;
-	Ogre::String mResourcePath;
-
-    // These internal methods package up the stages in the startup process
-    /** Sets up the application - returns false if the user chooses to abandon configuration. */
-    virtual bool setup(void)
-    {
-
-		String pluginsPath;
-		// only use plugins.cfg if not static
-#ifndef OGRE_STATIC_LIB
-		pluginsPath = mResourcePath + "plugins.cfg";
-#endif
-		
-        mRoot = new Root(pluginsPath, 
-            mResourcePath + "ogre.cfg", mResourcePath + "Ogre.log");
-
-        setupResources();
-
-        bool carryOn = configure();
-        if (!carryOn) return false;
-
-        chooseSceneManager();
-        createCamera();
-        createViewports();
-
-        // Set default mipmap level (NB some APIs ignore this)
-        TextureManager::getSingleton().setDefaultNumMipmaps(5);
-
-		// Create any resource listeners (for loading screens)
-		createResourceListener();
-		// Load resources
-		loadResources();
-
-		// Create the scene
-        createScene();
-
-        createFrameListener();
-
-        return true;
-
-    }
-    /** Configures the application - returns false if the user chooses to abandon configuration. */
-    virtual bool configure(void)
-    {
-        // Show the configuration dialog and initialise the system
-        // You can skip this and use root.restoreConfig() to load configuration
-        // settings if you were sure there are valid ones saved in ogre.cfg
-        if(mRoot->showConfigDialog())
-        {
-            // If returned true, user clicked OK so initialise
-            // Here we choose to let the system create a default rendering window by passing 'true'
-            mWindow = mRoot->initialise(true);
-            return true;
-        }
-        else
-        {
-            return false;
-        }
-    }
-
-    virtual void chooseSceneManager(void)
-    {
-        // Create the SceneManager, in this case a generic one
-        mSceneMgr = mRoot->createSceneManager(ST_GENERIC, "ExampleSMInstance");
-    }
-    virtual void createCamera(void)
-    {
-        // Create the camera
-        mCamera = mSceneMgr->createCamera("PlayerCam");
-
-        // Position it at 500 in Z direction
-        mCamera->setPosition(Vector3(0,0,500));
-        // Look back along -Z
-        mCamera->lookAt(Vector3(0,0,-300));
-        mCamera->setNearClipDistance(5);
-
-    }
-    virtual void createFrameListener(void)
-    {
-        mFrameListener= new ExampleFrameListener(mWindow, mCamera);
-        mFrameListener->showDebugOverlay(true);
-        mRoot->addFrameListener(mFrameListener);
-    }
-
-    virtual void createScene(void) = 0;    // pure virtual - this has to be overridden
-
-    virtual void destroyScene(void){}    // Optional to override this
-
-    virtual void createViewports(void)
-    {
-        // Create one viewport, entire window
-        Viewport* vp = mWindow->addViewport(mCamera);
-        vp->setBackgroundColour(ColourValue(0,0,0));
-
-        // Alter the camera aspect ratio to match the viewport
-        mCamera->setAspectRatio(
-            Real(vp->getActualWidth()) / Real(vp->getActualHeight()));
-    }
-
-    /// Method which will define the source of resources (other than current folder)
-    virtual void setupResources(void)
-    {
-        // Load resource paths from config file
-        ConfigFile cf;
-        cf.load(mResourcePath + "resources.cfg");
-
-        // Go through all sections & settings in the file
-        ConfigFile::SectionIterator seci = cf.getSectionIterator();
-
-        String secName, typeName, archName;
-        while (seci.hasMoreElements())
-        {
-            secName = seci.peekNextKey();
-            ConfigFile::SettingsMultiMap *settings = seci.getNext();
-            ConfigFile::SettingsMultiMap::iterator i;
-            for (i = settings->begin(); i != settings->end(); ++i)
-            {
-                typeName = i->first;
-                archName = i->second;
-#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
-                // OS X does not set the working directory relative to the app,
-                // In order to make things portable on OS X we need to provide
-                // the loading with it's own bundle path location
-                ResourceGroupManager::getSingleton().addResourceLocation(
-                    String(macBundlePath() + "/" + archName), typeName, secName);
-#else
-                ResourceGroupManager::getSingleton().addResourceLocation(
-                    archName, typeName, secName);
-#endif
-            }
-        }
-    }
-
-	/// Optional override method where you can create resource listeners (e.g. for loading screens)
-	virtual void createResourceListener(void)
-	{
-
-	}
-
-	/// Optional override method where you can perform resource group loading
-	/// Must at least do ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
-	virtual void loadResources(void)
-	{
-		// Initialise, parse scripts etc
-		ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
-
-	}
-
-
-
-};
-
-
-#endif
Index: code/trunk/Tutorial/ExampleFrameListener.h
===================================================================
--- code/trunk/Tutorial/ExampleFrameListener.h	(revision 43)
+++ 	(revision )
@@ -1,401 +1,0 @@
-/*
------------------------------------------------------------------------------
-This source file is part of OGRE
-    (Object-oriented Graphics Rendering Engine)
-For the latest info, see http://www.ogre3d.org/
-
-Copyright (c) 2000-2006 Torus Knot Software Ltd
-Also see acknowledgements in Readme.html
-
-You may use this sample code for anything you like, it is not covered by the
-LGPL like the rest of the engine.
------------------------------------------------------------------------------
-*/
-/*
------------------------------------------------------------------------------
-Filename:    ExampleFrameListener.h
-Description: Defines an example frame listener which responds to frame events.
-This frame listener just moves a specified camera around based on
-keyboard and mouse movements.
-Mouse:    Freelook
-W or Up:  Forward
-S or Down:Backward
-A:        Step left
-D:        Step right
-             PgUp:     Move upwards
-             PgDown:   Move downwards
-             F:        Toggle frame rate stats on/off
-			 R:        Render mode
-             T:        Cycle texture filtering
-                       Bilinear, Trilinear, Anisotropic(8)
-             P:        Toggle on/off display of camera position / orientation
------------------------------------------------------------------------------
-*/
-
-#ifndef __ExampleFrameListener_H__
-#define __ExampleFrameListener_H__
-
-#include "Ogre.h"
-#include "OgreStringConverter.h"
-#include "OgreException.h"
-
-//Use this define to signify OIS will be used as a DLL
-//(so that dll import/export macros are in effect)
-#define OIS_DYNAMIC_LIB
-#include <OIS/OIS.h>
-
-using namespace Ogre;
-
-class ExampleFrameListener: public FrameListener, public WindowEventListener
-{
-protected:
-	void updateStats(void)
-	{
-		static String currFps = "Current FPS: ";
-		static String avgFps = "Average FPS: ";
-		static String bestFps = "Best FPS: ";
-		static String worstFps = "Worst FPS: ";
-		static String tris = "Triangle Count: ";
-		static String batches = "Batch Count: ";
-
-		// update stats when necessary
-		try {
-			OverlayElement* guiAvg = OverlayManager::getSingleton().getOverlayElement("Core/AverageFps");
-			OverlayElement* guiCurr = OverlayManager::getSingleton().getOverlayElement("Core/CurrFps");
-			OverlayElement* guiBest = OverlayManager::getSingleton().getOverlayElement("Core/BestFps");
-			OverlayElement* guiWorst = OverlayManager::getSingleton().getOverlayElement("Core/WorstFps");
-
-			const RenderTarget::FrameStats& stats = mWindow->getStatistics();
-			guiAvg->setCaption(avgFps + StringConverter::toString(stats.avgFPS));
-			guiCurr->setCaption(currFps + StringConverter::toString(stats.lastFPS));
-			guiBest->setCaption(bestFps + StringConverter::toString(stats.bestFPS)
-				+" "+StringConverter::toString(stats.bestFrameTime)+" ms");
-			guiWorst->setCaption(worstFps + StringConverter::toString(stats.worstFPS)
-				+" "+StringConverter::toString(stats.worstFrameTime)+" ms");
-
-			OverlayElement* guiTris = OverlayManager::getSingleton().getOverlayElement("Core/NumTris");
-			guiTris->setCaption(tris + StringConverter::toString(stats.triangleCount));
-
-			OverlayElement* guiBatches = OverlayManager::getSingleton().getOverlayElement("Core/NumBatches");
-			guiBatches->setCaption(batches + StringConverter::toString(stats.batchCount));
-
-			OverlayElement* guiDbg = OverlayManager::getSingleton().getOverlayElement("Core/DebugText");
-			guiDbg->setCaption(mDebugText);
-		}
-		catch(...) { /* ignore */ }
-	}
-
-public:
-	// Constructor takes a RenderWindow because it uses that to determine input context
-	ExampleFrameListener(RenderWindow* win, Camera* cam, bool bufferedKeys = false, bool bufferedMouse = false,
-			     bool bufferedJoy = false ) :
-		mCamera(cam), mTranslateVector(Vector3::ZERO), mWindow(win), mStatsOn(true), mNumScreenShots(0),
-		mMoveScale(0.0f), mRotScale(0.0f), mTimeUntilNextToggle(0), mFiltering(TFO_BILINEAR),
-		mAniso(1), mSceneDetailIndex(0), mMoveSpeed(100), mRotateSpeed(36), mDebugOverlay(0),
-		mInputManager(0), mMouse(0), mKeyboard(0), mJoy(0)
-	{
-		using namespace OIS;
-
-		mDebugOverlay = OverlayManager::getSingleton().getByName("Core/DebugOverlay");
-
-		LogManager::getSingletonPtr()->logMessage("*** Initializing OIS ***");
-		ParamList pl;
-		size_t windowHnd = 0;
-		std::ostringstream windowHndStr;
-
-		win->getCustomAttribute("WINDOW", &windowHnd);
-		windowHndStr << windowHnd;
-		pl.insert(std::make_pair(std::string("WINDOW"), windowHndStr.str()));
-
-		mInputManager = InputManager::createInputSystem( pl );
-
-		//Create all devices (We only catch joystick exceptions here, as, most people have Key/Mouse)
-		mKeyboard = static_cast<Keyboard*>(mInputManager->createInputObject( OISKeyboard, bufferedKeys ));
-		mMouse = static_cast<Mouse*>(mInputManager->createInputObject( OISMouse, bufferedMouse ));
-		try {
-			mJoy = static_cast<JoyStick*>(mInputManager->createInputObject( OISJoyStick, bufferedJoy ));
-		}
-		catch(...) {
-			mJoy = 0;
-		}
-
-		//Set initial mouse clipping size
-		windowResized(mWindow);
-
-		showDebugOverlay(true);
-
-		//Register as a Window listener
-		WindowEventUtilities::addWindowEventListener(mWindow, this);
-	}
-
-	//Adjust mouse clipping area
-	virtual void windowResized(RenderWindow* rw)
-	{
-		unsigned int width, height, depth;
-		int left, top;
-		rw->getMetrics(width, height, depth, left, top);
-
-		const OIS::MouseState &ms = mMouse->getMouseState();
-		ms.width = width;
-		ms.height = height;
-	}
-
-	//Unattach OIS before window shutdown (very important under Linux)
-	virtual void windowClosed(RenderWindow* rw)
-	{
-		//Only close for window that created OIS (the main window in these demos)
-		if( rw == mWindow )
-		{
-			if( mInputManager )
-			{
-				mInputManager->destroyInputObject( mMouse );
-				mInputManager->destroyInputObject( mKeyboard );
-				mInputManager->destroyInputObject( mJoy );
-
-				OIS::InputManager::destroyInputSystem(mInputManager);
-				mInputManager = 0;
-			}
-		}
-	}
-
-	virtual ~ExampleFrameListener()
-	{
-		//Remove ourself as a Window listener
-		WindowEventUtilities::removeWindowEventListener(mWindow, this);
-		windowClosed(mWindow);
-	}
-
-	virtual bool processUnbufferedKeyInput(const FrameEvent& evt)
-	{
-		using namespace OIS;
-
-		if(mKeyboard->isKeyDown(KC_A))
-			mTranslateVector.x = -mMoveScale;	// Move camera left
-
-		if(mKeyboard->isKeyDown(KC_D))
-			mTranslateVector.x = mMoveScale;	// Move camera RIGHT
-
-		if(mKeyboard->isKeyDown(KC_UP) || mKeyboard->isKeyDown(KC_W) )
-			mTranslateVector.z = -mMoveScale;	// Move camera forward
-
-		if(mKeyboard->isKeyDown(KC_DOWN) || mKeyboard->isKeyDown(KC_S) )
-			mTranslateVector.z = mMoveScale;	// Move camera backward
-
-		if(mKeyboard->isKeyDown(KC_PGUP))
-			mTranslateVector.y = mMoveScale;	// Move camera up
-
-		if(mKeyboard->isKeyDown(KC_PGDOWN))
-			mTranslateVector.y = -mMoveScale;	// Move camera down
-
-		if(mKeyboard->isKeyDown(KC_RIGHT))
-			mCamera->yaw(-mRotScale);
-
-		if(mKeyboard->isKeyDown(KC_LEFT))
-			mCamera->yaw(mRotScale);
-
-		if( mKeyboard->isKeyDown(KC_ESCAPE) || mKeyboard->isKeyDown(KC_Q) )
-			return false;
-
-       	if( mKeyboard->isKeyDown(KC_F) && mTimeUntilNextToggle <= 0 )
-		{
-			mStatsOn = !mStatsOn;
-			showDebugOverlay(mStatsOn);
-			mTimeUntilNextToggle = 1;
-		}
-
-		if( mKeyboard->isKeyDown(KC_T) && mTimeUntilNextToggle <= 0 )
-		{
-			switch(mFiltering)
-			{
-			case TFO_BILINEAR:
-				mFiltering = TFO_TRILINEAR;
-				mAniso = 1;
-				break;
-			case TFO_TRILINEAR:
-				mFiltering = TFO_ANISOTROPIC;
-				mAniso = 8;
-				break;
-			case TFO_ANISOTROPIC:
-				mFiltering = TFO_BILINEAR;
-				mAniso = 1;
-				break;
-			default: break;
-			}
-			MaterialManager::getSingleton().setDefaultTextureFiltering(mFiltering);
-			MaterialManager::getSingleton().setDefaultAnisotropy(mAniso);
-
-			showDebugOverlay(mStatsOn);
-			mTimeUntilNextToggle = 1;
-		}
-
-		if(mKeyboard->isKeyDown(KC_SYSRQ) && mTimeUntilNextToggle <= 0)
-		{
-			std::ostringstream ss;
-			ss << "screenshot_" << ++mNumScreenShots << ".png";
-			mWindow->writeContentsToFile(ss.str());
-			mTimeUntilNextToggle = 0.5;
-			mDebugText = "Saved: " + ss.str();
-		}
-
-		if(mKeyboard->isKeyDown(KC_R) && mTimeUntilNextToggle <=0)
-		{
-			mSceneDetailIndex = (mSceneDetailIndex+1)%3 ;
-			switch(mSceneDetailIndex) {
-				case 0 : mCamera->setPolygonMode(PM_SOLID); break;
-				case 1 : mCamera->setPolygonMode(PM_WIREFRAME); break;
-				case 2 : mCamera->setPolygonMode(PM_POINTS); break;
-			}
-			mTimeUntilNextToggle = 0.5;
-		}
-
-		static bool displayCameraDetails = false;
-		if(mKeyboard->isKeyDown(KC_P) && mTimeUntilNextToggle <= 0)
-		{
-			displayCameraDetails = !displayCameraDetails;
-			mTimeUntilNextToggle = 0.5;
-			if (!displayCameraDetails)
-				mDebugText = "";
-		}
-
-		// Print camera details
-		if(displayCameraDetails)
-			mDebugText = "P: " + StringConverter::toString(mCamera->getDerivedPosition()) +
-						 " " + "O: " + StringConverter::toString(mCamera->getDerivedOrientation());
-
-		// Return true to continue rendering
-		return true;
-	}
-
-	bool processUnbufferedMouseInput(const FrameEvent& evt)
-	{
-		using namespace OIS;
-
-		// Rotation factors, may not be used if the second mouse button is pressed
-		// 2nd mouse button - slide, otherwise rotate
-		const MouseState &ms = mMouse->getMouseState();
-		if( ms.buttonDown( MB_Right ) )
-		{
-			mTranslateVector.x += ms.X.rel * 0.13;
-			mTranslateVector.y -= ms.Y.rel * 0.13;
-		}
-		else
-		{
-			mRotX = Degree(-ms.X.rel * 0.13);
-			mRotY = Degree(-ms.Y.rel * 0.13);
-		}
-
-		return true;
-	}
-
-	void moveCamera()
-	{
-		// Make all the changes to the camera
-		// Note that YAW direction is around a fixed axis (freelook style) rather than a natural YAW
-		//(e.g. airplane)
-		mCamera->yaw(mRotX);
-		mCamera->pitch(mRotY);
-		mCamera->moveRelative(mTranslateVector);
-	}
-
-	void showDebugOverlay(bool show)
-	{
-		if (mDebugOverlay)
-		{
-			if (show)
-				mDebugOverlay->show();
-			else
-				mDebugOverlay->hide();
-		}
-	}
-
-	// Override frameStarted event to process that (don't care about frameEnded)
-	bool frameStarted(const FrameEvent& evt)
-	{
-		using namespace OIS;
-
-		if(mWindow->isClosed())	return false;
-
-		//Need to capture/update each device
-		mKeyboard->capture();
-		mMouse->capture();
-		if( mJoy ) mJoy->capture();
-
-		bool buffJ = (mJoy) ? mJoy->buffered() : true;
-
-		//Check if one of the devices is not buffered
-		if( !mMouse->buffered() || !mKeyboard->buffered() || !buffJ )
-		{
-			// one of the input modes is immediate, so setup what is needed for immediate movement
-			if (mTimeUntilNextToggle >= 0)
-				mTimeUntilNextToggle -= evt.timeSinceLastFrame;
-
-			// If this is the first frame, pick a speed
-			if (evt.timeSinceLastFrame == 0)
-			{
-				mMoveScale = 1;
-				mRotScale = 0.1;
-			}
-			// Otherwise scale movement units by time passed since last frame
-			else
-			{
-				// Move about 100 units per second,
-				mMoveScale = mMoveSpeed * evt.timeSinceLastFrame;
-				// Take about 10 seconds for full rotation
-				mRotScale = mRotateSpeed * evt.timeSinceLastFrame;
-			}
-			mRotX = 0;
-			mRotY = 0;
-			mTranslateVector = Ogre::Vector3::ZERO;
-		}
-
-		//Check to see which device is not buffered, and handle it
-		if( !mKeyboard->buffered() )
-			if( processUnbufferedKeyInput(evt) == false )
-				return false;
-		if( !mMouse->buffered() )
-			if( processUnbufferedMouseInput(evt) == false )
-				return false;
-
-		if( !mMouse->buffered() || !mKeyboard->buffered() || !buffJ )
-			moveCamera();
-
-		return true;
-	}
-
-	bool frameEnded(const FrameEvent& evt)
-	{
-		updateStats();
-		return true;
-	}
-
-protected:
-	Camera* mCamera;
-
-	Vector3 mTranslateVector;
-	RenderWindow* mWindow;
-	bool mStatsOn;
-
-	std::string mDebugText;
-
-	unsigned int mNumScreenShots;
-	float mMoveScale;
-	Degree mRotScale;
-	// just to stop toggles flipping too fast
-	Real mTimeUntilNextToggle ;
-	Radian mRotX, mRotY;
-	TextureFilterOptions mFiltering;
-	int mAniso;
-
-	int mSceneDetailIndex ;
-	Real mMoveSpeed;
-	Degree mRotateSpeed;
-	Overlay* mDebugOverlay;
-
-	//OIS Input devices
-	OIS::InputManager* mInputManager;
-	OIS::Mouse*    mMouse;
-	OIS::Keyboard* mKeyboard;
-	OIS::JoyStick* mJoy;
-};
-
-#endif
Index: code/trunk/Tutorial/ExampleLoadingBar.h
===================================================================
--- code/trunk/Tutorial/ExampleLoadingBar.h	(revision 43)
+++ 	(revision )
@@ -1,182 +1,0 @@
-/*
------------------------------------------------------------------------------
-This source file is part of OGRE
-(Object-oriented Graphics Rendering Engine)
-For the latest info, see http://www.ogre3d.org/
-
-Copyright (c) 2000-2006 Torus Knot Software Ltd
-Also see acknowledgements in Readme.html
-
-You may use this sample code for anything you like, it is not covered by the
-LGPL like the rest of the engine.
------------------------------------------------------------------------------
-*/
-/*
------------------------------------------------------------------------------
-Filename:    ExampleLoadingBar.h
-Description: Defines an example loading progress bar which you can use during 
-startup, level changes etc to display loading progress. 
-IMPORTANT: Note that this progress bar relies on you having the OgreCore.zip 
-package already added to a resource group called 'Bootstrap' - this provides
-the basic resources required for the progress bar and will be loaded automatically.
-*/
-#include "OgreResourceGroupManager.h"
-#include "OgreException.h"
-#include "OgreOverlay.h"
-#include "OgreOverlayManager.h"
-#include "OgreRenderWindow.h"
-
-using namespace Ogre;
-
-/** Defines an example loading progress bar which you can use during 
-	startup, level changes etc to display loading progress. 
-@remarks
-	Basically you just need to create an instance of this class, call start()
-	before loading and finish() afterwards. You may also need to stop areas of
-	your scene rendering in between since this method will call 
-	RenderWindow::update() to update the display of the bar - we advise using
-	SceneManager's 'special case render queues' for this, see
-	SceneManager::addSpecialCaseRenderQueue for details.
-@note 
-	This progress bar relies on you having the OgreCore.zip package already 
-	added to a resource group called 'Bootstrap' - this provides the basic 
-	resources required for the progress bar and will be loaded automatically.
-*/
-class ExampleLoadingBar : public ResourceGroupListener
-{
-protected:
-	RenderWindow* mWindow;
-	Overlay* mLoadOverlay;
-	Real mInitProportion;
-	unsigned short mNumGroupsInit;
-	unsigned short mNumGroupsLoad;
-	Real mProgressBarMaxSize;
-	Real mProgressBarScriptSize;
-	Real mProgressBarInc;
-	OverlayElement* mLoadingBarElement;
-	OverlayElement* mLoadingDescriptionElement;
-	OverlayElement* mLoadingCommentElement;
-
-public:
-	ExampleLoadingBar() {}
-	virtual ~ExampleLoadingBar(){}
-
-	/** Show the loading bar and start listening.
-	@param window The window to update 
-	@param numGroupsInit The number of groups you're going to be initialising
-	@param numGroupsLoad The number of groups you're going to be loading
-	@param initProportion The proportion of the progress which will be taken
-		up by initialisation (ie script parsing etc). Defaults to 0.7 since
-		script parsing can often take the majority of the time.
-	*/
-	virtual void start(RenderWindow* window, 
-		unsigned short numGroupsInit = 1, 
-		unsigned short numGroupsLoad = 1, 
-		Real initProportion = 0.70f)
-	{
-		mWindow = window;
-		mNumGroupsInit = numGroupsInit;
-		mNumGroupsLoad = numGroupsLoad;
-		mInitProportion = initProportion;
-		// We need to pre-initialise the 'Bootstrap' group so we can use
-		// the basic contents in the loading screen
-		ResourceGroupManager::getSingleton().initialiseResourceGroup("Bootstrap");
-
-		OverlayManager& omgr = OverlayManager::getSingleton();
-		mLoadOverlay = (Overlay*)omgr.getByName("Core/LoadOverlay");
-		if (!mLoadOverlay)
-		{
-			OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, 
-				"Cannot find loading overlay", "ExampleLoadingBar::start");
-		}
-		mLoadOverlay->show();
-
-		// Save links to the bar and to the loading text, for updates as we go
-		mLoadingBarElement = omgr.getOverlayElement("Core/LoadPanel/Bar/Progress");
-		mLoadingCommentElement = omgr.getOverlayElement("Core/LoadPanel/Comment");
-		mLoadingDescriptionElement = omgr.getOverlayElement("Core/LoadPanel/Description");
-
-		OverlayElement* barContainer = omgr.getOverlayElement("Core/LoadPanel/Bar");
-		mProgressBarMaxSize = barContainer->getWidth();
-		mLoadingBarElement->setWidth(0);
-
-		// self is listener
-		ResourceGroupManager::getSingleton().addResourceGroupListener(this);
-
-
-
-	}
-
-	/** Hide the loading bar and stop listening. 
-	*/
-	virtual void finish(void)
-	{
-		// hide loading screen
-		mLoadOverlay->hide();
-
-		// Unregister listener
-		ResourceGroupManager::getSingleton().removeResourceGroupListener(this);
-
-	}
-
-
-	// ResourceGroupListener callbacks
-	void resourceGroupScriptingStarted(const String& groupName, size_t scriptCount)
-	{
-		assert(mNumGroupsInit > 0 && "You stated you were not going to init "
-			"any groups, but you did! Divide by zero would follow...");
-		// Lets assume script loading is 70%
-		mProgressBarInc = mProgressBarMaxSize * mInitProportion / (Real)scriptCount;
-		mProgressBarInc /= mNumGroupsInit;
-		mLoadingDescriptionElement->setCaption("Parsing scripts...");
-		mWindow->update();
-	}
-	void scriptParseStarted(const String& scriptName)
-	{
-		mLoadingCommentElement->setCaption(scriptName);
-		mWindow->update();
-	}
-	void scriptParseEnded(const String& scriptName)
-	{
-		mLoadingBarElement->setWidth(
-			mLoadingBarElement->getWidth() + mProgressBarInc);
-		mWindow->update();
-	}
-	void resourceGroupScriptingEnded(const String& groupName)
-	{
-	}
-	void resourceGroupLoadStarted(const String& groupName, size_t resourceCount)
-	{
-		assert(mNumGroupsLoad > 0 && "You stated you were not going to load "
-			"any groups, but you did! Divide by zero would follow...");
-		mProgressBarInc = mProgressBarMaxSize * (1-mInitProportion) / 
-			(Real)resourceCount;
-		mProgressBarInc /= mNumGroupsLoad;
-		mLoadingDescriptionElement->setCaption("Loading resources...");
-		mWindow->update();
-	}
-	void resourceLoadStarted(const ResourcePtr& resource)
-	{
-		mLoadingCommentElement->setCaption(resource->getName());
-		mWindow->update();
-	}
-	void resourceLoadEnded(void)
-	{
-	}
-	void worldGeometryStageStarted(const String& description)
-	{
-		mLoadingCommentElement->setCaption(description);
-		mWindow->update();
-	}
-	void worldGeometryStageEnded(void)
-	{
-		mLoadingBarElement->setWidth(
-			mLoadingBarElement->getWidth() + mProgressBarInc);
-		mWindow->update();
-	}
-	void resourceGroupLoadEnded(const String& groupName)
-	{
-	}
-
-};
-
Index: code/trunk/Tutorial/Media/DeferredShadingMedia/COPYING
===================================================================
--- code/trunk/Tutorial/Media/DeferredShadingMedia/COPYING	(revision 44)
+++ code/trunk/Tutorial/Media/DeferredShadingMedia/COPYING	(revision 44)
@@ -0,0 +1,18 @@
+Copyright (c) W.J. van der Laan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of 
+this software  and associated documentation files (the "Software"), to deal in 
+the Software without restriction, including without limitation the rights to use, 
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so, subject 
+to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies 
+or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE 
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Index: code/trunk/Tutorial/Media/DeferredShadingMedia/DeferredShading/material/glsl/nm_notex_ps.glsl
===================================================================
--- code/trunk/Tutorial/Media/DeferredShadingMedia/DeferredShading/material/glsl/nm_notex_ps.glsl	(revision 44)
+++ code/trunk/Tutorial/Media/DeferredShadingMedia/DeferredShading/material/glsl/nm_notex_ps.glsl	(revision 44)
@@ -0,0 +1,54 @@
+/******************************************************************************
+Copyright (c) W.J. van der Laan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of 
+this software  and associated documentation files (the "Software"), to deal in 
+the Software without restriction, including without limitation the rights to use, 
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so, subject 
+to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies 
+or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE 
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+******************************************************************************/
+/** Deferred shading framework
+	// W.J. :wumpus: van der Laan 2005 //
+	
+	Material shader: Single colour normal mapped
+*/
+
+#extension GL_ARB_draw_buffers : enable
+
+varying vec3 normal;
+varying vec3 tangent_;
+varying vec3 binormal;
+
+varying vec2 texCoord0;
+varying float depth;
+
+uniform sampler2D normTex;
+
+uniform float specularity;
+uniform vec3 colour;
+
+void main()                    
+{
+	// Frame for normal mapping
+	mat3 rotation = mat3(tangent_, binormal, normal);
+	vec3 texnormal = (vec3(texture2D(normTex, texCoord0))-0.5)*2.0;
+	
+   	gl_FragData[0].rgb = colour;
+	gl_FragData[0].a = specularity;
+	// rotation*texnormal is reversed for GL because matrices are stored transposed internally
+	// compared to HLSL
+	gl_FragData[1].xyz = normalize(rotation*texnormal); // Do normalisation here, saves an operation per light
+	gl_FragData[1].w = depth;
+	
+}
Index: code/trunk/Tutorial/Media/DeferredShadingMedia/DeferredShading/material/glsl/nm_ps.glsl
===================================================================
--- code/trunk/Tutorial/Media/DeferredShadingMedia/DeferredShading/material/glsl/nm_ps.glsl	(revision 44)
+++ code/trunk/Tutorial/Media/DeferredShadingMedia/DeferredShading/material/glsl/nm_ps.glsl	(revision 44)
@@ -0,0 +1,52 @@
+/******************************************************************************
+Copyright (c) W.J. van der Laan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of 
+this software  and associated documentation files (the "Software"), to deal in 
+the Software without restriction, including without limitation the rights to use, 
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so, subject 
+to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies 
+or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE 
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+******************************************************************************/
+/** Deferred shading framework
+	// W.J. :wumpus: van der Laan 2005 //
+	
+	Material shader: Textured normal mapped
+*/
+
+#extension GL_ARB_draw_buffers : enable
+
+varying vec3 normal;
+varying vec3 tangent_;
+varying vec3 binormal;
+
+varying vec2 texCoord0;
+varying float depth;
+uniform sampler2D tex0;
+uniform sampler2D normTex;
+
+uniform float specularity;
+
+void main()                    
+{
+	// Frame for normal mapping
+	mat3 rotation = mat3(tangent_, binormal, normal);
+	vec3 texnormal = (vec3(texture2D(normTex, texCoord0))-0.5)*2.0;
+	
+   	gl_FragData[0].rgb = vec3(texture2D(tex0, texCoord0));
+	gl_FragData[0].a = specularity;
+	// rotation*texnormal is reversed for GL because matrices are stored transposed internally
+	// compared to HLSL
+	gl_FragData[1].xyz = normalize(rotation*texnormal); // Do normalisation here, saves an operation per light
+	gl_FragData[1].w = depth;
+}
Index: code/trunk/Tutorial/Media/DeferredShadingMedia/DeferredShading/material/glsl/nm_vs.glsl
===================================================================
--- code/trunk/Tutorial/Media/DeferredShadingMedia/DeferredShading/material/glsl/nm_vs.glsl	(revision 44)
+++ code/trunk/Tutorial/Media/DeferredShadingMedia/DeferredShading/material/glsl/nm_vs.glsl	(revision 44)
@@ -0,0 +1,47 @@
+/******************************************************************************
+Copyright (c) W.J. van der Laan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of 
+this software  and associated documentation files (the "Software"), to deal in 
+the Software without restriction, including without limitation the rights to use, 
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so, subject 
+to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies 
+or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE 
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+******************************************************************************/
+/** Deferred shading framework
+	// W.J. :wumpus: van der Laan 2005 //
+	
+	Material shader: Normal mapped
+*/
+varying vec3 normal;
+varying vec3 tangent_;
+varying vec3 binormal;
+
+varying vec2 texCoord0;
+varying float depth;
+
+attribute vec3 tangent;
+
+void main()                    
+{
+   vec4 projPos = gl_ModelViewProjectionMatrix * gl_Vertex;
+   
+   gl_Position = projPos;
+   depth = projPos.w;
+   texCoord0 = vec2(gl_MultiTexCoord0);
+   
+   normal = vec3(gl_ModelViewMatrix*vec4(gl_Normal,0));
+   tangent_ = vec3(gl_ModelViewMatrix*vec4(tangent,0));
+   binormal = cross(normal, tangent_);
+   
+}
Index: code/trunk/Tutorial/Media/DeferredShadingMedia/DeferredShading/material/glsl/notex_ps.glsl
===================================================================
--- code/trunk/Tutorial/Media/DeferredShadingMedia/DeferredShading/material/glsl/notex_ps.glsl	(revision 44)
+++ code/trunk/Tutorial/Media/DeferredShadingMedia/DeferredShading/material/glsl/notex_ps.glsl	(revision 44)
@@ -0,0 +1,42 @@
+/******************************************************************************
+Copyright (c) W.J. van der Laan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of 
+this software  and associated documentation files (the "Software"), to deal in 
+the Software without restriction, including without limitation the rights to use, 
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so, subject 
+to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies 
+or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE 
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+******************************************************************************/
+/** Deferred shading framework
+	// W.J. :wumpus: van der Laan 2005 //
+	
+	Material shader: Single colour phong
+*/
+
+#extension GL_ARB_draw_buffers : enable
+
+varying vec3 normal;
+varying vec2 texCoord0;
+varying float depth;
+
+uniform float specularity;
+uniform vec3 colour;
+
+void main()                    
+{
+   	gl_FragData[0].rgb = colour;
+	gl_FragData[0].a = specularity;
+	gl_FragData[1].xyz = normalize(normal); // Do normalisation here, saves an operation per light
+	gl_FragData[1].w = depth;
+}
Index: code/trunk/Tutorial/Media/DeferredShadingMedia/DeferredShading/material/glsl/ps.glsl
===================================================================
--- code/trunk/Tutorial/Media/DeferredShadingMedia/DeferredShading/material/glsl/ps.glsl	(revision 44)
+++ code/trunk/Tutorial/Media/DeferredShadingMedia/DeferredShading/material/glsl/ps.glsl	(revision 44)
@@ -0,0 +1,42 @@
+/******************************************************************************
+Copyright (c) W.J. van der Laan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of 
+this software  and associated documentation files (the "Software"), to deal in 
+the Software without restriction, including without limitation the rights to use, 
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so, subject 
+to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies 
+or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE 
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+******************************************************************************/
+/** Deferred shading framework
+	// W.J. :wumpus: van der Laan 2005 //
+	
+	Material shader: Textured phongs
+*/
+
+#extension GL_ARB_draw_buffers : enable
+
+varying vec3 normal;
+varying vec2 texCoord0;
+varying float depth;
+
+uniform sampler2D Tex0;
+uniform float specularity;
+
+void main()                    
+{
+   	gl_FragData[0].rgb = vec3(texture2D(Tex0, texCoord0));
+	gl_FragData[0].a = specularity;
+	gl_FragData[1].xyz = normalize(normal); // Do normalisation here, saves an operation per light
+	gl_FragData[1].w = depth;
+}
Index: code/trunk/Tutorial/Media/DeferredShadingMedia/DeferredShading/material/glsl/vs.glsl
===================================================================
--- code/trunk/Tutorial/Media/DeferredShadingMedia/DeferredShading/material/glsl/vs.glsl	(revision 44)
+++ code/trunk/Tutorial/Media/DeferredShadingMedia/DeferredShading/material/glsl/vs.glsl	(revision 44)
@@ -0,0 +1,40 @@
+/******************************************************************************
+Copyright (c) W.J. van der Laan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of 
+this software  and associated documentation files (the "Software"), to deal in 
+the Software without restriction, including without limitation the rights to use, 
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so, subject 
+to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies 
+or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE 
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+******************************************************************************/
+/** Deferred shading framework
+	// W.J. :wumpus: van der Laan 2005 //
+	
+	Material shader: Phong material vertex shader
+*/
+varying vec3 normal;
+varying vec2 texCoord0;
+varying float depth;
+
+void main()                    
+{
+
+   vec4 projPos = gl_ModelViewProjectionMatrix * gl_Vertex;
+   
+   gl_Position = projPos;
+   depth = projPos.w;
+   texCoord0 = vec2(gl_MultiTexCoord0);
+   
+   normal = vec3(gl_ModelViewMatrix*vec4(gl_Normal,0));
+}
Index: code/trunk/Tutorial/Media/DeferredShadingMedia/DeferredShading/material/hlsl/nm_notex_ps.hlsl
===================================================================
--- code/trunk/Tutorial/Media/DeferredShadingMedia/DeferredShading/material/hlsl/nm_notex_ps.hlsl	(revision 44)
+++ code/trunk/Tutorial/Media/DeferredShadingMedia/DeferredShading/material/hlsl/nm_notex_ps.hlsl	(revision 44)
@@ -0,0 +1,56 @@
+/******************************************************************************
+Copyright (c) W.J. van der Laan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of 
+this software  and associated documentation files (the "Software"), to deal in 
+the Software without restriction, including without limitation the rights to use, 
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so, subject 
+to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies 
+or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE 
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+******************************************************************************/
+/** Deferred shading framework
+	// W.J. :wumpus: van der Laan 2005 //
+	
+	Material shader: Single colour normal mapped
+*/
+sampler Tex0: register(s0);
+
+struct OUTPUT
+{
+	float4 color0 : COLOR0; // Diffuse color + ?
+	float4 color1 : COLOR1; // Normal + depth
+};
+
+float3 colour;
+float specularity;
+
+OUTPUT main(
+	float3 normal: TEXCOORD0,
+	float4 texCoord0: TEXCOORD1,
+	float depth: TEXCOORD2,
+	float3 tangent: TEXCOORD3,
+	float3 binormal: TEXCOORD4
+)
+{
+	OUTPUT output;
+	// Frame for normal mapping
+	float3x3 rotation = float3x3(tangent, binormal, normal);
+	float3 texnormal = (tex2D(Tex0, texCoord0)-0.5)*2;
+	
+	output.color0.rgb = colour;
+	output.color0.a = specularity;
+	output.color1.xyz = normalize(mul(texnormal,rotation)); // Do normalisation here, saves an operation per light
+	output.color1.w = depth;
+	
+	return output;
+}
Index: code/trunk/Tutorial/Media/DeferredShadingMedia/DeferredShading/material/hlsl/nm_ps.hlsl
===================================================================
--- code/trunk/Tutorial/Media/DeferredShadingMedia/DeferredShading/material/hlsl/nm_ps.hlsl	(revision 44)
+++ code/trunk/Tutorial/Media/DeferredShadingMedia/DeferredShading/material/hlsl/nm_ps.hlsl	(revision 44)
@@ -0,0 +1,56 @@
+/******************************************************************************
+Copyright (c) W.J. van der Laan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of 
+this software  and associated documentation files (the "Software"), to deal in 
+the Software without restriction, including without limitation the rights to use, 
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so, subject 
+to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies 
+or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE 
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+******************************************************************************/
+/** Deferred shading framework
+	// W.J. :wumpus: van der Laan 2005 //
+	
+	Material shader: Textured normal mapped
+*/
+sampler Tex0: register(s0);
+sampler Tex1: register(s1);
+
+struct OUTPUT
+{
+	float4 color0 : COLOR0; // Diffuse color + ?
+	float4 color1 : COLOR1; // Normal + depth
+};
+
+float specularity;
+
+OUTPUT main(
+	float3 normal: TEXCOORD0,
+	float4 texCoord0: TEXCOORD1,
+	float depth: TEXCOORD2,
+	float3 tangent: TEXCOORD3,
+	float3 binormal: TEXCOORD4
+)
+{
+	OUTPUT output;
+	// Frame for normal mapping
+	float3x3 rotation = float3x3(tangent, binormal, normal);
+	float3 texnormal = (tex2D(Tex1, texCoord0)-0.5)*2;
+	
+	output.color0.rgb = tex2D(Tex0, texCoord0);
+	output.color0.a = specularity;
+	output.color1.xyz = normalize(mul(texnormal,rotation)); // Do normalisation here, saves an operation per light
+	output.color1.w = depth;
+	
+	return output;
+}
Index: code/trunk/Tutorial/Media/DeferredShadingMedia/DeferredShading/material/hlsl/nm_vs.hlsl
===================================================================
--- code/trunk/Tutorial/Media/DeferredShadingMedia/DeferredShading/material/hlsl/nm_vs.hlsl	(revision 44)
+++ code/trunk/Tutorial/Media/DeferredShadingMedia/DeferredShading/material/hlsl/nm_vs.hlsl	(revision 44)
@@ -0,0 +1,61 @@
+/******************************************************************************
+Copyright (c) W.J. van der Laan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of 
+this software  and associated documentation files (the "Software"), to deal in 
+the Software without restriction, including without limitation the rights to use, 
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so, subject 
+to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies 
+or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE 
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+******************************************************************************/
+/** Deferred shading framework
+	// W.J. :wumpus: van der Laan 2005 //
+	
+	Material shader: Normal mapped
+*/
+struct VS_OUTPUT {
+   float4 pos: POSITION;
+   float4 normal: TEXCOORD0;
+   float2 texCoord0: TEXCOORD1;
+   float depth: TEXCOORD2;
+   float3 tangent: TEXCOORD3;
+   float3 binormal: TEXCOORD4;
+};
+
+float4x4 worldViewProj;
+float4x4 world;
+float4x4 worldView;
+
+VS_OUTPUT main(
+	float4 Pos: POSITION, 
+	float3 normal: NORMAL,
+	float2 texCoord0: TEXCOORD0,
+	float3 tangent: TANGENT0
+){
+   VS_OUTPUT Out;
+   
+   Out.normal = mul(worldView, normal);
+   float4 projPos = mul(worldViewProj, Pos);
+   
+   Out.tangent = mul(worldView, tangent);
+   Out.binormal = cross(Out.normal, Out.tangent);
+   
+   Out.pos = projPos;
+   Out.texCoord0 = texCoord0;
+   Out.depth = projPos.w;
+   //Out.depth = projPos.z/projPos.w;
+
+   return Out;
+}
+
+
Index: code/trunk/Tutorial/Media/DeferredShadingMedia/DeferredShading/material/hlsl/notex_ps.hlsl
===================================================================
--- code/trunk/Tutorial/Media/DeferredShadingMedia/DeferredShading/material/hlsl/notex_ps.hlsl	(revision 44)
+++ code/trunk/Tutorial/Media/DeferredShadingMedia/DeferredShading/material/hlsl/notex_ps.hlsl	(revision 44)
@@ -0,0 +1,47 @@
+/******************************************************************************
+Copyright (c) W.J. van der Laan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of 
+this software  and associated documentation files (the "Software"), to deal in 
+the Software without restriction, including without limitation the rights to use, 
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so, subject 
+to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies 
+or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE 
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+******************************************************************************/
+/** Deferred shading framework
+	// W.J. :wumpus: van der Laan 2005 //
+	
+	Material shader: Single colour phong
+*/
+struct OUTPUT
+{
+	float4 color0 : COLOR0; // Diffuse color
+	float4 color1 : COLOR1; // Position
+};
+
+float3 colour;
+float specularity;
+
+OUTPUT main(
+	float4 normal: TEXCOORD0,
+	float4 texCoord0: TEXCOORD1,
+	float depth: TEXCOORD2
+)
+{
+	OUTPUT output;
+	output.color0.rgb = colour;
+	output.color0.a = specularity;
+	output.color1.xyz = normal;
+	output.color1.w = depth;
+	return output;
+}
Index: code/trunk/Tutorial/Media/DeferredShadingMedia/DeferredShading/material/hlsl/ps.hlsl
===================================================================
--- code/trunk/Tutorial/Media/DeferredShadingMedia/DeferredShading/material/hlsl/ps.hlsl	(revision 44)
+++ code/trunk/Tutorial/Media/DeferredShadingMedia/DeferredShading/material/hlsl/ps.hlsl	(revision 44)
@@ -0,0 +1,48 @@
+/******************************************************************************
+Copyright (c) W.J. van der Laan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of 
+this software  and associated documentation files (the "Software"), to deal in 
+the Software without restriction, including without limitation the rights to use, 
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so, subject 
+to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies 
+or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE 
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+******************************************************************************/
+/** Deferred shading framework
+	// W.J. :wumpus: van der Laan 2005 //
+	
+	Material shader: Textured phongs
+*/
+sampler Tex0: register(s0);
+
+struct OUTPUT
+{
+	float4 color0 : COLOR0; // Diffuse color
+	float4 color1 : COLOR1; // Position
+};
+
+float specularity;
+
+OUTPUT main(
+	float4 normal: TEXCOORD0,
+	float4 texCoord0: TEXCOORD1,
+	float depth: TEXCOORD2
+)
+{
+	OUTPUT output;
+	output.color0.rgb = tex2D(Tex0, texCoord0);
+	output.color0.a = specularity;
+	output.color1.xyz = normalize(normal); // Do normalisation here, saves an operation per light
+	output.color1.w = depth;
+	return output;
+}
Index: code/trunk/Tutorial/Media/DeferredShadingMedia/DeferredShading/material/hlsl/vs.hlsl
===================================================================
--- code/trunk/Tutorial/Media/DeferredShadingMedia/DeferredShading/material/hlsl/vs.hlsl	(revision 44)
+++ code/trunk/Tutorial/Media/DeferredShadingMedia/DeferredShading/material/hlsl/vs.hlsl	(revision 44)
@@ -0,0 +1,54 @@
+/******************************************************************************
+Copyright (c) W.J. van der Laan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of 
+this software  and associated documentation files (the "Software"), to deal in 
+the Software without restriction, including without limitation the rights to use, 
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so, subject 
+to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies 
+or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE 
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+******************************************************************************/
+/** Deferred shading framework
+	// W.J. :wumpus: van der Laan 2005 //
+	
+	Material shader: Phong material vertex shader
+*/
+struct VS_OUTPUT {
+   float4 pos: POSITION;
+   float4 normal: TEXCOORD0;
+   float2 texCoord0: TEXCOORD1;
+   float1 depth: TEXCOORD2;
+};
+
+float4x4 worldViewProj;
+float4x4 world;
+float4x4 worldView;
+
+VS_OUTPUT main(
+	float4 Pos: POSITION, 
+	float3 Normal: NORMAL,
+	float2 texCoord0: TEXCOORD0
+){
+   VS_OUTPUT Out;
+   
+   Out.normal = mul(worldView, Normal);
+   float4 projPos = mul(worldViewProj, Pos);
+   Out.pos = projPos;
+   Out.texCoord0 = texCoord0;
+   Out.depth = projPos.w;
+   //Out.depth = projPos.z/projPos.w;
+
+   return Out;
+}
+
+
Index: code/trunk/Tutorial/Media/DeferredShadingMedia/DeferredShading/post/glsl/Ambient_ps.glsl
===================================================================
--- code/trunk/Tutorial/Media/DeferredShadingMedia/DeferredShading/post/glsl/Ambient_ps.glsl	(revision 44)
+++ code/trunk/Tutorial/Media/DeferredShadingMedia/DeferredShading/post/glsl/Ambient_ps.glsl	(revision 44)
@@ -0,0 +1,56 @@
+/******************************************************************************
+Copyright (c) W.J. van der Laan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of 
+this software  and associated documentation files (the "Software"), to deal in 
+the Software without restriction, including without limitation the rights to use, 
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so, subject 
+to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies 
+or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE 
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+******************************************************************************/
+/** Deferred shading framework
+	// W.J. :wumpus: van der Laan 2005 //
+	
+	Post shader: Multipass, ambient (base) pass
+*/
+uniform sampler2D tex0;
+uniform sampler2D tex1;
+
+varying vec2 texCoord;
+varying vec3 projCoord;
+
+uniform mat4 proj;
+
+uniform vec3 ambientColor;
+
+void main()
+{
+	vec4 a0 = texture2D(tex0, texCoord); // Attribute 0: Diffuse color+shininess
+    vec4 a1 = texture2D(tex1, texCoord); // Attribute 1: Normal+depth
+    
+    // Clip fragment if depth is too far, so the skybox can be rendered on the background
+    if(a1.w==0.0)
+		discard;
+      
+    // Attributes
+    vec3 colour = a0.rgb;
+    float alpha = a0.a;		// Specularity
+    float distance = a1.w;  // Distance from viewer -- is zero if no lighting wanted
+    
+	// Calculate ambient colour of fragment
+    gl_FragColor = vec4( ambientColor*colour ,0);
+    
+    // Calculate depth of fragment; GL requires a 2.0* here as the range is [-1, 1]
+    // Also, see again how matrix is transposed ([3][2] instead of [2][3])
+    gl_FragDepth = projCoord.z*proj[2][2] + proj[3][2]/(2.0*distance);
+}
Index: code/trunk/Tutorial/Media/DeferredShadingMedia/DeferredShading/post/glsl/GlobalLight_ps.glsl
===================================================================
--- code/trunk/Tutorial/Media/DeferredShadingMedia/DeferredShading/post/glsl/GlobalLight_ps.glsl	(revision 44)
+++ code/trunk/Tutorial/Media/DeferredShadingMedia/DeferredShading/post/glsl/GlobalLight_ps.glsl	(revision 44)
@@ -0,0 +1,96 @@
+/******************************************************************************
+Copyright (c) W.J. van der Laan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of 
+this software  and associated documentation files (the "Software"), to deal in 
+the Software without restriction, including without limitation the rights to use, 
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so, subject 
+to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies 
+or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE 
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+******************************************************************************/
+/** Deferred shading framework
+	// W.J. :wumpus: van der Laan 2005 //
+	
+	Post shader: Multipass, one light
+*/
+uniform sampler2D tex0;
+uniform sampler2D tex1;
+
+varying vec2 texCoord;
+varying vec3 projCoord;
+
+// Attributes of light
+uniform vec4 lightPos0;
+uniform vec3 lightDiffuseColor0;
+uniform vec3 lightSpecularColor0;
+
+// Global parameters for lights
+struct LightGlobal
+{
+	vec3 position;
+	vec3 normal;
+	vec3 viewDir;
+};
+
+// Current state of light
+struct LightAccum
+{
+	vec3 light_diffuse;
+	vec3 light_specular;
+};
+
+// Do lighting calculations for one light
+void processLight(
+	inout LightAccum accum,
+	LightGlobal global,
+	vec4 lightPos,
+	vec3 lightDiffuseColor,
+	vec3 lightSpecularColor)
+{
+    vec3 lightVec = vec3(lightPos) - global.position;
+    vec3 lightDir = normalize(lightVec);
+    accum.light_diffuse += max(0.0,dot(lightDir, global.normal)) * lightDiffuseColor;
+    
+    vec3 h = normalize(global.viewDir + lightDir);
+    accum.light_specular += pow(dot(global.normal, h),32.0) * lightSpecularColor;
+}
+
+void main()
+{
+	vec4 a0 = texture2D(tex0, texCoord); // Attribute 0: Diffuse color+shininess
+    vec4 a1 = texture2D(tex1, texCoord); // Attribute 1: Normal+depth
+      
+    // Attributes
+    vec3 colour = a0.rgb;
+    float alpha = a0.a;		// Specularity
+    float distance = a1.w;  // Distance from viewer -- is zero if no lighting wanted
+    
+    LightGlobal global;
+    global.normal = a1.xyz;
+	global.position = projCoord*distance;
+    
+    // Apply light
+    LightAccum accum;
+    accum.light_diffuse = vec3(0,0,0);
+    accum.light_specular = vec3(0,0,0);
+    global.viewDir = -normalize(global.position);
+    
+    processLight(accum, global, lightPos0, lightDiffuseColor0, lightSpecularColor0);
+    
+    // Calcalate total lighting for this fragment
+    vec3 total_light_contrib;
+	total_light_contrib = accum.light_diffuse+alpha*accum.light_specular;
+	
+	// Calculate colour of fragment
+    gl_FragColor = vec4( total_light_contrib*colour ,0);
+}
Index: code/trunk/Tutorial/Media/DeferredShadingMedia/DeferredShading/post/glsl/LightMaterial_ps.glsl
===================================================================
--- code/trunk/Tutorial/Media/DeferredShadingMedia/DeferredShading/post/glsl/LightMaterial_ps.glsl	(revision 44)
+++ code/trunk/Tutorial/Media/DeferredShadingMedia/DeferredShading/post/glsl/LightMaterial_ps.glsl	(revision 44)
@@ -0,0 +1,85 @@
+/******************************************************************************
+Copyright (c) W.J. van der Laan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of 
+this software  and associated documentation files (the "Software"), to deal in 
+the Software without restriction, including without limitation the rights to use, 
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so, subject 
+to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies 
+or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE 
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+******************************************************************************/
+/** Deferred shading framework
+	// W.J. :wumpus: van der Laan 2005 //
+	
+	Post shader: Light geometry material
+*/
+uniform sampler2D tex0;
+uniform sampler2D tex1;
+
+varying vec2 texCoord;
+varying vec3 projCoord;
+
+// World view matrix to get object position in view space
+uniform mat4 worldView;
+
+// Attributes of light
+uniform vec3 lightDiffuseColor;
+uniform vec3 lightSpecularColor;
+uniform vec3 lightFalloff;
+
+void main()
+{
+	vec4 a0 = texture2D(tex0, texCoord); // Attribute 0: Diffuse color+shininess
+    vec4 a1 = texture2D(tex1, texCoord); // Attribute 1: Normal+depth
+
+    // Attributes
+    vec3 colour = a0.rgb;
+    float alpha = a0.a;		// Specularity
+    float distance = a1.w;  // Distance from viewer (w)
+    vec3 normal = a1.xyz;
+
+	// Calculate position of texel in view space
+    vec3 position = projCoord*distance;
+	
+	// Extract position in view space from worldView matrix
+	//vec3 lightPos = vec3(worldView[0][3],worldView[1][3],worldView[2][3]);
+	vec3 lightPos = vec3(worldView[3][0],worldView[3][1],worldView[3][2]);
+	
+    // Calculate light direction and distance
+    vec3 lightVec = lightPos - position;
+    float len_sq = dot(lightVec, lightVec);
+    float len = sqrt(len_sq);
+    vec3 lightDir = lightVec/len;
+    
+    /// Calculate attenuation    
+    float attenuation = dot(lightFalloff, vec3(1, len, len_sq));
+    
+    /// Calculate diffuse colour
+    vec3 light_diffuse = max(0.0,dot(lightDir, normal)) * lightDiffuseColor;
+    
+    /// Calculate specular component
+    vec3 viewDir = -normalize(position);
+    vec3 h = normalize(viewDir + lightDir);
+    vec3 light_specular = pow(dot(normal, h),32.0) * lightSpecularColor;
+    
+    // Calcalate total lighting for this fragment
+    vec3 total_light_contrib;
+    total_light_contrib = light_diffuse;
+	// Uncomment next line if specular desired
+	//total_light_contrib += alpha * light_specular;
+	
+    gl_FragColor = vec4(total_light_contrib*colour/attenuation, 0);
+    //gl_FragColor = vec4(1.0/attenuation, 0.0,0.0,0.0);
+    //gl_FragColor = vec4(a1.xyz,  0.0);
+}
+
Index: code/trunk/Tutorial/Media/DeferredShadingMedia/DeferredShading/post/glsl/LightMaterial_vs.glsl
===================================================================
--- code/trunk/Tutorial/Media/DeferredShadingMedia/DeferredShading/post/glsl/LightMaterial_vs.glsl	(revision 44)
+++ code/trunk/Tutorial/Media/DeferredShadingMedia/DeferredShading/post/glsl/LightMaterial_vs.glsl	(revision 44)
@@ -0,0 +1,61 @@
+/******************************************************************************
+Copyright (c) W.J. van der Laan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of 
+this software  and associated documentation files (the "Software"), to deal in 
+the Software without restriction, including without limitation the rights to use, 
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so, subject 
+to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies 
+or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE 
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+******************************************************************************/
+/** Deferred shading framework
+	// W.J. :wumpus: van der Laan 2005 //
+	
+	Post shader: Light geometry material
+*/
+varying vec2 texCoord;
+varying vec3 projCoord;
+
+uniform float vpWidth;
+uniform float vpHeight;
+uniform mat4 invProj;
+
+void main()                    
+{
+   vec4 projPos = gl_ModelViewProjectionMatrix * gl_Vertex;
+   projPos = projPos/projPos.w;
+   
+   // projPos is now in nonhomogeneous 2d space -- this makes sure no perspective interpolation is
+   // done that could mess with our concept.
+   //gl_Position = projPos;
+   vec2 texSize = vec2(vpWidth, vpHeight);
+   vec2 tcTemp = vec2(projPos[0], projPos[1])/2.0+0.5;
+   tcTemp = (floor(tcTemp * texSize)+0.5)/texSize;
+   
+   //float3 position = mul(invProj, float4(projCoord, 0, 1))*distance; 
+   // Acquire view space position via inverse projection transformation
+   // Optimisation for perspective, symmetric view frustrums 
+   // These interpolate over the frustrum plane for w=1
+   
+   projCoord = vec3(projPos[0], projPos[1], 1)*vec3(
+		invProj[0][0], // X vector component from X
+		invProj[1][1], // Y vector component from Y
+		invProj[3][2]  // Z vector component from W
+   );
+   
+   //projCoord = vec3(invProj*vec4(projPos[0], projPos[1], 0, 1));
+   
+   // Texture coordinate magic, this compensates for jitter
+   texCoord = vec2(tcTemp[0], 1.0-tcTemp[1]);   
+   gl_Position = vec4((tcTemp-0.5)*2.0, 0.0, 1.0);
+}
Index: code/trunk/Tutorial/Media/DeferredShadingMedia/DeferredShading/post/glsl/ShowColour_ps.glsl
===================================================================
--- code/trunk/Tutorial/Media/DeferredShadingMedia/DeferredShading/post/glsl/ShowColour_ps.glsl	(revision 44)
+++ code/trunk/Tutorial/Media/DeferredShadingMedia/DeferredShading/post/glsl/ShowColour_ps.glsl	(revision 44)
@@ -0,0 +1,39 @@
+/******************************************************************************
+Copyright (c) W.J. van der Laan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of 
+this software  and associated documentation files (the "Software"), to deal in 
+the Software without restriction, including without limitation the rights to use, 
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so, subject 
+to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies 
+or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE 
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+******************************************************************************/
+/** Deferred shading framework
+	// W.J. :wumpus: van der Laan 2005 //
+	
+	Post shader: Debug, show colour channel
+*/
+uniform sampler2D tex0;
+uniform sampler2D tex1;
+
+varying vec2 texCoord;
+varying vec3 projCoord;
+
+void main()
+{
+	vec4 a0 = texture2D(tex0, texCoord); // Attribute 0: Diffuse color+shininess
+    vec4 a1 = texture2D(tex1, texCoord); // Attribute 1: Normal+depth
+    
+    gl_FragColor=vec4(a0.xyz, 0);
+}
+
Index: code/trunk/Tutorial/Media/DeferredShadingMedia/DeferredShading/post/glsl/ShowDS_ps.glsl
===================================================================
--- code/trunk/Tutorial/Media/DeferredShadingMedia/DeferredShading/post/glsl/ShowDS_ps.glsl	(revision 44)
+++ code/trunk/Tutorial/Media/DeferredShadingMedia/DeferredShading/post/glsl/ShowDS_ps.glsl	(revision 44)
@@ -0,0 +1,39 @@
+/******************************************************************************
+Copyright (c) W.J. van der Laan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of 
+this software  and associated documentation files (the "Software"), to deal in 
+the Software without restriction, including without limitation the rights to use, 
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so, subject 
+to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies 
+or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE 
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+******************************************************************************/
+/** Deferred shading framework
+	// W.J. :wumpus: van der Laan 2005 //
+	
+	Post shader: Debug, show depth and specularity channel
+*/
+uniform sampler2D tex0;
+uniform sampler2D tex1;
+
+varying vec2 texCoord;
+varying vec3 projCoord;
+
+void main()
+{
+    vec4 a0 = texture2D(tex0, texCoord); // Attribute 0: Diffuse color+shininess
+    vec4 a1 = texture2D(tex1, texCoord); // Attribute 1: Normal+depth
+    
+    gl_FragColor=vec4(a0.w, 0, a1.w/1000.0, 0);
+}
+
Index: code/trunk/Tutorial/Media/DeferredShadingMedia/DeferredShading/post/glsl/ShowNormal_ps.glsl
===================================================================
--- code/trunk/Tutorial/Media/DeferredShadingMedia/DeferredShading/post/glsl/ShowNormal_ps.glsl	(revision 44)
+++ code/trunk/Tutorial/Media/DeferredShadingMedia/DeferredShading/post/glsl/ShowNormal_ps.glsl	(revision 44)
@@ -0,0 +1,39 @@
+/******************************************************************************
+Copyright (c) W.J. van der Laan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of 
+this software  and associated documentation files (the "Software"), to deal in 
+the Software without restriction, including without limitation the rights to use, 
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so, subject 
+to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies 
+or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE 
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+******************************************************************************/
+/** Deferred shading framework
+	// W.J. :wumpus: van der Laan 2005 //
+	
+	Post shader: Debug, show normal channel
+*/
+uniform sampler2D tex0;
+uniform sampler2D tex1;
+
+varying vec2 texCoord;
+varying vec3 projCoord;
+
+void main()
+{
+	vec4 a0 = texture2D(tex0, texCoord); // Attribute 0: Diffuse color+shininess
+    vec4 a1 = texture2D(tex1, texCoord); // Attribute 1: Normal+depth
+    
+    gl_FragColor=vec4((a1.xyz+vec3(1))*0.5,0);
+}
+
Index: code/trunk/Tutorial/Media/DeferredShadingMedia/DeferredShading/post/glsl/SinglePass_ps.glsl
===================================================================
--- code/trunk/Tutorial/Media/DeferredShadingMedia/DeferredShading/post/glsl/SinglePass_ps.glsl	(revision 44)
+++ code/trunk/Tutorial/Media/DeferredShadingMedia/DeferredShading/post/glsl/SinglePass_ps.glsl	(revision 44)
@@ -0,0 +1,111 @@
+/******************************************************************************
+Copyright (c) W.J. van der Laan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of 
+this software  and associated documentation files (the "Software"), to deal in 
+the Software without restriction, including without limitation the rights to use, 
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so, subject 
+to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies 
+or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE 
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+******************************************************************************/
+/** Deferred shading framework
+	// W.J. :wumpus: van der Laan 2005 //
+	
+	Post shader: Single pass
+*/
+uniform sampler2D tex0;
+uniform sampler2D tex1;
+
+varying vec2 texCoord;
+varying vec3 projCoord;
+
+uniform mat4 proj;
+
+uniform vec3 ambientColor;
+// Attributes of light 0
+uniform vec4 lightPos0;
+uniform vec3 lightDiffuseColor0;
+uniform vec3 lightSpecularColor0;
+// Attributes of light 1
+uniform vec4 lightPos1;
+uniform vec3 lightDiffuseColor1;
+uniform vec3 lightSpecularColor1;
+
+// Global parameters for lights
+struct LightGlobal
+{
+	vec3 position;
+	vec3 normal;
+	vec3 viewDir;
+};
+
+// Current state of light
+struct LightAccum
+{
+	vec3 light_diffuse;
+	vec3 light_specular;
+};
+
+// Do lighting calculations for one light
+void processLight(
+	inout LightAccum accum,
+	LightGlobal global,
+	vec4 lightPos,
+	vec3 lightDiffuseColor,
+	vec3 lightSpecularColor)
+{
+    vec3 lightVec = vec3(lightPos) - global.position;
+    vec3 lightDir = normalize(lightVec);
+    accum.light_diffuse += max(0.0,dot(lightDir, global.normal)) * lightDiffuseColor;
+    
+    vec3 h = normalize(global.viewDir + lightDir);
+    accum.light_specular += pow(dot(global.normal, h),32.0) * lightSpecularColor;
+}
+
+void main()
+{
+	vec4 a0 = texture2D(tex0, texCoord); // Attribute 0: Diffuse color+shininess
+    vec4 a1 = texture2D(tex1, texCoord); // Attribute 1: Normal+depth
+    
+    // Clip fragment if depth is too far, so the skybox can be rendered on the background
+    if(a1.w==0.0)
+		discard;
+      
+    // Attributes
+    vec3 colour = a0.rgb;
+    float alpha = a0.a;		// Specularity
+    float distance = a1.w;  // Distance from viewer -- is zero if no lighting wanted
+    
+    LightGlobal global;
+    global.normal = a1.xyz;
+	global.position = projCoord*distance;
+    
+    // Apply light
+    LightAccum accum;
+    accum.light_diffuse = vec3(0,0,0);
+    accum.light_specular = vec3(0,0,0);
+    global.viewDir = -normalize(global.position);
+    
+    processLight(accum, global, lightPos0, lightDiffuseColor0, lightSpecularColor0);
+    processLight(accum, global, lightPos1, lightDiffuseColor1, lightSpecularColor1);
+    
+    // Calcalate total lighting for this fragment
+    vec3 total_light_contrib;
+	total_light_contrib = ambientColor+accum.light_diffuse+alpha*accum.light_specular;
+	
+	// Calculate colour of fragment
+    gl_FragColor = vec4( total_light_contrib*colour ,0);
+    
+    // Calculate depth of fragment; GL requires a 2.0* here as the range is [-1, 1]
+    gl_FragDepth = projCoord.z*proj[2][2] + proj[3][2]/(2.0*distance);
+}
Index: code/trunk/Tutorial/Media/DeferredShadingMedia/DeferredShading/post/glsl/vs.glsl
===================================================================
--- code/trunk/Tutorial/Media/DeferredShadingMedia/DeferredShading/post/glsl/vs.glsl	(revision 44)
+++ code/trunk/Tutorial/Media/DeferredShadingMedia/DeferredShading/post/glsl/vs.glsl	(revision 44)
@@ -0,0 +1,42 @@
+/******************************************************************************
+Copyright (c) W.J. van der Laan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of 
+this software  and associated documentation files (the "Software"), to deal in 
+the Software without restriction, including without limitation the rights to use, 
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so, subject 
+to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies 
+or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE 
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+******************************************************************************/
+/** Deferred shading framework
+	// W.J. :wumpus: van der Laan 2005 //
+	
+	Post shader: Generic fullscreen quad
+*/
+varying vec2 texCoord;
+varying vec3 projCoord;
+
+uniform mat4 invProj;
+
+void main()                    
+{
+	vec2 inPos = sign(gl_Vertex.xy);
+	gl_Position = vec4(inPos.xy, 0.0, 1.0);
+	
+	texCoord  = (vec2(inPos.x, -inPos.y) + 1.0)/2.0;
+   
+	// Projection coordinates
+	// Inverted projection matrix
+	// These interpolate over the frustrum plane for w=1
+    projCoord = vec3(invProj*vec4(inPos.x, inPos.y, 0, 1));
+}
Index: code/trunk/Tutorial/Media/DeferredShadingMedia/DeferredShading/post/hlsl/Ambient_ps.hlsl
===================================================================
--- code/trunk/Tutorial/Media/DeferredShadingMedia/DeferredShading/post/hlsl/Ambient_ps.hlsl	(revision 44)
+++ code/trunk/Tutorial/Media/DeferredShadingMedia/DeferredShading/post/hlsl/Ambient_ps.hlsl	(revision 44)
@@ -0,0 +1,55 @@
+/******************************************************************************
+Copyright (c) W.J. van der Laan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of 
+this software  and associated documentation files (the "Software"), to deal in 
+the Software without restriction, including without limitation the rights to use, 
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so, subject 
+to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies 
+or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE 
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+******************************************************************************/
+/** Deferred shading framework
+	// W.J. :wumpus: van der Laan 2005 //
+	
+	Post shader: Multipass, ambient (base) pass
+*/
+sampler Tex0: register(s0);
+sampler Tex1: register(s1);
+
+// Ambient and depth pass
+float4 ambientColor;
+
+float4x4 proj;
+
+struct POUTPUT
+{
+	float4 colour: COLOR;
+	float depth: DEPTH;
+};
+
+POUTPUT main(float2 texCoord: TEXCOORD0, float3 projCoord: TEXCOORD1)
+{
+    float4 a0 = tex2D(Tex0, texCoord); // Attribute 0: Diffuse color+shininess
+    float4 a1 = tex2D(Tex1, texCoord); // Attribute 1: Normal+depth
+    
+    // Clip fragment if depth is too close, so the skybox can be rendered on the background
+    clip(a1.w-0.001);
+      
+    // Attributes
+    POUTPUT o;
+    float3 colour = a0.rgb;
+    o.colour = float4( ambientColor*colour ,0);
+    o.depth = projCoord.z*proj[2][2] + proj[2][3]/a1.w;
+    return o;
+}
+
Index: code/trunk/Tutorial/Media/DeferredShadingMedia/DeferredShading/post/hlsl/GlobalLight_ps.hlsl
===================================================================
--- code/trunk/Tutorial/Media/DeferredShadingMedia/DeferredShading/post/hlsl/GlobalLight_ps.hlsl	(revision 44)
+++ code/trunk/Tutorial/Media/DeferredShadingMedia/DeferredShading/post/hlsl/GlobalLight_ps.hlsl	(revision 44)
@@ -0,0 +1,101 @@
+/******************************************************************************
+Copyright (c) W.J. van der Laan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of 
+this software  and associated documentation files (the "Software"), to deal in 
+the Software without restriction, including without limitation the rights to use, 
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so, subject 
+to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies 
+or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE 
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+******************************************************************************/
+/** Deferred shading framework
+	// W.J. :wumpus: van der Laan 2005 //
+	
+	Post shader: Multipass, one light
+*/
+sampler Tex0: register(s0);
+sampler Tex1: register(s1);
+
+// Attributes of light 0
+float4 lightPos0;
+float4 lightDiffuseColor0;
+float4 lightSpecularColor0;
+
+// Global parameters for lights
+struct LightGlobal
+{
+	float3 position;
+	float3 normal;
+	float3 viewDir;
+};
+
+// Current state of light
+struct LightAccum
+{
+	float3 light_diffuse;
+	float3 light_specular;
+};
+
+// Do lighting calculations for one light
+void processLight(
+	inout LightAccum accum,
+	LightGlobal global,
+	float4 lightPos,
+	float4 lightDiffuseColor,
+	float4 lightSpecularColor)
+{
+    float3 lightVec = lightPos - global.position;
+    float3 lightDir = normalize(lightVec);
+    accum.light_diffuse += max(0,dot(lightDir, global.normal)) * lightDiffuseColor;
+    
+    float3 h = normalize(global.viewDir + lightDir);
+    accum.light_specular += pow(dot(global.normal, h),32) * lightSpecularColor;
+}
+
+float4 main(float2 texCoord: TEXCOORD0, float3 projCoord: TEXCOORD1) : COLOR 
+{
+    float4 a0 = tex2D(Tex0, texCoord); // Attribute 0: Diffuse color+shininess
+    float4 a1 = tex2D(Tex1, texCoord); // Attribute 1: Normal+depth
+    
+    LightGlobal global; 
+    
+    // Clip fragment if depth is too close, so the skybox can be rendered on the background
+    //clip(a1.w-0.001);
+      
+    // Attributes
+    float3 colour = a0.rgb;
+    float alpha = a0.a;		// Specularity
+    float distance = a1.w;  // Distance from viewer
+    //global.normal = normalize(a1.xyz);
+    global.normal = a1.xyz;
+
+    // Acquire view space position via inverse projection transformation
+    //global.position = mul(invProj, float4(projCoord, 0, 1))*distance;
+    global.position = projCoord*distance;
+    
+    // Apply light
+    LightAccum accum;
+    accum.light_diffuse = float3(0,0,0);
+    accum.light_specular = float3(0,0,0);
+    global.viewDir = -normalize(global.position);
+    
+    processLight(accum, global, lightPos0, lightDiffuseColor0, lightSpecularColor0);
+    
+    // Calcalate total lighting for this fragment
+    float3 total_light_contrib;
+	total_light_contrib = accum.light_diffuse+alpha*accum.light_specular;
+    return float4( total_light_contrib*colour ,0);
+    //return float4(accum.light_diffuse,0);
+    //return float4(global.position/1000.0,0);
+}
+
Index: code/trunk/Tutorial/Media/DeferredShadingMedia/DeferredShading/post/hlsl/LightMaterial_ps.hlsl
===================================================================
--- code/trunk/Tutorial/Media/DeferredShadingMedia/DeferredShading/post/hlsl/LightMaterial_ps.hlsl	(revision 44)
+++ code/trunk/Tutorial/Media/DeferredShadingMedia/DeferredShading/post/hlsl/LightMaterial_ps.hlsl	(revision 44)
@@ -0,0 +1,89 @@
+/******************************************************************************
+Copyright (c) W.J. van der Laan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of 
+this software  and associated documentation files (the "Software"), to deal in 
+the Software without restriction, including without limitation the rights to use, 
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so, subject 
+to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies 
+or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE 
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+******************************************************************************/
+/** Deferred shading framework
+	// W.J. :wumpus: van der Laan 2005 //
+	
+	Post shader: Light geometry material
+*/
+sampler Tex0: register(s0);
+sampler Tex1: register(s1);
+
+float4x4 worldView;
+
+// Attributes of light
+float4 lightDiffuseColor;
+float4 lightSpecularColor;
+float4 lightFalloff;
+
+float4 main(float2 texCoord: TEXCOORD0, float3 projCoord: TEXCOORD1) : COLOR 
+{
+	float4 a0 = tex2D(Tex0, texCoord); // Attribute 0: Diffuse color+shininess
+    float4 a1 = tex2D(Tex1, texCoord); // Attribute 1: Normal+depth
+
+    // Attributes
+    float3 colour = a0.rgb;
+    float alpha = a0.a;		// Specularity
+    float distance = a1.w;  // Distance from viewer (w)
+    float3 normal = a1.xyz;
+
+	// Calculate position of texel in view space
+    float3 position = projCoord*distance;
+	
+	// Extract position in view space from worldView matrix
+	float3 lightPos = float3(worldView[0][3],worldView[1][3],worldView[2][3]);
+	
+    // Calculate light direction and distance
+    float3 lightVec = lightPos - position;
+    float len_sq = dot(lightVec, lightVec);
+    float len = sqrt(len_sq);
+    float3 lightDir = lightVec/len;
+    
+    /// Calculate attenuation    
+    float attenuation = dot(lightFalloff, float3(1, len, len_sq));
+    
+    /// Calculate diffuse colour
+    float3 light_diffuse = max(0,dot(lightDir, normal)) * lightDiffuseColor;
+    
+    /// Calculate specular component
+    float3 viewDir = -normalize(position);
+    float3 h = normalize(viewDir + lightDir);
+    float3 light_specular = pow(dot(normal, h),32) * lightSpecularColor;
+    
+    // Calcalate total lighting for this fragment
+    float3 total_light_contrib;
+    total_light_contrib = light_diffuse;
+	// Uncomment next line if specular desired
+	//total_light_contrib += alpha * light_specular;
+	
+    return float4(total_light_contrib*colour/attenuation, 0);
+}
+// Debugging only
+    //return lightDiffuseColor;
+    //return lightDiffuseColor/attenuation;
+    //return float4(abs(position-position2),0);
+    //return length(lightPos-position)/1000.0;
+    //return float4(abs(lightPos-lightPos2),0);
+    //return float4(lightPos-position,0);
+    //return float4(-global.position/1000.0f,0);
+    //return float4(global.position/1000.0,0);
+    ///return float4(lightPos[0], lightPos[1], -lightPos[2], 0)/1000.0f;
+    //return lightDiffuseColor*a0.xyzw/2;
+
Index: code/trunk/Tutorial/Media/DeferredShadingMedia/DeferredShading/post/hlsl/LightMaterial_vs.hlsl
===================================================================
--- code/trunk/Tutorial/Media/DeferredShadingMedia/DeferredShading/post/hlsl/LightMaterial_vs.hlsl	(revision 44)
+++ code/trunk/Tutorial/Media/DeferredShadingMedia/DeferredShading/post/hlsl/LightMaterial_vs.hlsl	(revision 44)
@@ -0,0 +1,69 @@
+/******************************************************************************
+Copyright (c) W.J. van der Laan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of 
+this software  and associated documentation files (the "Software"), to deal in 
+the Software without restriction, including without limitation the rights to use, 
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so, subject 
+to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies 
+or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE 
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+******************************************************************************/
+/** Deferred shading framework
+	// W.J. :wumpus: van der Laan 2005 //
+	
+	Post shader: Light geometry material
+*/
+struct VS_OUTPUT {
+   float4 pos: POSITION;
+   float2 texCoord: TEXCOORD0;
+   float3 projCoord: TEXCOORD1;
+};
+
+uniform float vpWidth, vpHeight;
+uniform float4x4 worldViewProj;
+uniform float4x4 invProj;
+
+VS_OUTPUT main(
+	float4 Pos: POSITION
+){
+   VS_OUTPUT Out;
+   
+   float4 projPos = mul(worldViewProj, Pos);
+   projPos = projPos/projPos.w;
+   //projPos[2] = 0;
+
+   // projPos is now in nonhomogeneous 2d space -- this makes sure no perspective interpolation is
+   // done that could mess with our concept.
+   Out.pos = projPos;
+   
+   //float3 position = mul(invProj, float4(projCoord, 0, 1))*distance; 
+   // Acquire view space position via inverse projection transformation
+   // Optimisation for perspective, symmetric view frustrums 
+   // These interpolate over the frustrum plane for w=1
+   Out.projCoord = float3(projPos[0], projPos[1], 1)*float3(
+		invProj[0][0], // X vector component from X
+		invProj[1][1], // Y vector component from Y
+		invProj[2][3]  // Z vector component from W
+   );
+   
+   // Texture coordinate magic, this compensates for jitter
+   float2 texCoord = float2(projPos[0]/2+0.5, -projPos[1]/2+0.5);
+   float2 texSize = float2(vpWidth, vpHeight);
+   texCoord = floor(texCoord * texSize)/texSize;
+   Out.texCoord = texCoord;
+   
+
+   return Out;
+}
+
+
Index: code/trunk/Tutorial/Media/DeferredShadingMedia/DeferredShading/post/hlsl/ShowColour_ps.hlsl
===================================================================
--- code/trunk/Tutorial/Media/DeferredShadingMedia/DeferredShading/post/hlsl/ShowColour_ps.hlsl	(revision 44)
+++ code/trunk/Tutorial/Media/DeferredShadingMedia/DeferredShading/post/hlsl/ShowColour_ps.hlsl	(revision 44)
@@ -0,0 +1,36 @@
+/******************************************************************************
+Copyright (c) W.J. van der Laan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of 
+this software  and associated documentation files (the "Software"), to deal in 
+the Software without restriction, including without limitation the rights to use, 
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so, subject 
+to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies 
+or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE 
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+******************************************************************************/
+/** Deferred shading framework
+	// W.J. :wumpus: van der Laan 2005 //
+	
+	Post shader: Debug, show colour channel
+*/
+sampler Tex0: register(s0);
+sampler Tex1: register(s1);
+
+float4 main(float2 texCoord: TEXCOORD0, float2 projCoord: TEXCOORD1) : COLOR 
+{
+    float4 a0 = tex2D(Tex0, texCoord); // Attribute 0: Diffuse color+shininess
+    float4 a1 = tex2D(Tex1, texCoord); // Attribute 1: Normal+depth
+    
+    return float4(a0.xyz, 0);
+}
+
Index: code/trunk/Tutorial/Media/DeferredShadingMedia/DeferredShading/post/hlsl/ShowDS_ps.hlsl
===================================================================
--- code/trunk/Tutorial/Media/DeferredShadingMedia/DeferredShading/post/hlsl/ShowDS_ps.hlsl	(revision 44)
+++ code/trunk/Tutorial/Media/DeferredShadingMedia/DeferredShading/post/hlsl/ShowDS_ps.hlsl	(revision 44)
@@ -0,0 +1,36 @@
+/******************************************************************************
+Copyright (c) W.J. van der Laan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of 
+this software  and associated documentation files (the "Software"), to deal in 
+the Software without restriction, including without limitation the rights to use, 
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so, subject 
+to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies 
+or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE 
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+******************************************************************************/
+/** Deferred shading framework
+	// W.J. :wumpus: van der Laan 2005 //
+	
+	Post shader: Debug, show depth and specularity channel
+*/
+sampler Tex0: register(s0);
+sampler Tex1: register(s1);
+
+float4 main(float2 texCoord: TEXCOORD0, float2 projCoord: TEXCOORD1) : COLOR 
+{
+    float4 a0 = tex2D(Tex0, texCoord); // Attribute 0: Diffuse color+shininess
+    float4 a1 = tex2D(Tex1, texCoord); // Attribute 1: Normal+depth
+    
+    return float4(a0.w, 0, a1.w/1000.0, 0);
+}
+
Index: code/trunk/Tutorial/Media/DeferredShadingMedia/DeferredShading/post/hlsl/ShowNormal_ps.hlsl
===================================================================
--- code/trunk/Tutorial/Media/DeferredShadingMedia/DeferredShading/post/hlsl/ShowNormal_ps.hlsl	(revision 44)
+++ code/trunk/Tutorial/Media/DeferredShadingMedia/DeferredShading/post/hlsl/ShowNormal_ps.hlsl	(revision 44)
@@ -0,0 +1,38 @@
+/******************************************************************************
+Copyright (c) W.J. van der Laan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of 
+this software  and associated documentation files (the "Software"), to deal in 
+the Software without restriction, including without limitation the rights to use, 
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so, subject 
+to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies 
+or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE 
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+******************************************************************************/
+/** Deferred shading framework
+	// W.J. :wumpus: van der Laan 2005 //
+	
+	Post shader: Debug, show normal channel
+*/
+sampler Tex0: register(s0);
+sampler Tex1: register(s1);
+
+float4 main(float2 texCoord: TEXCOORD0, float2 projCoord: TEXCOORD1) : COLOR 
+{
+    float4 a0 = tex2D(Tex0, texCoord); // Attribute 0: Diffuse color+shininess
+    float4 a1 = tex2D(Tex1, texCoord); // Attribute 1: Normal+depth
+    
+    return float4((a1.xyz+1)*0.5,0);
+    //float d=dot(a1.xyz,float3(0,0,1))*2.0+0.5;
+    //return float4(1,0,0,0)*d+float4(0,0,1,0)*(1-d);
+}
+
Index: code/trunk/Tutorial/Media/DeferredShadingMedia/DeferredShading/post/hlsl/SinglePass_ps.hlsl
===================================================================
--- code/trunk/Tutorial/Media/DeferredShadingMedia/DeferredShading/post/hlsl/SinglePass_ps.hlsl	(revision 44)
+++ code/trunk/Tutorial/Media/DeferredShadingMedia/DeferredShading/post/hlsl/SinglePass_ps.hlsl	(revision 44)
@@ -0,0 +1,132 @@
+/******************************************************************************
+Copyright (c) W.J. van der Laan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of 
+this software  and associated documentation files (the "Software"), to deal in 
+the Software without restriction, including without limitation the rights to use, 
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so, subject 
+to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies 
+or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE 
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+******************************************************************************/
+/** Deferred shading framework
+	// W.J. :wumpus: van der Laan 2005 //
+	
+	Post shader: Single pass
+*/
+sampler Tex0: register(s0);
+sampler Tex1: register(s1);
+
+float4x4 proj;
+
+float4 ambientColor;
+// Attributes of light 0
+float4 lightPos0;
+float4 lightDiffuseColor0;
+float4 lightSpecularColor0;
+// Attributes of light 1
+float4 lightPos1;
+float4 lightDiffuseColor1;
+float4 lightSpecularColor1;
+
+// Global parameters for lights
+struct LightGlobal
+{
+	float3 position;
+	float3 normal;
+	float3 viewDir;
+};
+
+// Current state of light
+struct LightAccum
+{
+	float3 light_diffuse;
+	float3 light_specular;
+};
+
+// Do lighting calculations for one light
+void processLight(
+	inout LightAccum accum,
+	LightGlobal global,
+	float4 lightPos,
+	float4 lightDiffuseColor,
+	float4 lightSpecularColor)
+{
+    float3 lightVec = lightPos - global.position;
+    float3 lightDir = normalize(lightVec);
+    accum.light_diffuse += max(0,dot(lightDir, global.normal)) * lightDiffuseColor;
+    
+    float3 h = normalize(global.viewDir + lightDir);
+    accum.light_specular += pow(dot(global.normal, h),32) * lightSpecularColor;
+}
+
+struct POUTPUT
+{
+	float4 colour: COLOR;
+	float depth: DEPTH;
+};
+
+POUTPUT main(float2 texCoord: TEXCOORD0, float3 projCoord: TEXCOORD1)
+{
+	POUTPUT o;
+	
+    float4 a0 = tex2D(Tex0, texCoord); // Attribute 0: Diffuse color+shininess
+    float4 a1 = tex2D(Tex1, texCoord); // Attribute 1: Normal+depth
+    
+    LightGlobal global; 
+    
+    // Clip fragment if depth is too far, so the skybox can be rendered on the background
+    clip(a1.w-0.001);
+      
+    // Attributes
+    float3 colour = a0.rgb;
+    float alpha = a0.a;		// Specularity
+    float distance = a1.w;  // Distance from viewer -- is zero if no lighting wanted
+    //global.normal = normalize(a1.xyz); // normalizing done already
+    global.normal = a1.xyz;
+
+    // Acquire view space position via inverse projection transformation
+    //global.position = mul(invProj, float4(projCoord, 0, 1))*distance;
+    // Acquire view space position via inverse projection transformation
+    //float4 tpos;
+    //tpos = float4(projCoord, distance, 1.0);
+    //tpos = mul(invProj, tpos);
+    //tpos = tpos / tpos.w;
+    //global.position = tpos;
+    //global.position = float3(
+	//	invProj[0][0], // X vector component from X
+	//	invProj[1][1], // Y vector component from Y
+	//	invProj[2][3]  // Z vector component from W
+	//)*projCoord*distance;
+	global.position = projCoord*distance;
+    
+    // Apply light
+    LightAccum accum;
+    accum.light_diffuse = float3(0,0,0);
+    accum.light_specular = float3(0,0,0);
+    global.viewDir = -normalize(global.position);
+    
+    processLight(accum, global, lightPos0, lightDiffuseColor0, lightSpecularColor0);
+    processLight(accum, global, lightPos1, lightDiffuseColor1, lightSpecularColor1);
+    
+    // Calcalate total lighting for this fragment
+    float3 total_light_contrib;
+	total_light_contrib = ambientColor+accum.light_diffuse+alpha*accum.light_specular;
+	
+    o.colour = float4( total_light_contrib*colour ,0);
+    // Depth buffer value
+    // Transfering depth makes it possible to render particle effects and other transparent
+    // things unaffected by light in the postprocessing phase.
+    o.depth = projCoord.z*proj[2][2] + proj[2][3]/distance;
+    return o;
+}
+
Index: code/trunk/Tutorial/Media/DeferredShadingMedia/DeferredShading/post/hlsl/vs.hlsl
===================================================================
--- code/trunk/Tutorial/Media/DeferredShadingMedia/DeferredShading/post/hlsl/vs.hlsl	(revision 44)
+++ code/trunk/Tutorial/Media/DeferredShadingMedia/DeferredShading/post/hlsl/vs.hlsl	(revision 44)
@@ -0,0 +1,59 @@
+/******************************************************************************
+Copyright (c) W.J. van der Laan
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of 
+this software  and associated documentation files (the "Software"), to deal in 
+the Software without restriction, including without limitation the rights to use, 
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so, subject 
+to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies 
+or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE 
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+******************************************************************************/
+/** Deferred shading framework
+	// W.J. :wumpus: van der Laan 2005 //
+	
+	Post shader: Generic fullscreen quad
+*/
+struct VS_OUTPUT {
+   float4 Pos: POSITION;
+   float2 texCoord: TEXCOORD0;
+   float3 projCoord: TEXCOORD1;
+};
+float4x4 invProj;
+
+VS_OUTPUT main(float4 Pos: POSITION){
+   VS_OUTPUT Out;
+
+	// Clean up inaccuracies
+	Pos.xy = sign(Pos.xy);
+
+	Out.Pos = float4(Pos.xy, 0, 1);
+	
+	// Image-space
+	Out.texCoord.x = 0.5 * (1 + Pos.x);
+	Out.texCoord.y = 0.5 * (1 - Pos.y);
+   
+	// Projection coordinates
+	// Inverted projection matrix
+	// These interpolate over the frustrum plane for w=1
+    Out.projCoord = float3(Pos.x, Pos.y, 1) *
+		float3(
+			invProj[0][0], // X vector component from X
+			invProj[1][1], // Y vector component from Y
+			invProj[2][3]  // Z vector component from W
+		);
+
+	return Out;
+}
+
+
+
Index: code/trunk/Tutorial/Media/DeferredShadingMedia/deferred.glsl.program
===================================================================
--- code/trunk/Tutorial/Media/DeferredShadingMedia/deferred.glsl.program	(revision 44)
+++ code/trunk/Tutorial/Media/DeferredShadingMedia/deferred.glsl.program	(revision 44)
@@ -0,0 +1,50 @@
+// Materials for rendering to the fat buffer
+
+// Plain phong
+vertex_program DeferredShading/material/glsl/vs glsl
+{
+	source DeferredShading/material/glsl/vs.glsl
+}
+fragment_program DeferredShading/material/glsl/ps glsl
+{
+	source DeferredShading/material/glsl/ps.glsl
+	default_params
+	{
+		param_named specularity float 0.0
+	}
+}
+fragment_program DeferredShading/material/glsl/notex_ps glsl
+{
+	source DeferredShading/material/glsl/notex_ps.glsl
+	default_params
+	{
+		param_named specularity float 0.0
+		param_named colour float3 0.7 0.7 0.7
+	}
+}
+
+// Normal mapping
+vertex_program DeferredShading/material/glsl/nm_vs glsl
+{
+	source DeferredShading/material/glsl/nm_vs.glsl
+}
+fragment_program DeferredShading/material/glsl/nm_ps glsl
+{
+	source DeferredShading/material/glsl/nm_ps.glsl
+	default_params
+	{
+		param_named specularity float 0.0
+		param_named tex0 int 0
+		param_named normTex int 1
+	}
+}
+fragment_program DeferredShading/material/glsl/nm_notex_ps glsl
+{
+	source DeferredShading/material/glsl/nm_notex_ps.glsl
+	default_params
+	{
+		param_named colour float3 0.7 0.7 0.7
+		param_named specularity float 0.0
+		param_named normTex int 0
+	}
+}
Index: code/trunk/Tutorial/Media/DeferredShadingMedia/deferred.hlsl.program
===================================================================
--- code/trunk/Tutorial/Media/DeferredShadingMedia/deferred.hlsl.program	(revision 44)
+++ code/trunk/Tutorial/Media/DeferredShadingMedia/deferred.hlsl.program	(revision 44)
@@ -0,0 +1,70 @@
+// Materials for rendering to the fat buffer
+
+// Plain phong
+vertex_program DeferredShading/material/hlsl/vs hlsl
+{
+	source DeferredShading/material/hlsl/vs.hlsl
+	target vs_1_1
+	entry_point main
+	
+	default_params
+	{
+		param_named_auto worldView worldview_matrix
+		param_named_auto worldViewProj worldviewproj_matrix
+	}
+}
+fragment_program DeferredShading/material/hlsl/ps hlsl
+{
+	source DeferredShading/material/hlsl/ps.hlsl
+	target ps_2_0
+	entry_point main
+	default_params
+	{
+		param_named specularity float 0.0
+	}
+}
+fragment_program DeferredShading/material/hlsl/notex_ps hlsl
+{
+	source DeferredShading/material/hlsl/notex_ps.hlsl
+	target ps_2_0
+	entry_point main
+	default_params
+	{
+		param_named specularity float 0.0
+	}
+}
+
+// Normal mapping
+vertex_program DeferredShading/material/hlsl/nm_vs hlsl
+{
+	source DeferredShading/material/hlsl/nm_vs.hlsl
+	target vs_1_1
+	entry_point main
+	
+	default_params
+	{
+		param_named_auto worldView worldview_matrix
+		param_named_auto worldViewProj worldviewproj_matrix
+	}
+}
+fragment_program DeferredShading/material/hlsl/nm_ps hlsl
+{
+	source DeferredShading/material/hlsl/nm_ps.hlsl
+	target ps_2_0
+	entry_point main
+	default_params
+	{
+		param_named specularity float 0.0
+	}
+}
+fragment_program DeferredShading/material/hlsl/nm_notex_ps hlsl
+{
+	source DeferredShading/material/hlsl/nm_notex_ps.hlsl
+	target ps_2_0
+	entry_point main
+	default_params
+	{
+		param_named colour float3 0.7 0.7 0.7
+		param_named specularity float 0.0
+	}
+}
Index: code/trunk/Tutorial/Media/DeferredShadingMedia/deferred.material
===================================================================
--- code/trunk/Tutorial/Media/DeferredShadingMedia/deferred.material	(revision 44)
+++ code/trunk/Tutorial/Media/DeferredShadingMedia/deferred.material	(revision 44)
@@ -0,0 +1,152 @@
+// Materials for rendering to the fat buffer
+
+// Textured Phong shading material
+material DeferredShading/Material/TexturedPhong
+{
+	technique hlsl
+	{
+		pass main
+		{
+			vertex_program_ref DeferredShading/material/hlsl/vs
+			{
+			}
+			fragment_program_ref DeferredShading/material/hlsl/ps
+			{
+			}
+
+			texture_unit
+			{
+			}
+		}
+	}
+	technique glsl
+	{
+		pass main
+		{
+			vertex_program_ref DeferredShading/material/glsl/vs
+			{
+			}
+			fragment_program_ref DeferredShading/material/glsl/ps
+			{
+			}
+
+			texture_unit
+			{
+			}
+		}
+	}
+}
+
+// Untextured Phong shading material
+material DeferredShading/Material/UntexturedPhong
+{
+	technique hlsl
+	{
+		pass main
+		{
+			vertex_program_ref DeferredShading/material/hlsl/vs
+			{
+			}
+			fragment_program_ref DeferredShading/material/hlsl/notex_ps
+			{
+			}
+		}
+	}
+	technique glsl
+	{
+		pass main
+		{
+			vertex_program_ref DeferredShading/material/glsl/vs
+			{
+			}
+			fragment_program_ref DeferredShading/material/glsl/notex_ps
+			{
+			}
+		}
+	}
+}
+
+// Textured normal mapped material
+material DeferredShading/Material/TexturedNormalMapped
+{
+	technique hlsl
+	{
+		pass main
+		{
+			vertex_program_ref DeferredShading/material/hlsl/nm_vs
+			{
+			}
+			fragment_program_ref DeferredShading/material/hlsl/nm_ps
+			{
+			}
+
+			texture_unit
+			{
+			}
+			texture_unit
+			{
+				tex_coord_set 1
+			}
+		}
+	}
+	technique glsl
+	{
+		pass main
+		{
+			vertex_program_ref DeferredShading/material/glsl/nm_vs
+			{
+			}
+			fragment_program_ref DeferredShading/material/glsl/nm_ps
+			{
+			}
+
+			texture_unit
+			{
+			}
+			texture_unit
+			{
+				tex_coord_set 1
+			}
+		}
+	}
+}
+
+// Untextured normal mapped material
+material DeferredShading/Material/UntexturedNormalMapped
+{
+	technique hlsl
+	{
+		pass main
+		{
+			vertex_program_ref DeferredShading/material/hlsl/nm_vs
+			{
+			}
+			fragment_program_ref DeferredShading/material/hlsl/nm_notex_ps
+			{
+			}
+			texture_unit
+			{
+			}
+		}
+	}
+	technique glsl
+	{
+		pass main
+		{
+			vertex_program_ref DeferredShading/material/glsl/nm_vs
+			{
+			}
+			fragment_program_ref DeferredShading/material/glsl/nm_notex_ps
+			{
+			}
+			texture_unit
+			{
+				tex_coord_set 0
+			}
+			texture_unit
+			{
+				tex_coord_set 1
+			}
+		}
+	}
+}
Index: code/trunk/Tutorial/Media/DeferredShadingMedia/deferred_post_debug.glsl.program
===================================================================
--- code/trunk/Tutorial/Media/DeferredShadingMedia/deferred_post_debug.glsl.program	(revision 44)
+++ code/trunk/Tutorial/Media/DeferredShadingMedia/deferred_post_debug.glsl.program	(revision 44)
@@ -0,0 +1,27 @@
+fragment_program DeferredShading/post/glsl/ShowNormal_ps glsl
+{
+	source DeferredShading/post/glsl/ShowNormal_ps.glsl
+	default_params
+	{
+		param_named tex0 int 0
+		param_named tex1 int 1
+	}
+}
+fragment_program DeferredShading/post/glsl/ShowDS_ps glsl
+{
+	source DeferredShading/post/glsl/ShowDS_ps.glsl
+	default_params
+	{
+		param_named tex0 int 0
+		param_named tex1 int 1
+	}
+}
+fragment_program DeferredShading/post/glsl/ShowColour_ps glsl
+{
+	source DeferredShading/post/glsl/ShowColour_ps.glsl
+	default_params
+	{
+		param_named tex0 int 0
+		param_named tex1 int 1
+	}
+}
Index: code/trunk/Tutorial/Media/DeferredShadingMedia/deferred_post_debug.hlsl.program
===================================================================
--- code/trunk/Tutorial/Media/DeferredShadingMedia/deferred_post_debug.hlsl.program	(revision 44)
+++ code/trunk/Tutorial/Media/DeferredShadingMedia/deferred_post_debug.hlsl.program	(revision 44)
@@ -0,0 +1,18 @@
+fragment_program DeferredShading/post/hlsl/ShowNormal_ps hlsl
+{
+	source DeferredShading/post/hlsl/ShowNormal_ps.hlsl
+	target ps_2_0
+	entry_point main
+}
+fragment_program DeferredShading/post/hlsl/ShowDS_ps hlsl
+{
+	source DeferredShading/post/hlsl/ShowDS_ps.hlsl
+	target ps_2_0
+	entry_point main
+}
+fragment_program DeferredShading/post/hlsl/ShowColour_ps hlsl
+{
+	source DeferredShading/post/hlsl/ShowColour_ps.hlsl
+	target ps_2_0
+	entry_point main
+}
Index: code/trunk/Tutorial/Media/DeferredShadingMedia/deferred_post_debug.material
===================================================================
--- code/trunk/Tutorial/Media/DeferredShadingMedia/deferred_post_debug.material	(revision 44)
+++ code/trunk/Tutorial/Media/DeferredShadingMedia/deferred_post_debug.material	(revision 44)
@@ -0,0 +1,172 @@
+material DeferredShading/Post/ShowNormal
+{
+    technique
+    {
+    	pass
+		{
+			cull_hardware none
+			cull_software none
+			depth_func always_pass
+
+			fragment_program_ref DeferredShading/post/hlsl/ShowNormal_ps
+			{
+			}
+			vertex_program_ref DeferredShading/post/hlsl/vs
+			{
+			}
+			texture_unit
+			{
+				tex_address_mode clamp
+				filtering none
+			}
+			texture_unit
+			{
+				tex_coord_set 1
+				tex_address_mode clamp
+				filtering none
+			}
+		}
+	}
+	technique
+    {
+    	pass
+		{
+			cull_hardware none
+			cull_software none
+			depth_func always_pass
+
+			fragment_program_ref DeferredShading/post/glsl/ShowNormal_ps
+			{
+			}
+			vertex_program_ref DeferredShading/post/glsl/vs
+			{
+			}
+			texture_unit
+			{
+				tex_address_mode clamp
+				filtering none
+			}
+			texture_unit
+			{
+				tex_coord_set 1
+				tex_address_mode clamp
+				filtering none
+			}
+		}
+	}
+}
+
+material DeferredShading/Post/ShowDS
+{
+    technique
+    {
+    	pass
+		{
+			cull_hardware none
+			cull_software none
+			depth_func always_pass
+
+			fragment_program_ref DeferredShading/post/hlsl/ShowDS_ps
+			{
+			}
+			vertex_program_ref DeferredShading/post/hlsl/vs
+			{
+			}
+			texture_unit
+			{
+				tex_address_mode clamp
+				filtering none
+			}
+			texture_unit
+			{
+				tex_coord_set 1
+				tex_address_mode clamp
+				filtering none
+			}
+		}
+	}
+	technique
+    {
+    	pass
+		{
+			cull_hardware none
+			cull_software none
+			depth_func always_pass
+
+			fragment_program_ref DeferredShading/post/glsl/ShowDS_ps
+			{
+			}
+			vertex_program_ref DeferredShading/post/glsl/vs
+			{
+			}
+			texture_unit
+			{
+				tex_address_mode clamp
+				filtering none
+			}
+			texture_unit
+			{
+				tex_coord_set 1
+				tex_address_mode clamp
+				filtering none
+			}
+		}
+	}
+}
+material DeferredShading/Post/ShowColour
+{
+    technique
+    {
+    	pass
+		{
+			cull_hardware none
+			cull_software none
+			depth_func always_pass
+
+			fragment_program_ref DeferredShading/post/hlsl/ShowColour_ps
+			{
+			}
+			vertex_program_ref DeferredShading/post/hlsl/vs
+			{
+			}
+			texture_unit
+			{
+				tex_address_mode clamp
+				filtering none
+			}
+			texture_unit
+			{
+				tex_coord_set 1
+				tex_address_mode clamp
+				filtering none
+			}
+		}
+	}
+	technique
+    {
+    	pass
+		{
+			cull_hardware none
+			cull_software none
+			depth_func always_pass
+
+			fragment_program_ref DeferredShading/post/glsl/ShowColour_ps
+			{
+			}
+			vertex_program_ref DeferredShading/post/glsl/vs
+			{
+			}
+			texture_unit
+			{
+				tex_address_mode clamp
+				filtering none
+			}
+			texture_unit
+			{
+				tex_coord_set 1
+				tex_address_mode clamp
+				filtering none
+			}
+		}
+	}
+}
Index: code/trunk/Tutorial/Media/DeferredShadingMedia/deferred_post_minilight.glsl.program
===================================================================
--- code/trunk/Tutorial/Media/DeferredShadingMedia/deferred_post_minilight.glsl.program	(revision 44)
+++ code/trunk/Tutorial/Media/DeferredShadingMedia/deferred_post_minilight.glsl.program	(revision 44)
@@ -0,0 +1,26 @@
+// Auxilary lights
+vertex_program DeferredShading/post/glsl/LightMaterial_vs glsl
+{
+	source DeferredShading/post/glsl/LightMaterial_vs.glsl
+	default_params
+	{
+		param_named_auto invProj inverse_projection_matrix
+		param_named_auto vpWidth viewport_width
+		param_named_auto vpHeight viewport_height
+	}
+}
+fragment_program DeferredShading/post/glsl/LightMaterial_ps glsl
+{
+	source DeferredShading/post/glsl/LightMaterial_ps.glsl
+	default_params
+	{
+		param_named_auto worldView worldview_matrix
+		
+		param_named_auto lightDiffuseColor custom 1
+		param_named_auto lightSpecularColor custom 2
+		param_named_auto lightFalloff custom 3
+		
+		param_named tex0 int 0
+		param_named tex1 int 1
+	}
+}
Index: code/trunk/Tutorial/Media/DeferredShadingMedia/deferred_post_minilight.hlsl.program
===================================================================
--- code/trunk/Tutorial/Media/DeferredShadingMedia/deferred_post_minilight.hlsl.program	(revision 44)
+++ code/trunk/Tutorial/Media/DeferredShadingMedia/deferred_post_minilight.hlsl.program	(revision 44)
@@ -0,0 +1,29 @@
+// Auxilary lights
+vertex_program DeferredShading/post/hlsl/LightMaterial_vs hlsl
+{
+	source DeferredShading/post/hlsl/LightMaterial_vs.hlsl
+	target vs_1_1
+	entry_point main
+	default_params
+	{
+		param_named_auto worldViewProj worldviewproj_matrix
+		param_named_auto invProj inverse_projection_matrix
+		param_named_auto vpWidth viewport_width
+		param_named_auto vpHeight viewport_height
+	}
+}
+fragment_program DeferredShading/post/hlsl/LightMaterial_ps hlsl
+{
+	source DeferredShading/post/hlsl/LightMaterial_ps.hlsl
+	target ps_2_0
+	entry_point main
+
+	default_params
+	{
+		param_named_auto worldView worldview_matrix
+		
+		param_named_auto lightDiffuseColor custom 1
+		param_named_auto lightSpecularColor custom 2
+		param_named_auto lightFalloff custom 3
+	}
+}
Index: code/trunk/Tutorial/Media/DeferredShadingMedia/deferred_post_minilight.material
===================================================================
--- code/trunk/Tutorial/Media/DeferredShadingMedia/deferred_post_minilight.material	(revision 44)
+++ code/trunk/Tutorial/Media/DeferredShadingMedia/deferred_post_minilight.material	(revision 44)
@@ -0,0 +1,56 @@
+// Auxilary lights
+
+/// Reference material [geometry]
+material DeferredShading/LightMaterial
+{
+    technique
+    {
+		pass
+		{
+			// Don't disable depth test, because the light doesn't have to be rendered
+			// if the bounding geometry is obscured.
+			scene_blend add
+			depth_write off
+			depth_check on
+			lighting off
+			
+			
+			texture_unit
+			{
+				tex_address_mode clamp
+				filtering none
+			}
+			texture_unit
+			{
+				tex_address_mode clamp
+				filtering none
+			}
+		}
+	}
+}
+/// Reference material [quad]
+material DeferredShading/LightMaterialQuad
+{
+    technique
+    {
+		pass
+		{
+			scene_blend add
+			depth_write off
+			depth_check off
+			lighting off
+			
+			texture_unit
+			{
+				tex_address_mode clamp
+				filtering none
+			}
+			texture_unit
+			{
+				tex_address_mode clamp
+				filtering none
+			}
+		}
+	}
+}
+
Index: code/trunk/Tutorial/Media/DeferredShadingMedia/deferred_post_multipass.glsl.program
===================================================================
--- code/trunk/Tutorial/Media/DeferredShadingMedia/deferred_post_multipass.glsl.program	(revision 44)
+++ code/trunk/Tutorial/Media/DeferredShadingMedia/deferred_post_multipass.glsl.program	(revision 44)
@@ -0,0 +1,26 @@
+// Post processors
+fragment_program DeferredShading/post/glsl/Ambient_ps glsl
+{
+	source DeferredShading/post/glsl/Ambient_ps.glsl
+	
+	default_params
+	{
+		param_named_auto ambientColor ambient_light_colour 0		
+		param_named_auto proj projection_matrix
+		param_named tex0 int 0
+		param_named tex1 int 1
+	}
+}
+fragment_program DeferredShading/post/glsl/GlobalLight_ps glsl
+{
+	source DeferredShading/post/glsl/GlobalLight_ps.glsl
+	
+	default_params
+	{
+		param_named_auto lightPos0 light_position_view_space 0
+		param_named_auto lightDiffuseColor0 light_diffuse_colour 0
+		param_named_auto lightSpecularColor0 light_specular_colour 0
+		param_named tex0 int 0
+		param_named tex1 int 1
+	}
+}
Index: code/trunk/Tutorial/Media/DeferredShadingMedia/deferred_post_multipass.hlsl.program
===================================================================
--- code/trunk/Tutorial/Media/DeferredShadingMedia/deferred_post_multipass.hlsl.program	(revision 44)
+++ code/trunk/Tutorial/Media/DeferredShadingMedia/deferred_post_multipass.hlsl.program	(revision 44)
@@ -0,0 +1,28 @@
+// Post processors
+fragment_program DeferredShading/post/hlsl/Ambient_ps hlsl
+{
+	source DeferredShading/post/hlsl/Ambient_ps.hlsl
+	target ps_2_0
+	entry_point main
+	
+	default_params
+	{
+		param_named_auto ambientColor ambient_light_colour 0		
+		param_named_auto proj projection_matrix
+	}
+}
+fragment_program DeferredShading/post/hlsl/GlobalLight_ps hlsl
+{
+	source DeferredShading/post/hlsl/GlobalLight_ps.hlsl
+	target ps_2_0
+	entry_point main
+	
+	default_params
+	{
+		//param_named_auto invProj inverse_projection_matrix	
+		
+		param_named_auto lightPos0 light_position_view_space 0
+		param_named_auto lightDiffuseColor0 light_diffuse_colour 0
+		param_named_auto lightSpecularColor0 light_specular_colour 0
+	}
+}
Index: code/trunk/Tutorial/Media/DeferredShadingMedia/deferred_post_multipass.material
===================================================================
--- code/trunk/Tutorial/Media/DeferredShadingMedia/deferred_post_multipass.material	(revision 44)
+++ code/trunk/Tutorial/Media/DeferredShadingMedia/deferred_post_multipass.material	(revision 44)
@@ -0,0 +1,118 @@
+// Post processors
+
+material DeferredShading/Post/Multi
+{
+    technique
+    {
+    	pass
+		{
+			// Ambient and depth write pass
+			cull_hardware none
+			cull_software none
+			//depth_check off
+			depth_write on
+
+			fragment_program_ref DeferredShading/post/hlsl/Ambient_ps
+			{
+			}
+			vertex_program_ref DeferredShading/post/hlsl/vs
+			{
+			}
+			texture_unit
+			{
+				tex_address_mode clamp
+				filtering none
+			}
+			texture_unit
+			{
+				tex_coord_set 1
+				tex_address_mode clamp
+				filtering none
+			}
+		}
+		pass
+		{
+			scene_blend add
+			cull_hardware none
+			cull_software none
+			iteration once_per_light
+			depth_write off
+			//depth_check off
+
+			fragment_program_ref DeferredShading/post/hlsl/GlobalLight_ps
+			{
+			}
+			vertex_program_ref DeferredShading/post/hlsl/vs
+			{
+			}
+			texture_unit
+			{
+				tex_address_mode clamp
+				filtering none
+			}
+			texture_unit
+			{
+				tex_coord_set 1
+				tex_address_mode clamp
+				filtering none
+			}
+		}
+	}
+	technique
+    {
+    	pass
+		{
+			// Ambient and depth write pass
+			cull_hardware none
+			cull_software none
+			//depth_check off
+			depth_write on
+
+			fragment_program_ref DeferredShading/post/glsl/Ambient_ps
+			{
+			}
+			vertex_program_ref DeferredShading/post/glsl/vs
+			{
+			}
+			texture_unit
+			{
+				tex_address_mode clamp
+				filtering none
+			}
+			texture_unit
+			{
+				tex_coord_set 1
+				tex_address_mode clamp
+				filtering none
+			}
+		}
+		pass
+		{
+			scene_blend add
+			cull_hardware none
+			cull_software none
+			iteration once_per_light
+			depth_write off
+			depth_check off
+
+			fragment_program_ref DeferredShading/post/glsl/GlobalLight_ps
+			{
+			}
+			vertex_program_ref DeferredShading/post/glsl/vs
+			{
+			}
+			texture_unit
+			{
+				tex_address_mode clamp
+				filtering none
+			}
+			texture_unit
+			{
+				tex_coord_set 1
+				tex_address_mode clamp
+				filtering none
+			}
+		}
+	}
+}
+
Index: code/trunk/Tutorial/Media/DeferredShadingMedia/deferred_post_onepass.glsl.program
===================================================================
--- code/trunk/Tutorial/Media/DeferredShadingMedia/deferred_post_onepass.glsl.program	(revision 44)
+++ code/trunk/Tutorial/Media/DeferredShadingMedia/deferred_post_onepass.glsl.program	(revision 44)
@@ -0,0 +1,27 @@
+// Post processors
+
+vertex_program DeferredShading/post/glsl/vs glsl
+{
+	source DeferredShading/post/glsl/vs.glsl
+	default_params
+	{
+		param_named_auto invProj inverse_projection_matrix
+	}
+}
+fragment_program DeferredShading/post/glsl/SinglePass_ps glsl
+{
+	source DeferredShading/post/glsl/SinglePass_ps.glsl
+	default_params
+	{
+		param_named_auto proj projection_matrix
+		param_named_auto ambientColor ambient_light_colour 0
+		param_named_auto lightPos0 light_position_view_space 0
+		param_named_auto lightDiffuseColor0 light_diffuse_colour 0
+		param_named_auto lightSpecularColor0 light_specular_colour 0
+		param_named_auto lightPos1 light_position_view_space 1
+		param_named_auto lightDiffuseColor1 light_diffuse_colour 1
+		param_named_auto lightSpecularColor1 light_specular_colour 1
+		param_named tex0 int 0
+		param_named tex1 int 1
+	}
+}
Index: code/trunk/Tutorial/Media/DeferredShadingMedia/deferred_post_onepass.hlsl.program
===================================================================
--- code/trunk/Tutorial/Media/DeferredShadingMedia/deferred_post_onepass.hlsl.program	(revision 44)
+++ code/trunk/Tutorial/Media/DeferredShadingMedia/deferred_post_onepass.hlsl.program	(revision 44)
@@ -0,0 +1,29 @@
+// Post processors
+vertex_program DeferredShading/post/hlsl/vs hlsl
+{
+	source DeferredShading/post/hlsl/vs.hlsl
+	target vs_1_1
+	entry_point main
+	default_params
+	{
+		param_named_auto invProj inverse_projection_matrix
+	}
+}
+fragment_program DeferredShading/post/hlsl/SinglePass_ps hlsl
+{
+	source DeferredShading/post/hlsl/SinglePass_ps.hlsl
+	target ps_2_0
+	entry_point main
+	
+	default_params
+	{
+		param_named_auto proj projection_matrix
+		param_named_auto ambientColor ambient_light_colour 0
+		param_named_auto lightPos0 light_position_view_space 0
+		param_named_auto lightDiffuseColor0 light_diffuse_colour 0
+		param_named_auto lightSpecularColor0 light_specular_colour 0
+		param_named_auto lightPos1 light_position_view_space 1
+		param_named_auto lightDiffuseColor1 light_diffuse_colour 1
+		param_named_auto lightSpecularColor1 light_specular_colour 1
+	}
+}
Index: code/trunk/Tutorial/Media/DeferredShadingMedia/deferred_post_onepass.material
===================================================================
--- code/trunk/Tutorial/Media/DeferredShadingMedia/deferred_post_onepass.material	(revision 44)
+++ code/trunk/Tutorial/Media/DeferredShadingMedia/deferred_post_onepass.material	(revision 44)
@@ -0,0 +1,65 @@
+// Post processors
+material DeferredShading/Post/Single
+{
+    technique
+    {
+    	pass
+		{
+			cull_hardware none
+			cull_software none
+			depth_func always_pass
+			depth_write on
+			// Doesn't work for some reason
+			//depth_check off
+
+			fragment_program_ref DeferredShading/post/hlsl/SinglePass_ps
+			{
+			}
+			vertex_program_ref DeferredShading/post/hlsl/vs
+			{
+			}
+			texture_unit
+			{
+				tex_address_mode clamp
+				filtering none
+			}
+			texture_unit
+			{
+				tex_coord_set 1
+				tex_address_mode clamp
+				filtering none
+			}
+		}
+	}
+	technique
+    {
+    	pass
+		{
+			cull_hardware none
+			cull_software none
+			depth_func always_pass
+			depth_write on
+			// Doesn't work for some reason
+			//depth_check off
+
+			fragment_program_ref DeferredShading/post/glsl/SinglePass_ps
+			{
+			}
+			vertex_program_ref DeferredShading/post/glsl/vs
+			{
+			}
+			texture_unit
+			{
+				tex_address_mode clamp
+				filtering none
+			}
+			texture_unit
+			{
+				tex_coord_set 1
+				tex_address_mode clamp
+				filtering none
+			}
+		}
+	}
+}
+
Index: code/trunk/Tutorial/Media/DeferredShadingMedia/deferreddemo.material
===================================================================
--- code/trunk/Tutorial/Media/DeferredShadingMedia/deferreddemo.material	(revision 44)
+++ code/trunk/Tutorial/Media/DeferredShadingMedia/deferreddemo.material	(revision 44)
@@ -0,0 +1,228 @@
+// Materials for deferred shading test
+
+// Sky box
+material Test13/SkyBox
+{
+	technique
+	{
+		pass
+		{
+			depth_write off
+			lighting off
+			texture_unit
+			{
+				cubic_texture evening.jpg separateUV
+				tex_address_mode clamp
+			}
+		}
+	}
+}
+
+// Ground plane
+material Test13/Ground: DeferredShading/Material/TexturedPhong
+{
+	technique hlsl
+	{
+		pass main
+		{
+			texture_unit
+			{
+				texture grass_1024.jpg
+			}
+		}
+	}
+	technique glsl
+	{
+		pass main
+		{
+			texture_unit
+			{
+				texture grass_1024.jpg
+			}
+		}
+	}
+}
+
+// Rock wall texture [bumpmapped]
+material Test13/RockWall: DeferredShading/Material/TexturedNormalMapped
+{
+	technique hlsl
+	{
+		pass main
+		{
+			texture_unit
+			{
+				texture rockwall.tga
+			}
+			texture_unit
+			{
+				texture rockwall_NH.tga
+			}
+		}
+	}
+	technique glsl
+	{
+		pass main
+		{
+			texture_unit
+			{
+				texture rockwall.tga
+			}
+			texture_unit
+			{
+				texture rockwall_NH.tga
+			}
+		}
+	}
+}
+
+
+// Athena texture [bumpmapped, untextured]
+material Test13/DeferredAthena: DeferredShading/Material/UntexturedNormalMapped
+{
+	technique hlsl
+	{
+		pass main
+		{
+			texture_unit
+			{
+				texture atheneNormalMap.png
+			}
+			fragment_program_ref
+			{
+				param_named specularity float 0.5
+			}
+		}
+	}
+	technique glsl
+	{
+		pass main
+		{
+			texture_unit
+			{
+				texture atheneNormalMap.png
+			}
+			fragment_program_ref
+			{
+				param_named specularity float 0.5
+			}
+		}
+	}
+}
+
+/// Ogre parts
+material Test13/DeferredOgre/Skin: DeferredShading/Material/TexturedPhong
+{
+	technique hlsl
+	{
+		pass main
+		{
+			cull_hardware none
+			texture_unit
+			{
+				texture GreenSkin.jpg
+				tex_address_mode mirror
+			}
+		}
+	}
+	technique glsl
+	{
+		pass main
+		{
+			cull_hardware none
+			texture_unit
+			{
+				texture GreenSkin.jpg
+				tex_address_mode mirror
+			}
+		}
+	}
+}
+material Test13/DeferredOgre/EarRing: DeferredShading/Material/UntexturedPhong
+{
+	technique hlsl
+	{
+		pass main
+		{
+			fragment_program_ref
+			{
+				param_named specularity float 1.5
+				param_named colour float3 0.5 0.5 0
+			}
+		}
+	}
+	technique glsl
+	{
+		pass main
+		{
+			fragment_program_ref
+			{
+				param_named specularity float 1.5
+				param_named colour float3 0.5 0.5 0
+			}
+		}
+	}
+}
+material Test13/DeferredOgre/Tusks: DeferredShading/Material/TexturedPhong
+{
+	technique hlsl
+	{
+		pass main
+		{
+			fragment_program_ref
+			{
+				param_named specularity float 0.5
+			}
+			texture_unit
+			{
+				texture dirt01.jpg
+			}
+		}
+	}
+	technique glsl
+	{
+		pass main
+		{
+			fragment_program_ref
+			{
+				param_named specularity float 0.5
+			}
+			texture_unit
+			{
+				texture dirt01.jpg
+			}
+		}
+	}
+}
+material Test13/DeferredOgre/Eyes: DeferredShading/Material/TexturedPhong
+{
+	technique hlsl
+	{
+		pass main
+		{
+			fragment_program_ref
+			{
+				param_named specularity float 1.0
+			}
+			texture_unit
+			{
+				texture WeirdEye.png
+			}
+		}
+	}
+	technique glsl
+	{
+		pass main
+		{
+			fragment_program_ref
+			{
+				param_named specularity float 1.0
+			}
+			texture_unit
+			{
+				texture WeirdEye.png
+			}
+		}
+	}
+}
+
Index: code/trunk/Tutorial/Media/fonts/read_me.html
===================================================================
--- code/trunk/Tutorial/Media/fonts/read_me.html	(revision 44)
+++ code/trunk/Tutorial/Media/fonts/read_me.html	(revision 44)
@@ -0,0 +1,2 @@
+<html><head><title>Larabie Fonts "read me" file, license and FAQ</title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><meta name="keywords" content="typodermic,typo dermic,fonts,Larabie,Larabie Fonts,fontd,fotn,fnots,fons,fots,fnts,font,truetype,typefaces,typeface,logo,ttf,opentype,larbie,laribie,larby,larabee,lairby,larrabie,larraby,laraby,typography,Type1,postscript,macintosh,windows,design,lettering,type"><font face="Georgia"><h3>LARABIE FONTS README.TXT</h3><p>All Larabie Fonts in this file are free to use for personal and/or commercial purposes. No payment is necessary to use these fonts for personal or commercial use. For Software Products who want to include Larabie Fonts see the License Agreement below. You can add this font to a website but do not combine fonts into a single archive or alter them in any way.</p><p>All Larabie Fonts are free for commercial use but a sample of your product would be gratefully appreciated so I can see how the font looks in use. Contact <a href="http://www.larabiefonts.com/donation.html">www.larabiefonts.com/donation.html</a> for mailing information.</p><p>Some Larabie Fonts have enhanced and expanded families available for sale at <a href="http://www.typodermic.com">www.typodermic.com</a>.</p><p>If you'd like to make a voluntary donation to Larabie Fonts for the use of the free fonts in any amount please go to <a href="http://www.larabiefonts.com/donation.html">www.larabiefonts.com/donation.html</a></p><p>I accept CDs, magazines, t-shirts, a sample of your merchandise or anything featuring Larabie Fonts. Please remember to list your item as a gift on the customs form or I will have to pay import duties and taxes on the item. Mailing information is provided at the link above.</p><p>Font installation help is available at <a href="http://www.larabiefonts.com/help.html">www.larabiefonts.com/help.html</a></p><h3>LARABIE FONTS FREQUENTLY ASKED QUESTIONS</h3><ul><li>Q: How do use these fonts in my favourite software?<li>A: In Windows, you take the fonts out of the ZIP archive and place them in your fonts folder which can be found in your Control Panel. The next time you run your software, the font will be available. For example: If you install a new font, the next time you run Microsoft Word, that font will be available in the menu under Format / Font. For anything more complicated, or Mac installation, visit <a href="http://www.larabiefonts.com/help.html">www.larabiefonts.com/help.html</a></ul><ul><li>Q: How can I use this font in <a href="http://www.aol.com/aim/">AOL Instant Messenger</a>, <a href="http://messenger.msn.com/">MSN Messenger</a>, <a href="http://www.microsoft.com/office/outlook/">Outlook</a>, <a href="http://www.microsoft.com/office/outlook/">Outlook Express</a>, <a href="http://www.eudora.com/">Euodora</a> or any other email software?<li>A: At the time of this writing (Feb 2004) you cant. After installing one of my fonts, you may be able to select it in the above applications but the person at the other end wont see that same thing unless they have the font installed. If you really want to use my fonts in these applications, make sure the people at the other end have the same fonts installed.</ul><ul><li>Q: How can I use these fonts on a web page?<li>A: If youre creating a web page using Flash, its easy. Consult your Flash manual. If youre using <a href="http://www.adobe.com/products/acrobat/">Acrobat</a>, make sure the font embedding settings are turned on. Consult your Acrobat manual. For anything else there are limitations: If you want to use one of my fonts as your main, text font youre pretty much out of luck unless you explore a font embedding tool such as <a href="http://www.microsoft.com/typography/web/embedding/weft/">WEFT</a> but I dont recommend it. To use my fonts as headings or titles, use image creation software such as <a href="http://www.gimp.org/">The Gimp</a>, <a href="http://www.adobe.com/products/photoshop/">Photoshop</a>, <a href="http://www.jasc.com/">Paint Shop Pro</a>, <a href="http://www.google.com/search?q=pixia">Pixia</a> etc. Save the images as GIF files and place them on your web page. Theres a lot more to it than can be explained here but there are countless books available on web page design.</ul><ul><li>Q: How can I make these fonts bigger?<li>A: All my fonts are infinitely scalable; the limitations are in your software. A common problem is scaling fonts in Microsoft Word. If you choose Format / Font you can type in any number you like under size.</ul><ul><li>Q: Are these fonts really free?<li>A: Yes they are. Some fonts such as <a href="http://www.typodermic.com/fonts/19.html">Neuropol</a> have expanded font families available for sale at <a href="http://www.typodermic.com">www.typodermic.com</a> but the version you downloaded at Larabie Fonts is free.</ul><ul><li>Q: Your licence agreement states that the fonts cant be altered. Does that mean I cant mess around with your fonts in Photoshop/Illustrator/Publisher etc?<li>A: Those license restrictions refer to altering the actual fonts themselves, not what you make with them. As long as you dont alter the font files in font creation software such as FontLab or Fontographer youre free to create anything you like with them.</ul><ul><li>Q: Can I use your fonts in a logo?<li>A: Yes. But check with a lawyer if youre not sure. Its okay with me if you use it but do so at your own risk.</ul><ul><li>Q: Can I send you a sample of the nifty thing I created with your fonts?<li>A: Of course. Check <a href="http://www.larabiefonts.com/donation.html">www.larabiefonts.com/donation.html</a> for my current email or mailing address.</ul><ul><li>Q: Can you make a custom font for me?<li>A: Possibly. Check <a href="http://typodermic.com/custom.html">typodermic.com/custom.html</a> for details. Keep in mind that making fonts is my full-time job so no freebies.</ul><ul><li>Q: I want to sell software that includes you font files.<li>A: Contact me first at <a href="http://www.larabiefonts.com/email.html">www.larabiefonts.com/email.html</a>.</ul><ul><li>Q: I want to sell rubber stamp alphabets, alphabet punches or stencil alphabets using your font designs.<li>A: Contact me first at <a href="http://www.larabiefonts.com/email.html">www.larabiefonts.com/email.html</a>.</ul><ul><li>Q: My software wont let me embed one of your fonts.<li>A: You may have an old version of one of my fonts. Uninstall it and install a current version on Larabie Fonts.</ul><ul><li>Q: Can you help me find a font?<li>A: I really dont have the time but if you send a donation, I can give it a try. If not. post your question on my font forum: <a href="http://www.larabiefonts.com/info.html">www.larabiefonts.com/info.html</a>.</ul><h3>LARABIE FONTS END-USER LICENSE AGREEMENT FOR SOFTWARE PRODUCTS</h3><h4>SOFTWARE PRODUCT LICENSE</h4><p>The SOFTWARE PRODUCT is protected by copyright laws and International copyright treaties, as well as other intellectual property laws and treaties. The SOFTWARE PRODUCT is licensed, not sold.</p><h5>1. GRANT OF LICENSE. This document grants you the following rights:</h5><p>- Installation and Use. You may install and use an unlimited number of copies of the SOFTWARE PRODUCT.  You may copy and distribute unlimited copies of the SOFTWARE PRODUCT as you receive them, in any medium, provided that you publish on each copy an appropriate copyright notice. Keep intact all the notices that refer to this License and give any other recipients of the fonts a copy of this License along with the fonts.</p><h5>2. DESCRIPTION OF OTHER RIGHTS AND LIMITATIONS.</h5><p>- You may modify your copy or copies of the SOFTWARE PRODUCT or any portion of it, provided that you also meet all of these rules:</p><p>a) Do not alter in any way alphanumeric characters (A-Z, a-z, 1-9) contained in the font. An exception is converting between formats, here is allowed the nominal distortion that occurs during conversion from second order to third order quadratic curves (TrueType to Postscript) and vice versa.</p><p>b) Extra characters may be added; here it is allowed to use curves (shapes) from alphanumeric characters in fonts under same license.</p><p>c) It is allowed to modify and remove analpahbetics (punctuation, special characters, ligatures and symbols).</p><p>d) The original font name must be retained but can be augmented. (ie. a Font named Blue Highway can be renamed Blue Highway Cyrillic or Blue Highway ANSI, etc.)</p><p>e) Character mapping may be altered.</p><p>f) If the kerning information is altered or discarded it must be stated in the user notes or documentation.</p><p>g) All modifications must be released under this license.</p></p>LIMITED WARRANTY NO WARRANTIES. Larabie Fonts expressly disclaims any warranty for the SOFTWARE PRODUCT. The SOFTWARE PRODUCT and any related documentation is provided "as is" without warranty of any kind, either express or implied, including, without limitation, the implied warranties or merchantability, fitness for a particular purpose, or non-infringement. The entire risk arising out of use or performance of the SOFTWARE PRODUCT remains with you.</p><p>NO LIABILITY FOR CONSEQUENTIAL DAMAGES. In no event shall Larabie Fonts be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or any other pecuniary loss) arising out of the use of or inability to use this product, even if Larabie Fonts has been advised of the possibility of such damages.</p><h5>3. MISCELLANEOUS</h5><p>Should you have any questions concerning this document, or if you desire to contact Larabie Fonts for any reason, please email <a href="http://www.larabiefonts.com/email.html">www.larabiefonts.com/email.html</a>.</p></font></BODY></HTML>
+
Index: code/trunk/Tutorial/Media/fonts/sample.fontdef
===================================================================
--- code/trunk/Tutorial/Media/fonts/sample.fontdef	(revision 44)
+++ code/trunk/Tutorial/Media/fonts/sample.fontdef	(revision 44)
@@ -0,0 +1,11 @@
+StarWars
+{
+	// Now this one I agree with ;)
+	// A Star Wars font :)
+	type 		truetype
+	source 		solo5.ttf
+	size 		16
+	resolution 	96
+}
+
+
Index: code/trunk/Tutorial/Media/gui/CompositorDemo.layout
===================================================================
--- code/trunk/Tutorial/Media/gui/CompositorDemo.layout	(revision 44)
+++ code/trunk/Tutorial/Media/gui/CompositorDemo.layout	(revision 44)
@@ -0,0 +1,182 @@
+<?xml version="1.0" ?>
+<GUILayout>
+<Window Type="DefaultGUISheet" Name="root">
+
+	<Window Type="DefaultGUISheet" Name="debug_overlay">
+		<Property Name="AlwaysOnTop" Value="True" />
+		<Property Name="Disabled" Value="True" />
+		
+		<Window Type="TaharezLook/StaticText" Name="Panel 1">
+			<Property Name="UnifiedPosition" Value="{{0,0},{0.83,0}}" />
+			<Property Name="UnifiedSize" Value="{{0.23,0},{0.17,0}}" />
+			<Property Name="TopLeftFrameImage" Value="set:OgreGuiImagery image:BoxTopLeft" />
+			<Property Name="TopRightFrameImage" Value="set:OgreGuiImagery image:BoxTopRight" />
+			<Property Name="BottomLeftFrameImage" Value="set:OgreGuiImagery image:BoxBottomLeft" />
+			<Property Name="BottomRightFrameImage" Value="set:OgreGuiImagery image:BoxBottomRight" />
+			<Property Name="LeftFrameImage" Value="set:OgreGuiImagery image:BoxLeft" />
+			<Property Name="TopFrameImage" Value="set:OgreGuiImagery image:BoxTop" />
+			<Property Name="RightFrameImage" Value="set:OgreGuiImagery image:BoxRight" />
+			<Property Name="BottomFrameImage" Value="set:OgreGuiImagery image:BoxBottom" />
+			<Property Name="BackgroundImage" Value="set:OgreGuiImagery image:BoxBack" />
+			<Property Name="Alpha" Value="0.9" />
+			<Property Name="InheritsAlpha" Value="False" />
+	
+			<Window Type="TaharezLook/StaticText" Name="OPCurrentFPS">
+				<Property Name="FrameEnabled" Value="False" />
+				<Property Name="BackgroundEnabled" Value="False" />
+				<Property Name="Font" Value="BlueHighway-10" />
+				<Property Name="UnifiedPosition" Value="{{0.075,0},{0.12,0}}" />
+				<Property Name="UnifiedSize" Value="{{0.85,0},{0.25,0}}" />
+				<Property Name="TextColours" Value="tl:FF4FF06F tr:FF4FF06F bl:FF4FF06F br:FF4FF06F" />
+				<Property Name="HorzFormatting" Value="HorzCentred" />
+				<Property Name="Text" Value="Current FPS: " />
+			</Window>
+
+			<Window Type="TaharezLook/StaticImage" Name="OPBar1">
+				<Property Name="FrameEnabled" Value="False" />
+				<Property Name="BackgroundEnabled" Value="False" />
+				<Property Name="UnifiedPosition" Value="{{0.2,0},{0.27,0}}" />
+				<Property Name="UnifiedSize" Value="{{0.6,0},{0.025,0}}" />
+				<Property Name="Image" Value="set:OgreGuiImagery image:Bar" />
+			</Window>
+
+			<Window Type="TaharezLook/StaticText" Name="OPAverageFPS">
+				<Property Name="FrameEnabled" Value="False" />
+				<Property Name="BackgroundEnabled" Value="False" />
+				<Property Name="Font" Value="BlueHighway-10" />
+				<Property Name="UnifiedPosition" Value="{{0.075,0},{0.32,0}}" />
+				<Property Name="UnifiedSize" Value="{{1.0,0},{0.25,0}}" />
+				<Property Name="TextColours" Value="tl:FFFFF5F0 tr:FFFFF5F0 bl:FFFFF510 br:FFFFF5F0" />
+				<Property Name="Text" Value="Average FPS: " />
+			</Window>
+
+			<Window Type="TaharezLook/StaticText" Name="OPWorstFPS">
+				<Property Name="FrameEnabled" Value="False" />
+				<Property Name="BackgroundEnabled" Value="False" />
+				<Property Name="Font" Value="BlueHighway-10" />
+				<Property Name="UnifiedPosition" Value="{{0.075,0},{0.45,0}}" />
+				<Property Name="UnifiedSize" Value="{{1.0,0},{0.25,0}}" />
+				<Property Name="TextColours" Value="tl:FFFFF5F0 tr:FFFFF5F0 bl:FFFFF510 br:FFFFF5F0" />
+				<Property Name="Text" Value="Worst FPS: " />
+			</Window>
+
+			<Window Type="TaharezLook/StaticText" Name="OPBestFPS">
+				<Property Name="FrameEnabled" Value="False" />
+				<Property Name="BackgroundEnabled" Value="False" />
+				<Property Name="Font" Value="BlueHighway-10" />
+				<Property Name="UnifiedPosition" Value="{{0.075,0},{0.58,0}}" />
+				<Property Name="UnifiedSize" Value="{{1.0,0},{0.25,0}}" />
+				<Property Name="TextColours" Value="tl:FFFFF5F0 tr:FFFFF5F0 bl:FFFFF510 br:FFFFF5F0" />
+				<Property Name="Text" Value="Best FPS: " />
+			</Window>
+
+			<Window Type="TaharezLook/StaticText" Name="OPTriCount">
+				<Property Name="FrameEnabled" Value="False" />
+				<Property Name="BackgroundEnabled" Value="False" />
+				<Property Name="Font" Value="BlueHighway-10" />
+				<Property Name="UnifiedPosition" Value="{{0.075,0},{0.71,0}}" />
+				<Property Name="UnifiedSize" Value="{{1.0,0},{0.25,0}}" />
+				<Property Name="TextColours" Value="tl:FFFFF5F0 tr:FFFFF5F0 bl:FFFFF510 br:FFFFF5F0" />
+				<Property Name="Text" Value="Triangle Count: " />
+			</Window>
+
+		</Window>
+
+		<Window Type="TaharezLook/StaticText" Name="OPDebugMsg">
+			<Property Name="FrameEnabled" Value="False" />
+			<Property Name="BackgroundEnabled" Value="False" />
+			<Property Name="Font" Value="BlueHighway-10" />
+			<Property Name="UnifiedPosition" Value="{{0.25,0},{0.93,0}}" />
+			<Property Name="UnifiedSize" Value="{{0.65,0},{0.07,0}}" />
+			<Property Name="TextColours" Value="tl:A0FFFFFF tr:A0FFFFFF bl:A0FFFFFF br:A0FFFFFF" />
+			<Property Name="InheritsAlpha" Value="False" />
+			<Property Name="VertFormatting" Value="VertCentred" />
+			<Property Name="HorzFormatting" Value="WordWrapCentred" />
+		</Window>
+
+		<Window Type="TaharezLook/StaticImage" Name="OgreLogo">
+			<Property Name="FrameEnabled" Value="False" />
+			<Property Name="BackgroundEnabled" Value="False" />
+			<Property Name="UnifiedPosition" Value="{{0.9,0},{0.95,0}}" />
+			<Property Name="UnifiedSize" Value="{{0.1,0},{0.05,0}}" />
+			<Property Name="Image" Value="set:OgreGuiImagery image:OgreLogo" />
+			<Property Name="Alpha" Value="0.75" />
+			<Property Name="InheritsAlpha" Value="False" />
+		</Window>
+
+		<Window Type="TaharezLook/StaticImage" Name="CeguiLogo">
+			<Property Name="FrameEnabled" Value="False" />
+			<Property Name="BackgroundEnabled" Value="False" />
+			<Property Name="UnifiedPosition" Value="{{0.9125,0},{0.9115,0}}" />
+			<Property Name="UnifiedSize" Value="{{0.075,0},{0.0385,0}}" />
+			<Property Name="Image" Value="set:OgreGuiImagery image:CeguiLogo" />
+			<Property Name="Alpha" Value="0.75" />
+			<Property Name="InheritsAlpha" Value="False" />
+		</Window>
+
+	</Window>
+
+	<Window Type="DefaultGUISheet" Name="CompositorDemo">
+
+		<Property Name="UnifiedMaxSize" Value="{{1,0},{2,0}}" />
+		<Property Name="UnifiedSize" Value="{{1,0},{2,0}}" />
+
+
+		<Window Type="TaharezLook/StaticText" Name="HelpTxt">
+			<Property Name="UnifiedPosition" Value="{{0.6,0},{0.8,0}}" />
+			<Property Name="UnifiedMinSize" Value="{{0.5,0},{0.3,0}}" />
+			<Property Name="UnifiedSize" Value="{{0.5,0},{0.3,0}}" />
+			<Property Name="Text" Value="Use the Combo boxes to select a shader and a model" />
+			<Property Name="InheritsAlpha" Value="False" />
+		</Window>
+		
+		<Window Type="TaharezLook/FrameWindow" Name="CompositorSelectorWin">
+			<Property Name="UnifiedPosition" Value="{{0,0},{0,0}}" />
+			<Property Name="UnifiedMinSize" Value="{{0.16,0},{0.22,0}}" />
+			<Property Name="UnifiedMaxSize" Value="{{0.16,0},{0.75,0}}" />
+			<Property Name="UnifiedSize" Value="{{0.16,0},{0.3,0}}" />
+			<Property Name="Text" Value="Compositors" />
+			<Property Name="Alpha" Value="0.75" />
+			<Property Name="CloseButtonEnabled" Value="False" />
+
+			<Window Type="TaharezLook/Button" Name="ExitDemoBtn">
+				<Property Name="VerticalAlignment" Value="Bottom" />
+				<Property Name="HorizontalAlignment" Value="Centre" />
+				<Property Name="UnifiedPosition" Value="{{0,0},{0,0}}" />
+				<Property Name="UnifiedMaxSize" Value="{{0.12,0},{0.03,0}}" />
+				<Property Name="UnifiedMinSize" Value="{{0.12,0},{0.03,0}}" />
+				<Property Name="UnifiedSize" Value="{{0.33,0},{0.03,0}}" />
+				<Property Name="Text" Value="Exit Demo" />
+				<Property Name="InheritsAlpha" Value="False" />
+			</Window>
+
+		</Window>
+		<Window Type="TaharezLook/FrameWindow" Name="DebugRTTs">
+			<Property Name="RollUpState" Value="True" />
+			<Property Name="UnifiedPosition" Value="{{0.70,0},{0,0}}" />
+			<Property Name="UnifiedMinSize" Value="{{0.3,0},{0.3,0}}" />
+			<Property Name="UnifiedMaxSize" Value="{{0.3,0},{0.3,0}}" />
+			<Property Name="UnifiedSize" Value="{{0.3,0},{0.3,0}}" />
+			<Property Name="Text" Value="Debug RTTs" />
+			<Property Name="Alpha" Value="0.75" />
+			<Property Name="CloseButtonEnabled" Value="False" />
+
+			<Window Type="TaharezLook/Listbox" Name="DebugRTTListbox">
+				<Property Name="UnifiedPosition" Value="{{0.02,0},{0.1,0}}" />
+				<Property Name="UnifiedMinSize" Value="{{0.1,0},{0.25,0}}" />
+				<Property Name="UnifiedMaxSize" Value="{{0.1,0},{0.25,0}}" />
+				<Property Name="UnifiedSize" Value="{{0.1,0},{0.25,0}}" />
+			</Window>
+			<Window Type="TaharezLook/StaticImage" Name="DebugRTTImage">
+				<Property Name="UnifiedPosition" Value="{{0.36,0},{0.1,0}}" />
+				<Property Name="UnifiedMinSize" Value="{{0.2,0},{0.25,0}}" />
+				<Property Name="UnifiedMaxSize" Value="{{0.2,0},{0.25,0}}" />
+				<Property Name="UnifiedSize" Value="{{0.2,0},{0.25,0}}" />
+			</Window>
+		</Window>
+	</Window>
+
+
+</Window>
+
+</GUILayout>
Index: code/trunk/Tutorial/Media/gui/CompositorDemoCegui.config
===================================================================
--- code/trunk/Tutorial/Media/gui/CompositorDemoCegui.config	(revision 44)
+++ code/trunk/Tutorial/Media/gui/CompositorDemoCegui.config	(revision 44)
@@ -0,0 +1,6 @@
+<?xml version="1.0" ?>
+<CEGUIConfig
+	Scheme="TaharezLookSkin.scheme"
+	Layout="CompositorDemo.layout"
+	DefaultFont="BlueHighway-12"
+/>
Index: code/trunk/Tutorial/Media/gui/CrowdDemo.layout
===================================================================
--- code/trunk/Tutorial/Media/gui/CrowdDemo.layout	(revision 44)
+++ code/trunk/Tutorial/Media/gui/CrowdDemo.layout	(revision 44)
@@ -0,0 +1,201 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<GUILayout >
+    <Window Type="DefaultWindow" Name="root" >
+        <Property Name="InheritsAlpha" Value="False" />
+        <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+        <Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{1,0},{1,0}}" />
+        <Window Type="DefaultWindow" Name="debug_overlay" >
+            <Property Name="Disabled" Value="True" />
+            <Property Name="AlwaysOnTop" Value="True" />
+            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+            <Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{1,0},{1,0}}" />
+            <Window Type="TaharezLook/StaticText" Name="Panel 1" >
+                <Property Name="Alpha" Value="0.9" />
+                <Property Name="InheritsAlpha" Value="False" />
+                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                <Property Name="UnifiedAreaRect" Value="{{0,0},{0.83,0},{0.23,0},{1,0}}" />
+                <Window Type="TaharezLook/StaticText" Name="OPCurrentFPS" >
+                    <Property Name="Font" Value="BlueHighway-10" />
+                    <Property Name="Text" Value="Current FPS: " />
+                    <Property Name="TextColours" Value="tl:FF4FF06F tr:FF4FF06F bl:FF4FF06F br:FF4FF06F" />
+                    <Property Name="FrameEnabled" Value="False" />
+                    <Property Name="HorzFormatting" Value="HorzCentred" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.075,0},{0.12,0},{0.925,0},{0.37,0}}" />
+                    <Property Name="BackgroundEnabled" Value="False" />
+                </Window>
+                <Window Type="TaharezLook/StaticImage" Name="OPBar1" >
+                    <Property Name="FrameEnabled" Value="False" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.2,0},{0.27,0},{0.8,0},{0.295,0}}" />
+                    <Property Name="BackgroundEnabled" Value="False" />
+                </Window>
+                <Window Type="TaharezLook/StaticText" Name="OPAverageFPS" >
+                    <Property Name="Font" Value="BlueHighway-10" />
+                    <Property Name="Text" Value="Average FPS: " />
+                    <Property Name="TextColours" Value="tl:FFFFF5F0 tr:FFFFF5F0 bl:FFFFF510 br:FFFFF5F0" />
+                    <Property Name="FrameEnabled" Value="False" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.075,0},{0.32,0},{1.075,0},{0.57,0}}" />
+                    <Property Name="BackgroundEnabled" Value="False" />
+                </Window>
+                <Window Type="TaharezLook/StaticText" Name="OPWorstFPS" >
+                    <Property Name="Font" Value="BlueHighway-10" />
+                    <Property Name="Text" Value="Worst FPS: " />
+                    <Property Name="TextColours" Value="tl:FFFFF5F0 tr:FFFFF5F0 bl:FFFFF510 br:FFFFF5F0" />
+                    <Property Name="FrameEnabled" Value="False" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.075,0},{0.45,0},{1.075,0},{0.7,0}}" />
+                    <Property Name="BackgroundEnabled" Value="False" />
+                </Window>
+                <Window Type="TaharezLook/StaticText" Name="OPBestFPS" >
+                    <Property Name="Font" Value="BlueHighway-10" />
+                    <Property Name="Text" Value="Best FPS: " />
+                    <Property Name="TextColours" Value="tl:FFFFF5F0 tr:FFFFF5F0 bl:FFFFF510 br:FFFFF5F0" />
+                    <Property Name="FrameEnabled" Value="False" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.075,0},{0.58,0},{1.075,0},{0.83,0}}" />
+                    <Property Name="BackgroundEnabled" Value="False" />
+                </Window>
+                <Window Type="TaharezLook/StaticText" Name="OPTriCount" >
+                    <Property Name="Font" Value="BlueHighway-10" />
+                    <Property Name="Text" Value="Triangle Count: " />
+                    <Property Name="TextColours" Value="tl:FFFFF5F0 tr:FFFFF5F0 bl:FFFFF510 br:FFFFF5F0" />
+                    <Property Name="FrameEnabled" Value="False" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.075,0},{0.71,0},{1.075,0},{0.96,0}}" />
+                    <Property Name="BackgroundEnabled" Value="False" />
+                </Window>
+            </Window>
+            <Window Type="TaharezLook/StaticText" Name="OPDebugMsg" >
+                <Property Name="Font" Value="BlueHighway-10" />
+                <Property Name="TextColours" Value="tl:A0FFFFFF tr:A0FFFFFF bl:A0FFFFFF br:A0FFFFFF" />
+                <Property Name="FrameEnabled" Value="False" />
+                <Property Name="InheritsAlpha" Value="False" />
+                <Property Name="HorzFormatting" Value="WordWrapCentred" />
+                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                <Property Name="UnifiedAreaRect" Value="{{0.25,0},{0.93,0},{0.9,0},{1,0}}" />
+                <Property Name="BackgroundEnabled" Value="False" />
+            </Window>
+            <Window Type="TaharezLook/StaticImage" Name="OgreLogo" >
+                <Property Name="Alpha" Value="0.75" />
+                <Property Name="FrameEnabled" Value="False" />
+                <Property Name="InheritsAlpha" Value="False" />
+                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                <Property Name="UnifiedAreaRect" Value="{{0.9,0},{0.95,0},{1,0},{1,0}}" />
+                <Property Name="BackgroundEnabled" Value="False" />
+            </Window>
+            <Window Type="TaharezLook/StaticImage" Name="CeguiLogo" >
+                <Property Name="Alpha" Value="0.75" />
+                <Property Name="FrameEnabled" Value="False" />
+                <Property Name="InheritsAlpha" Value="False" />
+                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                <Property Name="UnifiedAreaRect" Value="{{0.9125,0},{0.9115,0},{0.9875,0},{0.95,0}}" />
+                <Property Name="BackgroundEnabled" Value="False" />
+            </Window>
+        </Window>
+        <Window Type="DefaultWindow" Name="InstancingDemo" >
+            <Property Name="Font" Value="BlueHighway-8" />
+            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+            <Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{1,0},{1,0}}" />
+            <Window Type="TaharezLook/FrameWindow" Name="CompositorSelectorWin" >
+                <Property Name="Text" Value="Techniques" />
+                <Property Name="Alpha" Value="0.75" />
+                <Property Name="TitlebarFont" Value="BlueHighway-12" />
+                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                <Property Name="TitlebarEnabled" Value="True" />
+                <Property Name="UnifiedAreaRect" Value="{{-0.00292969,0},{0.00381679,1.25081e-037},{0.331094,0},{0.464121,1.25081e-037}}" />
+                <Property Name="CloseButtonEnabled" Value="False" />
+                <Window Type="TaharezLook/RadioButton" Name="tInstancing" >
+                    <Property Name="Font" Value="BlueHighway-12" />
+                    <Property Name="Text" Value="Instancing" />
+                    <Property Name="Selected" Value="True" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.055847,0},{0.10764,0},{0.973986,0},{0.187074,0}}" />
+                </Window>
+                <Window Type="TaharezLook/RadioButton" Name="tIndependantEntities" >
+                    <Property Name="ID" Value="1" />
+                    <Property Name="Font" Value="BlueHighway-12" />
+					<Property Name="Text" Value="Independent Entities" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.055847,0},{0.172136,0},{0.962291,0},{0.265333,0}}" />
+                </Window>
+                <Window Type="TaharezLook/Checkbox" Name="Shadows" >
+                    <Property Name="Font" Value="BlueHighway-12" />
+                    <Property Name="Text" Value="Shadows on/off" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.05,0},{0.475788,0},{1.05,0},{0.579744,0}}" />
+                </Window>
+                <Window Type="TaharezLook/StaticText" Name="Object Count Text" >
+                    <Property Name="Font" Value="BlueHighway-12" />
+                    <Property Name="Text" Value="Object Count:" />
+                    <Property Name="FrameEnabled" Value="False" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.0880073,0},{0.263737,0},{0.382815,0},{0.369793,0}}" />
+                    <Property Name="BackgroundEnabled" Value="False" />
+                </Window>
+                <Window Type="TaharezLook/StaticText" Name="Object Count Number" >
+                    <Property Name="Font" Value="BlueHighway-12" />
+                    <Property Name="Text" Value="160" />
+                    <Property Name="FrameEnabled" Value="False" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.388902,0},{0.277557,0},{0.631087,0},{0.364265,0}}" />
+                    <Property Name="BackgroundEnabled" Value="False" />
+                </Window>
+                <Window Type="TaharezLook/HorizontalScrollbar" Name="Object Count" >
+                    <Property Name="PageSize" Value="0" />
+                    <Property Name="StepSize" Value="1" />
+                    <Property Name="OverlapSize" Value="0" />
+                    <Property Name="DocumentSize" Value="1" />
+                    <Property Name="InheritsAlpha" Value="False" />
+                    <Property Name="ScrollPosition" Value="0" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.05,0},{0.39,0},{0.95,0},{0.441213,0}}" />
+                </Window>
+                <Window Type="TaharezLook/StaticText" Name="Time Burner Text" >
+                    <Property Name="Font" Value="BlueHighway-12" />
+                    <Property Name="Text" Value="CPU occupation:" />
+                    <Property Name="FrameEnabled" Value="False" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.05,0},{0.59802,0},{0.427339,0},{0.680451,0}}" />
+                    <Property Name="BackgroundEnabled" Value="False" />
+                </Window>
+                <Window Type="TaharezLook/StaticText" Name="Time Burner Value" >
+                    <Property Name="Font" Value="BlueHighway-12" />
+                    <Property Name="Text" Value="0 ms" />
+                    <Property Name="FrameEnabled" Value="False" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.415811,0},{0.599679,0},{0.640395,0},{0.686178,0}}" />
+                    <Property Name="BackgroundEnabled" Value="False" />
+                </Window>
+                <Window Type="TaharezLook/HorizontalScrollbar" Name="Time Burner" >
+                    <Property Name="Font" Value="BlueHighway-12" />
+                    <Property Name="PageSize" Value="0" />
+                    <Property Name="StepSize" Value="1" />
+                    <Property Name="OverlapSize" Value="0" />
+                    <Property Name="DocumentSize" Value="1" />
+                    <Property Name="InheritsAlpha" Value="False" />
+                    <Property Name="ScrollPosition" Value="0" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.05,0},{0.687236,0},{0.95,0},{0.74726,0}}" />
+                </Window>
+                <Window Type="TaharezLook/Checkbox" Name="PostEffect" >
+                    <Property Name="Font" Value="BlueHighway-12" />
+                    <Property Name="Text" Value="Post Effect On/Off" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.0470764,0},{0.765568,0},{0.892124,0},{0.82884,0}}" />
+                </Window>
+                <Window Type="TaharezLook/Button" Name="ExitDemoBtn" >
+                    <Property Name="Font" Value="BlueHighway-12" />
+                    <Property Name="Text" Value="Exit Demo" />
+                    <Property Name="InheritsAlpha" Value="False" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{-0.0526254,0},{-0.063219,0},{0.277375,0},{-4.06504e-005,0}}" />
+                    <Property Name="VerticalAlignment" Value="Bottom" />
+                    <Property Name="HorizontalAlignment" Value="Centre" />
+                </Window>
+            </Window>
+        </Window>
+    </Window>
+</GUILayout>
Index: code/trunk/Tutorial/Media/gui/Falagard.xsd
===================================================================
--- code/trunk/Tutorial/Media/gui/Falagard.xsd	(revision 44)
+++ code/trunk/Tutorial/Media/gui/Falagard.xsd	(revision 44)
@@ -0,0 +1,391 @@
+<?xml version="1.0" ?>
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
+	<xsd:element name="Falagard" type="falagardSpecificationType" />
+	<xsd:complexType name="falagardSpecificationType">
+		<xsd:sequence>
+			<xsd:element name="WidgetLook" type="widgetLookType" minOccurs="0" maxOccurs="unbounded" />
+		</xsd:sequence>
+	</xsd:complexType>
+	<xsd:complexType name="widgetLookType">
+		<xsd:sequence>
+            <xsd:element name="PropertyDefinition" type="propertyDefinitionType" minOccurs="0" maxOccurs="unbounded" />
+            <xsd:element name="PropertyLinkDefinition" type="propertyLinkDefinitionType" minOccurs="0" maxOccurs="unbounded" />
+            <xsd:element name="Property" type="propertyType" minOccurs="0" maxOccurs="unbounded" />
+            <xsd:element name="NamedArea" type="namedAreaType" minOccurs="0" maxOccurs="unbounded" />
+			<xsd:element name="Child" type="widgetComponentType" minOccurs="0" maxOccurs="unbounded" />
+			<xsd:element name="ImagerySection" type="imagerySectionType" minOccurs="0" maxOccurs="unbounded" />
+			<xsd:element name="StateImagery" type="stateType" minOccurs="0" maxOccurs="unbounded" />
+		</xsd:sequence>
+		<xsd:attribute name="name" type="xsd:string" use="required" />
+	</xsd:complexType>
+    <xsd:complexType name="propertyDefinitionType">
+        <xsd:attribute name="type" type="propertyTypeEnum" use="optional" default="Generic" />
+        <xsd:attribute name="name" type="xsd:string" use="required" />
+        <xsd:attribute name="initialValue" type="xsd:string" use="optional" default="" />
+        <xsd:attribute name="layoutOnWrite" type="xsd:boolean" use="optional" default="false" />
+        <xsd:attribute name="redrawOnWrite" type="xsd:boolean" use="optional" default="false" />
+    </xsd:complexType>
+    <xsd:complexType name="propertyLinkDefinitionType">
+        <xsd:attribute name="type" type="propertyTypeEnum" use="optional" default="Generic" />
+        <xsd:attribute name="name" type="xsd:string" use="required" />
+        <xsd:attribute name="widget" type="xsd:string" use="required" />
+        <xsd:attribute name="targetProperty" type="xsd:string" use="optional" default="" />
+        <xsd:attribute name="initialValue" type="xsd:string" use="optional" default="" />
+        <xsd:attribute name="layoutOnWrite" type="xsd:boolean" use="optional" default="false" />
+        <xsd:attribute name="redrawOnWrite" type="xsd:boolean" use="optional" default="false" />
+    </xsd:complexType>
+    <xsd:complexType name="namedAreaType">
+        <xsd:sequence>
+            <xsd:element name="Area" type="componentAreaType" />
+        </xsd:sequence>
+        <xsd:attribute name="name" type="xsd:string" use="required" />
+    </xsd:complexType>
+	<xsd:complexType name="stateType">
+		<xsd:sequence>
+			<xsd:element name="Layer" type="layerType" minOccurs="0" maxOccurs="unbounded" />
+		</xsd:sequence>
+		<xsd:attribute name="name" type="xsd:string" use="required" />
+        <xsd:attribute name="clipped" type="xsd:boolean" use="optional" default="true" />
+	</xsd:complexType>
+	<xsd:complexType name="layerType">
+		<xsd:sequence>
+			<xsd:element name="Section" type="sectionSpecType" minOccurs="0" maxOccurs="unbounded" />
+		</xsd:sequence>
+		<xsd:attribute name="priority" type="xsd:integer" use="optional" default="0" />
+	</xsd:complexType>
+    <xsd:complexType name="sectionSpecType">
+        <xsd:choice  minOccurs="0" maxOccurs="1">
+            <xsd:element name="Colour" type="colourType" />
+            <xsd:element name="Colours" type="colourRectType" />
+            <xsd:element name="ColourProperty" type="settingByPropertyType" />
+            <xsd:element name="ColourRectProperty" type="settingByPropertyType" />
+        </xsd:choice>
+        <xsd:attribute name="look" type="xsd:string" use="optional" default="" />
+        <xsd:attribute name="section" type="xsd:string" use="required" />
+        <xsd:attribute name="controlProperty" type="xsd:string" use="optional" default="" />
+    </xsd:complexType>
+	<xsd:complexType name="imagerySectionType">
+		<xsd:sequence>
+            <xsd:choice  minOccurs="0" maxOccurs="1">
+                <xsd:element name="Colour" type="colourType" />
+                <xsd:element name="Colours" type="colourRectType" />
+                <xsd:element name="ColourProperty" type="settingByPropertyType" />
+                <xsd:element name="ColourRectProperty" type="settingByPropertyType" />
+            </xsd:choice>
+            <xsd:element name="FrameComponent" type="frameComponentType" minOccurs="0" maxOccurs="unbounded" />
+			<xsd:element name="ImageryComponent" type="imageryComponentType" minOccurs="0" maxOccurs="unbounded" />
+            <xsd:element name="TextComponent" type="textComponentType" minOccurs="0" maxOccurs="unbounded" />
+		</xsd:sequence>
+		<xsd:attribute name="name" type="xsd:string" use="required" />
+	</xsd:complexType>
+    <xsd:complexType name="frameComponentType">
+        <xsd:sequence>
+            <xsd:element name="Area" type="componentAreaType" />
+            <xsd:element name="Image" type="frameImageType" minOccurs="0" maxOccurs="9" />
+            <xsd:choice  minOccurs="0" maxOccurs="1">
+                <xsd:element name="Colour" type="colourType" />
+                <xsd:element name="Colours" type="colourRectType" />
+                <xsd:element name="ColourProperty" type="settingByPropertyType" />
+                <xsd:element name="ColourRectProperty" type="settingByPropertyType" />
+            </xsd:choice>
+            <xsd:choice  minOccurs="0" maxOccurs="1">
+                <xsd:element name="VertFormat" type="vertFormatType" />
+                <xsd:element name="VertFormatProperty" type="settingByPropertyType" />
+            </xsd:choice>
+            <xsd:choice  minOccurs="0" maxOccurs="1">
+                <xsd:element name="HorzFormat" type="horzFormatType" />
+                <xsd:element name="HorzFormatProperty" type="settingByPropertyType" />
+            </xsd:choice>
+        </xsd:sequence>
+    </xsd:complexType>
+    <xsd:complexType name="textComponentType">
+        <xsd:sequence>
+            <xsd:element name="Area" type="componentAreaType" />
+            <xsd:element name="Text" type="textStringType" minOccurs="0" maxOccurs="1" />
+            <xsd:element name="TextProperty" type="textPropertyType" minOccurs="0" maxOccurs="1" />
+            <xsd:element name="FontProperty" type="fontPropertyType" minOccurs="0" maxOccurs="1" />
+            <xsd:choice  minOccurs="0" maxOccurs="1">
+                <xsd:element name="Colour" type="colourType" />
+                <xsd:element name="Colours" type="colourRectType" />
+                <xsd:element name="ColourProperty" type="settingByPropertyType" />
+                <xsd:element name="ColourRectProperty" type="settingByPropertyType" />
+            </xsd:choice>
+            <xsd:choice  minOccurs="0" maxOccurs="1">
+                <xsd:element name="VertFormat" type="vertTextFormatType" />
+                <xsd:element name="VertFormatProperty" type="settingByPropertyType" />
+            </xsd:choice>
+            <xsd:choice  minOccurs="0" maxOccurs="1">
+                <xsd:element name="HorzFormat" type="horzTextFormatType" />
+                <xsd:element name="HorzFormatProperty" type="settingByPropertyType" />
+            </xsd:choice>
+        </xsd:sequence>
+    </xsd:complexType>
+	<xsd:complexType name="imageryComponentType">
+		<xsd:sequence>
+			<xsd:element name="Area" type="componentAreaType" />
+            <xsd:choice>
+                <xsd:element name="Image" type="imageType" />
+                <xsd:element name="ImageProperty" type="settingByPropertyType" />
+            </xsd:choice>
+            <xsd:choice  minOccurs="0" maxOccurs="1">
+                <xsd:element name="Colour" type="colourType" />
+                <xsd:element name="Colours" type="colourRectType" />
+                <xsd:element name="ColourProperty" type="settingByPropertyType" />
+                <xsd:element name="ColourRectProperty" type="settingByPropertyType" />
+            </xsd:choice>
+            <xsd:choice  minOccurs="0" maxOccurs="1">
+                <xsd:element name="VertFormat" type="vertFormatType" />
+                <xsd:element name="VertFormatProperty" type="settingByPropertyType" />
+            </xsd:choice>
+            <xsd:choice  minOccurs="0" maxOccurs="1">
+                <xsd:element name="HorzFormat" type="horzFormatType" />
+                <xsd:element name="HorzFormatProperty" type="settingByPropertyType" />
+            </xsd:choice>
+		</xsd:sequence>
+	</xsd:complexType>
+	<xsd:complexType name="widgetComponentType">
+		<xsd:sequence>
+			<xsd:element name="Area" type="componentAreaType" />
+			<xsd:element name="VertAlignment" type="vertAlignmentType" minOccurs="0" maxOccurs="1" />
+			<xsd:element name="HorzAlignment" type="horzAlignmentType" minOccurs="0" maxOccurs="1" />
+			<xsd:element name="Property" type="propertyType" minOccurs="0" maxOccurs="unbounded" />
+		</xsd:sequence>
+		<xsd:attribute name="type" type="xsd:string" use="required" />
+		<xsd:attribute name="nameSuffix" type="xsd:string" use="required" />
+		<xsd:attribute name="renderer" type="xsd:string" use="optional" default="" />
+		<xsd:attribute name="look" type="xsd:string" use="optional" default="" />
+	</xsd:complexType>
+	<xsd:complexType name="horzFormatType">
+		<xsd:attribute name="type" type="horzFormatEnum" use="required" />
+	</xsd:complexType>
+	<xsd:complexType name="vertFormatType">
+		<xsd:attribute name="type" type="vertFormatEnum" use="required" />
+	</xsd:complexType>
+        <xsd:complexType name="horzTextFormatType">
+		<xsd:attribute name="type" type="horzTextFormatEnum" use="required" />
+	</xsd:complexType>
+	<xsd:complexType name="vertTextFormatType">
+		<xsd:attribute name="type" type="vertTextFormatEnum" use="required" />
+	</xsd:complexType>
+	<xsd:complexType name="horzAlignmentType">
+		<xsd:attribute name="type" type="horzAlignmentEnum" use="required" />
+	</xsd:complexType>
+	<xsd:complexType name="vertAlignmentType">
+		<xsd:attribute name="type" type="vertAlignmentEnum" use="required" />
+	</xsd:complexType>
+	<xsd:complexType name="propertyType">
+		<xsd:attribute name="name" type="xsd:string" use="required" />
+		<xsd:attribute name="value" type="xsd:string" use="required" />
+	</xsd:complexType>
+	<xsd:complexType name="imageType">
+		<xsd:attribute name="imageset" type="xsd:string" use="required" />
+		<xsd:attribute name="image" type="xsd:string" use="required" />
+	</xsd:complexType>
+    <xsd:complexType name="frameImageType">
+        <xsd:attribute name="type" type="frameImageComponentEnum" use="required" />
+        <xsd:attribute name="imageset" type="xsd:string" use="required" />
+        <xsd:attribute name="image" type="xsd:string" use="required" />
+    </xsd:complexType>
+	<xsd:complexType name="componentAreaType">
+        <xsd:choice>
+            <xsd:sequence>
+                <xsd:element name="Dim" type="dimensionType" minOccurs="4" maxOccurs="4" />
+            </xsd:sequence>
+            <xsd:element name="AreaProperty" type="settingByPropertyType" />
+        </xsd:choice>
+	</xsd:complexType>
+	<xsd:complexType name="dimensionType">
+		<xsd:choice>
+			<xsd:element name="UnifiedDim" type="unifiedDimType" />
+			<xsd:element name="AbsoluteDim" type="absoluteDimType" />
+			<xsd:element name="ImageDim" type="imageDimType" />
+            <xsd:element name="WidgetDim" type="widgetDimType" />
+            <xsd:element name="FontDim" type="fontDimType" />
+            <xsd:element name="PropertyDim" type="propertyDimType" />
+		</xsd:choice>
+		<xsd:attribute name="type" type="dimensionTypeEnum" use="required" />
+	</xsd:complexType>
+    <xsd:complexType name="fontDimType">
+        <xsd:sequence>
+            <xsd:element name="DimOperator" type="dimensionOperatorType" minOccurs="0" maxOccurs="1" />
+        </xsd:sequence>
+        <xsd:attribute name="widget" type="xsd:string" use="optional" default="" />
+        <xsd:attribute name="font" type="xsd:string" use="optional" default="" />
+        <xsd:attribute name="string" type="xsd:string" use="optional" default="" />
+        <xsd:attribute name="type" type="fontMetricTypeEnum" use="required" />
+        <xsd:attribute name="padding" type="xsd:decimal" use="optional" default="0" />
+    </xsd:complexType>
+    <xsd:complexType name="propertyDimType">
+        <xsd:sequence>
+            <xsd:element name="DimOperator" type="dimensionOperatorType" minOccurs="0" maxOccurs="1" />
+        </xsd:sequence>
+        <xsd:attribute name="widget" type="xsd:string" use="optional" default="" />
+        <xsd:attribute name="name" type="xsd:string" use="required" />
+    </xsd:complexType>
+	<xsd:complexType name="unifiedDimType">
+        <xsd:sequence>
+            <xsd:element name="DimOperator" type="dimensionOperatorType" minOccurs="0" maxOccurs="1" />
+        </xsd:sequence>
+		<xsd:attribute name="scale" type="xsd:decimal" use="optional" default="0" />
+		<xsd:attribute name="offset" type="xsd:integer" use="optional" default="0" />
+		<xsd:attribute name="type" type="dimensionTypeEnum" use="required" />
+	</xsd:complexType>
+	<xsd:complexType name="absoluteDimType">
+        <xsd:sequence>
+            <xsd:element name="DimOperator" type="dimensionOperatorType" minOccurs="0" maxOccurs="1" />
+        </xsd:sequence>
+		<xsd:attribute name="value" type="xsd:decimal" use="optional" default="0" />
+	</xsd:complexType>
+	<xsd:complexType name="imageDimType">
+        <xsd:sequence>
+            <xsd:element name="DimOperator" type="dimensionOperatorType" minOccurs="0" maxOccurs="1" />
+        </xsd:sequence>
+		<xsd:attribute name="imageset" type="xsd:string" use="required" />
+		<xsd:attribute name="image" type="xsd:string" use="required" />
+		<xsd:attribute name="dimension" type="dimensionTypeEnum" use="required" />
+	</xsd:complexType>
+	<xsd:complexType name="widgetDimType">
+        <xsd:sequence>
+            <xsd:element name="DimOperator" type="dimensionOperatorType" minOccurs="0" maxOccurs="1" />
+        </xsd:sequence>
+		<xsd:attribute name="widget" type="xsd:string" use="optional" default="" />
+		<xsd:attribute name="dimension" type="dimensionTypeEnum" use="required" />
+	</xsd:complexType>
+    <xsd:complexType name="settingByPropertyType">
+        <xsd:attribute name="name" type="xsd:string" use="required" />
+    </xsd:complexType>
+	<xsd:complexType name="colourRectType">
+		<xsd:attribute name="topLeft" type="colourValType" use="required" />
+		<xsd:attribute name="topRight" type="colourValType" use="required" />
+		<xsd:attribute name="bottomLeft" type="colourValType" use="required" />
+		<xsd:attribute name="bottomRight" type="colourValType" use="required" />
+	</xsd:complexType>
+	<xsd:complexType name="colourType">
+		<xsd:attribute name="colour" type="colourValType" use="required" />
+	</xsd:complexType>
+	<xsd:simpleType name="colourValType">
+		<xsd:restriction base="xsd:string">
+			<xsd:pattern value="[a-fA-F0-9]{8}" />
+		</xsd:restriction>
+	</xsd:simpleType>
+    <xsd:complexType name="textStringType">
+        <xsd:attribute name="string" type="xsd:string" use="optional" default="" />
+        <xsd:attribute name="font" type="xsd:string" use="optional" default="" />
+    </xsd:complexType>
+    <xsd:complexType name="textPropertyType">
+        <xsd:attribute name="name" type="xsd:string" use="required" />
+    </xsd:complexType>
+    <xsd:complexType name="fontPropertyType">
+        <xsd:attribute name="name" type="xsd:string" use="required" />
+    </xsd:complexType>
+    <xsd:complexType name="dimensionOperatorType">
+        <xsd:choice>
+            <xsd:element name="UnifiedDim" type="unifiedDimType" />
+            <xsd:element name="AbsoluteDim" type="absoluteDimType" />
+            <xsd:element name="ImageDim" type="imageDimType" />
+            <xsd:element name="WidgetDim" type="widgetDimType" />
+            <xsd:element name="FontDim" type="fontDimType" />
+            <xsd:element name="PropertyDim" type="propertyDimType" />
+        </xsd:choice>
+        <xsd:attribute name="op" type="dimensionOperatorEnum" use="required" />
+    </xsd:complexType>
+	<xsd:simpleType name="dimensionTypeEnum">
+		<xsd:restriction base="xsd:string">
+			<xsd:enumeration value="LeftEdge" />
+			<xsd:enumeration value="TopEdge" />
+			<xsd:enumeration value="RightEdge" />
+			<xsd:enumeration value="BottomEdge" />
+			<xsd:enumeration value="XPosition" />
+			<xsd:enumeration value="YPosition" />
+			<xsd:enumeration value="Width" />
+			<xsd:enumeration value="Height" />
+			<xsd:enumeration value="XOffset" />
+			<xsd:enumeration value="YOffset" />
+		</xsd:restriction>
+	</xsd:simpleType>
+	<xsd:simpleType name="vertFormatEnum">
+		<xsd:restriction base="xsd:string">
+			<xsd:enumeration value="TopAligned" />
+			<xsd:enumeration value="CentreAligned" />
+			<xsd:enumeration value="BottomAligned" />
+			<xsd:enumeration value="Stretched" />
+			<xsd:enumeration value="Tiled" />
+		</xsd:restriction>
+	</xsd:simpleType>
+	<xsd:simpleType name="horzFormatEnum">
+		<xsd:restriction base="xsd:string">
+			<xsd:enumeration value="LeftAligned" />
+			<xsd:enumeration value="CentreAligned" />
+			<xsd:enumeration value="RightAligned" />
+			<xsd:enumeration value="Stretched" />
+			<xsd:enumeration value="Tiled" />
+		</xsd:restriction>
+	</xsd:simpleType>
+	<xsd:simpleType name="vertAlignmentEnum">
+		<xsd:restriction base="xsd:string">
+			<xsd:enumeration value="TopAligned" />
+			<xsd:enumeration value="CentreAligned" />
+			<xsd:enumeration value="BottomAligned" />
+		</xsd:restriction>
+	</xsd:simpleType>
+	<xsd:simpleType name="horzAlignmentEnum">
+		<xsd:restriction base="xsd:string">
+			<xsd:enumeration value="LeftAligned" />
+			<xsd:enumeration value="CentreAligned" />
+			<xsd:enumeration value="RightAligned" />
+		</xsd:restriction>
+	</xsd:simpleType>
+    <xsd:simpleType name="horzTextFormatEnum">
+        <xsd:restriction base="xsd:string">
+            <xsd:enumeration value="LeftAligned" />
+            <xsd:enumeration value="RightAligned" />
+            <xsd:enumeration value="CentreAligned" />
+            <xsd:enumeration value="Justified" />
+            <xsd:enumeration value="WordWrapLeftAligned" />
+            <xsd:enumeration value="WordWrapRightAligned" />
+            <xsd:enumeration value="WordWrapCentreAligned" />
+            <xsd:enumeration value="WordWrapJustified" />
+        </xsd:restriction>
+    </xsd:simpleType>
+    <xsd:simpleType name="vertTextFormatEnum">
+        <xsd:restriction base="xsd:string">
+            <xsd:enumeration value="TopAligned" />
+            <xsd:enumeration value="BottomAligned" />
+            <xsd:enumeration value="CentreAligned" />
+        </xsd:restriction>
+    </xsd:simpleType>
+    <xsd:simpleType name="propertyTypeEnum">
+        <xsd:restriction base="xsd:string">
+            <xsd:enumeration value="Generic" />
+        </xsd:restriction>
+    </xsd:simpleType>
+    <xsd:simpleType name="fontMetricTypeEnum">
+        <xsd:restriction base="xsd:string">
+            <xsd:enumeration value="LineSpacing" />
+            <xsd:enumeration value="Baseline" />
+            <xsd:enumeration value="HorzExtent" />
+        </xsd:restriction>
+    </xsd:simpleType>
+    <xsd:simpleType name="dimensionOperatorEnum">
+        <xsd:restriction base="xsd:string">
+            <xsd:enumeration value="Noop" />
+            <xsd:enumeration value="Add" />
+            <xsd:enumeration value="Subtract" />
+            <xsd:enumeration value="Multiply" />
+            <xsd:enumeration value="Divide" />
+        </xsd:restriction>
+    </xsd:simpleType>
+    <xsd:simpleType name="frameImageComponentEnum">
+        <xsd:restriction base="xsd:string">
+            <xsd:enumeration value="Background" />
+            <xsd:enumeration value="TopLeftCorner" />
+            <xsd:enumeration value="TopRightCorner" />
+            <xsd:enumeration value="BottomLeftCorner" />
+            <xsd:enumeration value="BottomRightCorner" />
+            <xsd:enumeration value="LeftEdge" />
+            <xsd:enumeration value="RightEdge" />
+            <xsd:enumeration value="TopEdge" />
+            <xsd:enumeration value="BottomEdge" />
+        </xsd:restriction>
+    </xsd:simpleType>
+</xsd:schema>
Index: code/trunk/Tutorial/Media/gui/Font.xsd
===================================================================
--- code/trunk/Tutorial/Media/gui/Font.xsd	(revision 44)
+++ code/trunk/Tutorial/Media/gui/Font.xsd	(revision 44)
@@ -0,0 +1,34 @@
+<?xml version="1.0" ?>
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
+	<xsd:element name="Font" type="FontType" />
+
+	<xsd:complexType name="FontType">
+		<xsd:sequence>
+			<xsd:element name="Mapping" type="MapType" maxOccurs="unbounded" minOccurs="0" />
+		</xsd:sequence>
+		<xsd:attributeGroup ref="FontAttrs" />
+	</xsd:complexType>
+	<xsd:complexType name="MapType">
+		<xsd:attribute name="Codepoint" type="xsd:nonNegativeInteger" use="required" />
+		<xsd:attribute name="Image" type="xsd:string" use="required" />
+		<xsd:attribute name="HorzAdvance" type="xsd:integer" use="optional" default="-1" />
+	</xsd:complexType>
+	<xsd:attributeGroup name="FontAttrs">
+		<xsd:attribute name="Name" type="xsd:string" use="required" />
+		<xsd:attribute name="Filename" type="xsd:string" use="required" />
+		<xsd:attribute name="ResourceGroup" type="xsd:string" use="optional"  default="" />
+		<xsd:attribute name="Type" use="required">
+			<xsd:simpleType>
+				<xsd:restriction base="xsd:string">
+					<xsd:enumeration value="FreeType" />
+					<xsd:enumeration value="Pixmap" />
+				</xsd:restriction>
+			</xsd:simpleType>
+		</xsd:attribute>
+		<xsd:attribute name="Size" type="xsd:nonNegativeInteger" use="optional" default="12" />
+		<xsd:attribute name="NativeHorzRes" type="xsd:nonNegativeInteger" use="optional" default="640" />
+		<xsd:attribute name="NativeVertRes" type="xsd:nonNegativeInteger" use="optional" default="480" />
+		<xsd:attribute name="AutoScaled" type="xsd:boolean" use="optional" default="false" />
+		<xsd:attribute name="AntiAlias" type="xsd:boolean" use="optional" default="true" />
+	</xsd:attributeGroup>
+</xsd:schema>
Index: code/trunk/Tutorial/Media/gui/GUILayout.xsd
===================================================================
--- code/trunk/Tutorial/Media/gui/GUILayout.xsd	(revision 44)
+++ code/trunk/Tutorial/Media/gui/GUILayout.xsd	(revision 44)
@@ -0,0 +1,63 @@
+<?xml version="1.0"?>
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
+
+	<xsd:element name="GUILayout" type="GUILayoutType"/>
+	
+	<xsd:complexType name="GUILayoutType">
+		<xsd:sequence>
+			<xsd:element name="Window" type="WindowType" />
+		</xsd:sequence>
+		<xsd:attribute name="Parent" type="xsd:string" use="optional" default=""/>
+	</xsd:complexType>
+	
+	<xsd:complexType name="WindowType">
+		<xsd:sequence>
+			<xsd:element name="LayoutImport" type="LayoutImportType"  minOccurs="0" maxOccurs="unbounded" />
+			<xsd:element name="Property" type="PropertyType"  minOccurs="0" maxOccurs="unbounded" />
+			<xsd:element name="Event" type="EventType"  minOccurs="0" maxOccurs="unbounded" />
+			<xsd:choice minOccurs="0" maxOccurs="unbounded">
+				<xsd:element name="Window" type="WindowType" />
+				<xsd:element name="AutoWindow" type="AutoWindowType" />
+			</xsd:choice>
+			<xsd:element name="Property" type="PropertyType"  minOccurs="0" maxOccurs="unbounded" />
+		</xsd:sequence>
+		<xsd:attribute name="Type" type="xsd:string" use="required"/>
+		<xsd:attribute name="Name" type="xsd:string" use="optional" default="" />
+	</xsd:complexType>
+
+	<xsd:complexType name="AutoWindowType">
+		<xsd:sequence>
+			<xsd:element name="LayoutImport" type="LayoutImportType"  minOccurs="0" maxOccurs="unbounded" />
+			<xsd:element name="Property" type="PropertyType"  minOccurs="0" maxOccurs="unbounded" />
+			<xsd:element name="Event" type="EventType"  minOccurs="0" maxOccurs="unbounded" />
+			<xsd:choice minOccurs="0" maxOccurs="unbounded">
+				<xsd:element name="Window" type="WindowType" />
+				<xsd:element name="AutoWindow" type="AutoWindowType" />
+			</xsd:choice>
+			<xsd:element name="Property" type="PropertyType"  minOccurs="0" maxOccurs="unbounded" />
+		</xsd:sequence>
+		<xsd:attribute name="NameSuffix" type="xsd:string" use="required"/>
+	</xsd:complexType>
+
+	<xsd:complexType name="PropertyType">
+		<xsd:simpleContent>
+			<xsd:extension base="xsd:string">
+				<xsd:attribute name="Name" type="xsd:string" use="required"/>
+				<xsd:attribute name="Value" type="xsd:string" use="optional"/>
+			</xsd:extension>
+		</xsd:simpleContent> 
+	</xsd:complexType>
+
+	<xsd:complexType name="LayoutImportType">
+		<xsd:attribute name="Filename" type="xsd:string" use="required"/>
+		<xsd:attribute name="Prefix" type="xsd:string" use="optional" default="" />
+		<xsd:attribute name="ResourceGroup" type="xsd:string" use="optional"  default="" />
+	</xsd:complexType>
+
+	<xsd:complexType name="EventType">
+		<xsd:attribute name="Name" type="xsd:string" use="required"/>
+		<xsd:attribute name="Function" type="xsd:string" use="required"/>
+	</xsd:complexType>
+
+</xsd:schema>
+
Index: code/trunk/Tutorial/Media/gui/GUIScheme.xsd
===================================================================
--- code/trunk/Tutorial/Media/gui/GUIScheme.xsd	(revision 44)
+++ code/trunk/Tutorial/Media/gui/GUIScheme.xsd	(revision 44)
@@ -0,0 +1,54 @@
+<?xml version="1.0" ?>
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
+	<xsd:element name="GUIScheme" type="SchemeType" />
+	<xsd:complexType name="SchemeType">
+        <xsd:choice minOccurs="0" maxOccurs="unbounded">
+			<xsd:element name="Imageset" type="NamedDataType" />
+            <xsd:element name="ImagesetFromImage" type="NamedDataType" />
+			<xsd:element name="Font" type="NamedDataType" />
+            <xsd:element name="LookNFeel" type="FileDataType" />
+			<xsd:element name="WindowSet" type="WindowSetType" />
+			<xsd:element name="WindowRendererSet" type="WindowRendererSetType" />
+			<xsd:element name="WindowAlias" type="WindowAliasType" />
+            <xsd:element name="FalagardMapping" type="FalagardMapType" />
+		</xsd:choice>
+		<xsd:attribute name="Name" type="xsd:string" use="required" />
+	</xsd:complexType>
+	<xsd:complexType name="WindowSetType">
+		<xsd:sequence>
+            <xsd:element name="WindowFactory" type="WindowFactoryType" minOccurs="0" maxOccurs="unbounded" />
+		</xsd:sequence>
+		<xsd:attribute name="Filename" type="xsd:string" use="required" />
+	</xsd:complexType>
+	<xsd:complexType name="WindowRendererSetType">
+		<xsd:sequence>
+            <xsd:element name="WindowRendererFactory" type="WindowRendererFactoryType" minOccurs="0" maxOccurs="unbounded" />
+		</xsd:sequence>
+		<xsd:attribute name="Filename" type="xsd:string" use="required" />
+	</xsd:complexType>
+    <xsd:complexType name="FileDataType">
+        <xsd:attribute name="Filename" type="xsd:string" use="required" />
+        <xsd:attribute name="ResourceGroup" type="xsd:string" use="optional"  default="" />
+    </xsd:complexType>
+	<xsd:complexType name="NamedDataType">
+		<xsd:attribute name="Name" type="xsd:string" use="required" />
+		<xsd:attribute name="Filename" type="xsd:string" use="required" />
+		<xsd:attribute name="ResourceGroup" type="xsd:string" use="optional"  default="" />
+	</xsd:complexType>
+	<xsd:complexType name="WindowFactoryType">
+		<xsd:attribute name="Name" type="xsd:string" use="required" />
+	</xsd:complexType>
+	<xsd:complexType name="WindowRendererFactoryType">
+		<xsd:attribute name="Name" type="xsd:string" use="required" />
+	</xsd:complexType>
+	<xsd:complexType name="WindowAliasType">
+		<xsd:attribute name="Alias" type="xsd:string" use="required" />
+		<xsd:attribute name="Target" type="xsd:string" use="required" />
+	</xsd:complexType>
+    <xsd:complexType name="FalagardMapType">
+        <xsd:attribute name="WindowType" type="xsd:string" use="required" />
+        <xsd:attribute name="TargetType" type="xsd:string" use="required" />
+		<xsd:attribute name="Renderer" type="xsd:string" use="required" />
+        <xsd:attribute name="LookNFeel" type="xsd:string" use="required" />
+    </xsd:complexType>
+</xsd:schema>
Index: code/trunk/Tutorial/Media/gui/Imageset.xsd
===================================================================
--- code/trunk/Tutorial/Media/gui/Imageset.xsd	(revision 44)
+++ code/trunk/Tutorial/Media/gui/Imageset.xsd	(revision 44)
@@ -0,0 +1,28 @@
+<?xml version="1.0"?>
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
+
+	<xsd:element name="Imageset" type="ImagesetType"/>
+	
+	<xsd:complexType name="ImagesetType">
+		<xsd:sequence>
+			<xsd:element name="Image" type="ImageType" maxOccurs="unbounded"/>
+		</xsd:sequence>
+		<xsd:attribute name="Imagefile" type="xsd:string" use="required"/>
+		<xsd:attribute name="ResourceGroup" type="xsd:string" use="optional"  default="" />
+		<xsd:attribute name="Name" type="xsd:string" use="required"/>
+		<xsd:attribute name="NativeHorzRes" type="xsd:nonNegativeInteger" use="optional" default="640" />
+		<xsd:attribute name="NativeVertRes" type="xsd:nonNegativeInteger" use="optional" default="480" />
+		<xsd:attribute name="AutoScaled" type="xsd:boolean" use="optional" default="false" />
+	</xsd:complexType>
+	
+	<xsd:complexType name="ImageType">
+		<xsd:attribute name="Name" type="xsd:string" use="required"/>
+		<xsd:attribute name="XPos" type="xsd:nonNegativeInteger" use="required"/>
+		<xsd:attribute name="YPos" type="xsd:nonNegativeInteger" use="required"/>
+		<xsd:attribute name="Width" type="xsd:nonNegativeInteger" use="required"/>
+		<xsd:attribute name="Height" type="xsd:nonNegativeInteger" use="required"/>
+		<xsd:attribute name="XOffset" type="xsd:integer" use="optional" default="0"/>
+		<xsd:attribute name="YOffset" type="xsd:integer" use="optional" default="0"/>						
+	</xsd:complexType>
+
+</xsd:schema>
Index: code/trunk/Tutorial/Media/gui/InstancingDemo.layout
===================================================================
--- code/trunk/Tutorial/Media/gui/InstancingDemo.layout	(revision 44)
+++ code/trunk/Tutorial/Media/gui/InstancingDemo.layout	(revision 44)
@@ -0,0 +1,214 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<GUILayout >
+    <Window Type="DefaultWindow" Name="root" >
+        <Property Name="InheritsAlpha" Value="False" />
+        <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+        <Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{1,0},{1,0}}" />
+        <Window Type="DefaultWindow" Name="debug_overlay" >
+            <Property Name="Disabled" Value="True" />
+            <Property Name="AlwaysOnTop" Value="True" />
+            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+            <Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{1,0},{1,0}}" />
+            <Window Type="TaharezLook/StaticText" Name="Panel 1" >
+                <Property Name="Alpha" Value="0.9" />
+                <Property Name="InheritsAlpha" Value="False" />
+                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                <Property Name="UnifiedAreaRect" Value="{{0,0},{0.83,0},{0.23,0},{1,0}}" />
+                <Window Type="TaharezLook/StaticText" Name="OPCurrentFPS" >
+                    <Property Name="Font" Value="BlueHighway-10" />
+                    <Property Name="Text" Value="Current FPS: " />
+                    <Property Name="TextColours" Value="tl:FF4FF06F tr:FF4FF06F bl:FF4FF06F br:FF4FF06F" />
+                    <Property Name="FrameEnabled" Value="False" />
+                    <Property Name="HorzFormatting" Value="HorzCentred" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.075,0},{0.12,0},{0.925,0},{0.37,0}}" />
+                    <Property Name="BackgroundEnabled" Value="False" />
+                </Window>
+                <Window Type="TaharezLook/StaticImage" Name="OPBar1" >
+                    <Property Name="FrameEnabled" Value="False" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.2,0},{0.27,0},{0.8,0},{0.295,0}}" />
+                    <Property Name="BackgroundEnabled" Value="False" />
+                </Window>
+                <Window Type="TaharezLook/StaticText" Name="OPAverageFPS" >
+                    <Property Name="Font" Value="BlueHighway-10" />
+                    <Property Name="Text" Value="Average FPS: " />
+                    <Property Name="TextColours" Value="tl:FFFFF5F0 tr:FFFFF5F0 bl:FFFFF510 br:FFFFF5F0" />
+                    <Property Name="FrameEnabled" Value="False" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.075,0},{0.32,0},{1.075,0},{0.57,0}}" />
+                    <Property Name="BackgroundEnabled" Value="False" />
+                </Window>
+                <Window Type="TaharezLook/StaticText" Name="OPWorstFPS" >
+                    <Property Name="Font" Value="BlueHighway-10" />
+                    <Property Name="Text" Value="Worst FPS: " />
+                    <Property Name="TextColours" Value="tl:FFFFF5F0 tr:FFFFF5F0 bl:FFFFF510 br:FFFFF5F0" />
+                    <Property Name="FrameEnabled" Value="False" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.075,0},{0.45,0},{1.075,0},{0.7,0}}" />
+                    <Property Name="BackgroundEnabled" Value="False" />
+                </Window>
+                <Window Type="TaharezLook/StaticText" Name="OPBestFPS" >
+                    <Property Name="Font" Value="BlueHighway-10" />
+                    <Property Name="Text" Value="Best FPS: " />
+                    <Property Name="TextColours" Value="tl:FFFFF5F0 tr:FFFFF5F0 bl:FFFFF510 br:FFFFF5F0" />
+                    <Property Name="FrameEnabled" Value="False" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.075,0},{0.58,0},{1.075,0},{0.83,0}}" />
+                    <Property Name="BackgroundEnabled" Value="False" />
+                </Window>
+                <Window Type="TaharezLook/StaticText" Name="OPTriCount" >
+                    <Property Name="Font" Value="BlueHighway-10" />
+                    <Property Name="Text" Value="Triangle Count: " />
+                    <Property Name="TextColours" Value="tl:FFFFF5F0 tr:FFFFF5F0 bl:FFFFF510 br:FFFFF5F0" />
+                    <Property Name="FrameEnabled" Value="False" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.075,0},{0.71,0},{1.075,0},{0.96,0}}" />
+                    <Property Name="BackgroundEnabled" Value="False" />
+                </Window>
+            </Window>
+            <Window Type="TaharezLook/StaticText" Name="OPDebugMsg" >
+                <Property Name="Font" Value="BlueHighway-10" />
+                <Property Name="TextColours" Value="tl:A0FFFFFF tr:A0FFFFFF bl:A0FFFFFF br:A0FFFFFF" />
+                <Property Name="FrameEnabled" Value="False" />
+                <Property Name="InheritsAlpha" Value="False" />
+                <Property Name="HorzFormatting" Value="WordWrapCentred" />
+                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                <Property Name="UnifiedAreaRect" Value="{{0.25,0},{0.93,0},{0.9,0},{1,0}}" />
+                <Property Name="BackgroundEnabled" Value="False" />
+            </Window>
+            <Window Type="TaharezLook/StaticImage" Name="OgreLogo" >
+                <Property Name="Alpha" Value="0.75" />
+                <Property Name="FrameEnabled" Value="False" />
+                <Property Name="InheritsAlpha" Value="False" />
+                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                <Property Name="UnifiedAreaRect" Value="{{0.9,0},{0.95,0},{1,0},{1,0}}" />
+                <Property Name="BackgroundEnabled" Value="False" />
+            </Window>
+            <Window Type="TaharezLook/StaticImage" Name="CeguiLogo" >
+                <Property Name="Alpha" Value="0.75" />
+                <Property Name="FrameEnabled" Value="False" />
+                <Property Name="InheritsAlpha" Value="False" />
+                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                <Property Name="UnifiedAreaRect" Value="{{0.9125,0},{0.9115,0},{0.9875,0},{0.95,0}}" />
+                <Property Name="BackgroundEnabled" Value="False" />
+            </Window>
+        </Window>
+        <Window Type="DefaultWindow" Name="InstancingDemo" >
+            <Property Name="Font" Value="BlueHighway-12" />
+            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+            <Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{1,0},{2,0}}" />
+            <Window Type="TaharezLook/FrameWindow" Name="CompositorSelectorWin" >
+                <Property Name="Font" Value="BlueHighway-12" />
+                <Property Name="Text" Value="Techniques" />
+                <Property Name="Alpha" Value="0.75" />
+                <Property Name="TitlebarFont" Value="BlueHighway-12" />
+                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                <Property Name="TitlebarEnabled" Value="True" />
+                <Property Name="UnifiedAreaRect" Value="{{0,0},{0.00508906,0},{0.237344,0},{0.487022,0}}" />
+                <Property Name="CloseButtonEnabled" Value="False" />
+                <Window Type="TaharezLook/RadioButton" Name="tInstancing" >
+                    <Property Name="Font" Value="BlueHighway-12" />
+                    <Property Name="Text" Value="Instancing" />
+                    <Property Name="Selected" Value="True" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.05,0},{0.0592397,0},{1.05,0},{0.140919,0}}" />
+                </Window>
+                <Window Type="TaharezLook/RadioButton" Name="tStaticGeometry" >
+                    <Property Name="ID" Value="1" />
+                    <Property Name="Font" Value="BlueHighway-12" />
+                    <Property Name="Text" Value="Static Geometry" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.05,0},{0.118479,0},{1.05,0},{0.198839,0}}" />
+                </Window>
+                <Window Type="TaharezLook/RadioButton" Name="tIndependantEntities" >
+                    <Property Name="ID" Value="2" />
+                    <Property Name="Font" Value="BlueHighway-12" />
+                    <Property Name="Text" Value="Independant Entities" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.05,0},{0.180359,0},{1.05,0},{0.260718,0}}" />
+                </Window>
+                <Window Type="TaharezLook/Checkbox" Name="Shadows" >
+                    <Property Name="Font" Value="BlueHighway-12" />
+                    <Property Name="Text" Value="Shadows on/off" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+					<Property Name="UnifiedAreaRect" Value="{{0.05,0},{0.458078,0},{1.05,0},{0.545613,0}}" />
+                </Window>
+                <Window Type="TaharezLook/StaticText" Name="Object Count Text" >
+                    <Property Name="Font" Value="BlueHighway-12" />
+                    <Property Name="Text" Value="Object Count:" />
+                    <Property Name="FrameEnabled" Value="False" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.0458855,0},{0.242239,0},{0.480053,0},{0.324677,0}}" />
+                    <Property Name="BackgroundEnabled" Value="False" />
+                </Window>
+                <Window Type="TaharezLook/StaticText" Name="Object Count Number" >
+                    <Property Name="Font" Value="BlueHighway-12" />
+                    <Property Name="Text" Value="160" />
+                    <Property Name="FrameEnabled" Value="False" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.475313,0},{0.245588,0},{0.679954,0},{0.327894,0}}" />
+                    <Property Name="BackgroundEnabled" Value="False" />
+                </Window>
+                <Window Type="TaharezLook/Combobox" Name="Objects" >
+                    <Property Name="Font" Value="BlueHighway-12" />
+                    <Property Name="Text" Value="Choose an object" />
+                    <Property Name="ReadOnly" Value="True" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.0541145,0},{0.561555,0},{0.954114,0},{0.821555,0}}" />
+                    <Property Name="MaxEditTextLength" Value="1073741823" />
+                </Window>
+                <Window Type="TaharezLook/HorizontalScrollbar" Name="Object Count" >
+                    <Property Name="PageSize" Value="0" />
+                    <Property Name="StepSize" Value="1" />
+                    <Property Name="OverlapSize" Value="0" />
+                    <Property Name="DocumentSize" Value="1" />
+                    <Property Name="ScrollPosition" Value="0" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.06,0},{0.33,0},{0.96,0},{0.382246,0}}" />
+                </Window>
+                <Window Type="TaharezLook/StaticText" Name="Time Burner Text" >
+                    <Property Name="Font" Value="BlueHighway-12" />
+                    <Property Name="Text" Value="CPU occupation:" />
+                    <Property Name="FrameEnabled" Value="False" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.0664582,0},{0.650819,0},{0.571251,0},{0.750819,0}}" />
+                    <Property Name="BackgroundEnabled" Value="False" />
+                </Window>
+                <Window Type="TaharezLook/StaticText" Name="Time Burner Value" >
+                    <Property Name="Font" Value="BlueHighway-12" />
+                    <Property Name="Text" Value="0 ms" />
+                    <Property Name="FrameEnabled" Value="False" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.616458,0},{0.650819,0},{0.905365,0},{0.750819,0}}" />
+                    <Property Name="BackgroundEnabled" Value="False" />
+                </Window>
+                <Window Type="TaharezLook/HorizontalScrollbar" Name="Time Burner" >
+                    <Property Name="PageSize" Value="0" />
+                    <Property Name="StepSize" Value="1" />
+                    <Property Name="OverlapSize" Value="0" />
+                    <Property Name="DocumentSize" Value="1" />
+                    <Property Name="ScrollPosition" Value="0" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.05,0},{0.75,0},{0.962344,0},{0.804855,0}}" />
+                </Window>
+                <Window Type="TaharezLook/Checkbox" Name="PostEffect" >
+                    <Property Name="Font" Value="BlueHighway-12" />
+                    <Property Name="Text" Value="Post Effect On/Off" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.05,0},{0.813539,0},{0.918334,0},{0.895712,0}}" />
+                </Window>
+                <Window Type="TaharezLook/Button" Name="ExitDemoBtn" >
+                    <Property Name="Font" Value="BlueHighway-12" />
+                    <Property Name="Text" Value="Exit Demo" />
+                    <Property Name="InheritsAlpha" Value="False" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{-0.0325521,0},{-0.0135575,0},{0.48346,0},{0.0739895,0}}" />
+                    <Property Name="VerticalAlignment" Value="Bottom" />
+                    <Property Name="HorizontalAlignment" Value="Centre" />
+                </Window>
+            </Window>
+        </Window>
+    </Window>
+</GUILayout>
Index: code/trunk/Tutorial/Media/gui/OceanDemoCegui.config
===================================================================
--- code/trunk/Tutorial/Media/gui/OceanDemoCegui.config	(revision 44)
+++ code/trunk/Tutorial/Media/gui/OceanDemoCegui.config	(revision 44)
@@ -0,0 +1,6 @@
+<?xml version="1.0" ?>
+<CEGUIConfig
+	Scheme="TaharezLookSkin.scheme"
+	Layout="OceanDemoLayout.xml"
+	DefaultFont="BlueHighway-12"
+/>
Index: code/trunk/Tutorial/Media/gui/OceanDemoLayout.xml
===================================================================
--- code/trunk/Tutorial/Media/gui/OceanDemoLayout.xml	(revision 44)
+++ code/trunk/Tutorial/Media/gui/OceanDemoLayout.xml	(revision 44)
@@ -0,0 +1,264 @@
+<?xml version="1.0" ?>
+<GUILayout>
+<Window Type="DefaultGUISheet" Name="root">
+
+	<Window Type="DefaultGUISheet" Name="debug_overlay">
+		<Property Name="AlwaysOnTop" Value="True" />
+		<Property Name="Disabled" Value="True" />
+		
+		<Window Type="TaharezLook/StaticText" Name="Panel 1">
+			<Property Name="UnifiedPosition" Value="{{0,0},{0.83,0}}" />
+			<Property Name="UnifiedSize" Value="{{0.23,0},{0.17,0}}" />
+			<Property Name="Alpha" Value="0.9" />
+			<Property Name="InheritsAlpha" Value="False" />
+	
+			<Window Type="TaharezLook/StaticText" Name="OPCurrentFPS">
+				<Property Name="FrameEnabled" Value="False" />
+				<Property Name="BackgroundEnabled" Value="False" />
+				<Property Name="Font" Value="BlueHighway-10" />
+				<Property Name="UnifiedPosition" Value="{{0.075,0},{0.12,0}}" />
+				<Property Name="UnifiedSize" Value="{{0.85,0},{0.25,0}}" />
+				<Property Name="TextColours" Value="tl:FF4FF06F tr:FF4FF06F bl:FF4FF06F br:FF4FF06F" />
+				<Property Name="HorzFormatting" Value="HorzCentred" />
+				<Property Name="Text" Value="Current FPS: " />
+			</Window>
+
+			<Window Type="TaharezLook/StaticImage" Name="OPBar1">
+				<Property Name="FrameEnabled" Value="False" />
+				<Property Name="BackgroundEnabled" Value="False" />
+				<Property Name="UnifiedPosition" Value="{{0.2,0},{0.27,0}}" />
+				<Property Name="UnifiedSize" Value="{{0.6,0},{0.025,0}}" />
+			</Window>
+
+			<Window Type="TaharezLook/StaticText" Name="OPAverageFPS">
+				<Property Name="FrameEnabled" Value="False" />
+				<Property Name="BackgroundEnabled" Value="False" />
+				<Property Name="Font" Value="BlueHighway-10" />
+				<Property Name="UnifiedPosition" Value="{{0.075,0},{0.32,0}}" />
+				<Property Name="UnifiedSize" Value="{{1.0,0},{0.25,0}}" />
+				<Property Name="TextColours" Value="tl:FFFFF5F0 tr:FFFFF5F0 bl:FFFFF510 br:FFFFF5F0" />
+				<Property Name="Text" Value="Average FPS: " />
+			</Window>
+
+			<Window Type="TaharezLook/StaticText" Name="OPWorstFPS">
+				<Property Name="FrameEnabled" Value="False" />
+				<Property Name="BackgroundEnabled" Value="False" />
+				<Property Name="Font" Value="BlueHighway-10" />
+				<Property Name="UnifiedPosition" Value="{{0.075,0},{0.45,0}}" />
+				<Property Name="UnifiedSize" Value="{{1.0,0},{0.25,0}}" />
+				<Property Name="TextColours" Value="tl:FFFFF5F0 tr:FFFFF5F0 bl:FFFFF510 br:FFFFF5F0" />
+				<Property Name="Text" Value="Worst FPS: " />
+			</Window>
+
+			<Window Type="TaharezLook/StaticText" Name="OPBestFPS">
+				<Property Name="FrameEnabled" Value="False" />
+				<Property Name="BackgroundEnabled" Value="False" />
+				<Property Name="Font" Value="BlueHighway-10" />
+				<Property Name="UnifiedPosition" Value="{{0.075,0},{0.58,0}}" />
+				<Property Name="UnifiedSize" Value="{{1.0,0},{0.25,0}}" />
+				<Property Name="TextColours" Value="tl:FFFFF5F0 tr:FFFFF5F0 bl:FFFFF510 br:FFFFF5F0" />
+				<Property Name="Text" Value="Best FPS: " />
+			</Window>
+
+			<Window Type="TaharezLook/StaticText" Name="OPTriCount">
+				<Property Name="FrameEnabled" Value="False" />
+				<Property Name="BackgroundEnabled" Value="False" />
+				<Property Name="Font" Value="BlueHighway-10" />
+				<Property Name="UnifiedPosition" Value="{{0.075,0},{0.71,0}}" />
+				<Property Name="UnifiedSize" Value="{{1.0,0},{0.25,0}}" />
+				<Property Name="TextColours" Value="tl:FFFFF5F0 tr:FFFFF5F0 bl:FFFFF510 br:FFFFF5F0" />
+				<Property Name="Text" Value="Triangle Count: " />
+			</Window>
+
+		</Window>
+
+		<Window Type="TaharezLook/StaticText" Name="OPDebugMsg">
+			<Property Name="FrameEnabled" Value="False" />
+			<Property Name="BackgroundEnabled" Value="False" />
+			<Property Name="Font" Value="BlueHighway-10" />
+			<Property Name="UnifiedPosition" Value="{{0.25,0},{0.93,0}}" />
+			<Property Name="UnifiedSize" Value="{{0.65,0},{0.07,0}}" />
+			<Property Name="TextColours" Value="tl:A0FFFFFF tr:A0FFFFFF bl:A0FFFFFF br:A0FFFFFF" />
+			<Property Name="InheritsAlpha" Value="False" />
+			<Property Name="VertFormatting" Value="VertCentred" />
+			<Property Name="HorzFormatting" Value="WordWrapCentred" />
+		</Window>
+
+		<Window Type="TaharezLook/StaticImage" Name="OgreLogo">
+			<Property Name="FrameEnabled" Value="False" />
+			<Property Name="BackgroundEnabled" Value="False" />
+			<Property Name="UnifiedPosition" Value="{{0.9,0},{0.95,0}}" />
+			<Property Name="UnifiedSize" Value="{{0.1,0},{0.05,0}}" />
+			<Property Name="Alpha" Value="0.75" />
+			<Property Name="InheritsAlpha" Value="False" />
+		</Window>
+
+		<Window Type="TaharezLook/StaticImage" Name="CeguiLogo">
+			<Property Name="FrameEnabled" Value="False" />
+			<Property Name="BackgroundEnabled" Value="False" />
+			<Property Name="UnifiedPosition" Value="{{0.9125,0},{0.9115,0}}" />
+			<Property Name="UnifiedSize" Value="{{0.075,0},{0.0385,0}}" />
+			<Property Name="Alpha" Value="0.75" />
+			<Property Name="InheritsAlpha" Value="False" />
+		</Window>
+
+	</Window>
+
+	<Window Type="DefaultGUISheet" Name="OceanDemo">
+
+		<Property Name="UnifiedMaxSize" Value="{{1,0},{2,0}}" />
+		<Property Name="UnifiedSize" Value="{{1,0},{2,0}}" />
+
+
+		<Window Type="TaharezLook/StaticText" Name="HelpTxt">
+			<Property Name="UnifiedPosition" Value="{{0.6,0},{0.8,0}}" />
+			<Property Name="UnifiedMinSize" Value="{{0.5,0},{0.3,0}}" />
+			<Property Name="UnifiedSize" Value="{{0.5,0},{0.3,0}}" />
+			<Property Name="Text" Value="Use the Combo boxes to select a shader and a model" />
+			<Property Name="InheritsAlpha" Value="False" />
+		</Window>
+		
+		<Window Type="TaharezLook/FrameWindow" Name="OceanDemo/MainWin">
+			<Property Name="UnifiedPosition" Value="{{0,0},{0,0}}" />
+			<Property Name="UnifiedMaxSize" Value="{{0.23,0},{0.23,0}}" />
+			<Property Name="UnifiedMinSize" Value="{{0.23,0},{0.23,0}}" />
+			<Property Name="UnifiedSize" Value="{{0.23,0},{0.23,0}}" />
+			<Property Name="Text" Value="Selector" />
+			<Property Name="Alpha" Value="0.75" />
+			<Property Name="CloseButtonEnabled" Value="False" />
+
+			<Window Type="TaharezLook/StaticText" Name="ShaderTxt">
+				<Property Name="UnifiedPosition" Value="{{0.05,0},{0.10,0}}" />
+				<Property Name="UnifiedMaxSize" Value="{{0.3,0},{0.06,0}}" />
+				<Property Name="UnifiedMinSize" Value="{{0.3,0},{0.06,0}}" />
+				<Property Name="UnifiedSize" Value="{{0.3,0},{0.06,0}}" />
+				<Property Name="HorzFormatting" Value="LeftAligned" />
+				<Property Name="Text" Value="Active Material" />
+				<Property Name="FrameEnabled" Value="False" />
+				<Property Name="BackgroundEnabled" Value="False" />
+				<Property Name="InheritsAlpha" Value="False" />
+			</Window>
+
+			<Window Type="TaharezLook/Combobox" Name="ShaderCombos">
+				<Property Name="UnifiedPosition" Value="{{0.05,0},{0.27,0}}" />
+				<Property Name="UnifiedMaxSize" Value="{{0.2,0},{0.25,0}}" />
+				<Property Name="UnifiedMinSize" Value="{{0.2,0},{0.25,0}}" />
+				<Property Name="UnifiedSize" Value="{{0.2,0},{0.25,0}}" />
+				<Property Name="InheritsAlpha" Value="False" />
+				<Property Name="ReadOnly" Value="True" />
+				<Property Name="ClippedByParent" Value="False" />
+			</Window>
+
+			<Window Type="TaharezLook/StaticText" Name="ModelTxt">
+				<Property Name="UnifiedPosition" Value="{{0.05,0},{0.40,0}}" />
+				<Property Name="UnifiedMaxSize" Value="{{0.3,0},{0.06,0}}" />
+				<Property Name="UnifiedMinSize" Value="{{0.3,0},{0.06,0}}" />
+				<Property Name="UnifiedSize" Value="{{0.3,0},{0.06,0}}" />
+				<Property Name="HorzFormatting" Value="LeftAligned" />
+				<Property Name="Text" Value="Active Model" />
+				<Property Name="FrameEnabled" Value="False" />
+				<Property Name="BackgroundEnabled" Value="False" />
+				<Property Name="InheritsAlpha" Value="False" />
+			</Window>
+
+			<Window Type="TaharezLook/Combobox" Name="ModelCombos">
+				<Property Name="UnifiedPosition" Value="{{0.05,0},{0.57,0}}" />
+				<Property Name="UnifiedMaxSize" Value="{{0.2,0},{0.25,0}}" />
+				<Property Name="UnifiedMinSize" Value="{{0.2,0},{0.25,0}}" />
+				<Property Name="UnifiedSize" Value="{{0.2,0},{0.25,0}}" />
+				<Property Name="InheritsAlpha" Value="False" />
+				<Property Name="ReadOnly" Value="True" />
+				<Property Name="ClippedByParent" Value="False" />
+			</Window>
+
+			<Window Type="TaharezLook/Button" Name="ExitDemoBtn">
+				<Property Name="UnifiedPosition" Value="{{0.25,0},{0.79,0}}" />
+				<Property Name="UnifiedMaxSize" Value="{{0.12,0},{0.04,0}}" />
+				<Property Name="UnifiedMinSize" Value="{{0.12,0},{0.04,0}}" />
+				<Property Name="UnifiedSize" Value="{{0.33,0},{0.04,0}}" />
+				<Property Name="Text" Value="Exit Demo" />
+				<Property Name="InheritsAlpha" Value="False" />
+			</Window>
+
+
+		</Window>
+
+
+		<Window Type="TaharezLook/FrameWindow" Name="ShaderControlsWin">
+			<Property Name="UnifiedPosition" Value="{{0.50,0},{0,0}}" />
+			<Property Name="UnifiedMaxSize" Value="{{0.5,0},{0.22,0}}" />
+			<Property Name="UnifiedMinSize" Value="{{0.5,0},{0.22,0}}" />
+			<Property Name="UnifiedSize" Value="{{0.5,0},{0.22,0}}" />
+			<Property Name="Text" Value="Shader Controls" />
+			<Property Name="Alpha" Value="0.75" />
+			<Property Name="CloseButtonEnabled" Value="False" />
+			
+			<Window Type="TaharezLook/VerticalScrollbar" Name="VerticalScroll">
+				<Property Name="UnifiedPosition" Value="{{0.94,0},{0.2,0}}" />
+				<Property Name="UnifiedSize" Value="{{0.04,0},{0.75,0}}" />
+				<Property Name="DocumentSize" Value="1" />
+				<Property Name="PageSize" Value="1" />
+				<Property Name="StepSize" Value="0.01" />
+				<Property Name="OverlapSize" Value="0.5" />
+			</Window>
+			
+		</Window>
+
+		<Window Type="TaharezLook/FrameWindow" Name="MovementControlsWin">
+			<Property Name="UnifiedPosition" Value="{{0.0,0},{0.2,0}}" />
+			<Property Name="UnifiedMaxSize" Value="{{0.15,0},{0.22,0}}" />
+			<Property Name="UnifiedMinSize" Value="{{0.15,0},{0.22,0}}" />
+			<Property Name="UnifiedSize" Value="{{0.15,0},{0.22,0}}" />
+			<Property Name="Text" Value="Movement" />
+			<Property Name="Alpha" Value="0.75" />
+			<Property Name="CloseButtonEnabled" Value="False" />
+			
+			<Window Type="TaharezLook/RadioButton" Name="CameraRBtn">
+				<Property Name="UnifiedPosition" Value="{{0.1,0},{0.2,0}}" />
+				<Property Name="UnifiedMaxSize" Value="{{0.12,0},{0.03,0}}" />
+				<Property Name="UnifiedMinSize" Value="{{0.12,0},{0.03,0}}" />
+				<Property Name="UnifiedSize" Value="{{0.33,0},{0.03,0}}" />
+				<Property Name="Text" Value="Camera" />
+				<Property Name="InheritsAlpha" Value="False" />
+				<Property Name="Selected" Value="true" />
+				<Property Name="ID" Value="0" />
+			
+			</Window>
+
+			<Window Type="TaharezLook/RadioButton" Name="ModelRBtn">
+				<Property Name="UnifiedPosition" Value="{{0.1,0},{0.4,0}}" />
+				<Property Name="UnifiedMaxSize" Value="{{0.12,0},{0.03,0}}" />
+				<Property Name="UnifiedMinSize" Value="{{0.12,0},{0.03,0}}" />
+				<Property Name="UnifiedSize" Value="{{0.33,0},{0.03,0}}" />
+				<Property Name="Text" Value="Model" />
+				<Property Name="InheritsAlpha" Value="False" />
+				<Property Name="Selected" Value="False" />
+				<Property Name="ID" Value="1" />
+			
+			</Window>
+			
+			<Window Type="TaharezLook/Checkbox" Name="ModelSpinCB">
+				<Property Name="UnifiedPosition" Value="{{0.2,0},{0.53,0}}" />
+				<Property Name="UnifiedMaxSize" Value="{{0.12,0},{0.03,0}}" />
+				<Property Name="UnifiedMinSize" Value="{{0.12,0},{0.03,0}}" />
+				<Property Name="UnifiedSize" Value="{{0.12,0},{0.03,0}}" />
+				<Property Name="InheritsAlpha" Value="False" />
+				<Property Name="Text" Value="Spin" />
+				<Property Name="Selected" Value="True" />
+			</Window>
+
+			<Window Type="TaharezLook/Checkbox" Name="LightSpinCB">
+				<Property Name="UnifiedPosition" Value="{{0.1,0},{0.7,0}}" />
+				<Property Name="UnifiedMaxSize" Value="{{0.12,0},{0.03,0}}" />
+				<Property Name="UnifiedMinSize" Value="{{0.12,0},{0.03,0}}" />
+				<Property Name="UnifiedSize" Value="{{0.12,0},{0.03,0}}" />
+				<Property Name="InheritsAlpha" Value="False" />
+				<Property Name="Text" Value="Spin Light" />
+				<Property Name="Selected" Value="False" />
+			</Window>
+		</Window>
+	</Window>
+
+</Window>
+
+</GUILayout>
Index: code/trunk/Tutorial/Media/gui/TaharezLook.imageset
===================================================================
--- code/trunk/Tutorial/Media/gui/TaharezLook.imageset	(revision 44)
+++ code/trunk/Tutorial/Media/gui/TaharezLook.imageset	(revision 44)
@@ -0,0 +1,242 @@
+<?xml version="1.0" ?>
+<Imageset Name="TaharezLook" Imagefile="TaharezLook.tga" NativeHorzRes="800" NativeVertRes="600" AutoScaled="true">
+	<Image Name="ClientBrush" XPos="2" YPos="2" Width="64" Height="64" />
+	<Image Name="WindowLeftEdge" XPos="6" YPos="95" Width="1" Height="22" XOffset="4" />
+	<Image Name="WindowRightEdge" XPos="34" YPos="95" Width="1" Height="22" XOffset="-5" />
+	<Image Name="WindowTopEdge" XPos="9" YPos="68" Width="23" Height="1" />
+	<Image Name="WindowBottomEdge" XPos="9" YPos="143" Width="23" Height="1" />
+	<Image Name="WindowTopLeft" XPos="2" YPos="68" Width="5" Height="24" />
+	<Image Name="WindowTopRight" XPos="34" YPos="68" Width="5" Height="24" />
+	<Image Name="WindowBottomLeft" XPos="2" YPos="120" Width="5" Height="24" />
+	<Image Name="WindowBottomRight" XPos="34" YPos="120" Width="5" Height="24" />
+	<Image Name="ButtonLeftNormal" XPos="68" YPos="20" Width="12" Height="16" />
+	<Image Name="ButtonMiddleNormal" XPos="82" YPos="20" Width="12" Height="16" />
+	<Image Name="ButtonRightNormal" XPos="96" YPos="20" Width="12" Height="16" />
+	<Image Name="ButtonLeftPushed" XPos="68" YPos="38" Width="12" Height="16" />
+	<Image Name="ButtonMiddlePushed" XPos="82" YPos="38" Width="12" Height="16" />
+	<Image Name="ButtonRightPushed" XPos="96" YPos="38" Width="12" Height="16" />
+	<Image Name="ButtonLeftHighlight" XPos="68" YPos="56" Width="12" Height="16" />
+	<Image Name="ButtonMiddleHighlight" XPos="82" YPos="56" Width="12" Height="16" />
+	<Image Name="ButtonRightHighlight" XPos="96" YPos="56" Width="12" Height="16" />
+	<Image Name="CheckboxNormal" XPos="110" YPos="2" Width="12" Height="12" />
+	<Image Name="CheckboxHover" XPos="110" YPos="30" Width="12" Height="12" />
+	<Image Name="CheckboxMark" XPos="110" YPos="16" Width="12" Height="12" />
+	<Image Name="RadioButtonNormal" XPos="124" YPos="2" Width="12" Height="12" />
+	<Image Name="RadioButtonHover" XPos="124" YPos="30" Width="12" Height="12" />
+	<Image Name="RadioButtonMark" XPos="124" YPos="16" Width="12" Height="12" />
+	<Image Name="TitlebarLeft" XPos="68" YPos="2" Width="8" Height="16" />
+	<Image Name="TitlebarMiddle" XPos="78" YPos="2" Width="8" Height="16" />
+	<Image Name="TitlebarRight" XPos="88" YPos="2" Width="8" Height="16" />
+	<Image Name="NewTitlebarLeft" XPos="61" YPos="127" Width="13" Height="16" />
+	<Image Name="NewTitlebarMiddle" XPos="77" YPos="127" Width="12" Height="16" />
+	<Image Name="NewTitlebarRight" XPos="92" YPos="127" Width="12" Height="16" />
+	<Image Name="SysAreaMiddle" XPos="107" YPos="127" Width="12" Height="16" />
+	<Image Name="SysAreaRight" XPos="122" YPos="127" Width="13" Height="16" />
+	<Image Name="StaticLeft" XPos="41" YPos="89" Width="6" Height="6" />
+	<Image Name="StaticRight" XPos="63" YPos="89" Width="6" Height="6" />
+	<Image Name="StaticTop" XPos="52" YPos="78" Width="6" Height="6" />
+	<Image Name="StaticBottom" XPos="52" YPos="100" Width="6" Height="6" />
+	<Image Name="StaticTopLeft" XPos="41" YPos="78" Width="6" Height="6" />
+	<Image Name="StaticTopRight" XPos="63" YPos="78" Width="6" Height="6" />
+	<Image Name="StaticBottomLeft" XPos="41" YPos="100" Width="6" Height="6" />
+	<Image Name="StaticBottomRight" XPos="63" YPos="100" Width="6" Height="6" />
+	<Image Name="StaticBackdrop" XPos="52" YPos="89" Width="6" Height="6" />
+	<Image Name="ProgressBarLeft" XPos="71" YPos="74" Width="7" Height="12" />
+	<Image Name="ProgressBarMiddle" XPos="80" YPos="74" Width="6" Height="12" />
+	<Image Name="ProgressBarRight" XPos="88" YPos="74" Width="6" Height="12" />
+	<Image Name="ProgressBarDimSegment" XPos="96" YPos="74" Width="8" Height="12" />
+	<Image Name="ProgressBarLitSegment" XPos="106" YPos="74" Width="8" Height="12" />
+	<Image Name="EditBoxLeft" XPos="41" YPos="108" Width="4" Height="18" />
+	<Image Name="EditBoxMiddle" XPos="47" YPos="108" Width="4" Height="18" />
+	<Image Name="EditBoxRight" XPos="53" YPos="108" Width="4" Height="18" />
+	<Image Name="EditBoxCarat" XPos="60" YPos="108" Width="4" Height="18" />
+	<Image Name="SpinnerUpNormal" XPos="68" YPos="110" Width="10" Height="6" />
+	<Image Name="SpinnerDownNormal" XPos="68" YPos="118" Width="10" Height="6" />
+	<Image Name="SpinnerUpHover" XPos="82" YPos="110" Width="10" Height="6" />
+	<Image Name="SpinnerDownHover" XPos="82" YPos="118" Width="10" Height="6" />
+	<Image Name="TextSelectionBrush" XPos="8" YPos="70" Width="16" Height="16" />
+	<Image Name="VertScrollTop" XPos="182" YPos="2" Width="20" Height="8" />
+	<Image Name="VertScrollMiddle" XPos="182" YPos="12" Width="20" Height="8" />
+	<Image Name="VertScrollBottom" XPos="182" YPos="22" Width="20" Height="8" />
+	<Image Name="VertScrollBarSegment" XPos="206" YPos="2" Width="4" Height="10" />
+	<Image Name="VertScrollThumbNormal" XPos="214" YPos="2" Width="8" Height="24" />
+	<Image Name="VertScrollThumbHover" XPos="224" YPos="2" Width="8" Height="24" />
+	<Image Name="VertScrollUpNormal" XPos="196" YPos="32" Width="12" Height="12" />
+	<Image Name="VertScrollDownNormal" XPos="182" YPos="32" Width="12" Height="12" />
+	<Image Name="VertScrollUpHover" XPos="196" YPos="46" Width="12" Height="12" />
+	<Image Name="VertScrollDownHover" XPos="182" YPos="46" Width="12" Height="12" />
+	<Image Name="MiniVertScrollBarSegment" XPos="207" YPos="60" Width="4" Height="10" />
+	<Image Name="MiniVertScrollThumbNormal" XPos="214" YPos="59" Width="7" Height="22" />
+	<Image Name="MiniVertScrollThumbTopNormal" XPos="214" YPos="59" Width="7" Height="5" />
+	<Image Name="MiniVertScrollThumbMiddleNormal" XPos="214" YPos="65" Width="7" Height="5" />
+	<Image Name="MiniVertScrollThumbBottomNormal" XPos="214" YPos="76" Width="7" Height="5" />
+	<Image Name="MiniVertScrollThumbTopHover" XPos="223" YPos="59" Width="7" Height="5" />
+	<Image Name="MiniVertScrollThumbMiddleHover" XPos="223" YPos="65" Width="7" Height="5" />
+	<Image Name="MiniVertScrollThumbBottomHover" XPos="223" YPos="76" Width="7" Height="5" />
+	<Image Name="MiniVertScrollThumbHover" XPos="223" YPos="59" Width="7" Height="22" />
+	<Image Name="MiniVertScrollUpNormal" XPos="194" YPos="60" Width="10" Height="9" />
+	<Image Name="MiniVertScrollDownNormal" XPos="182" YPos="59" Width="10" Height="9" />
+	<Image Name="MiniVertScrollUpHover" XPos="194" YPos="70" Width="10" Height="9" />
+	<Image Name="MiniVertScrollDownHover" XPos="182" YPos="69" Width="10" Height="9" />
+	<Image Name="VertSliderBody" XPos="234" YPos="2" Width="9" Height="48" />
+	<Image Name="VertSliderThumbNormal" XPos="217" YPos="28" Width="15" Height="6" />
+	<Image Name="VertSliderThumbHover" XPos="217" YPos="36" Width="15" Height="6" />
+	<Image Name="MiniHorzScrollBarSegment" XPos="244" YPos="80" Width="10" Height="4" />
+	<Image Name="MiniHorzScrollThumbNormal" XPos="233" YPos="87" Width="22" Height="7" />
+	<Image Name="MiniHorzScrollThumbLeftNormal" XPos="233" YPos="87" Width="5" Height="7" />
+	<Image Name="MiniHorzScrollThumbMiddleNormal" XPos="239" YPos="87" Width="5" Height="7" />
+	<Image Name="MiniHorzScrollThumbRightNormal" XPos="250" YPos="87" Width="5" Height="7" />
+	<Image Name="MiniHorzScrollThumbHover" XPos="233" YPos="96" Width="22" Height="7" />
+	<Image Name="MiniHorzScrollThumbLeftHover" XPos="233" YPos="96" Width="5" Height="7" />
+	<Image Name="MiniHorzScrollThumbMiddleHover" XPos="239" YPos="96" Width="5" Height="7" />
+	<Image Name="MiniHorzScrollThumbRightHover" XPos="250" YPos="96" Width="5" Height="7" />
+	<Image Name="MiniHorzScrollLeftNormal" XPos="246" YPos="55" Width="9" Height="10" />
+	<Image Name="MiniHorzScrollRightNormal" XPos="245" YPos="67" Width="9" Height="10" />
+	<Image Name="MiniHorzScrollLeftHover" XPos="236" YPos="55" Width="9" Height="10" />
+	<Image Name="MiniHorzScrollRightHover" XPos="235" YPos="67" Width="9" Height="10" />
+	<Image Name="ListboxLeft" XPos="41" YPos="89" Width="7" Height="6" />
+	<Image Name="ListboxRight" XPos="62" YPos="89" Width="7" Height="6" />
+	<Image Name="ListboxTop" XPos="52" YPos="78" Width="6" Height="7" />
+	<Image Name="ListboxBottom" XPos="52" YPos="99" Width="6" Height="7" />
+	<Image Name="ListboxTopLeft" XPos="41" YPos="78" Width="7" Height="7" />
+	<Image Name="ListboxTopRight" XPos="62" YPos="78" Width="7" Height="7" />
+	<Image Name="ListboxBottomLeft" XPos="41" YPos="99" Width="7" Height="7" />
+	<Image Name="ListboxBottomRight" XPos="62" YPos="99" Width="7" Height="7" />
+	<Image Name="ListboxBackdrop" XPos="52" YPos="89" Width="6" Height="6" />
+	<Image Name="ListboxSelectionBrush" XPos="8" YPos="70" Width="16" Height="16" />
+	<Image Name="ComboboxEditLeft" XPos="138" YPos="2" Width="8" Height="16" />
+	<Image Name="ComboboxEditMiddle" XPos="148" YPos="2" Width="8" Height="16" />
+	<Image Name="ComboboxListButtonNormal" XPos="158" YPos="2" Width="16" Height="16" />
+	<Image Name="ComboboxListButtonHover" XPos="158" YPos="20" Width="16" Height="16" />
+	<Image Name="ComboboxListLeft" XPos="138" YPos="48" Width="8" Height="8" />
+	<Image Name="ComboboxListRight" XPos="158" YPos="48" Width="8" Height="8" />
+	<Image Name="ComboboxListTop" XPos="148" YPos="48" Width="8" Height="8" />
+	<Image Name="ComboboxListBottom" XPos="148" YPos="58" Width="8" Height="8" />
+	<Image Name="ComboboxListTopLeft" XPos="138" YPos="38" Width="8" Height="8" />
+	<Image Name="ComboboxListTopRight" XPos="158" YPos="38" Width="8" Height="8" />
+	<Image Name="ComboboxListBottomLeft" XPos="138" YPos="58" Width="8" Height="8" />
+	<Image Name="ComboboxListBottomRight" XPos="158" YPos="58" Width="8" Height="8" />
+	<Image Name="ComboboxListBackdrop" XPos="148" YPos="48" Width="8" Height="8" />
+	<Image Name="ComboboxSelectionBrush" XPos="8" YPos="70" Width="16" Height="16" />
+	<Image Name="ComboboxDividerLeft" XPos="138" YPos="68" Width="14" Height="1" />
+	<Image Name="ComboboxDividerMiddle" XPos="154" YPos="68" Width="8" Height="1" />
+	<Image Name="ComboboxDividerRight" XPos="164" YPos="68" Width="14" Height="1" />
+	<Image Name="HeaderBarBackdropNormal" XPos="230" YPos="163" Width="10" Height="12" />
+	<Image Name="HeaderBarBackdropHover" XPos="230" YPos="163" Width="10" Height="12" />
+	<Image Name="HeaderBarSplitterNormal" XPos="225" YPos="92" Width="3" Height="16" />
+	<Image Name="HeaderBarSplitterHover" XPos="200" YPos="92" Width="3" Height="16" />
+	<Image Name="HeaderBarSortUp" XPos="233" YPos="178" Width="8" Height="8" />
+	<Image Name="HeaderBarSortDown" XPos="244" YPos="178" Width="8" Height="8" />
+	<Image Name="MultiListLeft" XPos="170" YPos="92" Width="7" Height="6" />
+	<Image Name="MultiListRight" XPos="191" YPos="92" Width="7" Height="6" />
+	<Image Name="MultiListTop" XPos="181" YPos="81" Width="6" Height="7" />
+	<Image Name="MultiListBottom" XPos="181" YPos="102" Width="6" Height="7" />
+	<Image Name="MultiListTopLeft" XPos="170" YPos="81" Width="7" Height="7" />
+	<Image Name="MultiListTopRight" XPos="191" YPos="81" Width="7" Height="7" />
+	<Image Name="MultiListBottomLeft" XPos="170" YPos="102" Width="7" Height="7" />
+	<Image Name="MultiListBottomRight" XPos="191" YPos="102" Width="7" Height="7" />
+	<Image Name="MultiListBackdrop" XPos="181" YPos="92" Width="6" Height="6" />
+	<Image Name="MultiListSelectionBrush" XPos="9" YPos="71" Width="14" Height="14" />
+	<Image Name="AltProgressLeft" XPos="71" YPos="88" Width="8" Height="12" />
+	<Image Name="AltProgressMiddle" XPos="81" YPos="88" Width="8" Height="12" />
+	<Image Name="AltProgressRight" XPos="91" YPos="88" Width="8" Height="12" />
+	<Image Name="AltProgressQuarter" XPos="102" YPos="89" Width="3" Height="4" />
+	<Image Name="AltProgressHalf" XPos="109" YPos="89" Width="4" Height="5" />
+	<Image Name="AltProgressLight1" XPos="100" YPos="97" Width="4" Height="8" />
+	<Image Name="AltProgressLight2" XPos="106" YPos="97" Width="4" Height="8" />
+	<Image Name="AltProgressLight3" XPos="112" YPos="97" Width="4" Height="8" />
+	<Image Name="AltProgressLight4" XPos="118" YPos="97" Width="4" Height="8" />
+	<Image Name="AltProgressLight5" XPos="124" YPos="97" Width="4" Height="8" />
+	<Image Name="AltProgressLight6" XPos="130" YPos="97" Width="4" Height="8" />
+	<Image Name="AltProgressLight7" XPos="136" YPos="97" Width="4" Height="8" />
+	<Image Name="AltProgressLight8" XPos="142" YPos="97" Width="4" Height="8" />
+	<Image Name="AltProgressLight9" XPos="148" YPos="97" Width="4" Height="8" />
+	<Image Name="AltProgressLight10" XPos="154" YPos="97" Width="4" Height="8" />
+	<Image Name="CloseButtonNormal" XPos="41" YPos="128" Width="16" Height="16" />
+	<Image Name="CloseButtonHover" XPos="41" YPos="146" Width="16" Height="16" />
+	<Image Name="CloseButtonPressed" XPos="41" YPos="164" Width="16" Height="16" />
+	<Image Name="NewCloseButtonNormal" XPos="90" YPos="146" Width="10" Height="10" />
+	<Image Name="NewCloseButtonHover" XPos="90" YPos="146" Width="10" Height="10" />
+	<Image Name="NewCloseButtonPressed" XPos="90" YPos="146" Width="10" Height="10" />
+	<Image Name="MultiLineEditboxLeft" XPos="41" YPos="89" Width="6" Height="6" />
+	<Image Name="MultiLineEditboxRight" XPos="63" YPos="89" Width="6" Height="6" />
+	<Image Name="MultiLineEditboxTop" XPos="52" YPos="78" Width="6" Height="6" />
+	<Image Name="MultiLineEditboxBottom" XPos="52" YPos="100" Width="6" Height="6" />
+	<Image Name="MultiLineEditboxTopLeft" XPos="41" YPos="78" Width="6" Height="6" />
+	<Image Name="MultiLineEditboxTopRight" XPos="63" YPos="78" Width="6" Height="6" />
+	<Image Name="MultiLineEditboxBottomLeft" XPos="41" YPos="100" Width="6" Height="6" />
+	<Image Name="MultiLineEditboxBottomRight" XPos="63" YPos="100" Width="6" Height="6" />
+	<Image Name="MultiLineEditboxBackdrop" XPos="52" YPos="89" Width="6" Height="6" />
+	<Image Name="MultiLineEditboxSelectionBrush" XPos="9" YPos="71" Width="14" Height="14" />
+	<Image Name="MouseTarget" XPos="182" YPos="127" Width="17" Height="17" XOffset="-8" YOffset="-8" />
+	<Image Name="MouseArrow" XPos="138" YPos="127" Width="31" Height="25" XOffset="0" YOffset="0" />
+	<Image Name="MouseMoveCursor" XPos="201" YPos="127" Width="18" Height="18" XOffset="-8" YOffset="-8" />
+	<Image Name="MouseNoSoCursor" XPos="221" YPos="127" Width="8" Height="18" XOffset="-3" YOffset="-8" />
+	<Image Name="MouseEsWeCursor" XPos="182" YPos="150" Width="18" Height="8" XOffset="-8" YOffset="-3" />
+	<Image Name="MouseNeSwCursor" XPos="201" YPos="147" Width="14" Height="14" XOffset="-7" YOffset="-7" />
+	<Image Name="MouseNwSeCursor" XPos="230" YPos="126" Width="14" Height="14" XOffset="-7" YOffset="-7" />
+	<Image Name="MouseTextBar" XPos="173" YPos="127" Width="7" Height="18" XOffset="-2" YOffset="-9" />
+	<Image Name="TabHorizontalFiller" XPos="197" YPos="201" Width="7" Height="1" />
+	<Image Name="TabContentPaneUpperLeft" XPos="41" YPos="78" Width="7" Height="7" />
+	<Image Name="TabContentPaneUpper" XPos="52" YPos="78" Width="6" Height="7" />
+	<Image Name="TabContentPaneUpperRight" XPos="62" YPos="78" Width="7" Height="7" />
+	<Image Name="TabContentPaneLeft" XPos="41" YPos="89" Width="7" Height="6" />
+	<Image Name="TabContentPaneRight" XPos="62" YPos="89" Width="7" Height="6" />
+	<Image Name="TabContentPaneLower" XPos="52" YPos="99" Width="6" Height="7" />
+	<Image Name="TabContentPaneLowerLeft" XPos="41" YPos="99" Width="7" Height="7" />
+	<Image Name="TabContentPaneLowerRight" XPos="62" YPos="99" Width="7" Height="7" />
+	<Image Name="TabContentPaneMiddle" XPos="52" YPos="89" Width="6" Height="6" />
+	<Image Name="TabButtonScrollLeftNormal" XPos="97" YPos="108" Width="16" Height="17" />
+	<Image Name="TabButtonScrollRightNormal" XPos="112" YPos="108" Width="16" Height="17" />
+	<Image Name="TabButtonScrollLeftHover" XPos="127" YPos="108" Width="16" Height="17" />
+	<Image Name="TabButtonScrollRightHover" XPos="142" YPos="108" Width="16" Height="17" />
+	<Image Name="TabButtonLeftNormal" XPos="41" YPos="89" Width="7" Height="6" />
+	<Image Name="TabButtonRightNormal" XPos="62" YPos="89" Width="7" Height="6" />
+	<Image Name="TabButtonUpperNormal" XPos="52" YPos="78" Width="6" Height="7" />
+	<Image Name="TabButtonLowerNormal" XPos="52" YPos="99" Width="6" Height="7" />
+	<Image Name="TabButtonUpperLeftNormal" XPos="41" YPos="78" Width="7" Height="7" />
+	<Image Name="TabButtonUpperLeft2Normal" XPos="186" YPos="164" Width="7" Height="7" />
+	<Image Name="TabButtonUpperRightNormal" XPos="62" YPos="78" Width="7" Height="7" />
+	<Image Name="TabButtonLowerLeftNormal" XPos="41" YPos="99" Width="7" Height="7" />
+	<Image Name="TabButtonLowerRightNormal" XPos="62" YPos="99" Width="7" Height="7" />
+	<Image Name="TabButtonLowerRight2Normal" XPos="187" YPos="195" Width="7" Height="7" />
+	<Image Name="TabButtonMiddleNormal" XPos="52" YPos="89" Width="6" Height="6" />
+	<Image Name="TabButtonLeftSelected" XPos="41" YPos="89" Width="7" Height="6" />
+	<Image Name="TabButtonRightSelected" XPos="62" YPos="89" Width="7" Height="6" />
+	<Image Name="TabButtonUpperSelected" XPos="52" YPos="78" Width="6" Height="7" />
+	<Image Name="TabButtonLowerSelected" XPos="52" YPos="89" Width="6" Height="6" />
+	<Image Name="TabButtonUpperLeftSelected" XPos="41" YPos="78" Width="7" Height="7" />
+	<Image Name="TabButtonUpperRightSelected" XPos="62" YPos="78" Width="7" Height="7" />
+	<Image Name="TabButtonLowerLeftSelected" XPos="41" YPos="99" Width="7" Height="7" />
+	<Image Name="TabButtonLowerRightSelected" XPos="62" YPos="99" Width="7" Height="7" />
+	<Image Name="TabButtonMiddleSelected" XPos="52" YPos="89" Width="6" Height="6" />
+	<Image Name="TooltipTopLeft" XPos="61" YPos="160" Width="4" Height="4" />
+	<Image Name="TooltipTopRight" XPos="85" YPos="160" Width="5" Height="4" />
+	<Image Name="TooltipBottomLeft" XPos="61" YPos="184" Width="4" Height="5" />
+	<Image Name="TooltipBottomRight" XPos="85" YPos="184" Width="5" Height="5" />
+	<Image Name="TooltipLeftEdge" XPos="61" YPos="171" Width="4" Height="6" />
+	<Image Name="TooltipRightEdge" XPos="85" YPos="171" Width="5" Height="6" />
+	<Image Name="TooltipTopEdge" XPos="72" YPos="160" Width="6" Height="4" />
+	<Image Name="TooltipBottomEdge" XPos="72" YPos="184" Width="6" Height="5" />
+	<Image Name="TooltipMiddle" XPos="72" YPos="171" Width="6" Height="6" />
+	<Image Name="MenuTopLeft" XPos="166" YPos="204" Width="2" Height="2" />
+	<Image Name="MenuTopRight" XPos="175" YPos="204" Width="3" Height="2" />
+	<Image Name="MenuBottomLeft" XPos="166" YPos="213" Width="2" Height="3" />
+	<Image Name="MenuBottomRight" XPos="175" YPos="213" Width="3" Height="3" />
+	<Image Name="MenuLeft" XPos="166" YPos="209" Width="2" Height="1" />
+	<Image Name="MenuRight" XPos="175" YPos="209" Width="3" Height="1" />
+	<Image Name="MenuTop" XPos="171" YPos="204" Width="1" Height="2" />
+	<Image Name="MenuBottom" XPos="171" YPos="213" Width="1" Height="3" />
+	<Image Name="MenuMiddle" XPos="171" YPos="209" Width="1" Height="1" />
+	<Image Name="PopupMenuFrameTopLeft" XPos="186" YPos="204" Width="2" Height="2" />
+	<Image Name="PopupMenuFrameTopRight" XPos="195" YPos="204" Width="4" Height="2" />
+	<Image Name="PopupMenuFrameBottomLeft" XPos="186" YPos="213" Width="2" Height="4" />
+	<Image Name="PopupMenuFrameBottomRight" XPos="195" YPos="213" Width="4" Height="4" />
+	<Image Name="PopupMenuFrameLeft" XPos="186" YPos="209" Width="2" Height="1" />
+	<Image Name="PopupMenuFrameRight" XPos="195" YPos="209" Width="4" Height="1" />
+	<Image Name="PopupMenuFrameTop" XPos="191" YPos="204" Width="1" Height="2" />
+	<Image Name="PopupMenuFrameBottom" XPos="191" YPos="213" Width="1" Height="4" />
+	<Image Name="PopupMenuMiddle" XPos="191" YPos="209" Width="1" Height="1" />
+	<Image Name="PopupMenuArrowRight" XPos="179" YPos="204" Width="5" Height="5" />
+	<Image Name="PopupMenuArrowLeft" XPos="179" YPos="210" Width="5" Height="5" />
+</Imageset>
Index: code/trunk/Tutorial/Media/gui/TaharezLook.looknfeel
===================================================================
--- code/trunk/Tutorial/Media/gui/TaharezLook.looknfeel	(revision 44)
+++ code/trunk/Tutorial/Media/gui/TaharezLook.looknfeel	(revision 44)
@@ -0,0 +1,4315 @@
+<?xml version="1.0" ?>
+<Falagard>
+    <!--
+    ***************************************************
+        TaharezLook/Button
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/Button">
+        <PropertyDefinition name="NormalTextColour" initialValue="FFFFFFFF" redrawOnWrite="true" />
+        <PropertyDefinition name="HoverTextColour" initialValue="FFFFFFFF" redrawOnWrite="true" />
+        <PropertyDefinition name="PushedTextColour" initialValue="FFFFFFFF" redrawOnWrite="true" />
+        <PropertyDefinition name="DisabledTextColour" initialValue="FF7F7F7F" redrawOnWrite="true" />
+        <PropertyDefinition name="VertLabelFormatting" initialValue="CentreAligned" />
+        <PropertyDefinition name="HorzLabelFormatting" initialValue="CentreAligned" />
+        <PropertyDefinition name="NormalImage" initialValue="" redrawOnWrite="true" />
+        <PropertyDefinition name="HoverImage" initialValue="" redrawOnWrite="true" />
+        <PropertyDefinition name="PushedImage" initialValue="" redrawOnWrite="true" />
+        <PropertyDefinition name="DisabledImage" initialValue="" redrawOnWrite="true" />
+        <PropertyDefinition name="VertImageFormatting" initialValue="Stretched" redrawOnWrite="true" />
+        <PropertyDefinition name="HorzImageFormatting" initialValue="Stretched" redrawOnWrite="true" />
+        <ImagerySection name="label">
+            <TextComponent>
+                <Area>
+                    <Dim type="LeftEdge"><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge"><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width"><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height"><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <VertFormatProperty name="VertLabelFormatting" />
+                <HorzFormatProperty name="HorzLabelFormatting" />
+            </TextComponent>
+        </ImagerySection>
+        <ImagerySection name="normal">
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge"><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge"><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width"><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height"><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image type="LeftEdge" imageset="TaharezLook" image="ButtonLeftNormal" />
+                <Image type="RightEdge" imageset="TaharezLook" image="ButtonRightNormal" />
+                <Image type="Background" imageset="TaharezLook" image="ButtonMiddleNormal" />
+            </FrameComponent>
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <ImageProperty name="NormalImage" />
+                <VertFormatProperty name="VertImageFormatting" />
+                <HorzFormatProperty name="HorzImageFormatting" />
+            </ImageryComponent>
+        </ImagerySection>
+        <ImagerySection name="hover">
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image type="LeftEdge" imageset="TaharezLook" image="ButtonLeftHighlight" />
+                <Image type="RightEdge" imageset="TaharezLook" image="ButtonRightHighlight" />
+                <Image type="Background" imageset="TaharezLook" image="ButtonMiddleHighlight" />
+            </FrameComponent>
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <ImageProperty name="HoverImage" />
+                <VertFormatProperty name="VertImageFormatting" />
+                <HorzFormatProperty name="HorzImageFormatting" />
+            </ImageryComponent>
+        </ImagerySection>
+        <ImagerySection name="pushed">
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image type="LeftEdge" imageset="TaharezLook" image="ButtonLeftPushed" />
+                <Image type="RightEdge" imageset="TaharezLook" image="ButtonRightPushed" />
+                <Image type="Background" imageset="TaharezLook" image="ButtonMiddlePushed" />
+            </FrameComponent>
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <ImageProperty name="PushedImage" />
+                <VertFormatProperty name="VertImageFormatting" />
+                <HorzFormatProperty name="HorzImageFormatting" />
+            </ImageryComponent>
+        </ImagerySection>
+        <StateImagery name="Normal">
+            <Layer>
+                <Section section="normal" />
+                <Section section="label">
+                    <ColourProperty name="NormalTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Hover">
+            <Layer>
+                <Section section="hover" />
+                <Section section="label">
+                    <ColourProperty name="HoverTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Pushed">
+            <Layer>
+                <Section section="pushed" />
+                <Section section="label">
+                    <ColourProperty name="PushedTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="PushedOff">
+            <Layer>
+                <Section section="hover" />
+                <Section section="label">
+                    <ColourProperty name="HoverTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Disabled">
+            <Layer>
+                <Section section="normal">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+                <Section section="label">
+                    <ColourProperty name="DisabledTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/RadioButton
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/RadioButton">
+		<PropertyDefinition name="NormalTextColour" initialValue="FFFFFFFF" redrawOnWrite="true" />
+        <PropertyDefinition name="HoverTextColour" initialValue="FFFFFFFF" redrawOnWrite="true" />
+        <PropertyDefinition name="PushedTextColour" initialValue="FFFFFFFF" redrawOnWrite="true" />
+        <PropertyDefinition name="DisabledTextColour" initialValue="FF7F7F7F" redrawOnWrite="true" />
+        <ImagerySection name="label">
+            <TextComponent>
+                <Area>
+                    <Dim type="LeftEdge" >
+                        <ImageDim imageset="TaharezLook" image="RadioButtonNormal" dimension="Width">
+                            <DimOperator op="Add">
+                                <AbsoluteDim value="3" />
+                            </DimOperator>
+                        </ImageDim>
+                    </Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="RightEdge" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <VertFormat type="CentreAligned" />
+                <HorzFormat type="LeftAligned" />
+            </TextComponent>
+        </ImagerySection>
+        <ImagerySection name="normal">
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="RadioButtonNormal" />
+                <VertFormat type="CentreAligned" />
+                <HorzFormat type="LeftAligned" />
+            </ImageryComponent>
+        </ImagerySection>
+        <ImagerySection name="hover">
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="RadioButtonHover" />
+                <VertFormat type="CentreAligned" />
+                <HorzFormat type="LeftAligned" />
+            </ImageryComponent>
+        </ImagerySection>
+        <ImagerySection name="select_mark">
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="RadioButtonMark" />
+                <VertFormat type="CentreAligned" />
+                <HorzFormat type="LeftAligned" />
+            </ImageryComponent>
+        </ImagerySection>
+        <StateImagery name="Normal">
+            <Layer>
+                <Section section="normal" />
+                <Section section="label">
+                    <ColourProperty name="NormalTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Hover">
+            <Layer>
+                <Section section="hover" />
+                <Section section="label">
+                    <ColourProperty name="HoverTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Disabled">
+            <Layer>
+                <Section section="normal">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+                <Section section="label">
+                    <ColourProperty name="DisabledTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="SelectedNormal">
+            <Layer>
+                <Section section="normal" />
+                <Section section="select_mark" />
+                <Section section="label">
+                    <ColourProperty name="NormalTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="SelectedHover">
+            <Layer>
+                <Section section="hover" />
+                <Section section="select_mark" />
+                <Section section="label">
+                    <ColourProperty name="HoverTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="SelectedDisabled">
+            <Layer>
+                <Section section="normal">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+                <Section section="select_mark">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+                <Section section="label">
+                    <ColourProperty name="DisabledTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/Checkbox
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/Checkbox">
+		<PropertyDefinition name="NormalTextColour" initialValue="FFFFFFFF" redrawOnWrite="true" />
+        <PropertyDefinition name="HoverTextColour" initialValue="FFFFFFFF" redrawOnWrite="true" />
+        <PropertyDefinition name="PushedTextColour" initialValue="FFFFFFFF" redrawOnWrite="true" />
+        <PropertyDefinition name="DisabledTextColour" initialValue="FF7F7F7F" redrawOnWrite="true" />
+        <ImagerySection name="label">
+            <TextComponent>
+                <Area>
+                    <Dim type="LeftEdge" >
+                        <ImageDim imageset="TaharezLook" image="CheckboxNormal" dimension="Width">
+                            <DimOperator op="Add">
+                                <AbsoluteDim value="3" />
+                            </DimOperator>
+                        </ImageDim>
+                    </Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="RightEdge" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <VertFormat type="CentreAligned" />
+                <HorzFormat type="LeftAligned" />
+            </TextComponent>
+        </ImagerySection>
+        <ImagerySection name="normal">
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="CheckboxNormal" />
+                <VertFormat type="CentreAligned" />
+                <HorzFormat type="LeftAligned" />
+            </ImageryComponent>
+        </ImagerySection>
+        <ImagerySection name="hover">
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="CheckboxHover" />
+                <VertFormat type="CentreAligned" />
+                <HorzFormat type="LeftAligned" />
+            </ImageryComponent>
+        </ImagerySection>
+        <ImagerySection name="select_mark">
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="CheckboxMark" />
+                <VertFormat type="CentreAligned" />
+                <HorzFormat type="LeftAligned" />
+            </ImageryComponent>
+        </ImagerySection>
+        <StateImagery name="Normal">
+            <Layer>
+                <Section section="normal" />
+                <Section section="label">
+                    <ColourProperty name="NormalTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Hover">
+            <Layer>
+                <Section section="hover" />
+                <Section section="label">
+                    <ColourProperty name="HoverTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Disabled">
+            <Layer>
+                <Section section="normal">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+                <Section section="label">
+                    <ColourProperty name="DisabledTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="SelectedNormal">
+            <Layer>
+                <Section section="normal" />
+                <Section section="select_mark" />
+                <Section section="label">
+                    <ColourProperty name="NormalTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="SelectedHover">
+            <Layer>
+                <Section section="hover" />
+                <Section section="select_mark" />
+                <Section section="label">
+                    <ColourProperty name="HoverTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="SelectedDisabled">
+            <Layer>
+                <Section section="normal">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+                <Section section="select_mark">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+                <Section section="label">
+                    <ColourProperty name="DisabledTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/Editbox
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/Editbox">
+        <PropertyDefinition name="NormalTextColour" initialValue="FFFFFFFF" redrawOnWrite="true" />
+        <PropertyDefinition name="SelectedTextColour" initialValue="FF000000" redrawOnWrite="true" />
+        <PropertyDefinition name="ActiveSelectionColour" initialValue="FF607FFF" redrawOnWrite="true" />
+        <PropertyDefinition name="InactiveSelectionColour" initialValue="FF808080" redrawOnWrite="true" />
+        <Property name="MouseCursorImage" value="set:TaharezLook image:MouseTextBar" />
+        <NamedArea name="TextArea">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="5" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="5" /></Dim>
+                <Dim type="RightEdge" ><UnifiedDim scale="1.0" offset="-5" type="RightEdge" /></Dim>
+                <Dim type="BottomEdge" ><UnifiedDim scale="1.0" offset="-5" type="BottomEdge" /></Dim>
+            </Area>
+        </NamedArea>
+        <ImagerySection name="container_normal">
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image type="LeftEdge" imageset="TaharezLook" image="EditBoxLeft" />
+                <Image type="RightEdge" imageset="TaharezLook" image="EditBoxRight" />
+                <Image type="Background" imageset="TaharezLook" image="EditBoxMiddle" />
+            </FrameComponent>
+        </ImagerySection>
+        <ImagerySection name="selection">
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="RightEdge" ><UnifiedDim scale="1.0" type="RightEdge" /></Dim>
+                    <Dim type="BottomEdge" ><UnifiedDim scale="1.0" type="BottomEdge" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="TextSelectionBrush" />
+                <VertFormat type="Stretched" />
+                <HorzFormat type="Stretched" />
+            </ImageryComponent>
+        </ImagerySection>
+        <ImagerySection name="Carat">
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><ImageDim imageset="TaharezLook" image="EditBoxCarat" dimension="Width" /></Dim>
+                    <Dim type="BottomEdge" ><UnifiedDim scale="1.0" type="BottomEdge" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="EditBoxCarat" />
+                <VertFormat type="Stretched" />
+                <HorzFormat type="Stretched" />
+            </ImageryComponent>
+        </ImagerySection>
+        <StateImagery name="Enabled">
+            <Layer>
+                <Section section="container_normal" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="ReadOnly">
+            <Layer>
+                <Section section="container_normal" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Disabled">
+            <Layer>
+                <Section section="container_normal">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="ActiveSelection">
+            <Layer>
+                <Section section="selection">
+                    <ColourProperty name="ActiveSelectionColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="InactiveSelection">
+            <Layer>
+                <Section section="selection">
+                    <ColourProperty name="InactiveSelectionColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/Titlebar
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/Titlebar">
+        <PropertyDefinition name="CaptionColour" initialValue="FFFFFFFF" redrawOnWrite="true" />
+        <ImagerySection name="main">
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1.0" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1.0" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="NewTitlebarLeft" />
+                <VertFormat type="Stretched" />
+            </ImageryComponent>
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="RightEdge" >
+                        <UnifiedDim scale="1" type="RightEdge">
+                            <DimOperator op="Subtract">
+                                <ImageDim imageset="TaharezLook" image="SysAreaRight" dimension="Width">
+                                    <DimOperator op="Add">
+                                        <ImageDim imageset="TaharezLook" image="SysAreaMiddle" dimension="Width" />
+                                    </DimOperator>
+                                </ImageDim>
+                            </DimOperator>
+                        </UnifiedDim>
+                    </Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1.0" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="NewTitlebarRight" />
+                <VertFormat type="Stretched" />
+                <HorzFormat type="RightAligned" />
+            </ImageryComponent>
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="RightEdge" >
+                        <UnifiedDim scale="1" type="RightEdge">
+                            <DimOperator op="Subtract">
+                                <ImageDim imageset="TaharezLook" image="SysAreaRight" dimension="Width" />
+                            </DimOperator>
+                        </UnifiedDim>
+                    </Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1.0" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="SysAreaMiddle" />
+                <VertFormat type="Stretched" />
+                <HorzFormat type="RightAligned" />
+            </ImageryComponent>
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1.0" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1.0" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="SysAreaRight" />
+                <VertFormat type="Stretched" />
+                <HorzFormat type="RightAligned" />
+            </ImageryComponent>
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="NewTitlebarLeft" dimension="Width" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="RightEdge" >
+                        <UnifiedDim scale="1" type="RightEdge">
+                            <DimOperator op="Subtract">
+                                <ImageDim imageset="TaharezLook" image="SysAreaRight" dimension="Width">
+                                    <DimOperator op="Add">
+                                        <ImageDim imageset="TaharezLook" image="SysAreaMiddle" dimension="Width">
+                                            <DimOperator op="Add">
+                                                <ImageDim imageset="TaharezLook" image="NewTitlebarRight" dimension="Width" />
+                                            </DimOperator>
+                                        </ImageDim>
+                                    </DimOperator>
+                                </ImageDim>
+                            </DimOperator>
+                        </UnifiedDim>
+                    </Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1.0" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="NewTitlebarMiddle" />
+                <VertFormat type="Stretched" />
+                <HorzFormat type="Stretched" />
+            </ImageryComponent>
+        </ImagerySection>
+        <ImagerySection name="caption">
+            <TextComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="NewTitlebarLeft" dimension="Width" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" offset="-75" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <ColourProperty name="CaptionColour" />
+                <VertFormat type="CentreAligned" />
+            </TextComponent>
+        </ImagerySection>
+        <StateImagery name="Active">
+            <Layer>
+                <Section section="main" />
+                <Section section="caption" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Inactive">
+            <Layer>
+                <Section section="main" />
+                <Section section="caption" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Disabled">
+            <Layer>
+                <Section section="main">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+                <Section section="caption">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+            </Layer>
+        </StateImagery>
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/FrameWindow
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/FrameWindow">
+        <PropertyLinkDefinition name="CaptionColour" widget="__auto_titlebar__" targetProperty="CaptionColour" initialValue="FFFFFFFF" />
+        <PropertyLinkDefinition name="TitlebarFont" widget="__auto_titlebar__" targetProperty="Font" />
+        <Property name="NSSizingCursorImage" value="set:TaharezLook image:MouseNoSoCursor" />
+        <Property name="EWSizingCursorImage" value="set:TaharezLook image:MouseEsWeCursor" />
+        <Property name="NWSESizingCursorImage" value="set:TaharezLook image:MouseNwSeCursor" />
+        <Property name="NESWSizingCursorImage" value="set:TaharezLook image:MouseNeSwCursor" />
+        <NamedArea name="ClientWithTitleWithFrame">
+            <Area>
+                <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="WindowTopLeft" dimension="Width" /></Dim>
+                <Dim type="TopEdge" ><WidgetDim widget="__auto_titlebar__" dimension="BottomEdge" /></Dim>
+                <Dim type="RightEdge" >
+                    <UnifiedDim scale="1" type="RightEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="WindowTopRight" dimension="Width" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="BottomEdge" >
+                    <UnifiedDim scale="1" type="BottomEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="WindowBottomEdge" dimension="Height" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+        </NamedArea>
+        <NamedArea name="ClientWithTitleNoFrame">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><WidgetDim widget="__auto_titlebar__" dimension="BottomEdge" /></Dim>
+                <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                <Dim type="BottomEdge" ><WidgetDim dimension="BottomEdge" /></Dim>
+            </Area>
+        </NamedArea>
+        <NamedArea name="ClientNoTitleWithFrame">
+            <Area>
+                <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="WindowTopLeft" dimension="Width" /></Dim>
+                <Dim type="TopEdge" ><ImageDim imageset="TaharezLook" image="WindowTopEdge" dimension="Height" /></Dim>
+                <Dim type="RightEdge" >
+                    <UnifiedDim scale="1" type="RightEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="WindowTopRight" dimension="Width" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="BottomEdge" >
+                    <UnifiedDim scale="1" type="BottomEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="WindowBottomEdge" dimension="Height" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+        </NamedArea>
+        <NamedArea name="ClientNoTitleNoFrame">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+            </Area>
+        </NamedArea>
+        <Child type="TaharezLook/Titlebar" nameSuffix="__auto_titlebar__">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                <Dim type="Height" ><FontDim type="LineSpacing" padding="8" /></Dim>
+            </Area>
+            <Property name="AlwaysOnTop" value="False" />
+        </Child>
+        <Child type="TaharezLook/SystemButton" nameSuffix="__auto_closebutton__">
+            <Area>
+                <Dim type="LeftEdge" >
+                    <UnifiedDim scale="1" type="LeftEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="SysAreaRight" dimension="Width">
+                                <DimOperator op="Add">
+                                    <ImageDim imageset="TaharezLook" image="SysAreaMiddle" dimension="Width" />
+                                </DimOperator>
+                            </ImageDim>
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="TopEdge" >
+                    <AbsoluteDim value="0.5">
+                        <DimOperator op="Multiply">
+                            <WidgetDim widget="__auto_titlebar__" dimension="Height">
+                                <DimOperator op="Subtract">
+                                    <ImageDim imageset="TaharezLook" image="NewCloseButtonNormal" dimension="Width" />
+                                </DimOperator>
+                            </WidgetDim>
+                        </DimOperator>
+                    </AbsoluteDim>
+                </Dim>
+                <Dim type="Width" ><ImageDim imageset="TaharezLook" image="NewCloseButtonNormal" dimension="Width" /></Dim>
+                <Dim type="Height" ><ImageDim imageset="TaharezLook" image="NewCloseButtonNormal" dimension="Width" /></Dim>
+            </Area>
+            <Property name="AlwaysOnTop" value="True" />
+            <Property name="NormalImage" value="set:TaharezLook image:NewCloseButtonNormal" />
+            <Property name="HoverImage" value="set:TaharezLook image:NewCloseButtonHover" />
+            <Property name="PushedImage" value="set:TaharezLook image:NewCloseButtonPressed" />
+        </Child>
+        <ImagerySection name="withtitle_frame">
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><WidgetDim widget="__auto_titlebar__" dimension="BottomEdge" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="BottomEdge" ><UnifiedDim scale="1" type="BottomEdge" /></Dim>
+                </Area>
+                <Image type="BottomLeftCorner" imageset="TaharezLook" image="WindowBottomLeft" />
+                <Image type="BottomRightCorner" imageset="TaharezLook" image="WindowBottomRight" />
+                <Image type="LeftEdge" imageset="TaharezLook" image="WindowLeftEdge" />
+                <Image type="RightEdge" imageset="TaharezLook" image="WindowRightEdge" />
+                <Image type="BottomEdge" imageset="TaharezLook" image="WindowBottomEdge" />
+                <Image type="Background" imageset="TaharezLook" image="ClientBrush" />
+                <VertFormat type="Tiled" />
+                <HorzFormat type="Tiled" />
+            </FrameComponent>
+        </ImagerySection>
+        <ImagerySection name="notitle_frame">
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image type="TopLeftCorner" imageset="TaharezLook" image="WindowTopLeft" />
+                <Image type="TopRightCorner" imageset="TaharezLook" image="WindowTopRight" />
+                <Image type="BottomLeftCorner" imageset="TaharezLook" image="WindowBottomLeft" />
+                <Image type="BottomRightCorner" imageset="TaharezLook" image="WindowBottomRight" />
+                <Image type="LeftEdge" imageset="TaharezLook" image="WindowLeftEdge" />
+                <Image type="RightEdge" imageset="TaharezLook" image="WindowRightEdge" />
+                <Image type="BottomEdge" imageset="TaharezLook" image="WindowBottomEdge" />
+                <Image type="Background" imageset="TaharezLook" image="ClientBrush" />
+                <VertFormat type="Tiled" />
+                <HorzFormat type="Tiled" />
+            </FrameComponent>
+        </ImagerySection>
+        <ImagerySection name="withtitle_noframe_client_area">
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><WidgetDim widget="__auto_titlebar__" dimension="Height" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="BottomEdge" ><UnifiedDim scale="1" type="BottomEdge" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="ClientBrush" />
+                <VertFormat type="Tiled" />
+                <HorzFormat type="Tiled" />
+            </ImageryComponent>
+        </ImagerySection>
+        <ImagerySection name="notitle_noframe_client_area">
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="ClientBrush" />
+                <VertFormat type="Tiled" />
+                <HorzFormat type="Tiled" />
+            </ImageryComponent>
+        </ImagerySection>
+        <StateImagery name="ActiveWithTitleWithFrame">
+            <Layer>
+                <Section section="withtitle_frame" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="InactiveWithTitleWithFrame">
+            <Layer>
+                <Section section="withtitle_frame" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="DisabledWithTitleWithFrame">
+            <Layer>
+                <Section section="withtitle_frame">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="ActiveWithTitleNoFrame">
+            <Layer>
+                <Section section="withtitle_noframe_client_area" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="InactiveWithTitleNoFrame">
+            <Layer>
+                <Section section="withtitle_noframe_client_area" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="DisabledWithTitleNoFrame">
+            <Layer>
+                <Section section="withtitle_noframe_client_area">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="ActiveNoTitleWithFrame">
+            <Layer>
+                <Section section="notitle_frame" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="InactiveNoTitleWithFrame">
+            <Layer>
+                <Section section="notitle_frame" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="DisabledNoTitleWithFrame">
+            <Layer>
+                <Section section="notitle_frame">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="ActiveNoTitleNoFrame">
+            <Layer>
+                <Section section="notitle_noframe_client_area" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="InactiveNoTitleNoFrame">
+            <Layer>
+                <Section section="notitle_noframe_client_area" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="DisabledNoTitleNoFrame">
+            <Layer>
+                <Section section="notitle_noframe_client_area">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+            </Layer>
+        </StateImagery>
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/ProgressBar
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/ProgressBar">
+        <NamedArea name="ProgressArea">
+            <Area>
+                <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="ProgressBarLeft" dimension="Width" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="RightEdge" >
+                    <UnifiedDim scale="1" type="RightEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="ProgressBarRight" dimension="Width" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+            </Area>
+        </NamedArea>
+        <ImagerySection name="frame">
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image type="LeftEdge" imageset="TaharezLook" image="ProgressBarLeft" />
+                <Image type="RightEdge" imageset="TaharezLook" image="ProgressBarRight" />
+                <Image type="Background" imageset="TaharezLook" image="ProgressBarMiddle" />
+            </FrameComponent>
+        </ImagerySection>
+        <ImagerySection name="progress_lights" >
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="ProgressBarLitSegment" />
+                <VertFormat type="Stretched" />
+                <HorzFormat type="Tiled" />
+            </ImageryComponent>
+        </ImagerySection>
+        <StateImagery name="Enabled">
+            <Layer>
+                <Section section="frame" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Disabled">
+            <Layer>
+                <Section section="frame">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="EnabledProgress">
+            <Layer>
+                <Section section="progress_lights" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="DisabledProgress">
+            <Layer>
+                <Section section="progress_lights">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+            </Layer>
+        </StateImagery>
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/AlternateProgressBar
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/AltProgressBar">
+        <NamedArea name="ProgressArea">
+            <Area>
+                <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="AltProgressLeft" dimension="Width" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="2" /></Dim>
+                <Dim type="RightEdge" >
+                    <UnifiedDim scale="1" type="RightEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="AltProgressRight" dimension="Width" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="Height" ><UnifiedDim scale="1" offset="-4" type="Height" /></Dim>
+            </Area>
+        </NamedArea>
+        <ImagerySection name="frame">
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image type="LeftEdge" imageset="TaharezLook" image="AltProgressLeft" />
+                <Image type="RightEdge" imageset="TaharezLook" image="AltProgressRight" />
+                <Image type="Background" imageset="TaharezLook" image="AltProgressMiddle" />
+            </FrameComponent>
+        </ImagerySection>
+        <ImagerySection name="progress_lights" >
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><UnifiedDim scale="0" type="LeftEdge" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="0.1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="AltProgressLight1" />
+                <VertFormat type="Stretched" />
+                <HorzFormat type="Tiled" />
+            </ImageryComponent>
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><UnifiedDim scale="0.1" type="LeftEdge" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="0.1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="AltProgressLight2" />
+                <VertFormat type="Stretched" />
+                <HorzFormat type="Tiled" />
+            </ImageryComponent>
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><UnifiedDim scale="0.2" type="LeftEdge" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="0.1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="AltProgressLight3" />
+                <VertFormat type="Stretched" />
+                <HorzFormat type="Tiled" />
+            </ImageryComponent>
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><UnifiedDim scale="0.3" type="LeftEdge" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="0.1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="AltProgressLight4" />
+                <VertFormat type="Stretched" />
+                <HorzFormat type="Tiled" />
+            </ImageryComponent>
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><UnifiedDim scale="0.4" type="LeftEdge" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="0.1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="AltProgressLight5" />
+                <VertFormat type="Stretched" />
+                <HorzFormat type="Tiled" />
+            </ImageryComponent>
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><UnifiedDim scale="0.5" type="LeftEdge" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="0.1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="AltProgressLight6" />
+                <VertFormat type="Stretched" />
+                <HorzFormat type="Tiled" />
+            </ImageryComponent>
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><UnifiedDim scale="0.6" type="LeftEdge" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="0.1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="AltProgressLight7" />
+                <VertFormat type="Stretched" />
+                <HorzFormat type="Tiled" />
+            </ImageryComponent>
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><UnifiedDim scale="0.7" type="LeftEdge" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="0.1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="AltProgressLight8" />
+                <VertFormat type="Stretched" />
+                <HorzFormat type="Tiled" />
+            </ImageryComponent>
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><UnifiedDim scale="0.8" type="LeftEdge" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="0.1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="AltProgressLight9" />
+                <VertFormat type="Stretched" />
+                <HorzFormat type="Tiled" />
+            </ImageryComponent>
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><UnifiedDim scale="0.9" type="LeftEdge" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="0.1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="AltProgressLight10" />
+                <VertFormat type="Stretched" />
+                <HorzFormat type="Tiled" />
+            </ImageryComponent>
+        </ImagerySection>
+        <StateImagery name="Enabled">
+            <Layer>
+                <Section section="frame" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Disabled">
+            <Layer>
+                <Section section="frame">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="EnabledProgress">
+            <Layer>
+                <Section section="progress_lights" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="DisabledProgress">
+            <Layer>
+                <Section section="progress_lights">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+            </Layer>
+        </StateImagery>
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/VUMeter (progress bar)
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/VUMeter">
+        <Property name="VerticalProgress" value="True" />
+        <NamedArea name="ProgressArea">
+            <Area>
+                <Dim type="LeftEdge" ><UnifiedDim scale="0" type="LeftEdge" /></Dim>
+                <Dim type="TopEdge" ><UnifiedDim scale="0" type="TopEdge" /></Dim>
+                <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+            </Area>
+        </NamedArea>
+        <ImagerySection name="progress_lights" >
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><UnifiedDim scale="0" type="LeftEdge" /></Dim>
+                    <Dim type="TopEdge" ><UnifiedDim scale="0.5" type="TopEdge" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="0.5" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="TextSelectionBrush" />
+                <Colours topLeft="FF00FF00" topRight="FF00FF00" bottomLeft="FF00FF00" bottomRight="FF00FF00" />
+                <VertFormat type="Tiled" />
+                <HorzFormat type="Stretched" />
+            </ImageryComponent>
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><UnifiedDim scale="0" type="LeftEdge" /></Dim>
+                    <Dim type="TopEdge" ><UnifiedDim scale="0.2" type="TopEdge" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="0.3" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="TextSelectionBrush" />
+                <Colours topLeft="FFFFFF00" topRight="FFFFFF00" bottomLeft="FFFFFF00" bottomRight="FFFFFF00" />
+                <VertFormat type="Tiled" />
+                <HorzFormat type="Stretched" />
+            </ImageryComponent>
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><UnifiedDim scale="0" type="LeftEdge" /></Dim>
+                    <Dim type="TopEdge" ><UnifiedDim scale="0" type="TopEdge" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="0.2" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="TextSelectionBrush" />
+                <Colours topLeft="FFFF0000" topRight="FFFF0000" bottomLeft="FFFF0000" bottomRight="FFFF0000" />
+                <VertFormat type="Tiled" />
+                <HorzFormat type="Stretched" />
+            </ImageryComponent>
+        </ImagerySection>
+        <StateImagery name="Enabled">
+        </StateImagery>
+        <StateImagery name="Disabled">
+        </StateImagery>
+        <StateImagery name="EnabledProgress">
+            <Layer>
+                <Section section="progress_lights" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="DisabledProgress">
+            <Layer>
+                <Section section="progress_lights">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+            </Layer>
+        </StateImagery>
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/SliderThumb
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/SliderThumb">
+        <Property name="VertFree" value="True" />
+        <ImagerySection name="normal">
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1.0" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1.0" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="VertSliderThumbNormal" />
+                <VertFormat type="Stretched" />
+                <HorzFormat type="Stretched" />
+            </ImageryComponent>
+        </ImagerySection>
+        <ImagerySection name="hover">
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1.0" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1.0" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="VertSliderThumbHover" />
+                <VertFormat type="Stretched" />
+                <HorzFormat type="Stretched" />
+            </ImageryComponent>
+        </ImagerySection>
+        <StateImagery name="Normal">
+            <Layer>
+                <Section section="normal" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Hover">
+            <Layer>
+                <Section section="hover" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Pushed">
+            <Layer>
+                <Section section="hover" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Disabled">
+            <Layer>
+                <Section section="normal">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+            </Layer>
+        </StateImagery>
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/Slider
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/Slider">
+        <Property name="VerticalSlider" value="True" />
+        <Property name="MouseButtonDownAutoRepeat" value="True" />
+        <Property name="WantsMultiClickEvents" value="False" />
+        <NamedArea name="ThumbTrackArea">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="RightEdge" ><UnifiedDim scale="1.0" type="RightEdge" /></Dim>
+                <Dim type="BottomEdge" ><UnifiedDim scale="1.0" type="BottomEdge" /></Dim>
+            </Area>
+        </NamedArea>
+        <Child  type="TaharezLook/SliderThumb" nameSuffix="__auto_thumb__">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="Width" ><UnifiedDim scale="1.0" type="Width" /></Dim>
+                <Dim type="Height" ><ImageDim imageset="TaharezLook" image="VertSliderThumbNormal" dimension="Height" /></Dim>
+            </Area>
+        </Child>
+        <ImagerySection name="main">
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="3" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1.0" offset="-6" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1.0" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="VertSliderBody" />
+                <VertFormat type="Stretched" />
+                <HorzFormat type="Stretched" />
+            </ImageryComponent>
+        </ImagerySection>
+        <StateImagery name="Enabled">
+            <Layer>
+                <Section section="main" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Disabled">
+            <Layer>
+                <Section section="main">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+            </Layer>
+        </StateImagery>
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/HorizontalScrollbarThumb
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/HorizontalScrollbarThumb">
+        <Property name="HorzFree" value="True" />
+        <ImagerySection name="normal">
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1.0" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1.0" type="Height" /></Dim>
+                </Area>
+                <Image type="LeftEdge" imageset="TaharezLook" image="MiniHorzScrollThumbLeftNormal" />
+                <Image type="RightEdge" imageset="TaharezLook" image="MiniHorzScrollThumbRightNormal" />
+                <Image type="Background" imageset="TaharezLook" image="MiniHorzScrollThumbMiddleNormal" />
+            </FrameComponent>
+        </ImagerySection>
+        <ImagerySection name="hover">
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1.0" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1.0" type="Height" /></Dim>
+                </Area>
+                <Image type="LeftEdge" imageset="TaharezLook" image="MiniHorzScrollThumbLeftHover" />
+                <Image type="RightEdge" imageset="TaharezLook" image="MiniHorzScrollThumbRightHover" />
+                <Image type="Background" imageset="TaharezLook" image="MiniHorzScrollThumbMiddleHover" />
+            </FrameComponent>
+        </ImagerySection>
+        <StateImagery name="Normal">
+            <Layer>
+                <Section section="normal" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Hover">
+            <Layer>
+                <Section section="hover" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Pushed">
+            <Layer>
+                <Section section="normal" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Disabled">
+            <Layer>
+                <Section section="normal">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+            </Layer>
+        </StateImagery>
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/HorizontalScrollbar
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/HorizontalScrollbar">
+        <NamedArea name="ThumbTrackArea">
+            <Area>
+                <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="MiniHorzScrollLeftNormal" dimension="Width" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="RightEdge" >
+                    <UnifiedDim scale="1.0" type="RightEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="MiniHorzScrollRightNormal" dimension="Width" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="BottomEdge" ><UnifiedDim scale="1.0" type="BottomEdge" /></Dim>
+            </Area>
+        </NamedArea>
+        <Child  type="TaharezLook/ImageButton" nameSuffix="__auto_incbtn__">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="Width" ><ImageDim imageset="TaharezLook" image="MiniHorzScrollRightNormal" dimension="Width" /></Dim>
+                <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+            </Area>
+            <HorzAlignment type="RightAligned" />
+            <Property name="NormalImage" value="set:TaharezLook image:MiniHorzScrollRightNormal" />
+            <Property name="HoverImage" value="set:TaharezLook image:MiniHorzScrollRightHover" />
+            <Property name="PushedImage" value="set:TaharezLook image:MiniHorzScrollRightNormal" />
+        </Child>
+        <Child  type="TaharezLook/ImageButton" nameSuffix="__auto_decbtn__">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="Width" ><ImageDim imageset="TaharezLook" image="MiniHorzScrollLeftNormal" dimension="Width" /></Dim>
+                <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+            </Area>
+            <Property name="NormalImage" value="set:TaharezLook image:MiniHorzScrollLeftNormal" />
+            <Property name="HoverImage" value="set:TaharezLook image:MiniHorzScrollLeftHover" />
+            <Property name="PushedImage" value="set:TaharezLook image:MiniHorzScrollLeftNormal" />
+        </Child>
+        <Child  type="TaharezLook/HorizontalScrollbarThumb" nameSuffix="__auto_thumb__">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="Width" ><UnifiedDim scale="0.1" type="Width" /></Dim>
+                <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+            </Area>
+            <Property name="UnifiedMinSize" value="{{0,25},{0,0}}" />
+        </Child>
+        <ImagerySection name="main">
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="MiniHorzScrollLeftNormal" dimension="Width" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="RightEdge" >
+                        <UnifiedDim scale="1.0" type="RightEdge">
+                            <DimOperator op="Subtract">
+                                <ImageDim imageset="TaharezLook" image="MiniHorzScrollRightNormal" dimension="Width" />
+                            </DimOperator>
+                        </UnifiedDim>
+                    </Dim>
+                    <Dim type="BottomEdge" ><UnifiedDim scale="1.0" type="BottomEdge" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="MiniHorzScrollBarSegment" />
+                <VertFormat type="CentreAligned" />
+                <HorzFormat type="Stretched" />
+            </ImageryComponent>
+        </ImagerySection>
+        <StateImagery name="Enabled">
+            <Layer>
+                <Section section="main" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Disabled">
+            <Layer>
+                <Section section="main">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+            </Layer>
+        </StateImagery>
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/VerticalScrollbarThumb
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/VerticalScrollbarThumb">
+        <Property name="VertFree" value="True" />
+        <ImagerySection name="normal">
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1.0" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1.0" type="Height" /></Dim>
+                </Area>
+                <Image type="TopEdge" imageset="TaharezLook" image="MiniVertScrollThumbTopNormal" />
+                <Image type="BottomEdge" imageset="TaharezLook" image="MiniVertScrollThumbBottomNormal" />
+                <Image type="Background" imageset="TaharezLook" image="MiniVertScrollThumbMiddleNormal" />
+            </FrameComponent>
+        </ImagerySection>
+        <ImagerySection name="hover">
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1.0" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1.0" type="Height" /></Dim>
+                </Area>
+                <Image type="TopEdge" imageset="TaharezLook" image="MiniVertScrollThumbTopHover" />
+                <Image type="BottomEdge" imageset="TaharezLook" image="MiniVertScrollThumbBottomHover" />
+                <Image type="Background" imageset="TaharezLook" image="MiniVertScrollThumbMiddleHover" />
+            </FrameComponent>
+        </ImagerySection>
+        <StateImagery name="Normal">
+            <Layer>
+                <Section section="normal" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Hover">
+            <Layer>
+                <Section section="hover" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Pushed">
+            <Layer>
+                <Section section="normal" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Disabled">
+            <Layer>
+                <Section section="normal">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+            </Layer>
+        </StateImagery>
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/VerticalScrollbar
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/VerticalScrollbar">
+        <Property name="VerticalScrollbar" value="True" />
+        <NamedArea name="ThumbTrackArea">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><ImageDim imageset="TaharezLook" image="MiniVertScrollUpNormal" dimension="Height" /></Dim>
+                <Dim type="RightEdge" ><UnifiedDim scale="1.0" type="RightEdge" /></Dim>
+                <Dim type="BottomEdge" >
+                    <UnifiedDim scale="1.0" type="BottomEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="MiniVertScrollDownNormal" dimension="Height" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+        </NamedArea>
+        <Child  type="TaharezLook/ImageButton" nameSuffix="__auto_incbtn__">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                <Dim type="Height" ><ImageDim imageset="TaharezLook" image="MiniVertScrollDownNormal" dimension="Height" /></Dim>
+            </Area>
+            <VertAlignment type="BottomAligned" />
+            <Property name="NormalImage" value="set:TaharezLook image:MiniVertScrollDownNormal" />
+            <Property name="HoverImage" value="set:TaharezLook image:MiniVertScrollDownHover" />
+            <Property name="PushedImage" value="set:TaharezLook image:MiniVertScrollDownNormal" />
+        </Child>
+        <Child  type="TaharezLook/ImageButton" nameSuffix="__auto_decbtn__">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                <Dim type="Height" ><ImageDim imageset="TaharezLook" image="MiniVertScrollUpNormal" dimension="Height" /></Dim>
+            </Area>
+            <Property name="NormalImage" value="set:TaharezLook image:MiniVertScrollUpNormal" />
+            <Property name="HoverImage" value="set:TaharezLook image:MiniVertScrollUpHover" />
+            <Property name="PushedImage" value="set:TaharezLook image:MiniVertScrollUpNormal" />
+        </Child>
+        <Child  type="TaharezLook/VerticalScrollbarThumb" nameSuffix="__auto_thumb__">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                <Dim type="Height" ><UnifiedDim scale="0.1" type="Height" /></Dim>
+            </Area>
+            <Property name="UnifiedMinSize" value="{{0,0},{0,25}}" />
+        </Child>
+        <ImagerySection name="main">
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><ImageDim imageset="TaharezLook" image="MiniVertScrollUpNormal" dimension="Height" /></Dim>
+                    <Dim type="RightEdge" ><UnifiedDim scale="1.0" type="RightEdge" /></Dim>
+                    <Dim type="BottomEdge" >
+                        <UnifiedDim scale="1.0" type="BottomEdge">
+                            <DimOperator op="Subtract">
+                                <ImageDim imageset="TaharezLook" image="MiniVertScrollDownNormal" dimension="Height" />
+                            </DimOperator>
+                        </UnifiedDim>
+                    </Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="MiniVertScrollBarSegment" />
+                <VertFormat type="Stretched" />
+                <HorzFormat type="CentreAligned" />
+            </ImageryComponent>
+        </ImagerySection>
+        <StateImagery name="Enabled">
+            <Layer>
+                <Section section="main" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Disabled">
+            <Layer>
+                <Section section="main">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+            </Layer>
+        </StateImagery>
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/Listbox
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/Listbox">
+        <NamedArea name="ItemRenderingArea">
+            <Area>
+                <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="ListboxLeft" dimension="Width" /></Dim>
+                <Dim type="TopEdge" ><ImageDim imageset="TaharezLook" image="ListboxTop" dimension="Height" /></Dim>
+                <Dim type="RightEdge" >
+                    <UnifiedDim scale="1" type="RightEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="ListboxRight" dimension="Width" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="BottomEdge" >
+                    <UnifiedDim scale="1" type="BottomEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="ListboxBottom" dimension="Height" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+        </NamedArea>
+        <NamedArea name="ItemRenderingAreaHScroll">
+            <Area>
+                <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="ListboxLeft" dimension="Width" /></Dim>
+                <Dim type="TopEdge" ><ImageDim imageset="TaharezLook" image="ListboxTop" dimension="Height" /></Dim>
+                <Dim type="RightEdge" >
+                    <UnifiedDim scale="1" type="RightEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="ListboxRight" dimension="Width" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="BottomEdge" >
+                    <UnifiedDim scale="1" type="BottomEdge">
+                        <DimOperator op="Subtract">
+                            <WidgetDim widget="__auto_hscrollbar__" dimension="Height" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+        </NamedArea>
+        <NamedArea name="ItemRenderingAreaVScroll">
+            <Area>
+                <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="ListboxLeft" dimension="Width" /></Dim>
+                <Dim type="TopEdge" ><ImageDim imageset="TaharezLook" image="ListboxTop" dimension="Height" /></Dim>
+                <Dim type="RightEdge" >
+                    <UnifiedDim scale="1" type="RightEdge">
+                        <DimOperator op="Subtract">
+                            <WidgetDim widget="__auto_vscrollbar__" dimension="Width" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="BottomEdge" >
+                    <UnifiedDim scale="1" type="BottomEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="ListboxBottom" dimension="Height" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+        </NamedArea>
+        <NamedArea name="ItemRenderingAreaHVScroll">
+            <Area>
+                <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="ListboxLeft" dimension="Width" /></Dim>
+                <Dim type="TopEdge" ><ImageDim imageset="TaharezLook" image="ListboxTop" dimension="Height" /></Dim>
+                <Dim type="RightEdge" >
+                    <UnifiedDim scale="1" type="RightEdge">
+                        <DimOperator op="Subtract">
+                            <WidgetDim widget="__auto_vscrollbar__" dimension="Width" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="BottomEdge" >
+                    <UnifiedDim scale="1" type="BottomEdge">
+                        <DimOperator op="Subtract">
+                            <WidgetDim widget="__auto_hscrollbar__" dimension="Height" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+        </NamedArea>
+        <Child  type="TaharezLook/HorizontalScrollbar" nameSuffix="__auto_hscrollbar__">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="Width" ><UnifiedDim scale="1" offset="-12" type="Width" /></Dim>
+                <Dim type="Height" ><AbsoluteDim value="12" /></Dim>
+            </Area>
+            <VertAlignment type="BottomAligned" />
+        </Child>
+        <Child  type="TaharezLook/VerticalScrollbar" nameSuffix="__auto_vscrollbar__">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="Width" ><AbsoluteDim value="12" /></Dim>
+                <Dim type="Height" ><UnifiedDim scale="1" offset="-12" type="Height" /></Dim>
+            </Area>
+            <HorzAlignment type="RightAligned" />
+        </Child>
+        <ImagerySection name="main">
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image type="TopLeftCorner" imageset="TaharezLook" image="ListboxTopLeft" />
+                <Image type="TopRightCorner" imageset="TaharezLook" image="ListboxTopRight" />
+                <Image type="BottomLeftCorner" imageset="TaharezLook" image="ListboxBottomLeft" />
+                <Image type="BottomRightCorner" imageset="TaharezLook" image="ListboxBottomRight" />
+                <Image type="LeftEdge" imageset="TaharezLook" image="ListboxLeft" />
+                <Image type="RightEdge" imageset="TaharezLook" image="ListboxRight" />
+                <Image type="TopEdge" imageset="TaharezLook" image="ListboxTop" />
+                <Image type="BottomEdge" imageset="TaharezLook" image="ListboxBottom" />
+                <Image type="Background" imageset="TaharezLook" image="ListboxBackdrop" />
+            </FrameComponent>
+        </ImagerySection>
+        <StateImagery name="Enabled">
+            <Layer>
+                <Section section="main" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Disabled">
+            <Layer>
+                <Section section="main">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+            </Layer>
+        </StateImagery>
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/ComboDropList
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/ComboDropList">
+        <NamedArea name="ItemRenderingArea">
+            <Area>
+                <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="ComboboxListLeft" dimension="Width" /></Dim>
+                <Dim type="TopEdge" ><ImageDim imageset="TaharezLook" image="ComboboxListTop" dimension="Height" /></Dim>
+                <Dim type="RightEdge" >
+                    <UnifiedDim scale="1" type="RightEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="ComboboxListRight" dimension="Width" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="BottomEdge" >
+                    <UnifiedDim scale="1" type="BottomEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="ComboboxListBottom" dimension="Height" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+        </NamedArea>
+        <NamedArea name="ItemRenderingAreaHScroll">
+            <Area>
+                <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="ComboboxListLeft" dimension="Width" /></Dim>
+                <Dim type="TopEdge" ><ImageDim imageset="TaharezLook" image="ComboboxListTop" dimension="Height" /></Dim>
+                <Dim type="RightEdge" >
+                    <UnifiedDim scale="1" type="RightEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="ComboboxListRight" dimension="Width" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="BottomEdge" >
+                    <UnifiedDim scale="1" type="BottomEdge">
+                        <DimOperator op="Subtract">
+                            <WidgetDim widget="__auto_hscrollbar__" dimension="Height" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+        </NamedArea>
+        <NamedArea name="ItemRenderingAreaVScroll">
+            <Area>
+                <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="ComboboxListLeft" dimension="Width" /></Dim>
+                <Dim type="TopEdge" ><ImageDim imageset="TaharezLook" image="ComboboxListTop" dimension="Height" /></Dim>
+                <Dim type="RightEdge" >
+                    <UnifiedDim scale="1" type="RightEdge">
+                        <DimOperator op="Subtract">
+                            <WidgetDim widget="__auto_vscrollbar__" dimension="Width" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="BottomEdge" >
+                    <UnifiedDim scale="1" type="BottomEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="ComboboxListBottom" dimension="Height" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+        </NamedArea>
+        <NamedArea name="ItemRenderingAreaHVScroll">
+            <Area>
+                <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="ComboboxListLeft" dimension="Width" /></Dim>
+                <Dim type="TopEdge" ><ImageDim imageset="TaharezLook" image="ComboboxListTop" dimension="Height" /></Dim>
+                <Dim type="RightEdge" >
+                    <UnifiedDim scale="1" type="RightEdge">
+                        <DimOperator op="Subtract">
+                            <WidgetDim widget="__auto_vscrollbar__" dimension="Width" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="BottomEdge" >
+                    <UnifiedDim scale="1" type="BottomEdge">
+                        <DimOperator op="Subtract">
+                            <WidgetDim widget="__auto_hscrollbar__" dimension="Height" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+        </NamedArea>
+        <Child  type="TaharezLook/HorizontalScrollbar" nameSuffix="__auto_hscrollbar__">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="Width" ><UnifiedDim scale="1" offset="-12" type="Width" /></Dim>
+                <Dim type="Height" ><AbsoluteDim value="12" /></Dim>
+            </Area>
+            <VertAlignment type="BottomAligned" />
+        </Child>
+        <Child  type="TaharezLook/VerticalScrollbar" nameSuffix="__auto_vscrollbar__">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="Width" ><AbsoluteDim value="12" /></Dim>
+                <Dim type="Height" ><UnifiedDim scale="1" offset="-12" type="Height" /></Dim>
+            </Area>
+            <HorzAlignment type="RightAligned" />
+        </Child>
+        <ImagerySection name="main">
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image type="TopLeftCorner" imageset="TaharezLook" image="ComboboxListTopLeft" />
+                <Image type="TopRightCorner" imageset="TaharezLook" image="ComboboxListTopRight" />
+                <Image type="BottomLeftCorner" imageset="TaharezLook" image="ComboboxListBottomLeft" />
+                <Image type="BottomRightCorner" imageset="TaharezLook" image="ComboboxListBottomRight" />
+                <Image type="LeftEdge" imageset="TaharezLook" image="ComboboxListLeft" />
+                <Image type="RightEdge" imageset="TaharezLook" image="ComboboxListRight" />
+                <Image type="TopEdge" imageset="TaharezLook" image="ComboboxListTop" />
+                <Image type="BottomEdge" imageset="TaharezLook" image="ComboboxListBottom" />
+                <Image type="Background" imageset="TaharezLook" image="ComboboxListBackdrop" />
+            </FrameComponent>
+        </ImagerySection>
+        <StateImagery name="Enabled">
+            <Layer>
+                <Section section="main" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Disabled">
+            <Layer>
+                <Section section="main">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+            </Layer>
+        </StateImagery>
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/ComboEditbox
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/ComboEditbox">
+        <PropertyDefinition name="NormalTextColour" initialValue="FFFFFFFF" redrawOnWrite="true" />
+        <PropertyDefinition name="SelectedTextColour" initialValue="FF000000" redrawOnWrite="true" />
+        <PropertyDefinition name="ActiveSelectionColour" initialValue="FF607FFF" redrawOnWrite="true" />
+        <PropertyDefinition name="InactiveSelectionColour" initialValue="FF808080" redrawOnWrite="true" />
+        <Property name="MouseCursorImage" value="set:TaharezLook image:MouseTextBar" />
+        <NamedArea name="TextArea">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="5" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="5" /></Dim>
+                <Dim type="RightEdge" ><UnifiedDim scale="1.0" offset="-5" type="RightEdge" /></Dim>
+                <Dim type="BottomEdge" ><UnifiedDim scale="1.0" offset="-5" type="BottomEdge" /></Dim>
+            </Area>
+        </NamedArea>
+        <ImagerySection name="container_normal">
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1.0" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1.0" type="Height" /></Dim>
+                </Area>
+                <Image type="LeftEdge" imageset="TaharezLook" image="ComboboxEditLeft" />
+                <Image type="Background" imageset="TaharezLook" image="ComboboxEditMiddle" />
+            </FrameComponent>
+        </ImagerySection>
+        <ImagerySection name="selection">
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="RightEdge" ><UnifiedDim scale="1.0" type="RightEdge" /></Dim>
+                    <Dim type="BottomEdge" ><UnifiedDim scale="1.0" type="BottomEdge" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="TextSelectionBrush" />
+                <VertFormat type="Stretched" />
+                <HorzFormat type="Stretched" />
+            </ImageryComponent>
+        </ImagerySection>
+        <ImagerySection name="Carat">
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><ImageDim imageset="TaharezLook" image="EditBoxCarat" dimension="Width" /></Dim>
+                    <Dim type="BottomEdge" ><UnifiedDim scale="1.0" type="BottomEdge" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="EditBoxCarat" />
+                <VertFormat type="Stretched" />
+                <HorzFormat type="Stretched" />
+            </ImageryComponent>
+        </ImagerySection>
+        <StateImagery name="Enabled">
+            <Layer>
+                <Section section="container_normal" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="ReadOnly">
+            <Layer>
+                <Section section="container_normal" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Disabled">
+            <Layer>
+                <Section section="container_normal">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="ActiveSelection">
+            <Layer>
+                <Section section="selection">
+                    <ColourProperty name="ActiveSelectionColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="InactiveSelection">
+            <Layer>
+                <Section section="selection">
+                    <ColourProperty name="InactiveSelectionColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/Combobox
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/Combobox">
+        <PropertyLinkDefinition name="NormalEditTextColour" widget="__auto_editbox__" targetProperty="NormalTextColour" initialValue="FFFFFFFF" />
+        <PropertyLinkDefinition name="SelectedEditTextColour" widget="__auto_editbox__" targetProperty="SelectedTextColour" initialValue="FF000000" />
+        <PropertyLinkDefinition name="ActiveEditSelectionColour" widget="__auto_editbox__" targetProperty="ActiveSelectionColour" initialValue="FF6060FF" />
+        <PropertyLinkDefinition name="InactiveEditSelectionColour" widget="__auto_editbox__" targetProperty="InactiveSelectionColour" initialValue="FF808080" />
+        <Child  type="TaharezLook/ComboEditbox" nameSuffix="__auto_editbox__">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="RightEdge" >
+                    <UnifiedDim scale="1" type="RightEdge">
+                        <DimOperator op="Subtract">
+                            <FontDim type="LineSpacing">
+                                <DimOperator op="Multiply">
+                                    <AbsoluteDim value="1.5" />
+                                </DimOperator>
+                            </FontDim>
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="Height" >
+                    <FontDim type="LineSpacing">
+                        <DimOperator op="Multiply">
+                            <AbsoluteDim value="1.5" />
+                        </DimOperator>
+                    </FontDim>
+                </Dim>
+            </Area>
+        </Child>
+        <Child  type="TaharezLook/ComboDropList" nameSuffix="__auto_droplist__">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><WidgetDim widget="__auto_editbox__" dimension="BottomEdge" /></Dim>
+                <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                <Dim type="BottomEdge" ><UnifiedDim scale="1" type="BottomEdge" /></Dim>
+            </Area>
+        </Child>
+        <Child  type="TaharezLook/ImageButton" nameSuffix="__auto_button__">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="Width" ><WidgetDim widget="__auto_editbox__" dimension="Height" /></Dim>
+                <Dim type="Height" ><WidgetDim widget="__auto_editbox__" dimension="Height" /></Dim>
+            </Area>
+            <HorzAlignment type="RightAligned" />
+            <Property name="NormalImage" value="set:TaharezLook image:ComboboxListButtonNormal" />
+            <Property name="HoverImage" value="set:TaharezLook image:ComboboxListButtonHover" />
+            <Property name="PushedImage" value="set:TaharezLook image:ComboboxListButtonNormal" />
+        </Child>
+        <StateImagery name="Enabled" />
+        <StateImagery name="Disabled" />
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/Spinner
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/Spinner">
+        <Child  type="TaharezLook/Editbox" nameSuffix="__auto_editbox__">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="RightEdge" >
+                    <UnifiedDim scale="1" type="RightEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="VertScrollUpNormal" dimension="Width" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+            </Area>
+        </Child>
+        <Child  type="TaharezLook/ImageButton" nameSuffix="__auto_incbtn__">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="Width" ><ImageDim imageset="TaharezLook" image="VertScrollUpNormal" dimension="Width" /></Dim>
+                <Dim type="Height" ><UnifiedDim scale="0.5" type="Height" /></Dim>
+            </Area>
+            <HorzAlignment type="RightAligned" />
+            <Property name="NormalImage" value="set:TaharezLook image:VertScrollUpNormal" />
+            <Property name="HoverImage" value="set:TaharezLook image:VertScrollUpHover" />
+            <Property name="PushedImage" value="set:TaharezLook image:VertScrollUpNormal" />
+        </Child>
+        <Child  type="TaharezLook/ImageButton" nameSuffix="__auto_decbtn__">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><UnifiedDim scale="0.5" type="TopEdge" /></Dim>
+                <Dim type="Width" ><ImageDim imageset="TaharezLook" image="VertScrollUpNormal" dimension="Width" /></Dim>
+                <Dim type="Height" ><UnifiedDim scale="0.5" type="Height" /></Dim>
+            </Area>
+            <HorzAlignment type="RightAligned" />
+            <Property name="NormalImage" value="set:TaharezLook image:VertScrollDownNormal" />
+            <Property name="HoverImage" value="set:TaharezLook image:VertScrollDownHover" />
+            <Property name="PushedImage" value="set:TaharezLook image:VertScrollDownNormal" />
+        </Child>
+        <StateImagery name="Enabled" />
+        <StateImagery name="Disabled" />
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/StaticShared
+        (Shared imagery components for static widgets)
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/StaticShared">
+        <ImagerySection name="frame">
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image type="TopLeftCorner" imageset="TaharezLook" image="StaticTopLeft" />
+                <Image type="TopRightCorner" imageset="TaharezLook" image="StaticTopRight" />
+                <Image type="BottomLeftCorner" imageset="TaharezLook" image="StaticBottomLeft" />
+                <Image type="BottomRightCorner" imageset="TaharezLook" image="StaticBottomRight" />
+                <Image type="LeftEdge" imageset="TaharezLook" image="StaticLeft" />
+                <Image type="RightEdge" imageset="TaharezLook" image="StaticRight" />
+                <Image type="TopEdge" imageset="TaharezLook" image="StaticTop" />
+                <Image type="BottomEdge" imageset="TaharezLook" image="StaticBottom" />
+                <ColourRectProperty name="FrameColours" />
+            </FrameComponent>
+        </ImagerySection>
+        <ImagerySection name="background">
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="StaticLeft" dimension="Width" /></Dim>
+                    <Dim type="TopEdge" ><ImageDim imageset="TaharezLook" image="StaticTop" dimension="Height" /></Dim>
+                    <Dim type="RightEdge" >
+                        <UnifiedDim scale="1" type="RightEdge">
+                            <DimOperator op="Subtract">
+                                <ImageDim imageset="TaharezLook" image="StaticRight" dimension="Width" />
+                            </DimOperator>
+                        </UnifiedDim>
+                    </Dim>
+                    <Dim type="BottomEdge" >
+                        <UnifiedDim scale="1" type="BottomEdge">
+                            <DimOperator op="Subtract">
+                                <ImageDim imageset="TaharezLook" image="StaticBottom" dimension="Height" />
+                            </DimOperator>
+                        </UnifiedDim>
+                    </Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="StaticBackdrop" />
+                <!--<ColourRectProperty name="BackgroundColours" />-->
+                <Colours topLeft="FFFFFFFF" topRight="FFFFFFFF" bottomLeft="FFFFFFFF" bottomRight="FFFFFFFF" />
+                <VertFormat type="Stretched" />
+                <HorzFormat type="Stretched" />
+            </ImageryComponent>
+        </ImagerySection>
+        <ImagerySection name="background_noframe">
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge"><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge"><AbsoluteDim value="0" /></Dim>
+                    <Dim type="RightEdge"><UnifiedDim scale="1" type="RightEdge" /></Dim>
+                    <Dim type="BottomEdge"><UnifiedDim scale="1" type="BottomEdge" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="StaticBackdrop" />
+                <!--<ColourRectProperty name="BackgroundColours" />-->
+                <Colours topLeft="FFFFFFFF" topRight="FFFFFFFF" bottomLeft="FFFFFFFF" bottomRight="FFFFFFFF" />
+                <VertFormat type="Stretched" />
+                <HorzFormat type="Stretched" />
+            </ImageryComponent>
+        </ImagerySection>
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/StaticImage
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/StaticImage">
+		<PropertyDefinition name="ImageColours" initialValue="tl:FFFFFFFF tr:FFFFFFFF bl:FFFFFFFF br:FFFFFFFF" redrawOnWrite="true" />
+		<PropertyDefinition name="FrameColours" initialValue="tl:FFFFFFFF tr:FFFFFFFF bl:FFFFFFFF br:FFFFFFFF" redrawOnWrite="true" />
+		<PropertyDefinition name="BackgroundColours" initialValue="tl:FFFFFFFF tr:FFFFFFFF bl:FFFFFFFF br:FFFFFFFF" redrawOnWrite="true" />
+        <PropertyDefinition name="VertFormatting" initialValue="Stretched" redrawOnWrite="true" />
+        <PropertyDefinition name="HorzFormatting" initialValue="Stretched" redrawOnWrite="true" />
+        <Property name="BackgroundEnabled" value="True" />
+        <Property name="FrameEnabled" value="True" />
+        <ImagerySection name="image_withframe">
+            <ImageryComponent>
+                <Area>
+					<Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="StaticLeft" dimension="Width" /></Dim>
+					<Dim type="TopEdge" ><ImageDim imageset="TaharezLook" image="StaticTop" dimension="Height" /></Dim>
+					<Dim type="RightEdge" >
+						<UnifiedDim scale="1" type="RightEdge">
+							<DimOperator op="Subtract">
+								<ImageDim imageset="TaharezLook" image="StaticRight" dimension="Width" />
+							</DimOperator>
+						</UnifiedDim>
+					</Dim>
+					<Dim type="BottomEdge" >
+						<UnifiedDim scale="1" type="BottomEdge">
+							<DimOperator op="Subtract">
+								<ImageDim imageset="TaharezLook" image="StaticBottom" dimension="Height" />
+							</DimOperator>
+						</UnifiedDim>
+					</Dim>
+				</Area>
+                <ImageProperty name="Image" />
+                <ColourRectProperty name="ImageColours" />
+                <VertFormatProperty name="VertFormatting" />
+                <HorzFormatProperty name="HorzFormatting" />
+            </ImageryComponent>
+        </ImagerySection>
+        <ImagerySection name="image_noframe">
+            <ImageryComponent>
+                <Area>
+					<Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+					<Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+					<Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+					<Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+				</Area>
+                <ImageProperty name="Image" />
+                <ColourRectProperty name="ImageColours" />
+                <VertFormatProperty name="VertFormatting" />
+                <HorzFormatProperty name="HorzFormatting" />
+            </ImageryComponent>
+        </ImagerySection>
+        <StateImagery name="Enabled" />
+        <StateImagery name="Disabled" />
+        <StateImagery name="EnabledFrame">
+            <Layer>
+                <Section look="TaharezLook/StaticShared" section="frame" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="DisabledFrame">
+            <Layer>
+                <Section look="TaharezLook/StaticShared" section="frame" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="WithFrameEnabledBackground">
+            <Layer>
+                <Section look="TaharezLook/StaticShared" section="background" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="WithFrameDisabledBackground">
+            <Layer>
+                <Section look="TaharezLook/StaticShared" section="background" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="NoFrameEnabledBackground">
+            <Layer>
+                <Section look="TaharezLook/StaticShared" section="background_noframe" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="NoFrameDisabledBackground">
+            <Layer>
+                <Section look="TaharezLook/StaticShared" section="background_noframe" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="WithFrameImage">
+            <Layer>
+                <Section section="image_withframe" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="NoFrameImage">
+            <Layer>
+                <Section section="image_noframe" />
+            </Layer>
+        </StateImagery>
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/StaticText
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/StaticText">
+		<PropertyDefinition name="FrameColours" initialValue="tl:FFFFFFFF tr:FFFFFFFF bl:FFFFFFFF br:FFFFFFFF" redrawOnWrite="true" />
+		<PropertyDefinition name="BackgroundColours" initialValue="tl:FFFFFFFF tr:FFFFFFFF bl:FFFFFFFF br:FFFFFFFF" redrawOnWrite="true" />
+        <Property name="FrameEnabled" value="True" />
+        <Property name="BackgroundEnabled" value="True" />
+        <NamedArea name="WithFrameTextRenderArea">
+            <Area>
+                <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="StaticLeft" dimension="Width" /></Dim>
+                <Dim type="TopEdge" ><ImageDim imageset="TaharezLook" image="StaticTop" dimension="Height" /></Dim>
+                <Dim type="RightEdge" >
+                    <UnifiedDim scale="1" type="RightEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="StaticRight" dimension="Width" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="BottomEdge" >
+                    <UnifiedDim scale="1" type="BottomEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="StaticBottom" dimension="Height" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+        </NamedArea>
+        <NamedArea name="WithFrameTextRenderAreaHScroll">
+            <Area>
+                <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="StaticLeft" dimension="Width" /></Dim>
+                <Dim type="TopEdge" ><ImageDim imageset="TaharezLook" image="StaticTop" dimension="Height" /></Dim>
+                <Dim type="RightEdge" >
+                    <UnifiedDim scale="1" type="RightEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="StaticRight" dimension="Width" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="BottomEdge" >
+                    <UnifiedDim scale="1" type="BottomEdge">
+                        <DimOperator op="Subtract">
+                            <WidgetDim widget="__auto_hscrollbar__" dimension="Height" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+        </NamedArea>
+        <NamedArea name="WithFrameTextRenderAreaVScroll">
+            <Area>
+                <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="StaticLeft" dimension="Width" /></Dim>
+                <Dim type="TopEdge" ><ImageDim imageset="TaharezLook" image="StaticTop" dimension="Height" /></Dim>
+                <Dim type="RightEdge" >
+                    <UnifiedDim scale="1" type="RightEdge">
+                        <DimOperator op="Subtract">
+                            <WidgetDim widget="__auto_vscrollbar__" dimension="Width" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="BottomEdge" >
+                    <UnifiedDim scale="1" type="BottomEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="StaticBottom" dimension="Height" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+        </NamedArea>
+        <NamedArea name="WithFrameTextRenderAreaHVScroll">
+            <Area>
+                <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="StaticLeft" dimension="Width" /></Dim>
+                <Dim type="TopEdge" ><ImageDim imageset="TaharezLook" image="StaticTop" dimension="Height" /></Dim>
+                <Dim type="RightEdge" >
+                    <UnifiedDim scale="1" type="RightEdge">
+                        <DimOperator op="Subtract">
+                            <WidgetDim widget="__auto_vscrollbar__" dimension="Width" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="BottomEdge" >
+                    <UnifiedDim scale="1" type="BottomEdge">
+                        <DimOperator op="Subtract">
+                            <WidgetDim widget="__auto_hscrollbar__" dimension="Height" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+        </NamedArea>
+        <NamedArea name="NoFrameTextRenderArea">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="RightEdge" ><UnifiedDim scale="1" type="RightEdge" /></Dim>
+                <Dim type="BottomEdge" ><UnifiedDim scale="1" type="BottomEdge" /></Dim>
+            </Area>
+        </NamedArea>
+        <NamedArea name="NoFrameTextRenderAreaHScroll">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="RightEdge" ><UnifiedDim scale="1" type="RightEdge" /></Dim>
+                <Dim type="BottomEdge" >
+                    <UnifiedDim scale="1" type="BottomEdge">
+                        <DimOperator op="Subtract">
+                            <WidgetDim widget="__auto_hscrollbar__" dimension="Height" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+        </NamedArea>
+        <NamedArea name="NoFrameTextRenderAreaVScroll">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="RightEdge" >
+                    <UnifiedDim scale="1" type="RightEdge">
+                        <DimOperator op="Subtract">
+                            <WidgetDim widget="__auto_vscrollbar__" dimension="Width" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="BottomEdge" ><UnifiedDim scale="1" type="BottomEdge" /></Dim>
+            </Area>
+        </NamedArea>
+        <NamedArea name="NoFrameTextRenderAreaHVScroll">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="RightEdge" >
+                    <UnifiedDim scale="1" type="RightEdge">
+                        <DimOperator op="Subtract">
+                            <WidgetDim widget="__auto_vscrollbar__" dimension="Width" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="BottomEdge" >
+                    <UnifiedDim scale="1" type="BottomEdge">
+                        <DimOperator op="Subtract">
+                            <WidgetDim widget="__auto_hscrollbar__" dimension="Height" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+        </NamedArea>
+        <Child  type="TaharezLook/HorizontalScrollbar" nameSuffix="__auto_hscrollbar__">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="Width" ><UnifiedDim scale="1" offset="-12" type="Width" /></Dim>
+                <Dim type="Height" ><AbsoluteDim value="12" /></Dim>
+            </Area>
+            <VertAlignment type="BottomAligned" />
+        </Child>
+        <Child  type="TaharezLook/VerticalScrollbar" nameSuffix="__auto_vscrollbar__">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="Width" ><AbsoluteDim value="12" /></Dim>
+                <Dim type="Height" ><UnifiedDim scale="1" offset="-12" type="Height" /></Dim>
+            </Area>
+            <HorzAlignment type="RightAligned" />
+        </Child>
+        <StateImagery name="Enabled" />
+        <StateImagery name="Disabled" />
+        <StateImagery name="EnabledFrame">
+            <Layer>
+                <Section look="TaharezLook/StaticShared" section="frame" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="DisabledFrame">
+            <Layer>
+                <Section look="TaharezLook/StaticShared" section="frame" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="WithFrameEnabledBackground">
+            <Layer>
+                <Section look="TaharezLook/StaticShared" section="background" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="WithFrameDisabledBackground">
+            <Layer>
+                <Section look="TaharezLook/StaticShared" section="background" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="NoFrameEnabledBackground">
+            <Layer>
+                <Section look="TaharezLook/StaticShared" section="background_noframe" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="NoFrameDisabledBackground">
+            <Layer>
+                <Section look="TaharezLook/StaticShared" section="background_noframe" />
+            </Layer>
+        </StateImagery>
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/ListHeaderSegment
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/ListHeaderSegment">
+        <Property name="SizingCursorImage" value="set:TaharezLook image:MouseEsWeCursor" />
+        <Property name="MovingCursorImage" value="set:TaharezLook image:MouseMoveCursor" />
+        <ImagerySection name="segment_normal">
+            <Colours topLeft="FFDDDDDD" topRight="FFDDDDDD" bottomLeft="FFDDDDDD" bottomRight="FFDDDDDD" />
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="RightEdge" >
+                        <UnifiedDim scale="1" type="RightEdge">
+                            <DimOperator op="Subtract">
+                                <ImageDim imageset="TaharezLook" image="HeaderBarSplitterNormal" dimension="Width" />
+                            </DimOperator>
+                        </UnifiedDim>
+                    </Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="HeaderBarBackdropNormal" />
+                <VertFormat type="Stretched" />
+                <HorzFormat type="Stretched" />
+            </ImageryComponent>
+        </ImagerySection>
+        <ImagerySection name="segment_hover">
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="RightEdge" >
+                        <UnifiedDim scale="1" type="RightEdge">
+                            <DimOperator op="Subtract">
+                                <ImageDim imageset="TaharezLook" image="HeaderBarSplitterNormal" dimension="Width" />
+                            </DimOperator>
+                        </UnifiedDim>
+                    </Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="HeaderBarBackdropHover" />
+                <VertFormat type="Stretched" />
+                <HorzFormat type="Stretched" />
+            </ImageryComponent>
+        </ImagerySection>
+        <ImagerySection name="splitter_normal">
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="HeaderBarSplitterNormal" />
+                <VertFormat type="Stretched" />
+                <HorzFormat type="RightAligned" />
+            </ImageryComponent>
+        </ImagerySection>
+        <ImagerySection name="splitter_hover">
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="HeaderBarSplitterHover" />
+                <VertFormat type="Stretched" />
+                <HorzFormat type="RightAligned" />
+            </ImageryComponent>
+        </ImagerySection>
+        <ImagerySection name="ascend_icon">
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="3" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="3" /></Dim>
+                    <Dim type="Width" ><ImageDim imageset="TaharezLook" image="HeaderBarSortUp" dimension="Width" /></Dim>
+                    <Dim type="Height" ><ImageDim imageset="TaharezLook" image="HeaderBarSortUp" dimension="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="HeaderBarSortUp" />
+            </ImageryComponent>
+        </ImagerySection>
+        <ImagerySection name="descend_icon">
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="3" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="3" /></Dim>
+                    <Dim type="Width" ><ImageDim imageset="TaharezLook" image="HeaderBarSortDown" dimension="Width" /></Dim>
+                    <Dim type="Height" ><ImageDim imageset="TaharezLook" image="HeaderBarSortDown" dimension="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="HeaderBarSortDown" />
+            </ImageryComponent>
+        </ImagerySection>
+        <ImagerySection name="label">
+            <TextComponent>
+                <Area>
+                    <Dim type="LeftEdge" >
+                        <ImageDim imageset="TaharezLook" image="HeaderBarSortUp" dimension="Width">
+                            <DimOperator op="Add">
+                                <AbsoluteDim value="5" />
+                            </DimOperator>
+                        </ImageDim>
+                    </Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="RightEdge" ><UnifiedDim scale="1" type="RightEdge" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <VertFormat type="CentreAligned" />
+            </TextComponent>
+        </ImagerySection>
+        <StateImagery name="Normal">
+            <Layer>
+                <Section section="segment_normal" />
+                <Section section="splitter_normal" />
+                <Section section="label" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Hover">
+            <Layer>
+                <Section section="segment_hover" />
+                <Section section="splitter_normal" />
+                <Section section="label" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="SplitterHover">
+            <Layer>
+                <Section section="segment_normal" />
+                <Section section="splitter_hover" />
+                <Section section="label" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="DragGhost" clipped="false" >
+            <Layer priority="1" >
+                <Section section="segment_normal">
+                    <Colours topLeft="90FFFFFF" topRight="90FFFFFF" bottomLeft="90FFFFFF" bottomRight="90FFFFFF" />
+                </Section>
+                <Section section="splitter_normal">
+                    <Colours topLeft="90FFFFFF" topRight="90FFFFFF" bottomLeft="90FFFFFF" bottomRight="90FFFFFF" />
+                </Section>
+                <Section section="label">
+                    <Colours topLeft="90FFFFFF" topRight="90FFFFFF" bottomLeft="90FFFFFF" bottomRight="90FFFFFF" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="AscendingSortIcon">
+            <Layer>
+                <Section section="ascend_icon" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="DescendingSortIcon">
+            <Layer>
+                <Section section="descend_icon" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="GhostAscendingSortIcon" clipped="false">
+            <Layer priority="1" >
+                <Section section="ascend_icon">
+                    <Colours topLeft="90FFFFFF" topRight="90FFFFFF" bottomLeft="90FFFFFF" bottomRight="90FFFFFF" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="GhostDescendingSortIcon" clipped="false">
+            <Layer priority="1" >
+                <Section section="descend_icon">
+                    <Colours topLeft="90FFFFFF" topRight="90FFFFFF" bottomLeft="90FFFFFF" bottomRight="90FFFFFF" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Disabled">
+            <Layer>
+                <Section section="segment_normal">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+                <Section section="splitter_normal">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+                <Section section="label">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+            </Layer>
+        </StateImagery>
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/ListHeader
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/ListHeader">
+        <Property name="SegmentWidgetType" value="TaharezLook/ListHeaderSegment" />
+        <StateImagery name="Enabled" />
+        <StateImagery name="Disabled" />
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/MultiColumnList
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/MultiColumnList">
+        <NamedArea name="ItemRenderingArea">
+            <Area>
+                <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="MultiListLeft" dimension="Width" /></Dim>
+                <Dim type="TopEdge" ><WidgetDim widget="__auto_listheader__" dimension="BottomEdge" /></Dim>
+                <Dim type="RightEdge" >
+                    <UnifiedDim scale="1" type="RightEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="MultiListRight" dimension="Width" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="BottomEdge" >
+                    <UnifiedDim scale="1" type="BottomEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="MultiListBottom" dimension="Height" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+        </NamedArea>
+        <NamedArea name="ItemRenderingAreaHScroll">
+            <Area>
+                <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="MultiListLeft" dimension="Width" /></Dim>
+                <Dim type="TopEdge" ><WidgetDim widget="__auto_listheader__" dimension="BottomEdge" /></Dim>
+                <Dim type="RightEdge" >
+                    <UnifiedDim scale="1" type="RightEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="MultiListRight" dimension="Width" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="BottomEdge" >
+                    <UnifiedDim scale="1" type="BottomEdge">
+                        <DimOperator op="Subtract">
+                            <WidgetDim widget="__auto_hscrollbar__" dimension="Height" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+        </NamedArea>
+        <NamedArea name="ItemRenderingAreaVScroll">
+            <Area>
+                <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="MultiListLeft" dimension="Width" /></Dim>
+                <Dim type="TopEdge" ><WidgetDim widget="__auto_listheader__" dimension="BottomEdge" /></Dim>
+                <Dim type="RightEdge" >
+                    <UnifiedDim scale="1" type="RightEdge">
+                        <DimOperator op="Subtract">
+                            <WidgetDim widget="__auto_vscrollbar__" dimension="Width" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="BottomEdge" >
+                    <UnifiedDim scale="1" type="BottomEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="MultiListBottom" dimension="Height" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+        </NamedArea>
+        <NamedArea name="ItemRenderingAreaHVScroll">
+            <Area>
+                <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="MultiListLeft" dimension="Width" /></Dim>
+                <Dim type="TopEdge" ><WidgetDim widget="__auto_listheader__" dimension="BottomEdge" /></Dim>
+                <Dim type="RightEdge" >
+                    <UnifiedDim scale="1" type="RightEdge">
+                        <DimOperator op="Subtract">
+                            <WidgetDim widget="__auto_vscrollbar__" dimension="Width" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="BottomEdge" >
+                    <UnifiedDim scale="1" type="BottomEdge">
+                        <DimOperator op="Subtract">
+                            <WidgetDim widget="__auto_hscrollbar__" dimension="Height" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+        </NamedArea>
+        <Child  type="TaharezLook/ListHeader" nameSuffix="__auto_listheader__">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="2" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="2" /></Dim>
+                <Dim type="RightEdge" ><UnifiedDim scale="1" offset="-2" type="RightEdge" /></Dim>
+                <Dim type="Height" >
+                    <FontDim type="LineSpacing">
+                        <DimOperator op="Multiply">
+                            <AbsoluteDim value="1.5" />
+                        </DimOperator>
+                    </FontDim>
+                </Dim>
+            </Area>
+        </Child>
+        <Child  type="TaharezLook/HorizontalScrollbar" nameSuffix="__auto_hscrollbar__">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="Width" ><UnifiedDim scale="1" offset="-12" type="Width" /></Dim>
+                <Dim type="Height" ><AbsoluteDim value="12" /></Dim>
+            </Area>
+            <VertAlignment type="BottomAligned" />
+        </Child>
+        <Child  type="TaharezLook/VerticalScrollbar" nameSuffix="__auto_vscrollbar__">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><WidgetDim widget="__auto_listheader__" dimension="BottomEdge" /></Dim>
+                <Dim type="Width" ><AbsoluteDim value="12" /></Dim>
+                <Dim type="BottomEdge" ><UnifiedDim scale="1" offset="-12" type="BottomEdge" /></Dim>
+            </Area>
+            <HorzAlignment type="RightAligned" />
+        </Child>
+        <ImagerySection name="main">
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image type="TopLeftCorner" imageset="TaharezLook" image="MultiListTopLeft" />
+                <Image type="TopRightCorner" imageset="TaharezLook" image="MultiListTopRight" />
+                <Image type="BottomLeftCorner" imageset="TaharezLook" image="MultiListBottomLeft" />
+                <Image type="BottomRightCorner" imageset="TaharezLook" image="MultiListBottomRight" />
+                <Image type="LeftEdge" imageset="TaharezLook" image="MultiListLeft" />
+                <Image type="RightEdge" imageset="TaharezLook" image="MultiListRight" />
+                <Image type="TopEdge" imageset="TaharezLook" image="MultiListTop" />
+                <Image type="BottomEdge" imageset="TaharezLook" image="MultiListBottom" />
+                <Image type="Background" imageset="TaharezLook" image="MultiListBackdrop" />
+            </FrameComponent>
+        </ImagerySection>
+        <StateImagery name="Enabled">
+            <Layer>
+                <Section section="main" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Disabled">
+            <Layer>
+                <Section section="main">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+            </Layer>
+        </StateImagery>
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/MultiLineEditbox
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/MultiLineEditbox">
+        <PropertyDefinition name="NormalTextColour" initialValue="FFFFFFFF" redrawOnWrite="true" />
+        <PropertyDefinition name="SelectedTextColour" initialValue="FF000000" redrawOnWrite="true" />
+        <PropertyDefinition name="ActiveSelectionColour" initialValue="FF607FFF" redrawOnWrite="true" />
+        <PropertyDefinition name="InactiveSelectionColour" initialValue="FF808080" redrawOnWrite="true" />
+        <Property name="MouseCursorImage" value="set:TaharezLook image:MouseTextBar" />
+        <Property name="SelectionBrushImage" value="set:TaharezLook image:MultiLineEditboxSelectionBrush" />
+        <NamedArea name="TextArea">
+            <Area>
+                <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="MultiLineEditboxLeft" dimension="Width" /></Dim>
+                <Dim type="TopEdge" ><ImageDim imageset="TaharezLook" image="MultiLineEditboxTop" dimension="Height" /></Dim>
+                <Dim type="RightEdge" >
+                    <UnifiedDim scale="1" type="RightEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="MultiLineEditboxRight" dimension="Width" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="BottomEdge" >
+                    <UnifiedDim scale="1" type="BottomEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="MultiLineEditboxBottom" dimension="Height" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+        </NamedArea>
+        <NamedArea name="TextAreaHScroll">
+            <Area>
+                <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="MultiLineEditboxLeft" dimension="Width" /></Dim>
+                <Dim type="TopEdge" ><ImageDim imageset="TaharezLook" image="MultiLineEditboxTop" dimension="Height" /></Dim>
+                <Dim type="RightEdge" >
+                    <UnifiedDim scale="1" type="RightEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="MultiLineEditboxRight" dimension="Width" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="BottomEdge" >
+                    <UnifiedDim scale="1" type="BottomEdge">
+                        <DimOperator op="Subtract">
+                            <WidgetDim widget="__auto_hscrollbar__" dimension="Height" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+        </NamedArea>
+        <NamedArea name="TextAreaVScroll">
+            <Area>
+                <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="MultiLineEditboxLeft" dimension="Width" /></Dim>
+                <Dim type="TopEdge" ><ImageDim imageset="TaharezLook" image="MultiLineEditboxTop" dimension="Height" /></Dim>
+                <Dim type="RightEdge" >
+                    <UnifiedDim scale="1" type="RightEdge">
+                        <DimOperator op="Subtract">
+                            <WidgetDim widget="__auto_vscrollbar__" dimension="Width" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="BottomEdge" >
+                    <UnifiedDim scale="1" type="BottomEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="MultiLineEditboxBottom" dimension="Height" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+        </NamedArea>
+        <NamedArea name="TextAreaHVScroll">
+            <Area>
+                <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="MultiLineEditboxLeft" dimension="Width" /></Dim>
+                <Dim type="TopEdge" ><ImageDim imageset="TaharezLook" image="MultiLineEditboxTop" dimension="Height" /></Dim>
+                <Dim type="RightEdge" >
+                    <UnifiedDim scale="1" type="RightEdge">
+                        <DimOperator op="Subtract">
+                            <WidgetDim widget="__auto_vscrollbar__" dimension="Width" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="BottomEdge" >
+                    <UnifiedDim scale="1" type="BottomEdge">
+                        <DimOperator op="Subtract">
+                            <WidgetDim widget="__auto_hscrollbar__" dimension="Height" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+        </NamedArea>
+        <Child  type="TaharezLook/HorizontalScrollbar" nameSuffix="__auto_hscrollbar__">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="Width" ><UnifiedDim scale="1" offset="-12" type="Width" /></Dim>
+                <Dim type="Height" ><AbsoluteDim value="12" /></Dim>
+            </Area>
+            <VertAlignment type="BottomAligned" />
+        </Child>
+        <Child  type="TaharezLook/VerticalScrollbar" nameSuffix="__auto_vscrollbar__">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="Width" ><AbsoluteDim value="12" /></Dim>
+                <Dim type="Height" ><UnifiedDim scale="1" offset="-12" type="Height" /></Dim>
+            </Area>
+            <HorzAlignment type="RightAligned" />
+        </Child>
+        <ImagerySection name="main">
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image type="TopLeftCorner" imageset="TaharezLook" image="MultiLineEditboxTopLeft" />
+                <Image type="TopRightCorner" imageset="TaharezLook" image="MultiLineEditboxTopRight" />
+                <Image type="BottomLeftCorner" imageset="TaharezLook" image="MultiLineEditboxBottomLeft" />
+                <Image type="BottomRightCorner" imageset="TaharezLook" image="MultiLineEditboxBottomRight" />
+                <Image type="LeftEdge" imageset="TaharezLook" image="MultiLineEditboxLeft" />
+                <Image type="RightEdge" imageset="TaharezLook" image="MultiLineEditboxRight" />
+                <Image type="TopEdge" imageset="TaharezLook" image="MultiLineEditboxTop" />
+                <Image type="BottomEdge" imageset="TaharezLook" image="MultiLineEditboxBottom" />
+                <Image type="Background" imageset="TaharezLook" image="MultiLineEditboxBackdrop" />
+            </FrameComponent>
+        </ImagerySection>
+        <ImagerySection name="Carat">
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><ImageDim imageset="TaharezLook" image="EditBoxCarat" dimension="Width" /></Dim>
+                    <Dim type="BottomEdge" ><UnifiedDim scale="1.0" type="BottomEdge" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="EditBoxCarat" />
+                <VertFormat type="Stretched" />
+                <HorzFormat type="Stretched" />
+            </ImageryComponent>
+        </ImagerySection>
+        <StateImagery name="Enabled">
+            <Layer>
+                <Section section="main" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="ReadOnly">
+            <Layer>
+                <Section section="main" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Disabled">
+            <Layer>
+                <Section section="main">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+            </Layer>
+        </StateImagery>
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/Tooltip
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/Tooltip">
+        <NamedArea name="TextArea">
+            <Area>
+                <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="TooltipLeftEdge" dimension="Width" /></Dim>
+                <Dim type="TopEdge" ><ImageDim imageset="TaharezLook" image="TooltipTopEdge" dimension="Height" /></Dim>
+                <Dim type="RightEdge" >
+                    <UnifiedDim scale="1" type="RightEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="TooltipRightEdge" dimension="Width" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="BottomEdge" >
+                    <UnifiedDim scale="1" type="BottomEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="TooltipBottomEdge" dimension="Height" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+        </NamedArea>
+        <ImagerySection name="main">
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image type="TopLeftCorner" imageset="TaharezLook" image="TooltipTopLeft" />
+                <Image type="TopRightCorner" imageset="TaharezLook" image="TooltipTopRight" />
+                <Image type="BottomLeftCorner" imageset="TaharezLook" image="TooltipBottomLeft" />
+                <Image type="BottomRightCorner" imageset="TaharezLook" image="TooltipBottomRight" />
+                <Image type="LeftEdge" imageset="TaharezLook" image="TooltipLeftEdge" />
+                <Image type="RightEdge" imageset="TaharezLook" image="TooltipRightEdge" />
+                <Image type="TopEdge" imageset="TaharezLook" image="TooltipTopEdge" />
+                <Image type="BottomEdge" imageset="TaharezLook" image="TooltipBottomEdge" />
+                <Image type="Background" imageset="TaharezLook" image="TooltipMiddle" />
+            </FrameComponent>
+        </ImagerySection>
+        <ImagerySection name="label">
+            <TextComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="TooltipLeftEdge" dimension="Width" /></Dim>
+                    <Dim type="TopEdge" ><ImageDim imageset="TaharezLook" image="TooltipTopEdge" dimension="Height" /></Dim>
+                    <Dim type="RightEdge" >
+                        <UnifiedDim scale="1" type="RightEdge">
+                            <DimOperator op="Subtract">
+                                <ImageDim imageset="TaharezLook" image="TooltipRightEdge" dimension="Width" />
+                            </DimOperator>
+                        </UnifiedDim>
+                    </Dim>
+                    <Dim type="BottomEdge" >
+                        <UnifiedDim scale="1" type="BottomEdge">
+                            <DimOperator op="Subtract">
+                                <ImageDim imageset="TaharezLook" image="TooltipBottomEdge" dimension="Height" />
+                            </DimOperator>
+                        </UnifiedDim>
+                    </Dim>
+                </Area>
+                <Colours topLeft="FF000000" topRight="FF000000" bottomLeft="FF000000" bottomRight="FF000000" />
+                <VertFormat type="CentreAligned" />
+                <HorzFormat type="CentreAligned" />
+            </TextComponent>
+        </ImagerySection>
+        <StateImagery name="Enabled">
+            <Layer>
+                <Section section="main" />
+                <Section section="label" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Disabled">
+            <Layer>
+                <Section section="main" />
+                <Section section="label" />
+            </Layer>
+        </StateImagery>
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/ScrollablePane
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/ScrollablePane">
+        <NamedArea name="ViewableArea">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="RightEdge" ><UnifiedDim scale="1.0" type="RightEdge" /></Dim>
+                <Dim type="BottomEdge" ><UnifiedDim scale="1.0" type="BottomEdge" /></Dim>
+            </Area>
+        </NamedArea>
+        <NamedArea name="ViewableAreaHScroll">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="RightEdge" ><UnifiedDim scale="1.0" type="RightEdge" /></Dim>
+                <Dim type="BottomEdge" >
+                    <UnifiedDim scale="1" type="BottomEdge">
+                        <DimOperator op="Subtract">
+                            <WidgetDim widget="__auto_hscrollbar__" dimension="Height" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+        </NamedArea>
+        <NamedArea name="ViewableAreaVScroll">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="RightEdge" >
+                    <UnifiedDim scale="1" type="RightEdge">
+                        <DimOperator op="Subtract">
+                            <WidgetDim widget="__auto_vscrollbar__" dimension="Width" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="BottomEdge" ><UnifiedDim scale="1.0" type="BottomEdge" /></Dim>
+            </Area>
+        </NamedArea>
+        <NamedArea name="ViewableAreaHVScroll">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="RightEdge" >
+                    <UnifiedDim scale="1" type="RightEdge">
+                        <DimOperator op="Subtract">
+                            <WidgetDim widget="__auto_vscrollbar__" dimension="Width" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="BottomEdge" >
+                    <UnifiedDim scale="1" type="BottomEdge">
+                        <DimOperator op="Subtract">
+                            <WidgetDim widget="__auto_hscrollbar__" dimension="Height" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+        </NamedArea>
+        <Child  type="TaharezLook/HorizontalScrollbar" nameSuffix="__auto_hscrollbar__">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="Width" ><UnifiedDim scale="1" offset="-12" type="Width" /></Dim>
+                <Dim type="Height" ><AbsoluteDim value="12" /></Dim>
+            </Area>
+            <VertAlignment type="BottomAligned" />
+        </Child>
+        <Child  type="TaharezLook/VerticalScrollbar" nameSuffix="__auto_vscrollbar__">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="Width" ><AbsoluteDim value="12" /></Dim>
+                <Dim type="Height" ><UnifiedDim scale="1" offset="-12" type="Height" /></Dim>
+            </Area>
+            <HorzAlignment type="RightAligned" />
+        </Child>
+        <StateImagery name="Enabled" />
+        <StateImagery name="Disabled" />
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/TabButton
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/TabButton">
+        <PropertyDefinition name="NormalTextColour" initialValue="FFC0C0C0" redrawOnWrite="true" />
+        <PropertyDefinition name="HoverTextColour" initialValue="FFE0E0E0" redrawOnWrite="true" />
+        <PropertyDefinition name="PushedTextColour" initialValue="FFFFFFFF" redrawOnWrite="true" />
+        <PropertyDefinition name="SelectedTextColour" initialValue="FFE0E0E0" redrawOnWrite="true" />
+        <PropertyDefinition name="DisabledTextColour" initialValue="FF7F7F7F" redrawOnWrite="true" />
+        <ImagerySection name="label">
+            <TextComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <VertFormat type="CentreAligned" />
+                <HorzFormat type="CentreAligned" />
+            </TextComponent>
+        </ImagerySection>
+        <ImagerySection name="top_normal">
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image type="TopLeftCorner" imageset="TaharezLook" image="TabButtonUpperLeftNormal" />
+                <Image type="TopRightCorner" imageset="TaharezLook" image="TabButtonUpperRightNormal" />
+                <Image type="BottomLeftCorner" imageset="TaharezLook" image="TabButtonLowerLeftNormal" />
+                <Image type="BottomRightCorner" imageset="TaharezLook" image="TabButtonLowerRight2Normal" />
+                <Image type="LeftEdge" imageset="TaharezLook" image="TabButtonLeftNormal" />
+                <Image type="RightEdge" imageset="TaharezLook" image="TabButtonRightNormal" />
+                <Image type="TopEdge" imageset="TaharezLook" image="TabButtonUpperNormal" />
+                <Image type="BottomEdge" imageset="TaharezLook" image="TabButtonLowerNormal" />
+                <Image type="Background" imageset="TaharezLook" image="TabButtonMiddleNormal" />
+            </FrameComponent>
+        </ImagerySection>
+        <ImagerySection name="bot_normal">
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image type="TopLeftCorner" imageset="TaharezLook" image="TabButtonUpperLeft2Normal" />
+                <Image type="TopRightCorner" imageset="TaharezLook" image="TabButtonUpperRightNormal" />
+                <Image type="BottomLeftCorner" imageset="TaharezLook" image="TabButtonLowerLeftNormal" />
+                <Image type="BottomRightCorner" imageset="TaharezLook" image="TabButtonLowerRightNormal" />
+                <Image type="LeftEdge" imageset="TaharezLook" image="TabButtonLeftNormal" />
+                <Image type="RightEdge" imageset="TaharezLook" image="TabButtonRightNormal" />
+                <Image type="TopEdge" imageset="TaharezLook" image="TabButtonUpperNormal" />
+                <Image type="BottomEdge" imageset="TaharezLook" image="TabButtonLowerNormal" />
+                <Image type="Background" imageset="TaharezLook" image="TabButtonMiddleNormal" />
+            </FrameComponent>
+        </ImagerySection>
+        <ImagerySection name="top_hover">
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image type="TopLeftCorner" imageset="TaharezLook" image="TabButtonUpperLeftNormal" />
+                <Image type="TopRightCorner" imageset="TaharezLook" image="TabButtonUpperRightNormal" />
+                <Image type="BottomLeftCorner" imageset="TaharezLook" image="TabButtonLowerLeftNormal" />
+                <Image type="BottomRightCorner" imageset="TaharezLook" image="TabButtonLowerRight2Normal" />
+                <Image type="LeftEdge" imageset="TaharezLook" image="TabButtonLeftNormal" />
+                <Image type="RightEdge" imageset="TaharezLook" image="TabButtonRightNormal" />
+                <Image type="TopEdge" imageset="TaharezLook" image="TabButtonUpperNormal" />
+                <Image type="BottomEdge" imageset="TaharezLook" image="TabButtonLowerNormal" />
+                <Image type="Background" imageset="TaharezLook" image="TabButtonMiddleNormal" />
+            </FrameComponent>
+        </ImagerySection>
+        <ImagerySection name="bot_hover">
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image type="TopLeftCorner" imageset="TaharezLook" image="TabButtonUpperLeft2Normal" />
+                <Image type="TopRightCorner" imageset="TaharezLook" image="TabButtonUpperRightNormal" />
+                <Image type="BottomLeftCorner" imageset="TaharezLook" image="TabButtonLowerLeftNormal" />
+                <Image type="BottomRightCorner" imageset="TaharezLook" image="TabButtonLowerRightNormal" />
+                <Image type="LeftEdge" imageset="TaharezLook" image="TabButtonLeftNormal" />
+                <Image type="RightEdge" imageset="TaharezLook" image="TabButtonRightNormal" />
+                <Image type="TopEdge" imageset="TaharezLook" image="TabButtonUpperNormal" />
+                <Image type="BottomEdge" imageset="TaharezLook" image="TabButtonLowerNormal" />
+                <Image type="Background" imageset="TaharezLook" image="TabButtonMiddleNormal" />
+            </FrameComponent>
+        </ImagerySection>
+        <ImagerySection name="top_selected">
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image type="TopLeftCorner" imageset="TaharezLook" image="TabButtonUpperLeftSelected" />
+                <Image type="TopEdge" imageset="TaharezLook" image="TabButtonUpperSelected" />
+                <Image type="TopRightCorner" imageset="TaharezLook" image="TabButtonUpperRightSelected" />
+                <Image type="LeftEdge" imageset="TaharezLook" image="TabButtonLeftSelected" />
+                <Image type="Background" imageset="TaharezLook" image="TabButtonMiddleSelected" />
+                <Image type="RightEdge" imageset="TaharezLook" image="TabButtonRightSelected" />
+            </FrameComponent>
+        </ImagerySection>
+        <ImagerySection name="bot_selected">
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image type="LeftEdge" imageset="TaharezLook" image="TabButtonLeftSelected" />
+                <Image type="Background" imageset="TaharezLook" image="TabButtonMiddleSelected" />
+                <Image type="RightEdge" imageset="TaharezLook" image="TabButtonRightSelected" />
+                <Image type="BottomLeftCorner" imageset="TaharezLook" image="TabButtonLowerLeftNormal" />
+                <Image type="BottomEdge" imageset="TaharezLook" image="TabButtonLowerNormal" />
+                <Image type="BottomRightCorner" imageset="TaharezLook" image="TabButtonLowerRightNormal" />
+            </FrameComponent>
+        </ImagerySection>
+        <StateImagery name="TopNormal">
+            <Layer>
+                <Section section="top_normal" />
+                <Section section="label">
+                    <ColourProperty name="NormalTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="BottomNormal">
+            <Layer>
+                <Section section="bot_normal" />
+                <Section section="label">
+                    <ColourProperty name="NormalTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="TopHover">
+            <Layer>
+                <Section section="top_hover" />
+                <Section section="label">
+                    <ColourProperty name="HoverTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="BottomHover">
+            <Layer>
+                <Section section="bot_hover" />
+                <Section section="label">
+                    <ColourProperty name="HoverTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="TopSelected">
+            <Layer>
+                <Section section="top_selected" />
+                <Section section="label">
+                    <ColourProperty name="SelectedTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="BottomSelected">
+            <Layer>
+                <Section section="bot_selected" />
+                <Section section="label">
+                    <ColourProperty name="SelectedTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="TopPushed">
+            <Layer>
+                <Section section="top_normal" />
+                <Section section="label">
+                    <ColourProperty name="PushedTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="BottomPushed">
+            <Layer>
+                <Section section="bot_normal" />
+                <Section section="label">
+                    <ColourProperty name="PushedTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="TopDisabled">
+            <Layer>
+                <Section section="top_normal">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+                <Section section="label">
+                    <ColourProperty name="DisabledTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="BottomDisabled">
+            <Layer>
+                <Section section="bot_normal">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+                <Section section="label">
+                    <ColourProperty name="DisabledTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/TabContentPane
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/TabContentPane">
+        <PropertyDefinition name="EnableTop" initialValue="0" redrawOnWrite="true" layoutOnwrite="true" />
+        <PropertyDefinition name="EnableBottom" initialValue="0" redrawOnWrite="true" layoutOnwrite="true" />
+        <ImagerySection name="normal">
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="BottomEdge" >
+                        <ImageDim imageset="TaharezLook" image="TabContentPaneUpperLeft" dimension="Height">
+                            <DimOperator op="Multiply">
+                                <PropertyDim name="EnableTop" />
+                            </DimOperator>
+                        </ImageDim>
+                    </Dim>
+                </Area>
+                <Image type="TopLeftCorner" imageset="TaharezLook" image="TabContentPaneUpperLeft" />
+                <Image type="TopEdge" imageset="TaharezLook" image="TabContentPaneUpper" />
+                <Image type="TopRightCorner" imageset="TaharezLook" image="TabContentPaneUpperRight" />
+            </FrameComponent>
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" >
+                        <ImageDim imageset="TaharezLook" image="TabContentPaneUpperLeft" dimension="Height">
+                            <DimOperator op="Multiply">
+                                <PropertyDim name="EnableTop" />
+                            </DimOperator>
+                        </ImageDim>
+                    </Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="BottomEdge" >
+                        <UnifiedDim scale="1" type="Height">
+                            <DimOperator op="Subtract">
+                                <ImageDim imageset="TaharezLook" image="TabContentPaneLowerLeft" dimension="Height">
+                                    <DimOperator op="Multiply">
+                                        <PropertyDim name="EnableBottom" />
+                                    </DimOperator>
+                                </ImageDim>
+                            </DimOperator>
+                        </UnifiedDim>
+                    </Dim>
+                </Area>
+                <Image type="LeftEdge" imageset="TaharezLook" image="TabContentPaneLeft" />
+                <Image type="Background" imageset="TaharezLook" image="TabContentPaneMiddle" />
+                <Image type="RightEdge" imageset="TaharezLook" image="TabContentPaneRight" />
+            </FrameComponent>
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" >
+                        <UnifiedDim scale="1" type="Height">
+                            <DimOperator op="Subtract">
+                                <ImageDim imageset="TaharezLook" image="TabContentPaneLowerLeft" dimension="Height">
+                                    <DimOperator op="Multiply">
+                                        <PropertyDim name="EnableBottom" />
+                                    </DimOperator>
+                                </ImageDim>
+                            </DimOperator>
+                        </UnifiedDim>
+                    </Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="BottomEdge" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image type="BottomLeftCorner" imageset="TaharezLook" image="TabContentPaneLowerLeft" />
+                <Image type="BottomEdge" imageset="TaharezLook" image="TabContentPaneLower" />
+                <Image type="BottomRightCorner" imageset="TaharezLook" image="TabContentPaneLowerRight" />
+            </FrameComponent>
+        </ImagerySection>
+        <StateImagery name="Enabled">
+            <Layer>
+                <Section section="normal" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Disabled">
+            <Layer>
+                <Section section="normal">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+            </Layer>
+        </StateImagery>
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/TabButtonPane
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/TabButtonPane">
+        <PropertyDefinition name="EnableTop" initialValue="1" redrawOnWrite="true" layoutOnwrite="true" />
+        <PropertyDefinition name="EnableBottom" initialValue="1" redrawOnWrite="true" layoutOnwrite="true" />
+        <ImagerySection name="normal">
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="BottomEdge" >
+                        <ImageDim imageset="TaharezLook" image="TabHorizontalFiller" dimension="Height">
+                            <DimOperator op="Multiply">
+                                <PropertyDim name="EnableTop" />
+                            </DimOperator>
+                        </ImageDim>
+                    </Dim>
+                </Area>
+                <Image type="TopEdge" imageset="TaharezLook" image="TabHorizontalFiller" />
+            </FrameComponent>
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" >
+                        <ImageDim imageset="TaharezLook" image="TabHorizontalFiller" dimension="Height">
+                            <DimOperator op="Multiply">
+                                <PropertyDim name="EnableTop" />
+                            </DimOperator>
+                        </ImageDim>
+                    </Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="BottomEdge" >
+                        <UnifiedDim scale="1" type="Height">
+                            <DimOperator op="Subtract">
+                                <ImageDim imageset="TaharezLook" image="TabHorizontalFiller" dimension="Height">
+                                    <DimOperator op="Multiply">
+                                        <PropertyDim name="EnableBottom" />
+                                    </DimOperator>
+                                </ImageDim>
+                            </DimOperator>
+                        </UnifiedDim>
+                    </Dim>
+                </Area>
+            </FrameComponent>
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" >
+                        <UnifiedDim scale="1" type="Height">
+                            <DimOperator op="Subtract">
+                                <ImageDim imageset="TaharezLook" image="TabHorizontalFiller" dimension="Height">
+                                    <DimOperator op="Multiply">
+                                        <PropertyDim name="EnableBottom" />
+                                    </DimOperator>
+                                </ImageDim>
+                            </DimOperator>
+                        </UnifiedDim>
+                    </Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="BottomEdge" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image type="BottomEdge" imageset="TaharezLook" image="TabHorizontalFiller" />
+            </FrameComponent>
+        </ImagerySection>
+        <StateImagery name="Enabled">
+            <Layer>
+                <Section section="normal" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Disabled">
+            <Layer>
+                <Section section="normal">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+            </Layer>
+        </StateImagery>
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/TabControl
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/TabControl">
+        <Property name="TabButtonType" value="TaharezLook/TabButton" />
+        <Property name="TabTextPadding" value="{0,6}" />
+        <Child type="TaharezLook/TabContentPane" nameSuffix="__auto_TabPane__">
+            <Area>
+                <Dim type="LeftEdge"><AbsoluteDim value="0" /></Dim>
+                <Dim type="RightEdge"><UnifiedDim scale="1" type="Width" /></Dim>
+                <Dim type="TopEdge">
+                    <PropertyDim widget="__auto_TabPane__" name="EnableBottom">
+                        <DimOperator op="Multiply">
+                            <PropertyDim name="TabHeight" type="Height" />
+                        </DimOperator>
+                    </PropertyDim>
+                </Dim>
+                <Dim type="Height">
+                    <UnifiedDim scale="1" type="Height">
+                        <DimOperator op="Subtract">
+                            <PropertyDim name="TabHeight" type="Height" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+        </Child>
+        <Child  type="TaharezLook/TabButtonPane" nameSuffix="__auto_TabPane__Buttons">
+            <Area>
+                <Dim type="LeftEdge"><AbsoluteDim value="0" /></Dim>
+                <Dim type="RightEdge"><UnifiedDim scale="1" type="Width" /></Dim>
+                <Dim type="TopEdge">
+                    <PropertyDim widget="__auto_TabPane__Buttons" name="EnableTop">
+                        <DimOperator op="Multiply">
+                            <UnifiedDim scale="1" type="Height">
+                                <DimOperator op="Subtract">
+                                    <PropertyDim name="TabHeight" type="Height" />
+                                </DimOperator>
+                            </UnifiedDim>
+                        </DimOperator>
+                    </PropertyDim>
+                </Dim>
+                <Dim type="Height"><PropertyDim name="TabHeight" type="Height" /></Dim>
+            </Area>
+        </Child>
+        <Child type="TaharezLook/SystemButton" nameSuffix="__auto_TabPane__ScrollLeft">
+            <Area>
+                <Dim type="LeftEdge"><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge">
+                    <WidgetDim widget="__auto_TabPane__Buttons" dimension="TopEdge" />
+                </Dim>
+                <Dim type="Width">
+                    <WidgetDim widget="__auto_TabPane__Buttons" dimension="Height">
+                        <DimOperator op="Multiply">
+                            <ImageDim imageset="TaharezLook" image="TabButtonScrollLeftNormal" dimension="Width">
+                                <DimOperator op="Divide">
+                                    <ImageDim imageset="TaharezLook" image="TabButtonScrollLeftNormal" dimension="Height" />
+                                </DimOperator>
+                            </ImageDim>
+                        </DimOperator>
+                    </WidgetDim>
+                </Dim>
+                <Dim type="BottomEdge">
+                    <WidgetDim widget="__auto_TabPane__Buttons" dimension="BottomEdge" />
+                </Dim>
+            </Area>
+            <Property name="AlwaysOnTop" value="True" />
+            <Property name="NormalImage" value="set:TaharezLook image:TabButtonScrollLeftNormal" />
+            <Property name="HoverImage" value="set:TaharezLook image:TabButtonScrollLeftHover" />
+            <Property name="PushedImage" value="set:TaharezLook image:TabButtonScrollLeftHover" />
+        </Child>
+        <Child type="TaharezLook/SystemButton" nameSuffix="__auto_TabPane__ScrollRight">
+            <Area>
+                <Dim type="Width">
+                    <WidgetDim widget="__auto_TabPane__Buttons" dimension="Height">
+                        <DimOperator op="Multiply">
+                            <ImageDim imageset="TaharezLook" image="TabButtonScrollRightNormal" dimension="Width">
+                                <DimOperator op="Divide">
+                                    <ImageDim imageset="TaharezLook" image="TabButtonScrollRightNormal" dimension="Height" />
+                                </DimOperator>
+                            </ImageDim>
+                        </DimOperator>
+                    </WidgetDim>
+                </Dim>
+                <Dim type="LeftEdge">
+                    <UnifiedDim scale="1" type="Width">
+                        <DimOperator op="Subtract">
+                            <WidgetDim widget="__auto_TabPane__ScrollRight" dimension="Width" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="TopEdge">
+                    <WidgetDim widget="__auto_TabPane__Buttons" dimension="TopEdge" />
+                </Dim>
+                <Dim type="Height"><AbsoluteDim value="0" />
+                    <WidgetDim widget="__auto_TabPane__Buttons" dimension="Height" />
+                </Dim>
+            </Area>
+            <Property name="AlwaysOnTop" value="True" />
+            <Property name="NormalImage" value="set:TaharezLook image:TabButtonScrollRightNormal" />
+            <Property name="HoverImage" value="set:TaharezLook image:TabButtonScrollRightHover" />
+            <Property name="PushedImage" value="set:TaharezLook image:TabButtonScrollRightHover" />
+        </Child>
+        <StateImagery name="Enabled" />
+        <StateImagery name="Disabled" />
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/MenuItem
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/MenuItem">
+        <PropertyDefinition name="NormalTextColour" initialValue="FFFFFFFF" redrawOnWrite="true" />
+        <PropertyDefinition name="DisabledTextColour" initialValue="FF7F7F7F" redrawOnWrite="true" />
+        <PropertyDefinition name="HoverColour" initialValue="FFFFFFFF" redrawOnWrite="true" />
+        <PropertyDefinition name="PushedColour" initialValue="FFFFFFFF" redrawOnWrite="true" />
+        <PropertyDefinition name="OpenedColour" initialValue="FFFFFFFF" redrawOnWrite="true" />
+        <Property name="WantsMultiClickEvents" value="False" />
+        <NamedArea name="ContentSize">
+            <Area>
+                <Dim type="LeftEdge"><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge"><AbsoluteDim value="0" /></Dim>
+                <Dim type="Width">
+                    <FontDim type="HorzExtent">
+                        <DimOperator op="Add">
+                            <ImageDim imageset="TaharezLook" image="MenuLeft" dimension="Width">
+                                <DimOperator op="Add">
+                                    <ImageDim imageset="TaharezLook" image="MenuRight" dimension="Width" />
+                                </DimOperator>
+                            </ImageDim>
+                        </DimOperator>
+                    </FontDim>
+                </Dim>
+                <Dim type="Height">
+                    <FontDim type="LineSpacing">
+                        <DimOperator op="Add">
+                            <ImageDim imageset="TaharezLook" image="MenuTop" dimension="Height">
+                                <DimOperator op="Add">
+                                    <ImageDim imageset="TaharezLook" image="MenuBottom" dimension="Height" />
+                                </DimOperator>
+                            </ImageDim>
+                        </DimOperator>
+                    </FontDim>
+                </Dim>
+            </Area>
+        </NamedArea>
+        <NamedArea name="HasPopupContentSize">
+            <Area>
+                <Dim type="LeftEdge"><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge"><AbsoluteDim value="0" /></Dim>
+                <Dim type="Width">
+                    <FontDim type="HorzExtent">
+                        <DimOperator op="Add">
+                            <ImageDim imageset="TaharezLook" image="MenuLeft" dimension="Width">
+                                <DimOperator op="Add">
+                                    <ImageDim imageset="TaharezLook" image="MenuRight" dimension="Width">
+                                        <DimOperator op="Add">
+                                            <ImageDim imageset="TaharezLook" image="PopupMenuArrowLeft" dimension="Width">
+                                                <DimOperator op="Multiply">
+                                                    <AbsoluteDim value="3" />
+                                                </DimOperator>
+                                            </ImageDim>
+                                        </DimOperator>
+                                    </ImageDim>
+                                </DimOperator>
+                            </ImageDim>
+                        </DimOperator>
+                    </FontDim>
+                </Dim>
+                <Dim type="Height">
+                    <FontDim type="LineSpacing">
+                        <DimOperator op="Add">
+                            <ImageDim imageset="TaharezLook" image="MenuTop" dimension="Height">
+                                <DimOperator op="Add">
+                                    <ImageDim imageset="TaharezLook" image="MenuBottom" dimension="Height" />
+                                </DimOperator>
+                            </ImageDim>
+                        </DimOperator>
+                    </FontDim>
+                </Dim>
+            </Area>
+        </NamedArea>
+        <ImagerySection name="label">
+            <TextComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="MenuLeft" dimension="Width" /></Dim>
+                    <Dim type="TopEdge" ><ImageDim imageset="TaharezLook" image="MenuTop" dimension="Height" /></Dim>
+                    <Dim type="RightEdge" >
+                        <UnifiedDim scale="1" type="RightEdge">
+                            <DimOperator op="Subtract">
+                                <ImageDim imageset="TaharezLook" image="MenuRight" dimension="Width" />
+                            </DimOperator>
+                        </UnifiedDim>
+                    </Dim>
+                    <Dim type="BottomEdge" >
+                        <UnifiedDim scale="1" type="BottomEdge">
+                            <DimOperator op="Subtract">
+                                <ImageDim imageset="TaharezLook" image="MenuBottom" dimension="Height" />
+                            </DimOperator>
+                        </UnifiedDim>
+                    </Dim>
+                </Area>
+                <VertFormat type="CentreAligned" />
+                <HorzFormat type="LeftAligned" />
+            </TextComponent>
+        </ImagerySection>
+        <ImagerySection name="frame">
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image type="TopLeftCorner" imageset="TaharezLook" image="MenuTopLeft" />
+                <Image type="TopRightCorner" imageset="TaharezLook" image="MenuTopRight" />
+                <Image type="BottomLeftCorner" imageset="TaharezLook" image="MenuBottomLeft" />
+                <Image type="BottomRightCorner" imageset="TaharezLook" image="MenuBottomRight" />
+                <Image type="LeftEdge" imageset="TaharezLook" image="MenuLeft" />
+                <Image type="RightEdge" imageset="TaharezLook" image="MenuRight" />
+                <Image type="TopEdge" imageset="TaharezLook" image="MenuTop" />
+                <Image type="BottomEdge" imageset="TaharezLook" image="MenuBottom" />
+                <Image type="Background" imageset="TaharezLook" image="MenuMiddle" />
+            </FrameComponent>
+        </ImagerySection>
+        <ImagerySection name="popup_arrow_right">
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" >
+                        <UnifiedDim scale="1" type="Width">
+                            <DimOperator op="Subtract">
+                                <ImageDim imageset="TaharezLook" image="PopupMenuArrowRight" dimension="Width" />
+                            </DimOperator>
+                        </UnifiedDim>
+                    </Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="PopupMenuArrowRight" />
+                <VertFormat type="CentreAligned" />
+                <HorzFormat type="RightAligned" />
+            </ImageryComponent>
+        </ImagerySection>
+        <ImagerySection name="popup_arrow_left">
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" >
+                        <UnifiedDim scale="1" type="Width">
+                            <DimOperator op="Subtract">
+                                <ImageDim imageset="TaharezLook" image="PopupMenuArrowLeft" dimension="Width" />
+                            </DimOperator>
+                        </UnifiedDim>
+                    </Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="PopupMenuArrowLeft" />
+                <VertFormat type="CentreAligned" />
+                <HorzFormat type="RightAligned" />
+            </ImageryComponent>
+        </ImagerySection>
+        <StateImagery name="EnabledNormal">
+            <Layer>
+                <Section section="label">
+                    <ColourProperty name="NormalTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="EnabledHover">
+            <Layer>
+                <Section section="frame">
+                    <ColourProperty name="HoverColour" />
+                </Section>
+                <Section section="label">
+                    <ColourProperty name="NormalTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="EnabledPushed">
+            <Layer>
+                <Section section="frame">
+                    <ColourProperty name="PushedColour" />
+                </Section>
+                <Section section="label">
+                    <ColourProperty name="NormalTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="EnabledPopupOpen">
+            <Layer>
+                <Section section="frame">
+                    <ColourProperty name="OpenedColour" />
+                </Section>
+                <Section section="label">
+                    <ColourProperty name="NormalTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="DisabledNormal">
+            <Layer>
+                <Section section="label">
+                    <ColourProperty name="DisabledTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="DisabledHover">
+            <Layer>
+                <Section section="frame">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+                <Section section="label">
+                    <ColourProperty name="DisabledTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="DisabledPushed">
+            <Layer>
+                <Section section="frame">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+                <Section section="label">
+                    <ColourProperty name="DisabledTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="DisabledPopupOpen">
+            <Layer>
+                <Section section="frame">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+                <Section section="label">
+                    <ColourProperty name="DisabledTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="PopupClosedIcon">
+            <Layer>
+                <Section section="popup_arrow_right" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="PopupOpenIcon">
+            <Layer>
+                <Section section="popup_arrow_left" />
+            </Layer>
+        </StateImagery>
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/PopupMenu
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/PopupMenu">
+        <PropertyDefinition name="BackgroundColours" initialValue="tl:FFFFFFFF tr:FFFFFFFF bl:FFFFFFFF br:FFFFFFFF" redrawOnWrite="true" />
+        <PropertyDefinition name="BorderWidth" initialValue="0" layoutOnWrite="true" />
+        <NamedArea name="ItemRenderArea">
+            <Area>
+                <Dim type="LeftEdge" >
+                    <ImageDim imageset="TaharezLook" image="PopupMenuFrameLeft" dimension="Width">
+                        <DimOperator op="Add">
+                            <PropertyDim name="BorderWidth" />
+                        </DimOperator>
+                    </ImageDim>
+                </Dim>
+                <Dim type="TopEdge" >
+                    <ImageDim imageset="TaharezLook" image="PopupMenuFrameTop" dimension="Height">
+                        <DimOperator op="Add">
+                            <PropertyDim name="BorderWidth" />
+                        </DimOperator>
+                    </ImageDim>
+                </Dim>
+                <Dim type="RightEdge" >
+                    <UnifiedDim scale="1" type="RightEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="PopupMenuFrameRight" dimension="Width">
+                                <DimOperator op="Add">
+                                    <PropertyDim name="BorderWidth" />
+                                </DimOperator>
+                            </ImageDim>
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="BottomEdge" >
+                    <UnifiedDim scale="1" type="BottomEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="PopupMenuFrameBottom" dimension="Height">
+                                <DimOperator op="Add">
+                                    <PropertyDim name="BorderWidth" />
+                                </DimOperator>
+                            </ImageDim>
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+        </NamedArea>
+        <ImagerySection name="frame">
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image type="TopLeftCorner" imageset="TaharezLook" image="PopupMenuFrameTopLeft" />
+                <Image type="TopRightCorner" imageset="TaharezLook" image="PopupMenuFrameTopRight" />
+                <Image type="BottomLeftCorner" imageset="TaharezLook" image="PopupMenuFrameBottomLeft" />
+                <Image type="BottomRightCorner" imageset="TaharezLook" image="PopupMenuFrameBottomRight" />
+                <Image type="LeftEdge" imageset="TaharezLook" image="PopupMenuFrameLeft" />
+                <Image type="RightEdge" imageset="TaharezLook" image="PopupMenuFrameRight" />
+                <Image type="TopEdge" imageset="TaharezLook" image="PopupMenuFrameTop" />
+                <Image type="BottomEdge" imageset="TaharezLook" image="PopupMenuFrameBottom" />
+                <Image type="Background" imageset="TaharezLook" image="PopupMenuMiddle" />
+            </FrameComponent>
+        </ImagerySection>
+        <StateImagery name="Enabled">
+            <Layer>
+                <Section section="frame">
+                    <ColourRectProperty name="BackgroundColours" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Disabled">
+            <Layer>
+                <Section section="frame">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+            </Layer>
+        </StateImagery>
+    </WidgetLook>
+    
+    
+    <!--
+    ***************************************************
+        TaharezLook/Menubar
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/Menubar">
+        <PropertyDefinition name="BackgroundColours" initialValue="tl:FFFFFFFF tr:FFFFFFFF bl:FFFFFFFF br:FFFFFFFF" redrawOnWrite="true" />
+        <PropertyDefinition name="BorderWidth" initialValue="5" layoutOnWrite="true" />
+        <NamedArea name="ItemRenderArea">
+            <Area>
+                <Dim type="LeftEdge" >
+                    <ImageDim imageset="TaharezLook" image="PopupMenuFrameLeft" dimension="Width">
+                        <DimOperator op="Add">
+                            <PropertyDim name="BorderWidth" />
+                        </DimOperator>
+                    </ImageDim>
+                </Dim>
+                <Dim type="TopEdge" >
+                    <ImageDim imageset="TaharezLook" image="PopupMenuFrameTop" dimension="Height">
+                        <DimOperator op="Add">
+                            <PropertyDim name="BorderWidth" />
+                        </DimOperator>
+                    </ImageDim>
+                </Dim>
+                <Dim type="RightEdge" >
+                    <UnifiedDim scale="1" type="RightEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="PopupMenuFrameRight" dimension="Width">
+                                <DimOperator op="Add">
+                                    <PropertyDim name="BorderWidth" />
+                                </DimOperator>
+                            </ImageDim>
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="BottomEdge" >
+                    <UnifiedDim scale="1" type="BottomEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="PopupMenuFrameBottom" dimension="Height">
+                                <DimOperator op="Add">
+                                    <PropertyDim name="BorderWidth" />
+                                </DimOperator>
+                            </ImageDim>
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+        </NamedArea>
+        <ImagerySection name="frame">
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image type="TopLeftCorner" imageset="TaharezLook" image="PopupMenuFrameTopLeft" />
+                <Image type="TopRightCorner" imageset="TaharezLook" image="PopupMenuFrameTopRight" />
+                <Image type="BottomLeftCorner" imageset="TaharezLook" image="PopupMenuFrameBottomLeft" />
+                <Image type="BottomRightCorner" imageset="TaharezLook" image="PopupMenuFrameBottomRight" />
+                <Image type="LeftEdge" imageset="TaharezLook" image="PopupMenuFrameLeft" />
+                <Image type="RightEdge" imageset="TaharezLook" image="PopupMenuFrameRight" />
+                <Image type="TopEdge" imageset="TaharezLook" image="PopupMenuFrameTop" />
+                <Image type="BottomEdge" imageset="TaharezLook" image="PopupMenuFrameBottom" />
+                <Image type="Background" imageset="TaharezLook" image="PopupMenuMiddle" />
+            </FrameComponent>
+        </ImagerySection>
+        <StateImagery name="Enabled">
+            <Layer>
+                <Section section="frame">
+                    <ColourRectProperty name="BackgroundColours" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Disabled">
+            <Layer>
+                <Section section="frame">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+            </Layer>
+        </StateImagery>
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/LargeVerticalScrollbarThumb
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/LargeVerticalScrollbarThumb">
+        <Property name="VertFree" value="True" />
+        <ImagerySection name="normal">
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1.0" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1.0" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="VertScrollThumbNormal" />
+                <VertFormat type="Stretched" />
+                <HorzFormat type="Stretched" />
+            </ImageryComponent>
+        </ImagerySection>
+        <ImagerySection name="hover">
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1.0" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1.0" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="VertScrollThumbHover" />
+                <VertFormat type="Stretched" />
+                <HorzFormat type="Stretched" />
+            </ImageryComponent>
+        </ImagerySection>
+        <StateImagery name="Normal">
+            <Layer>
+                <Section section="normal" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Hover">
+            <Layer>
+                <Section section="hover" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Pushed">
+            <Layer>
+                <Section section="normal" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Disabled">
+            <Layer>
+                <Section section="normal">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+            </Layer>
+        </StateImagery>
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/LargeVerticalScrollbar
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/LargeVerticalScrollbar">
+        <Property name="VerticalScrollbar" value="True" />
+        <NamedArea name="ThumbTrackArea">
+            <Area>
+                <Dim type="LeftEdge" ><UnifiedDim scale="0.325" type="LeftEdge" /></Dim>
+                <Dim type="TopEdge" >
+                    <WidgetDim widget="__auto_decbtn__" dimension="Height">
+                        <DimOperator op="Add">
+                            <ImageDim imageset="TaharezLook" image="VertScrollTop" dimension="Height">
+                                <DimOperator op="Multiply">
+                                    <AbsoluteDim value="0.5" />
+                                </DimOperator>
+                            </ImageDim>
+                        </DimOperator>
+                    </WidgetDim>
+                </Dim>
+                <Dim type="RightEdge" ><UnifiedDim scale="1.0" type="RightEdge" /></Dim>
+                <Dim type="BottomEdge" >
+                    <UnifiedDim scale="1.0" type="BottomEdge">
+                        <DimOperator op="Subtract">
+                            <WidgetDim widget="__auto_decbtn__" dimension="Height">
+                                <DimOperator op="Add">
+                                    <ImageDim imageset="TaharezLook" image="VertScrollTop" dimension="Height">
+                                        <DimOperator op="Multiply">
+                                            <AbsoluteDim value="0.5" />
+                                        </DimOperator>
+                                    </ImageDim>
+                                </DimOperator>
+                            </WidgetDim>
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+        </NamedArea>
+        <Child  type="TaharezLook/ImageButton" nameSuffix="__auto_incbtn__">
+            <Area>
+                <Dim type="LeftEdge" ><UnifiedDim scale="0.25" type="LeftEdge" /></Dim>
+                <Dim type="TopEdge" >
+                    <AbsoluteDim value="-1">
+                        <DimOperator op="Multiply">
+                            <ImageDim imageset="TaharezLook" image="VertScrollTop" dimension="Height">
+                                <DimOperator op="Multiply">
+                                    <AbsoluteDim value="0.5" />
+                                </DimOperator>
+                            </ImageDim>
+                        </DimOperator>
+                    </AbsoluteDim>
+                </Dim>
+                <Dim type="Width" ><UnifiedDim scale="0.6" type="Width" /></Dim>
+                <Dim type="Height" >
+                    <UnifiedDim scale="0.6" type="Width">
+                        <DimOperator op="Multiply">
+                            <ImageDim imageset="TaharezLook" image="VertScrollUpNormal" dimension="Width">
+                                <DimOperator op="Divide">
+                                    <ImageDim imageset="TaharezLook" image="VertScrollUpNormal" dimension="Height"/>
+                                </DimOperator>
+                            </ImageDim>
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+            <VertAlignment type="BottomAligned" />
+            <Property name="NormalImage" value="set:TaharezLook image:VertScrollDownNormal" />
+            <Property name="HoverImage" value="set:TaharezLook image:VertScrollDownHover" />
+            <Property name="PushedImage" value="set:TaharezLook image:VertScrollDownNormal" />
+        </Child>
+        <Child  type="TaharezLook/ImageButton" nameSuffix="__auto_decbtn__">
+            <Area>
+                <Dim type="LeftEdge" ><UnifiedDim scale="0.25" type="LeftEdge" /></Dim>
+                <Dim type="TopEdge">
+                    <ImageDim imageset="TaharezLook" image="VertScrollTop" dimension="Height">
+                        <DimOperator op="Multiply">
+                            <AbsoluteDim value="0.5" />
+                        </DimOperator>
+                    </ImageDim>
+                </Dim>
+                <Dim type="Width" ><UnifiedDim scale="0.6" type="Width" /></Dim>
+                <Dim type="Height" >
+                    <UnifiedDim scale="0.6" type="Width">
+                        <DimOperator op="Multiply">
+                            <ImageDim imageset="TaharezLook" image="VertScrollUpNormal" dimension="Width">
+                                <DimOperator op="Divide">
+                                    <ImageDim imageset="TaharezLook" image="VertScrollUpNormal" dimension="Height"/>
+                                </DimOperator>
+                            </ImageDim>
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+            <Property name="NormalImage" value="set:TaharezLook image:VertScrollUpNormal" />
+            <Property name="HoverImage" value="set:TaharezLook image:VertScrollUpHover" />
+            <Property name="PushedImage" value="set:TaharezLook image:VertScrollUpNormal" />
+        </Child>
+        <Child  type="TaharezLook/LargeVerticalScrollbarThumb" nameSuffix="__auto_thumb__">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="Width" ><UnifiedDim scale="0.4" type="Width" /></Dim>
+                <Dim type="Height" >
+                    <UnifiedDim scale="0.4" type="Width">
+                        <DimOperator op="Multiply">
+                            <ImageDim imageset="TaharezLook" image="VertScrollThumbNormal" dimension="Height">
+                                <DimOperator op="Divide">
+                                    <ImageDim imageset="TaharezLook" image="VertScrollThumbNormal" dimension="Width"/>
+                                </DimOperator>
+                            </ImageDim>
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+        </Child>
+        <ImagerySection name="main">
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image type="TopEdge" imageset="TaharezLook" image="VertScrollTop" />
+                <Image type="BottomEdge" imageset="TaharezLook" image="VertScrollBottom" />
+                <Image type="Background" imageset="TaharezLook" image="VertScrollMiddle" />
+            </FrameComponent>
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><UnifiedDim scale="0.45" type="LeftEdge" /></Dim>
+                    <Dim type="TopEdge" >
+                        <WidgetDim widget="__auto_decbtn__" dimension="Height">
+                            <DimOperator op="Add">
+                                <ImageDim imageset="TaharezLook" image="VertScrollTop" dimension="Height">
+                                    <DimOperator op="Multiply">
+                                        <AbsoluteDim value="0.5" />
+                                    </DimOperator>
+                                </ImageDim>
+                            </DimOperator>
+                        </WidgetDim>
+                    </Dim>
+                    <Dim type="RightEdge" ><UnifiedDim scale="1.0" type="RightEdge" /></Dim>
+                    <Dim type="BottomEdge" >
+                        <UnifiedDim scale="1.0" type="BottomEdge">
+                            <DimOperator op="Subtract">
+                                <WidgetDim widget="__auto_decbtn__" dimension="Height">
+                                    <DimOperator op="Add">
+                                        <ImageDim imageset="TaharezLook" image="VertScrollTop" dimension="Height">
+                                            <DimOperator op="Multiply">
+                                                <AbsoluteDim value="0.5" />
+                                            </DimOperator>
+                                        </ImageDim>
+                                    </DimOperator>
+                                </WidgetDim>
+                            </DimOperator>
+                        </UnifiedDim>
+                    </Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="VertScrollBarSegment" />
+                <VertFormat type="Tiled" />
+            </ImageryComponent>
+        </ImagerySection>
+        <StateImagery name="Enabled">
+            <Layer>
+                <Section section="main" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Disabled">
+            <Layer>
+                <Section section="main">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+            </Layer>
+        </StateImagery>
+    </WidgetLook>
+
+    <!--
+    ***************************************************
+        TaharezLook/ImageButton
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/ImageButton">
+        <PropertyDefinition name="NormalImage" initialValue="" redrawOnWrite="true" />
+        <PropertyDefinition name="HoverImage" initialValue="" redrawOnWrite="true" />
+        <PropertyDefinition name="PushedImage" initialValue="" redrawOnWrite="true" />
+        <PropertyDefinition name="DisabledImage" initialValue="" redrawOnWrite="true" />
+        <PropertyDefinition name="VertImageFormatting" initialValue="Stretched" redrawOnWrite="true" />
+        <PropertyDefinition name="HorzImageFormatting" initialValue="Stretched" redrawOnWrite="true" />
+        <ImagerySection name="normal">
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <ImageProperty name="NormalImage" />
+                <VertFormatProperty name="VertImageFormatting" />
+                <HorzFormatProperty name="HorzImageFormatting" />
+            </ImageryComponent>
+        </ImagerySection>
+        <ImagerySection name="hover">
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <ImageProperty name="HoverImage" />
+                <VertFormatProperty name="VertImageFormatting" />
+                <HorzFormatProperty name="HorzImageFormatting" />
+            </ImageryComponent>
+        </ImagerySection>
+        <ImagerySection name="pushed">
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <ImageProperty name="PushedImage" />
+                <VertFormatProperty name="VertImageFormatting" />
+                <HorzFormatProperty name="HorzImageFormatting" />
+            </ImageryComponent>
+        </ImagerySection>
+        <ImagerySection name="disabled">
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <ImageProperty name="DisabledImage" />
+                <VertFormatProperty name="VertImageFormatting" />
+                <HorzFormatProperty name="HorzImageFormatting" />
+            </ImageryComponent>
+        </ImagerySection>
+        <StateImagery name="Normal">
+            <Layer>
+                <Section section="normal" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Hover">
+            <Layer>
+                <Section section="hover" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Pushed">
+            <Layer>
+                <Section section="pushed" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="PushedOff">
+            <Layer>
+                <Section section="hover" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Disabled">
+            <Layer>
+                <Section section="disabled" />
+            </Layer>
+        </StateImagery>
+    </WidgetLook>
+
+</Falagard>
+
Index: code/trunk/Tutorial/Media/gui/TaharezLookSkin.scheme
===================================================================
--- code/trunk/Tutorial/Media/gui/TaharezLookSkin.scheme	(revision 44)
+++ code/trunk/Tutorial/Media/gui/TaharezLookSkin.scheme	(revision 44)
@@ -0,0 +1,48 @@
+<?xml version="1.0" ?>
+<GUIScheme Name="TaharezLook">
+	<Imageset Name="TaharezLook" Filename="TaharezLook.imageset" />
+    <Font Name="BlueHighway-12" Filename="bluehighway-12.font" />
+    <Font Name="BlueHighway-10" Filename="bluehighway-10.font" />
+    <Font Name="BlueHighway-8" Filename="bluehighway-8.font" />
+	<LookNFeel Filename="TaharezLook.looknfeel" />
+	<WindowRendererSet Filename="CEGUIFalagardWRBase" />
+	<FalagardMapping WindowType="TaharezLook/Button"      TargetType="CEGUI/PushButton"  Renderer="Falagard/Button"       LookNFeel="TaharezLook/Button" />
+	<FalagardMapping WindowType="TaharezLook/Checkbox"    TargetType="CEGUI/Checkbox"    Renderer="Falagard/ToggleButton" LookNFeel="TaharezLook/Checkbox" />
+	<FalagardMapping WindowType="TaharezLook/ImageButton" TargetType="CEGUI/PushButton"  Renderer="Falagard/Button"       LookNFeel="TaharezLook/ImageButton" />
+	<FalagardMapping WindowType="TaharezLook/RadioButton" TargetType="CEGUI/RadioButton" Renderer="Falagard/ToggleButton" LookNFeel="TaharezLook/RadioButton" />
+	<FalagardMapping WindowType="TaharezLook/FrameWindow"  TargetType="CEGUI/FrameWindow" Renderer="Falagard/FrameWindow"  LookNFeel="TaharezLook/FrameWindow" />
+	<FalagardMapping WindowType="TaharezLook/Titlebar"     TargetType="CEGUI/Titlebar"    Renderer="Falagard/Titlebar"     LookNFeel="TaharezLook/Titlebar" />
+	<FalagardMapping WindowType="TaharezLook/SystemButton" TargetType="CEGUI/PushButton"  Renderer="Falagard/SystemButton" LookNFeel="TaharezLook/Button" />
+	<FalagardMapping WindowType="TaharezLook/Editbox"          TargetType="CEGUI/Editbox"          Renderer="Falagard/Editbox"          LookNFeel="TaharezLook/Editbox" />
+	<FalagardMapping WindowType="TaharezLook/MultiLineEditbox" TargetType="CEGUI/MultiLineEditbox" Renderer="Falagard/MultiLineEditbox" LookNFeel="TaharezLook/MultiLineEditbox" />
+	<FalagardMapping WindowType="TaharezLook/Menubar"   TargetType="CEGUI/Menubar"   Renderer="Falagard/Menubar"   LookNFeel="TaharezLook/Menubar" />
+	<FalagardMapping WindowType="TaharezLook/PopupMenu" TargetType="CEGUI/PopupMenu" Renderer="Falagard/PopupMenu" LookNFeel="TaharezLook/PopupMenu" />
+	<FalagardMapping WindowType="TaharezLook/MenuItem"  TargetType="CEGUI/MenuItem"  Renderer="Falagard/MenuItem"  LookNFeel="TaharezLook/MenuItem" />
+	<FalagardMapping WindowType="TaharezLook/AlternateProgressBar" TargetType="CEGUI/ProgressBar" Renderer="Falagard/ProgressBar" LookNFeel="TaharezLook/AltProgressBar" />
+	<FalagardMapping WindowType="TaharezLook/ProgressBar"          TargetType="CEGUI/ProgressBar" Renderer="Falagard/ProgressBar" LookNFeel="TaharezLook/ProgressBar" />
+	<FalagardMapping WindowType="TaharezLook/VUMeter"              TargetType="CEGUI/ProgressBar" Renderer="Falagard/ProgressBar" LookNFeel="TaharezLook/VUMeter" />
+	<FalagardMapping WindowType="TaharezLook/VerticalScrollbar"   TargetType="CEGUI/Scrollbar" Renderer="Falagard/Scrollbar" LookNFeel="TaharezLook/VerticalScrollbar" />
+	<FalagardMapping WindowType="TaharezLook/HorizontalScrollbar" TargetType="CEGUI/Scrollbar" Renderer="Falagard/Scrollbar" LookNFeel="TaharezLook/HorizontalScrollbar" />
+	<FalagardMapping WindowType="TaharezLook/VerticalScrollbarThumb"   TargetType="CEGUI/Thumb" Renderer="Falagard/Button" LookNFeel="TaharezLook/VerticalScrollbarThumb" />
+	<FalagardMapping WindowType="TaharezLook/HorizontalScrollbarThumb" TargetType="CEGUI/Thumb" Renderer="Falagard/Button" LookNFeel="TaharezLook/HorizontalScrollbarThumb" />
+	<FalagardMapping WindowType="TaharezLook/LargeVerticalScrollbar"      TargetType="CEGUI/Scrollbar" Renderer="Falagard/Scrollbar" LookNFeel="TaharezLook/LargeVerticalScrollbar" />
+	<FalagardMapping WindowType="TaharezLook/LargeVerticalScrollbarThumb" TargetType="CEGUI/Thumb"     Renderer="Falagard/Button"    LookNFeel="TaharezLook/LargeVerticalScrollbarThumb" />
+	<FalagardMapping WindowType="TaharezLook/TabButton"  TargetType="CEGUI/TabButton"  Renderer="Falagard/TabButton"  LookNFeel="TaharezLook/TabButton" />
+	<FalagardMapping WindowType="TaharezLook/TabControl" TargetType="CEGUI/TabControl" Renderer="Falagard/TabControl" LookNFeel="TaharezLook/TabControl" />
+	<FalagardMapping WindowType="TaharezLook/TabContentPane"    TargetType="DefaultWindow"    Renderer="Falagard/Default"    LookNFeel="TaharezLook/TabContentPane" />
+	<FalagardMapping WindowType="TaharezLook/TabButtonPane"    TargetType="DefaultWindow"    Renderer="Falagard/Default"    LookNFeel="TaharezLook/TabButtonPane" />
+	<FalagardMapping WindowType="TaharezLook/ComboDropList" TargetType="CEGUI/ComboDropList" Renderer="Falagard/Listbox" LookNFeel="TaharezLook/ComboDropList" />
+	<FalagardMapping WindowType="TaharezLook/ComboEditbox"  TargetType="CEGUI/Editbox"	 Renderer="Falagard/Editbox" LookNFeel="TaharezLook/ComboEditbox" />
+	<FalagardMapping WindowType="TaharezLook/Combobox"	TargetType="CEGUI/Combobox"	 Renderer="Falagard/Default" LookNFeel="TaharezLook/Combobox" />
+	<FalagardMapping WindowType="TaharezLook/Listbox"           TargetType="CEGUI/Listbox"           Renderer="Falagard/Listbox"           LookNFeel="TaharezLook/Listbox" />
+	<FalagardMapping WindowType="TaharezLook/ListHeader"        TargetType="CEGUI/ListHeader"        Renderer="Falagard/ListHeader"        LookNFeel="TaharezLook/ListHeader" />
+	<FalagardMapping WindowType="TaharezLook/ListHeaderSegment" TargetType="CEGUI/ListHeaderSegment" Renderer="Falagard/ListHeaderSegment" LookNFeel="TaharezLook/ListHeaderSegment" />
+	<FalagardMapping WindowType="TaharezLook/MultiColumnList"   TargetType="CEGUI/MultiColumnList"   Renderer="Falagard/MultiColumnList"   LookNFeel="TaharezLook/MultiColumnList" />
+	<FalagardMapping WindowType="TaharezLook/Slider"      TargetType="CEGUI/Slider"      Renderer="Falagard/Slider"  LookNFeel="TaharezLook/Slider" />
+	<FalagardMapping WindowType="TaharezLook/SliderThumb" TargetType="CEGUI/Thumb" Renderer="Falagard/Button"  LookNFeel="TaharezLook/SliderThumb" />
+	<FalagardMapping WindowType="TaharezLook/ScrollablePane" TargetType="CEGUI/ScrollablePane" Renderer="Falagard/ScrollablePane" LookNFeel="TaharezLook/ScrollablePane" />
+	<FalagardMapping WindowType="TaharezLook/Spinner" TargetType="CEGUI/Spinner" Renderer="Falagard/Default" LookNFeel="TaharezLook/Spinner" />
+	<FalagardMapping WindowType="TaharezLook/Tooltip" TargetType="CEGUI/Tooltip" Renderer="Falagard/Tooltip" LookNFeel="TaharezLook/Tooltip" />
+	<FalagardMapping WindowType="TaharezLook/StaticImage" TargetType="DefaultWindow" Renderer="Falagard/StaticImage" LookNFeel="TaharezLook/StaticImage" />
+	<FalagardMapping WindowType="TaharezLook/StaticText"  TargetType="DefaultWindow" Renderer="Falagard/StaticText"  LookNFeel="TaharezLook/StaticText" />
+</GUIScheme>
Index: code/trunk/Tutorial/Media/gui/TaharezLookWidgetAliases.scheme
===================================================================
--- code/trunk/Tutorial/Media/gui/TaharezLookWidgetAliases.scheme	(revision 44)
+++ code/trunk/Tutorial/Media/gui/TaharezLookWidgetAliases.scheme	(revision 44)
@@ -0,0 +1,34 @@
+<?xml version="1.0" ?>
+<GUIScheme Name="TaharezLookWidgetAliases">
+	<WindowAlias Alias="Taharez AltProgressBar" Target="TaharezLook/AlternateProgressBar" />
+	<WindowAlias Alias="Taharez Button" Target="TaharezLook/Button" />
+	<WindowAlias Alias="Taharez Checkbox" Target="TaharezLook/Checkbox" />
+	<WindowAlias Alias="Taharez Close Button" Target="TaharezLook/CloseButton" />
+	<WindowAlias Alias="Taharez Combobox" Target="TaharezLook/Combobox" />
+	<WindowAlias Alias="Taharez ComboDropList" Target="TaharezLook/ComboDropList" />
+	<WindowAlias Alias="Taharez ComboEditbox" Target="TaharezLook/ComboEditbox" />
+	<WindowAlias Alias="Taharez Editbox" Target="TaharezLook/Editbox" />
+	<WindowAlias Alias="Taharez Frame Window" Target="TaharezLook/FrameWindow" />
+	<WindowAlias Alias="Taharez Listbox" Target="TaharezLook/Listbox" />
+	<WindowAlias Alias="Taharez ListHeader" Target="TaharezLook/ListHeader" />
+	<WindowAlias Alias="Taharez ListHeaderSegment" Target="TaharezLook/ListHeaderSegment" />
+	<WindowAlias Alias="Taharez MiniHorzScrollbar" Target="TaharezLook/HorizontalScrollbar" />
+	<WindowAlias Alias="Taharez MiniHorzScrollbarThumb" Target="TaharezLook/HorizontalScrollbarThumb" />
+	<WindowAlias Alias="Taharez MiniVertScrollbar" Target="TaharezLook/VerticalScrollbar" />
+	<WindowAlias Alias="Taharez MiniVertScrollbarThumb" Target="TaharezLook/VerticalScrollbarThumb" />
+	<WindowAlias Alias="Taharez MultiColumnList" Target="TaharezLook/MultiColumnList" />
+	<WindowAlias Alias="Taharez MultiLineEditbox" Target="TaharezLook/MultiLineEditbox" />
+	<WindowAlias Alias="Taharez ProgressBar" Target="TaharezLook/ProgressBar" />
+	<WindowAlias Alias="Taharez RadioButton" Target="TaharezLook/RadioButton" />
+	<WindowAlias Alias="Taharez Slider" Target="TaharezLook/Slider" />
+	<WindowAlias Alias="Taharez Slider Thumb" Target="TaharezLook/SliderThumb" />
+	<WindowAlias Alias="Taharez StaticImage" Target="TaharezLook/StaticImage" />
+	<WindowAlias Alias="Taharez StaticText" Target="TaharezLook/StaticText" />
+	<WindowAlias Alias="Taharez Tab Button" Target="TaharezLook/TabButton" />
+	<WindowAlias Alias="Taharez Tab Pane" Target="TaharezLook/TabPane" />
+	<WindowAlias Alias="Taharez Tab Control" Target="TaharezLook/TabControl" />
+	<WindowAlias Alias="Taharez Titlebar" Target="TaharezLook/Titlebar" />
+	<WindowAlias Alias="Taharez VertScrollbar" Target="TaharezLook/LargeVerticalScrollbar" />
+	<WindowAlias Alias="Taharez VertScrollbarThumb" Target="TaharezLook/LargeVerticalScrollbarThumb" />
+</GUIScheme>
+
Index: code/trunk/Tutorial/Media/gui/bluehighway-10.font
===================================================================
--- code/trunk/Tutorial/Media/gui/bluehighway-10.font	(revision 44)
+++ code/trunk/Tutorial/Media/gui/bluehighway-10.font	(revision 44)
@@ -0,0 +1,2 @@
+<?xml version="1.0" ?>
+<Font Name="BlueHighway-10" Filename="bluehigh.ttf" Type="FreeType" Size="10" NativeHorzRes="1024" NativeVertRes="768" AutoScaled="false" AntiAlias="true" />
Index: code/trunk/Tutorial/Media/gui/bluehighway-12.font
===================================================================
--- code/trunk/Tutorial/Media/gui/bluehighway-12.font	(revision 44)
+++ code/trunk/Tutorial/Media/gui/bluehighway-12.font	(revision 44)
@@ -0,0 +1,2 @@
+<?xml version="1.0" ?>
+<Font Name="BlueHighway-12" Filename="bluehigh.ttf" Type="FreeType" Size="12" NativeHorzRes="800" NativeVertRes="600" AutoScaled="true"/>
Index: code/trunk/Tutorial/Media/gui/bluehighway-8.font
===================================================================
--- code/trunk/Tutorial/Media/gui/bluehighway-8.font	(revision 44)
+++ code/trunk/Tutorial/Media/gui/bluehighway-8.font	(revision 44)
@@ -0,0 +1,2 @@
+<?xml version="1.0" ?>
+<Font Name="BlueHighway-8" Filename="bluehigh.ttf" Type="FreeType" Size="8" NativeHorzRes="1024" NativeVertRes="768" AutoScaled="true" AntiAlias="true" />
Index: code/trunk/Tutorial/Media/gui/cegui8.layout
===================================================================
--- code/trunk/Tutorial/Media/gui/cegui8.layout	(revision 44)
+++ code/trunk/Tutorial/Media/gui/cegui8.layout	(revision 44)
@@ -0,0 +1,130 @@
+<?xml version="1.0" ?>
+<!-- Layout file from CEGUI Demo8 -->
+<GUILayout>
+<Window Type="DefaultGUISheet" Name="demo_root">
+
+	<Window Type="DefaultGUISheet" Name="Demo8">
+
+		<Property Name="UnifiedMaxSize" Value="{{1,0},{2,0}}" />
+		<Property Name="UnifiedSize" Value="{{1,0},{2,0}}"  />
+
+		<Window Type="TaharezLook/VerticalScrollbar" Name="Demo8/ViewScroll">
+			<Property Name="UnifiedPosition" Value="{{0.0,0},{0.0,0}}"  />
+			<Property Name="UnifiedSize" Value="{{0.03,0},{0.75,0}}"  />
+			<Property Name="DocumentSize" Value="2" />
+			<Property Name="PageSize" Value="1" />
+			<Property Name="StepSize" Value="0.01" />
+			<Property Name="OverlapSize" Value="0.5" />
+		</Window>
+
+        <Window Type="TaharezLook/FrameWindow" Name="Demo8/Window1">
+			<Property Name="UnifiedPosition" Value="{{0.05,0},{0.1,0}}"  />
+			<Property Name="UnifiedMaxSize" Value="{{0.5,0},{1,0}}" />
+			<Property Name="UnifiedMinSize" Value="{{0,128},{0,128}}" />
+			<Property Name="UnifiedSize" Value="{{0.4,0},{0.35,0}}"  />
+			<Property Name="Text" Value="Demo 8 - Listbox Demo" />
+
+			<Window Type="TaharezLook/Listbox" Name="Demo8/Window1/Listbox">
+				<Property Name="UnifiedPosition" Value="{{0.05,0},{0.1,0}}"  />
+				<Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+				<Property Name="UnifiedSize" Value="{{0.9,0},{0.33,0}}"  />
+			</Window>
+
+			<Window Type="TaharezLook/StaticText" Name="Demo8/Window1/Controls">
+				<Property Name="UnifiedPosition" Value="{{0.05,0},{0.45,0}}"  />
+				<Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+				<Property Name="UnifiedSize" Value="{{0.9,0},{0.5,0}}"  />
+
+                <Window Type="TaharezLook/HorizontalScrollbar" Name="Demo8/Window1/Controls/Red">
+					<Property Name="UnifiedPosition" Value="{{0.05,0},{0.05,0}}"  />
+					<Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+					<Property Name="UnifiedSize" Value="{{0.9,0},{0.06,0}}"  />
+					<Property Name="DocumentSize" Value="255" />
+					<Property Name="PageSize" Value="16" />
+					<Property Name="StepSize" Value="1" />
+					<Property Name="OverlapSize" Value="1" />
+				</Window>
+
+                <Window Type="TaharezLook/HorizontalScrollbar" Name="Demo8/Window1/Controls/Green">
+					<Property Name="UnifiedPosition" Value="{{0.05,0},{0.12,0}}"  />
+					<Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+					<Property Name="UnifiedSize" Value="{{0.9,0},{0.06,0}}"  />
+					<Property Name="DocumentSize" Value="256" />
+					<Property Name="PageSize" Value="16" />
+					<Property Name="StepSize" Value="1" />
+					<Property Name="OverlapSize" Value="1" />
+				</Window>
+
+                <Window Type="TaharezLook/HorizontalScrollbar" Name="Demo8/Window1/Controls/Blue">
+					<Property Name="UnifiedPosition" Value="{{0.05,0},{0.19,0}}"  />
+					<Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+					<Property Name="UnifiedSize" Value="{{0.9,0},{0.06,0}}"  />
+					<Property Name="DocumentSize" Value="255" />
+					<Property Name="PageSize" Value="16" />
+					<Property Name="StepSize" Value="1" />
+					<Property Name="OverlapSize" Value="1" />
+				</Window>
+
+				<Window Type="TaharezLook/StaticImage" Name="Demo8/Window1/Controls/ColourSample">
+					<Property Name="UnifiedPosition" Value="{{0.05,0},{0.26,0}}"  />
+					<Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+					<Property Name="UnifiedSize" Value="{{0.9,0},{0.1,0}}"  />
+					<Property Name="Image" Value="set:TaharezLook image:ListboxSelectionBrush" />
+					<Property Name="ImageColours" Value="tl:0 tr:0 bl:0 br:0" />
+				</Window>
+
+				<Window Type="TaharezLook/Editbox" Name="Demo8/Window1/Controls/Editbox">
+					<Property Name="UnifiedPosition" Value="{{0.05,0},{0.38,0}}"  />
+					<Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+					<Property Name="UnifiedSize" Value="{{0.6,0},{0.15,0}}"  />
+				</Window>
+
+                <Window Type="TaharezLook/Button" Name="Demo8/Window1/Controls/Add">
+					<Property Name="UnifiedPosition" Value="{{0.68,0},{0.38,0}}"  />
+					<Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+					<Property Name="UnifiedSize" Value="{{0.3,0},{0.15,0}}"  />
+					<Property Name="Text" Value="Add" />
+				</Window>
+
+                <Window Type="TaharezLook/StaticText" Name="Demo8/Window1/Controls/ins1">
+					<Property Name="UnifiedPosition" Value="{{0.05,0},{0.55,0}}"  />
+					<Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+					<Property Name="UnifiedSize" Value="{{0.9,0},{0.4,0}}"  />
+					<Property Name="HorzFormatting" Value="WordWrapCentred" />
+					<Property Name="Text" Value="Use this panel to add items.  The scrollbars change the selection colour." />
+				</Window>
+
+			</Window>
+			
+		</Window>
+
+        <Window Type="TaharezLook/FrameWindow" Name="Demo8/Window2">
+			<Property Name="UnifiedPosition" Value="{{0.55,0},{0.1,0}}"  />
+			<Property Name="UnifiedMaxSize" Value="{{0.5,0},{1,0}}" />
+			<Property Name="UnifiedMinSize" Value="{{0,128},{0,128}}" />
+			<Property Name="UnifiedSize" Value="{{0.4,0},{0.3,0}}"  />
+			<Property Name="Text" Value="Demo 8 - Information Window" />
+
+            <Window Type="TaharezLook/StaticText" Name="Demo8/Window2/Info">
+				<Property Name="UnifiedPosition" Value="{{0.05,0},{0.1,0}}"  />
+				<Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+				<Property Name="UnifiedSize" Value="{{0.9,0},{0.3,0}}"  />
+				<Property Name="HorzFormatting" Value="WordWrapCentred" />
+				<Property Name="Text" Value="The panel below gives some information about the item under the mouse." />
+			</Window>
+	
+            <Window Type="TaharezLook/StaticText" Name="Demo8/Window2/Tips">
+				<Property Name="UnifiedPosition" Value="{{0.05,0},{0.5,0}}"  />
+				<Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+				<Property Name="UnifiedSize" Value="{{0.9,0},{0.4,0}}"  />
+				<Property Name="HorzFormatting" Value="WordWrapCentred" />
+			</Window>
+
+		</Window>
+
+
+	</Window>
+
+</Window>
+
+</GUILayout>
Index: code/trunk/Tutorial/Media/gui/facial.layout
===================================================================
--- code/trunk/Tutorial/Media/gui/facial.layout	(revision 44)
+++ code/trunk/Tutorial/Media/gui/facial.layout	(revision 44)
@@ -0,0 +1,379 @@
+<?xml version="1.0" ?>
+<GUILayout>
+<Window Type="DefaultGUISheet" Name="root">
+    <Window Type="DefaultGUISheet" Name="FacialDemo">
+		<Property Name="UnifiedSize" Value="{{0.25,0},{1,0}}" />
+
+		<Window Type="TaharezLook/FrameWindow" Name="OgreGuiDemo/WindowPropertiesWindow">
+
+			<Property Name="UnifiedSize" Value="{{0,200},{0,400}}" />
+            <Property Name="UnifiedPosition" Value="{{0,0},{0,0.52}}" />
+            <Property Name="TitlebarEnabled" Value="false" />
+            <Property Name="CloseButtonEnabled" Value="false" />
+			<Property Name="Text" Value="Editor Window" />
+			<Window Type="TaharezLook/RadioButton" Name="Facial/Radio/Play">
+				<Property Name="Font" Value="BlueHighway-12"/>
+
+				<Property Name="UnifiedPosition" Value="{{0,15},{0,5}}" />
+				<Property Name="UnifiedSize" Value="{{0,90},{0,40}}" />
+                <Property Name="Text" Value="Animation" />
+            </Window>
+			<Window Type="TaharezLook/RadioButton" Name="Facial/Radio/Manual">
+				<Property Name="Font" Value="BlueHighway-12"/>
+
+                <Property Name="UnifiedPosition" Value="{{0,110},{0,5}}" />
+				<Property Name="UnifiedSize" Value="{{0,90},{0,40}}" />
+                <Property Name="Text" Value="Manual" />
+			</Window>				
+			<Window Type="TaharezLook/StaticText" Name="Facial/Expressions">
+				<Property Name="FrameEnabled" Value="False"/>
+				<Property Name="BackgroundEnabled" Value="False"/>
+				<Property Name="Font" Value="BlueHighway-12"/>
+
+				<Property Name="UnifiedPosition" Value="{{0,5},{0,35}}" />
+				<Property Name="UnifiedSize" Value="{{0,190},{0,40}}" />
+                <Property Name="Text" Value="Expressions" />
+            </Window>
+			<Window Type="TaharezLook/StaticText" Name="Facial/Happy_Label">
+				<Property Name="FrameEnabled" Value="False"/>
+				<Property Name="BackgroundEnabled" Value="False"/>
+				<Property Name="Font" Value="BlueHighway-12"/>
+
+				<Property Name="UnifiedPosition" Value="{{0,5},{0,55}}" />
+				<Property Name="UnifiedSize" Value="{{0,60},{0,40}}" />
+                <Property Name="Text" Value="Happy" />
+            </Window>
+			<Window Type="TaharezLook/HorizontalScrollbar" Name="Facial/Happy_Scroll">
+
+                <Property Name="UnifiedPosition" Value="{{0,60},{0,75}}" />
+				<Property Name="UnifiedSize" Value="{{0,120},{0,10}}" />
+				<Property Name="DocumentSize" Value="1.1" />
+				<Property Name="PageSize" Value="0.1" />
+				<Property Name="StepSize" Value="0.05" />
+				<Property Name="OverlapSize" Value="0.05" />
+            </Window>
+			<Window Type="TaharezLook/StaticText" Name="Facial/Sad_Label">
+				<Property Name="FrameEnabled" Value="False"/>
+				<Property Name="BackgroundEnabled" Value="False"/>
+				<Property Name="Font" Value="BlueHighway-12"/>
+
+				<Property Name="UnifiedPosition" Value="{{0,5},{0,70}}" />
+				<Property Name="UnifiedSize" Value="{{0,60},{0,40}}" />
+                <Property Name="Text" Value="Sad" />
+            </Window>
+			<Window Type="TaharezLook/HorizontalScrollbar" Name="Facial/Sad_Scroll">
+
+				<Property Name="UnifiedPosition" Value="{{0,60},{0,90}}" />
+				<Property Name="UnifiedSize" Value="{{0,120},{0,10}}" />
+				<Property Name="DocumentSize" Value="1.1" />
+				<Property Name="PageSize" Value="0.1" />
+				<Property Name="StepSize" Value="0.05" />
+				<Property Name="OverlapSize" Value="0.05" />
+            </Window>
+			<Window Type="TaharezLook/StaticText" Name="Facial/Angry_Label">
+				<Property Name="FrameEnabled" Value="False"/>
+				<Property Name="BackgroundEnabled" Value="False"/>
+				<Property Name="Font" Value="BlueHighway-12"/>
+
+                <Property Name="UnifiedPosition" Value="{{0,5},{0,85}}" />
+				<Property Name="UnifiedSize" Value="{{0,60},{0,40}}" />
+                <Property Name="Text" Value="Angry" />
+            </Window>
+			<Window Type="TaharezLook/HorizontalScrollbar" Name="Facial/Angry_Scroll">
+
+                <Property Name="UnifiedPosition" Value="{{0,60},{0,105}}" />
+				<Property Name="UnifiedSize" Value="{{0,120},{0,10}}" />
+				<Property Name="DocumentSize" Value="1.1" />
+				<Property Name="PageSize" Value="0.1" />
+				<Property Name="StepSize" Value="0.05" />
+				<Property Name="OverlapSize" Value="0.05" />
+			</Window>
+
+			<Window Type="TaharezLook/StaticText" Name="Facial/MouthShapes">
+				<Property Name="FrameEnabled" Value="False"/>
+				<Property Name="BackgroundEnabled" Value="False"/>
+				<Property Name="Font" Value="BlueHighway-12"/>
+
+				<Property Name="UnifiedPosition" Value="{{0,5},{0,110}}" />
+				<Property Name="UnifiedSize" Value="{{0,150},{0,40}}" />
+                <Property Name="Text" Value="Mouth Shapes" />
+            </Window>
+
+			<Window Type="TaharezLook/StaticText" Name="Facial/A_Label">
+				<Property Name="FrameEnabled" Value="False"/>
+				<Property Name="BackgroundEnabled" Value="False"/>
+				<Property Name="Font" Value="BlueHighway-12"/>
+
+                <Property Name="UnifiedPosition" Value="{{0,25},{0,135}}" />
+				<Property Name="UnifiedSize" Value="{{0,30},{0,40}}" />
+                <Property Name="Text" Value="A" />
+            </Window>
+			<Window Type="TaharezLook/HorizontalScrollbar" Name="Facial/A_Scroll">
+
+				<Property Name="UnifiedPosition" Value="{{0,60},{0,150}}" />
+				<Property Name="UnifiedSize" Value="{{0,120},{0,10}}" />
+				<Property Name="DocumentSize" Value="1.1" />
+				<Property Name="PageSize" Value="0.1" />
+				<Property Name="StepSize" Value="0.05" />
+				<Property Name="OverlapSize" Value="0.05" />
+            </Window>
+			<Window Type="TaharezLook/StaticText" Name="Facial/E_Label">
+				<Property Name="FrameEnabled" Value="False"/>
+				<Property Name="BackgroundEnabled" Value="False"/>
+				<Property Name="Font" Value="BlueHighway-12"/>
+
+				<Property Name="UnifiedPosition" Value="{{0,25},{0,150}}" />
+				<Property Name="UnifiedSize" Value="{{0,30},{0,40}}" />
+                <Property Name="Text" Value="E" />
+            </Window>
+			<Window Type="TaharezLook/HorizontalScrollbar" Name="Facial/E_Scroll">
+
+				<Property Name="UnifiedPosition" Value="{{0,60},{0,165}}" />
+				<Property Name="UnifiedSize" Value="{{0,120},{0,10}}" />
+				<Property Name="DocumentSize" Value="1.1" />
+				<Property Name="PageSize" Value="0.1" />
+				<Property Name="StepSize" Value="0.05" />
+				<Property Name="OverlapSize" Value="0.05" />
+            </Window>
+			<Window Type="TaharezLook/StaticText" Name="Facial/I_Label">
+				<Property Name="FrameEnabled" Value="False"/>
+				<Property Name="BackgroundEnabled" Value="False"/>
+				<Property Name="Font" Value="BlueHighway-12"/>
+
+                <Property Name="UnifiedPosition" Value="{{0,25},{0,165}}" />
+				<Property Name="UnifiedSize" Value="{{0,30},{0,40}}" />
+                <Property Name="Text" Value="I" />
+            </Window>
+			<Window Type="TaharezLook/HorizontalScrollbar" Name="Facial/I_Scroll">
+
+                <Property Name="UnifiedPosition" Value="{{0,60},{0,180}}" />
+				<Property Name="UnifiedSize" Value="{{0,120},{0,10}}" />
+				<Property Name="DocumentSize" Value="1.1" />
+				<Property Name="PageSize" Value="0.1" />
+				<Property Name="StepSize" Value="0.05" />
+				<Property Name="OverlapSize" Value="0.05" />
+            </Window>
+			<Window Type="TaharezLook/StaticText" Name="Facial/O_Label">
+				<Property Name="FrameEnabled" Value="False"/>
+				<Property Name="BackgroundEnabled" Value="False"/>
+				<Property Name="Font" Value="BlueHighway-12"/>
+
+				<Property Name="UnifiedPosition" Value="{{0,25},{0,180}}" />
+				<Property Name="UnifiedSize" Value="{{0,30},{0,40}}" />
+                <Property Name="Text" Value="O" />
+            </Window>
+			<Window Type="TaharezLook/HorizontalScrollbar" Name="Facial/O_Scroll">
+
+                <Property Name="UnifiedPosition" Value="{{0,60},{0,195}}" />
+				<Property Name="UnifiedSize" Value="{{0,120},{0,10}}" />
+				<Property Name="DocumentSize" Value="1.1" />
+				<Property Name="PageSize" Value="0.1" />
+				<Property Name="StepSize" Value="0.05" />
+				<Property Name="OverlapSize" Value="0.05" />
+            </Window>
+			<Window Type="TaharezLook/StaticText" Name="Facial/U_Label">
+				<Property Name="FrameEnabled" Value="False"/>
+				<Property Name="BackgroundEnabled" Value="False"/>
+				<Property Name="Font" Value="BlueHighway-12"/>
+
+                <Property Name="UnifiedPosition" Value="{{0,25},{0,195}}" />
+				<Property Name="UnifiedSize" Value="{{0,30},{0,40}}" />
+                <Property Name="Text" Value="U" />
+            </Window>
+			<Window Type="TaharezLook/HorizontalScrollbar" Name="Facial/U_Scroll">
+
+                <Property Name="UnifiedPosition" Value="{{0,60},{0,210}}" />
+				<Property Name="UnifiedSize" Value="{{0,120},{0,10}}" />
+				<Property Name="DocumentSize" Value="1.1" />
+				<Property Name="PageSize" Value="0.1" />
+				<Property Name="StepSize" Value="0.05" />
+				<Property Name="OverlapSize" Value="0.05" />
+            </Window>
+			<Window Type="TaharezLook/StaticText" Name="Facial/C_Label">
+				<Property Name="FrameEnabled" Value="False"/>
+				<Property Name="BackgroundEnabled" Value="False"/>
+				<Property Name="Font" Value="BlueHighway-12"/>
+
+                <Property Name="UnifiedPosition" Value="{{0,25},{0,210}}" />
+				<Property Name="UnifiedSize" Value="{{0,30},{0,40}}" />
+                <Property Name="Text" Value="C" />
+            </Window>
+			<Window Type="TaharezLook/HorizontalScrollbar" Name="Facial/C_Scroll">
+
+                <Property Name="UnifiedPosition" Value="{{0,60},{0,225}}" />
+				<Property Name="UnifiedSize" Value="{{0,120},{0,10}}" />
+				<Property Name="DocumentSize" Value="1.1" />
+				<Property Name="PageSize" Value="0.1" />
+				<Property Name="StepSize" Value="0.05" />
+				<Property Name="OverlapSize" Value="0.05" />
+			</Window>
+			<Window Type="TaharezLook/StaticText" Name="Facial/W_Label">
+				<Property Name="FrameEnabled" Value="False"/>
+				<Property Name="BackgroundEnabled" Value="False"/>
+				<Property Name="Font" Value="BlueHighway-12"/>
+
+				<Property Name="UnifiedPosition" Value="{{0,25},{0,225}}" />
+				<Property Name="UnifiedSize" Value="{{0,30},{0,40}}" />
+                <Property Name="Text" Value="W" />
+            </Window>
+			<Window Type="TaharezLook/HorizontalScrollbar" Name="Facial/W_Scroll">
+
+                <Property Name="UnifiedPosition" Value="{{0,60},{0,240}}" />
+				<Property Name="UnifiedSize" Value="{{0,120},{0,10}}" />
+				<Property Name="DocumentSize" Value="1.1" />
+				<Property Name="PageSize" Value="0.1" />
+				<Property Name="StepSize" Value="0.05" />
+				<Property Name="OverlapSize" Value="0.05" />
+            </Window>
+			<Window Type="TaharezLook/StaticText" Name="Facial/M_Label">
+				<Property Name="FrameEnabled" Value="False"/>
+				<Property Name="BackgroundEnabled" Value="False"/>
+				<Property Name="Font" Value="BlueHighway-12"/>
+
+                <Property Name="UnifiedPosition" Value="{{0,25},{0,240}}" />
+				<Property Name="UnifiedSize" Value="{{0,30},{0,40}}" />
+                <Property Name="Text" Value="M" />
+            </Window>
+			<Window Type="TaharezLook/HorizontalScrollbar" Name="Facial/M_Scroll">
+
+				<Property Name="UnifiedPosition" Value="{{0,60},{0,255}}" />
+				<Property Name="UnifiedSize" Value="{{0,120},{0,10}}" />
+				<Property Name="DocumentSize" Value="1.1" />
+				<Property Name="PageSize" Value="0.1" />
+				<Property Name="StepSize" Value="0.05" />
+				<Property Name="OverlapSize" Value="0.05" />
+            </Window>
+			<Window Type="TaharezLook/StaticText" Name="Facial/L_Label">
+				<Property Name="FrameEnabled" Value="False"/>
+				<Property Name="BackgroundEnabled" Value="False"/>
+				<Property Name="Font" Value="BlueHighway-12"/>
+
+                <Property Name="UnifiedPosition" Value="{{0,25},{0,255}}" />
+				<Property Name="UnifiedSize" Value="{{0,30},{0,40}}" />
+                <Property Name="Text" Value="L" />
+            </Window>
+			<Window Type="TaharezLook/HorizontalScrollbar" Name="Facial/L_Scroll">
+
+				<Property Name="UnifiedPosition" Value="{{0,60},{0,270}}" />
+				<Property Name="UnifiedSize" Value="{{0,120},{0,10}}" />
+				<Property Name="DocumentSize" Value="1.1" />
+				<Property Name="PageSize" Value="0.1" />
+				<Property Name="StepSize" Value="0.05" />
+				<Property Name="OverlapSize" Value="0.05" />
+            </Window>
+			<Window Type="TaharezLook/StaticText" Name="Facial/F_Label">
+				<Property Name="FrameEnabled" Value="False"/>
+				<Property Name="BackgroundEnabled" Value="False"/>
+				<Property Name="Font" Value="BlueHighway-12"/>
+
+                <Property Name="UnifiedPosition" Value="{{0,25},{0,270}}" />
+				<Property Name="UnifiedSize" Value="{{0,30},{0,40}}" />
+                <Property Name="Text" Value="F" />
+            </Window>
+			<Window Type="TaharezLook/HorizontalScrollbar" Name="Facial/F_Scroll">
+
+                <Property Name="UnifiedPosition" Value="{{0,60},{0,285}}" />
+				<Property Name="UnifiedSize" Value="{{0,120},{0,10}}" />
+				<Property Name="DocumentSize" Value="1.1" />
+				<Property Name="PageSize" Value="0.1" />
+				<Property Name="StepSize" Value="0.05" />
+				<Property Name="OverlapSize" Value="0.05" />
+            </Window>
+			<Window Type="TaharezLook/StaticText" Name="Facial/T_Label">
+				<Property Name="FrameEnabled" Value="False"/>
+				<Property Name="BackgroundEnabled" Value="False"/>
+				<Property Name="Font" Value="BlueHighway-12"/>
+
+                <Property Name="UnifiedPosition" Value="{{0,25},{0,285}}" />
+				<Property Name="UnifiedSize" Value="{{0,30},{0,40}}" />
+                <Property Name="Text" Value="T" />
+            </Window>
+			<Window Type="TaharezLook/HorizontalScrollbar" Name="Facial/T_Scroll">
+
+				<Property Name="UnifiedPosition" Value="{{0,60},{0,300}}" />
+				<Property Name="UnifiedSize" Value="{{0,120},{0,10}}" />
+				<Property Name="DocumentSize" Value="1.1" />
+				<Property Name="PageSize" Value="0.1" />
+				<Property Name="StepSize" Value="0.05" />
+				<Property Name="OverlapSize" Value="0.05" />
+            </Window>
+			<Window Type="TaharezLook/StaticText" Name="Facial/P_Label">
+				<Property Name="FrameEnabled" Value="False"/>
+				<Property Name="BackgroundEnabled" Value="False"/>
+				<Property Name="Font" Value="BlueHighway-12"/>
+
+                <Property Name="UnifiedPosition" Value="{{0,25},{0,300}}" />
+				<Property Name="UnifiedSize" Value="{{0,30},{0,40}}" />
+                <Property Name="Text" Value="P" />
+            </Window>
+			<Window Type="TaharezLook/HorizontalScrollbar" Name="Facial/P_Scroll">
+
+                <Property Name="UnifiedPosition" Value="{{0,60},{0,315}}" />
+				<Property Name="UnifiedSize" Value="{{0,120},{0,10}}" />
+				<Property Name="DocumentSize" Value="1.1" />
+				<Property Name="PageSize" Value="0.1" />
+				<Property Name="StepSize" Value="0.05" />
+				<Property Name="OverlapSize" Value="0.05" />
+            </Window>
+			<Window Type="TaharezLook/StaticText" Name="Facial/R_Label">
+				<Property Name="FrameEnabled" Value="False"/>
+				<Property Name="BackgroundEnabled" Value="False"/>
+				<Property Name="Font" Value="BlueHighway-12"/>
+
+                <Property Name="UnifiedPosition" Value="{{0,25},{0,315}}" />
+				<Property Name="UnifiedSize" Value="{{0,30},{0,40}}" />
+                <Property Name="Text" Value="R" />
+            </Window>
+			<Window Type="TaharezLook/HorizontalScrollbar" Name="Facial/R_Scroll">
+
+                <Property Name="UnifiedPosition" Value="{{0,60},{0,330}}" />
+				<Property Name="UnifiedSize" Value="{{0,120},{0,10}}" />
+				<Property Name="DocumentSize" Value="1.1" />
+				<Property Name="PageSize" Value="0.1" />
+				<Property Name="StepSize" Value="0.05" />
+				<Property Name="OverlapSize" Value="0.05" />
+            </Window>
+			<Window Type="TaharezLook/StaticText" Name="Facial/S_Label">
+				<Property Name="FrameEnabled" Value="False"/>
+				<Property Name="BackgroundEnabled" Value="False"/>
+				<Property Name="Font" Value="BlueHighway-12"/>
+
+                <Property Name="UnifiedPosition" Value="{{0,25},{0,330}}" />
+				<Property Name="UnifiedSize" Value="{{0,30},{0,40}}" />
+                <Property Name="Text" Value="S" />
+            </Window>
+			<Window Type="TaharezLook/HorizontalScrollbar" Name="Facial/S_Scroll">
+
+                <Property Name="UnifiedPosition" Value="{{0,60},{0,345}}" />
+				<Property Name="UnifiedSize" Value="{{0,120},{0,10}}" />
+				<Property Name="DocumentSize" Value="1.1" />
+				<Property Name="PageSize" Value="0.1" />
+				<Property Name="StepSize" Value="0.05" />
+				<Property Name="OverlapSize" Value="0.05" />
+            </Window>
+			<Window Type="TaharezLook/StaticText" Name="Facial/TH_Label">
+				<Property Name="FrameEnabled" Value="False"/>
+				<Property Name="BackgroundEnabled" Value="False"/>
+				<Property Name="Font" Value="BlueHighway-12"/>
+
+                <Property Name="UnifiedPosition" Value="{{0,25},{0,345}}" />
+				<Property Name="UnifiedSize" Value="{{0,35},{0,40}}" />
+                <Property Name="Text" Value="TH" />
+            </Window>
+			<Window Type="TaharezLook/HorizontalScrollbar" Name="Facial/TH_Scroll">
+
+                <Property Name="UnifiedPosition" Value="{{0,60},{0,360}}" />
+				<Property Name="UnifiedSize" Value="{{0,120},{0,10}}" />
+				<Property Name="DocumentSize" Value="1.1" />
+				<Property Name="PageSize" Value="0.1" />
+				<Property Name="StepSize" Value="0.05" />
+				<Property Name="OverlapSize" Value="0.05" />
+            </Window>
+			
+			<!-- A, U, O, E, I, C, W, M, L, F, T, P, R, S, TH -->
+
+        </Window>
+	</Window>
+</Window>
+
+</GUILayout>
Index: code/trunk/Tutorial/Media/gui/ogregui.layout
===================================================================
--- code/trunk/Tutorial/Media/gui/ogregui.layout	(revision 44)
+++ code/trunk/Tutorial/Media/gui/ogregui.layout	(revision 44)
@@ -0,0 +1,79 @@
+<?xml version="1.0" ?>
+<GUILayout>
+<Window Type="DefaultGUISheet" Name="root">
+    <Window Type="DefaultGUISheet" Name="OgreGuiDemo">
+		<Property Name="UnifiedSize" Value="{{0.25,0},{1,0}}" />
+
+        <Window Type="TaharezLook/TabControl" Name="OgreGuiDemo/TabCtrl">
+            <Property Name="UnifiedPosition" Value="{{0.0,0},{0.0,0}}" />
+            <Property Name="UnifiedSize" Value="{{1,0},{0.5,0}}" />
+
+            <Window Type="DefaultGUISheet" Name="OgreGuiDemo/TabCtrl/Page1">
+                <Property Name="Text" Value="File" />
+                <Window Type="TaharezLook/Button" Name="OgreGuiDemo/TabCtrl/Page1/NewButton">
+                    <Property Name="UnifiedPosition" Value="{{0.1,0},{0.1,0}}" />
+                    <Property Name="UnifiedSize" Value="{{0.8,0},{0.07,0}}" />
+                    <Property Name="Text" Value="New" />
+                </Window>
+                <Window Type="TaharezLook/Button" Name="OgreGuiDemo/TabCtrl/Page1/LoadButton">
+                    <Property Name="UnifiedPosition" Value="{{0.1,0},{0.2,0}}" />
+                    <Property Name="UnifiedSize" Value="{{0.8,0},{0.07,0}}" />
+                    <Property Name="Text" Value="Load Test Layout" />
+                </Window>
+                <Window Type="TaharezLook/Button" Name="OgreGuiDemo/TabCtrl/Page1/QuitButton">
+                    <Property Name="UnifiedPosition" Value="{{0.1,0},{0.3,0}}" />
+                    <Property Name="UnifiedSize" Value="{{0.8,0},{0.07,0}}" />
+                    <Property Name="Text" Value="Quit" />
+                </Window>
+            </Window>
+            <Window Type="DefaultGUISheet" Name="OgreGuiDemo/TabCtrl/Page2">
+                <Property Name="Text" Value="Objects" />
+                <Window Type="TaharezLook/Combobox" Name="OgreGuiDemo/TabCtrl/Page2/ObjectTypeList">
+                    <Property Name="UnifiedPosition" Value="{{0.1,0},{0.1,0}}" />
+                    <Property Name="UnifiedSize" Value="{{0.8,0},{0.5,0}}" />
+                    <Property Name="Text" Value="Select Type" />
+                    <Property Name="ClippedByParent" Value="false" />
+                    <Property Name="ReadOnly" Value="true" />
+                </Window>
+            </Window>
+        </Window>
+        <!--<Window Type="TaharezLook/FrameWindow" Name="OgreGuiDemo/WindowPropertiesWindow">
+            <Property Name="UnifiedSize" Value="{{1,0},{0.3,0}}" />
+            <Property Name="UnifiedPosition" Value="{{0,0},{0.52,0}}" />
+            <Property Name="TitlebarEnabled" Value="false" />
+            <Property Name="CloseButtonEnabled" Value="false" />
+            <Property Name="Visible" Value="false" />
+            <Property Name="Text" Value="Editor Window" />
+            <Window Type="TaharezLook/StaticText" Name="OgreGuiDemo/WindowProperties/NameText">
+                <Property Name="UnifiedPosition" Value="{{0.05,0},{0.2,0}}" />
+                <Property Name="UnifiedSize" Value="{{0.9,0},{0.4,0}}" />
+                <Property Name="Text" Value="Name:" />
+            </Window>
+
+            <Window Type="TaharezLook/Button" Name="OgreGuiDemo/WindowPropertiesWindow/OKButton">
+                <Property Name="UnifiedPosition" Value="{{0.15,0},{0.8,0}}" />
+                <Property Name="UnifiedSize" Value="{{0.3,0},{0.1,0}}" />
+                <Property Name="Text" Value="OK" />
+            </Window>
+            <Window Type="TaharezLook/Button" Name="OgreGuiDemo/WindowPropertiesWindow/CancelButton">
+                <Property Name="UnifiedPosition" Value="{{0.55,0},{0.8,0}}" />
+                <Property Name="UnifiedSize" Value="{{0.3,0},{0.1,0}}" />
+                <Property Name="Text" Value="Cancel" />
+            </Window>
+        </Window>-->
+	</Window>
+    <Window Type="DefaultGUISheet" Name="OgreGuiDemo2">
+		<Property Name="UnifiedSize" Value="{{0.75,0},{1,0}}" />
+		<Property Name="UnifiedPosition" Value="{{0.25,0},{0,0}}" />
+        <Window Type="TaharezLook/FrameWindow" Name="OgreGuiDemo2/MainWindow">
+            <Property Name="UnifiedSize" Value="{{1,0},{1,0}}" />
+            <Property Name="UnifiedPosition" Value="{{0,0},{0,0}}" />
+            <Property Name="DragMovingEnabled" Value="false" />
+            <Property Name="RollUpEnabled" Value="false" />
+            <Property Name="CloseButtonEnabled" Value="false" />
+            <Property Name="Text" Value="Editor Window" />
+        </Window>
+    </Window>
+</Window>
+
+</GUILayout>
Index: code/trunk/Tutorial/Media/gui/shadows.layout
===================================================================
--- code/trunk/Tutorial/Media/gui/shadows.layout	(revision 44)
+++ code/trunk/Tutorial/Media/gui/shadows.layout	(revision 44)
@@ -0,0 +1,247 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<GUILayout >
+    <Window Type="DefaultWindow" Name="Shadows" >
+        <Property Name="InheritsAlpha" Value="False" />
+        <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+        <Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{1,0},{1,0}}" />
+        <Window Type="TaharezLook/FrameWindow" Name="Shadows/Main" >
+            <Property Name="Font" Value="BlueHighway-12" />
+            <Property Name="Alpha" Value="0.5" />
+            <Property Name="FrameEnabled" Value="False" />
+            <Property Name="TitlebarFont" Value="BlueHighway-12" />
+            <Property Name="SizingEnabled" Value="False" />
+            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+            <Property Name="TitlebarEnabled" Value="False" />
+            <Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{0.797107,0},{0.148408,0}}" />
+            <Property Name="DragMovingEnabled" Value="False" />
+            <Property Name="CloseButtonEnabled" Value="False" />
+            <Window Type="TaharezLook/RadioButton" Name="Shadows/Stencil" >
+                <Property Name="ID" Value="1" />
+                <Property Name="Font" Value="BlueHighway-12" />
+                <Property Name="Text" Value="Stencil shadows" />
+                <Property Name="GroupID" Value="1" />
+                <Property Name="Tooltip" Value="Stencil Shadows: Geometric shadow volumes are generated from mesh silhouettes and extruded, shadowed areas calculated in the stencil buffer. Good on lower end hardware but cannot handle alpha or vertex programs that deform shape, and is too expensive at high poly counts. Sharp edged shadows." />
+                <Property Name="InheritsAlpha" Value="False" />
+                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                <Property Name="UnifiedAreaRect" Value="{{0.00465426,0},{0.167892,0},{0.192628,0},{0.344774,0}}" />
+            </Window>
+            <Window Type="TaharezLook/RadioButton" Name="Shadows/Texture" >
+                <Property Name="ID" Value="2" />
+                <Property Name="Font" Value="BlueHighway-12" />
+                <Property Name="Text" Value="Texture shadows" />
+                <Property Name="GroupID" Value="1" />
+                <Property Name="Tooltip" Value="Texture Shadows: Shadow casters are rendered to a texture and this is later projected onto shadow receivers. More flexible,  handles alpha and deforming vertex programs, and texture shadow can be used in shaders for more advanced effects. Uses more GPU memory and fixed size can cause aliasing (but see projection options)" />
+                <Property Name="InheritsAlpha" Value="False" />
+                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                <Property Name="UnifiedAreaRect" Value="{{0.00531136,0},{0.362541,0},{0.194019,0},{0.529099,0}}" />
+            </Window>
+            <Window Type="TaharezLook/StaticText" Name="Shadows/Label2" >
+                <Property Name="Font" Value="BlueHighway-12" />
+                <Property Name="Text" Value="Lighting:" />
+                <Property Name="TextColours" Value="tl:FFFFFF00 tr:FFFFFF00 bl:FFFFFF00 br:FFFFFF00" />
+                <Property Name="FrameEnabled" Value="False" />
+                <Property Name="InheritsAlpha" Value="False" />
+                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                <Property Name="UnifiedAreaRect" Value="{{0.19234,0},{-0.0189824,0},{0.303863,0},{0.18662,0}}" />
+                <Property Name="BackgroundEnabled" Value="False" />
+            </Window>
+            <Window Type="TaharezLook/StaticText" Name="Shadows/Label1" >
+                <Property Name="Font" Value="BlueHighway-12" />
+                <Property Name="Text" Value="Technique:" />
+                <Property Name="TextColours" Value="tl:FFFFFF00 tr:FFFFFF00 bl:FFFFFF00 br:FFFFFF00" />
+                <Property Name="FrameEnabled" Value="False" />
+                <Property Name="InheritsAlpha" Value="False" />
+                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                <Property Name="UnifiedAreaRect" Value="{{0.00658522,0},{-0.00904641,0},{0.160622,0},{0.186908,0}}" />
+                <Property Name="BackgroundEnabled" Value="False" />
+            </Window>
+            <Window Type="TaharezLook/RadioButton" Name="Shadows/Additive" >
+                <Property Name="ID" Value="3" />
+                <Property Name="Font" Value="BlueHighway-12" />
+                <Property Name="Text" Value="Additive" />
+                <Property Name="GroupID" Value="2" />
+                <Property Name="Tooltip" Value="Additive Lighting: Light is built up incrementally in the scene, and areas of shadow are masked out per light during the process. Much more realistic lighting model, taking into account multiple coloured lights and ambient contribution well, but more expensive since it can take more passes to render." />
+                <Property Name="InheritsAlpha" Value="False" />
+                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                <Property Name="UnifiedAreaRect" Value="{{0.196723,0},{0.174711,0},{0.327724,0},{0.348675,0}}" />
+            </Window>
+            <Window Type="TaharezLook/RadioButton" Name="Shadows/Modulative" >
+                <Property Name="ID" Value="4" />
+                <Property Name="Font" Value="BlueHighway-12" />
+                <Property Name="Text" Value="Modulative" />
+                <Property Name="GroupID" Value="2" />
+                <Property Name="Tooltip" Value="Modulative shadows: Shadowed areas are uniformly darkened by a shadow colour after rendering the scene normally. A simple but inaccurate model, it works best when there is one dominant light source (e.g. outdoor daylight). Multiple lights exhibit overdarkening artefacts." />
+                <Property Name="InheritsAlpha" Value="False" />
+                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                <Property Name="UnifiedAreaRect" Value="{{0.195901,0},{0.36936,0},{0.334983,0},{0.532604,0}}" />
+            </Window>
+            <Window Type="TaharezLook/StaticText" Name="Shadows/Desc" >
+                <Property Name="Font" Value="BlueHighway-10" />
+                <Property Name="Text" >
+</Property>
+                <Property Name="FrameEnabled" Value="False" />
+                <Property Name="InheritsAlpha" Value="False" />
+                <Property Name="HorzFormatting" Value="WordWrapLeftAligned" />
+                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                <Property Name="VertFormatting" Value="TopAligned" />
+                <Property Name="UnifiedAreaRect" Value="{{-0.00124776,0},{0.534509,0},{0.998327,0},{1.00537,0}}" />
+            </Window>
+            <Window Type="TaharezLook/StaticImage" Name="Shadows/ProjectionGroup" >
+                <Property Name="Font" Value="BlueHighway-12" />
+                <Property Name="FrameEnabled" Value="False" />
+                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                <Property Name="UnifiedAreaRect" Value="{{0.318294,0},{0.0269328,0},{0.547929,0},{0.488323,0}}" />
+                <Property Name="BackgroundEnabled" Value="False" />
+                <Window Type="TaharezLook/StaticText" Name="Shadows/Label21" >
+                    <Property Name="Font" Value="BlueHighway-12" />
+                    <Property Name="Text" Value="Projection:" />
+                    <Property Name="TextColours" Value="tl:FFFFFF00 tr:FFFFFF00 bl:FFFFFF00 br:FFFFFF00" />
+                    <Property Name="FrameEnabled" Value="False" />
+                    <Property Name="InheritsAlpha" Value="False" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.0242767,0},{-0.00538364,0},{0.514109,0},{0.300338,0}}" />
+                    <Property Name="BackgroundEnabled" Value="False" />
+                </Window>
+                <Window Type="TaharezLook/Combobox" Name="Shadows/Projection" >
+                    <Property Name="Font" Value="BlueHighway-12" />
+                    <Property Name="Tooltip" Value="Projection: This is the basis for the shadow projection. A uniform projection is the simplest but can also cause aliasing close to the camera due to the finite resolution of the shadow texture. You can plug new ShadowCameraSetup classes to change the projection basis and distribute the shadow texture differently to compensate for this." />
+                    <Property Name="ReadOnly" Value="True" />
+                    <Property Name="InheritsAlpha" Value="False" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="ClippedByParent" Value="False" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.0215161,0},{0.406132,0},{1.00682,0},{4,0}}" />
+                    <Property Name="MaxEditTextLength" Value="1073741823" />
+                </Window>
+            </Window>
+            <Window Type="TaharezLook/StaticImage" Name="Shadows/MaterialGroup" >
+                <Property Name="Font" Value="BlueHighway-12" />
+                <Property Name="FrameEnabled" Value="False" />
+                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                <Property Name="UnifiedAreaRect" Value="{{0.554514,0},{0.0286934,0},{0.927227,0},{0.490084,0}}" />
+                <Property Name="BackgroundEnabled" Value="False" />
+                <Window Type="TaharezLook/StaticText" Name="Shadows/Label211" >
+                    <Property Name="Font" Value="BlueHighway-12" />
+                    <Property Name="Text" Value="Material Setup:" />
+                    <Property Name="TextColours" Value="tl:FFFFFF00 tr:FFFFFF00 bl:FFFFFF00 br:FFFFFF00" />
+                    <Property Name="FrameEnabled" Value="False" />
+                    <Property Name="InheritsAlpha" Value="False" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="ClippedByParent" Value="False" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.021516,0},{-0.158454,0},{0.862772,0},{0.387132,0}}" />
+                    <Property Name="BackgroundEnabled" Value="False" />
+                </Window>
+                <Window Type="TaharezLook/Combobox" Name="Shadows/Material" >
+                    <Property Name="Font" Value="BlueHighway-12" />
+                    <Property Name="Tooltip" Value="Material setup: You can customise materials texture shadows with material; you can modify the standard shadow passes, which are separate from the normal render, or you can use &apos;custom sequence&apos; shadows which allow you to incorporate shadow textures directly in your own materials, thus gaining complete control. Both can use shaders for effects like PCF / depth shadowmapping." />
+                    <Property Name="ReadOnly" Value="True" />
+                    <Property Name="InheritsAlpha" Value="False" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="ClippedByParent" Value="False" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.021516,0},{0.406132,0},{0.731289,0},{4,0}}" />
+                    <Property Name="MaxEditTextLength" Value="1073741823" />
+                </Window>
+            </Window>
+            <Window Type="TaharezLook/StaticImage" Name="Shadows/DepthShadowTweakGroup" >
+                <Property Name="Font" Value="BlueHighway-12" />
+                <Property Name="FrameEnabled" Value="False" />
+                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                <Property Name="UnifiedAreaRect" Value="{{0.825038,0},{0.0186838,0},{0.999281,0},{0.548657,0}}" />
+                <Property Name="BackgroundEnabled" Value="False" />
+                <Window Type="TaharezLook/StaticText" Name="Shadows/DepthShadowTweakGroup/FixedBiasLabel" >
+                    <Property Name="Font" Value="BlueHighway-10" />
+                    <Property Name="Text" Value="FixedBias:" />
+                    <Property Name="TextColours" Value="tl:FFFFFF00 tr:FFFFFF00 bl:FFFFFF00 br:FFFFFF00" />
+                    <Property Name="FrameEnabled" Value="False" />
+                    <Property Name="InheritsAlpha" Value="False" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="ClippedByParent" Value="False" />
+					<Property Name="UnifiedAreaRect" Value="{{0.0316741,0},{0.0,0},{0.373716,0},{0.2,0}}" />
+                    <Property Name="BackgroundEnabled" Value="False" />
+                </Window>
+                <Window Type="TaharezLook/HorizontalScrollbar" Name="Shadows/DepthShadowTweakGroup/FixedBias" >
+                    <Property Name="PageSize" Value="0.001" />
+                    <Property Name="StepSize" Value="0.0005" />
+                    <Property Name="OverlapSize" Value="0.0005" />
+                    <Property Name="DocumentSize" Value="0.021" />
+                    <Property Name="InheritsAlpha" Value="False" />
+                    <Property Name="ScrollPosition" Value="0" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="ClippedByParent" Value="False" />
+					<Property Name="UnifiedAreaRect" Value="{{0.4,0},{0.0,0},{1,0},{0.15,0}}" />
+                </Window>
+                <Window Type="TaharezLook/StaticText" Name="Shadows/DepthShadowTweakGroup/FixedBiasText" >
+                    <Property Name="Font" Value="BlueHighway-10" />
+					<Property Name="Text" Value="" />
+                    <Property Name="FrameEnabled" Value="False" />
+                    <Property Name="InheritsAlpha" Value="False" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+					<Property Name="UnifiedAreaRect" Value="{{0.70,0},{0.125,0},{0.943746,0},{0.3,0}}" />
+                    <Property Name="BackgroundEnabled" Value="False" />
+                </Window>
+                <Window Type="TaharezLook/StaticText" Name="Shadows/DepthShadowTweakGroup/SlopeBiasLabel" >
+                    <Property Name="Font" Value="BlueHighway-10" />
+                    <Property Name="Text" Value="SlopeBias:" />
+                    <Property Name="TextColours" Value="tl:FFFFFF00 tr:FFFFFF00 bl:FFFFFF00 br:FFFFFF00" />
+                    <Property Name="FrameEnabled" Value="False" />
+                    <Property Name="InheritsAlpha" Value="False" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="ClippedByParent" Value="False" />
+					<Property Name="UnifiedAreaRect" Value="{{0.0316741,0},{0.35,0},{0.373716,0},{0.55,0}}" />
+                    <Property Name="BackgroundEnabled" Value="False" />
+                </Window>
+                <Window Type="TaharezLook/HorizontalScrollbar" Name="Shadows/DepthShadowTweakGroup/SlopeBias" >
+                    <Property Name="PageSize" Value="0.1" />
+                    <Property Name="StepSize" Value="0.05" />
+                    <Property Name="OverlapSize" Value="0.05" />
+                    <Property Name="DocumentSize" Value="2.1" />
+                    <Property Name="InheritsAlpha" Value="False" />
+                    <Property Name="ScrollPosition" Value="0" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="ClippedByParent" Value="False" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.4,0},{0.35,0},{1,0},{0.5,0}}" />
+                </Window>
+				<Window Type="TaharezLook/StaticText" Name="Shadows/DepthShadowTweakGroup/SlopeBiasText" >
+                    <Property Name="Font" Value="BlueHighway-10" />
+					<Property Name="Text" Value="" />
+                    <Property Name="FrameEnabled" Value="False" />
+                    <Property Name="InheritsAlpha" Value="False" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+					<Property Name="UnifiedAreaRect" Value="{{0.70,0},{0.475,0},{0.943746,0},{0.675,0}}" />
+                    <Property Name="BackgroundEnabled" Value="False" />
+                </Window>
+				<Window Type="TaharezLook/StaticText" Name="Shadows/DepthShadowTweakGroup/SlopeClampLabel" >
+                    <Property Name="Font" Value="BlueHighway-10" />
+					<Property Name="Text" Value="Clamp:" />
+                    <Property Name="TextColours" Value="tl:FFFFFF00 tr:FFFFFF00 bl:FFFFFF00 br:FFFFFF00" />
+                    <Property Name="FrameEnabled" Value="False" />
+                    <Property Name="InheritsAlpha" Value="False" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="ClippedByParent" Value="False" />
+					<Property Name="UnifiedAreaRect" Value="{{0.0316741,0},{0.675,0},{0.472153,0},{0.85,0}}" />
+                    <Property Name="BackgroundEnabled" Value="False" />
+                </Window>
+                <Window Type="TaharezLook/HorizontalScrollbar" Name="Shadows/DepthShadowTweakGroup/SlopeClamp" >
+                    <Property Name="PageSize" Value="0.01" />
+                    <Property Name="StepSize" Value="0.005" />
+                    <Property Name="OverlapSize" Value="0.005" />
+                    <Property Name="DocumentSize" Value="0.11" />
+                    <Property Name="InheritsAlpha" Value="False" />
+                    <Property Name="ScrollPosition" Value="0" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="ClippedByParent" Value="False" />
+					<Property Name="UnifiedAreaRect" Value="{{0.4,0},{0.7,0},{1,0},{0.85,0}}" />
+                </Window>
+				<Window Type="TaharezLook/StaticText" Name="Shadows/DepthShadowTweakGroup/SlopeClampText" >
+                    <Property Name="Font" Value="BlueHighway-10" />
+					<Property Name="Text" Value="" />
+                    <Property Name="FrameEnabled" Value="False" />
+                    <Property Name="InheritsAlpha" Value="False" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+					<Property Name="UnifiedAreaRect" Value="{{0.70,0},{0.825,0},{0.943746,0},{0.99,0}}" />
+                    <Property Name="BackgroundEnabled" Value="False" />
+                </Window>
+            </Window>
+        </Window>
+    </Window>
+</GUILayout>
Index: code/trunk/Tutorial/Media/materials/programs/AmbientOneTexture.glsl
===================================================================
--- code/trunk/Tutorial/Media/materials/programs/AmbientOneTexture.glsl	(revision 44)
+++ code/trunk/Tutorial/Media/materials/programs/AmbientOneTexture.glsl	(revision 44)
@@ -0,0 +1,13 @@
+uniform vec4 ambient;
+
+/*
+  Basic ambient lighting vertex program
+*/
+void main()
+{
+	gl_Position = ftransform();
+	gl_TexCoord[0] = gl_MultiTexCoord0;
+	gl_FrontColor = ambient;
+}
+
+
Index: code/trunk/Tutorial/Media/materials/programs/Bloom_ps20.hlsl
===================================================================
--- code/trunk/Tutorial/Media/materials/programs/Bloom_ps20.hlsl	(revision 44)
+++ code/trunk/Tutorial/Media/materials/programs/Bloom_ps20.hlsl	(revision 44)
@@ -0,0 +1,52 @@
+sampler Blur1: register(s1);
+sampler RT: register(s0);
+
+
+float luminance(float3 c)
+{
+	return dot( c, float3(0.3, 0.59, 0.11) );
+}
+
+float4 main(float2 texCoord: TEXCOORD0) : COLOR {
+	float4 sharp = tex2D(RT,   texCoord);
+	float4 blur  = tex2D(Blur1, texCoord);
+
+
+
+	return ( sharp + blur * 1.8 ) / 2;
+
+//	float4 color	= lerp( sharp, blur, 0.4f );
+
+//	return color;
+
+
+/*
+	return ( sharp + blur * 1.8 ) / 2 +
+			 luminance(blur) * 
+			 float4( 0.5, 0.5, 0.5, 0) +
+			 luminance(sharp) *
+			 float4( 0.3, 0.3, 0.3, 0);
+*/
+/*
+	return ( sharp + blur * 0.9) / 2 +
+			 luminance(blur) * float4(0.1, 0.15, 0.7, 0);
+*/
+
+/*
+	return ( sharp + blur * 0.9) / 2 +
+			 luminance(blur) * float4(0.1, 0.15, 0.7, 0);
+*/
+
+//	float4 retColor = luminance( sharp ) +
+//							luminance( blur ) + blur / 2;
+//	return retColor;
+}
+
+
+
+
+
+
+
+
+
Index: code/trunk/Tutorial/Media/materials/programs/Bloom_vs11.hlsl
===================================================================
--- code/trunk/Tutorial/Media/materials/programs/Bloom_vs11.hlsl	(revision 44)
+++ code/trunk/Tutorial/Media/materials/programs/Bloom_vs11.hlsl	(revision 44)
@@ -0,0 +1,21 @@
+
+struct VS_OUTPUT {
+   float4 Pos: POSITION;
+   float2 texCoord: TEXCOORD0;
+};
+
+VS_OUTPUT main(float4 Pos: POSITION){
+   VS_OUTPUT Out;
+
+   // Clean up inaccuracies
+   Pos.xy = sign(Pos.xy);
+
+   Out.Pos = float4(Pos.xy, 0, 1);
+   // Image-space
+   Out.texCoord.x = 0.5 * (1 + Pos.x);
+   Out.texCoord.y = 0.5 * (1 - Pos.y);
+
+   return Out;
+}
+
+
Index: code/trunk/Tutorial/Media/materials/programs/Blur0_ps20.hlsl
===================================================================
--- code/trunk/Tutorial/Media/materials/programs/Blur0_ps20.hlsl	(revision 44)
+++ code/trunk/Tutorial/Media/materials/programs/Blur0_ps20.hlsl	(revision 44)
@@ -0,0 +1,31 @@
+sampler RT: register(s0);
+// Simple blur filter
+
+float4 main(float2 texCoord: TEXCOORD0) : COLOR {
+
+	float2 samples[12] = {
+   	-0.326212, -0.405805,
+   	-0.840144, -0.073580,
+   	-0.695914,  0.457137,
+   	-0.203345,  0.620716,
+    	0.962340, -0.194983,
+    	0.473434, -0.480026,
+    	0.519456,  0.767022,
+    	0.185461, -0.893124,
+    	0.507431,  0.064425,
+    	0.896420,  0.412458,
+   	-0.321940, -0.932615,
+   	-0.791559, -0.597705,
+	};
+
+   float4 sum = tex2D(RT, texCoord);
+   for (int i = 0; i < 12; i++){
+      sum += tex2D(RT, texCoord + 0.025 * samples[i]);
+   }
+   return sum / 13;
+
+}
+
+
+
+
Index: code/trunk/Tutorial/Media/materials/programs/Blur0_vs.glsl
===================================================================
--- code/trunk/Tutorial/Media/materials/programs/Blur0_vs.glsl	(revision 44)
+++ code/trunk/Tutorial/Media/materials/programs/Blur0_vs.glsl	(revision 44)
@@ -0,0 +1,15 @@
+varying vec2 texCoord[5];
+
+void main()                    
+{
+	vec2 inPos = sign(gl_Vertex.xy);
+	gl_Position = vec4(inPos.xy, 0.0, 1.0);
+	
+	texCoord[0]  = (vec2(inPos.x, -inPos.y) + 1.0)/2.0;
+	
+	const float size = 0.01;
+	texCoord[1] = texCoord[0] + vec2(1.0, 0.0)*size;
+	texCoord[2] = texCoord[0] + vec2(2.0, 0.0)*size;
+	texCoord[3] = texCoord[0] + vec2(-1.0, 0.0)*size;
+	texCoord[4] = texCoord[0] + vec2(-2.0, 0.0)*size;
+}
Index: code/trunk/Tutorial/Media/materials/programs/Blur0_vs11.hlsl
===================================================================
--- code/trunk/Tutorial/Media/materials/programs/Blur0_vs11.hlsl	(revision 44)
+++ code/trunk/Tutorial/Media/materials/programs/Blur0_vs11.hlsl	(revision 44)
@@ -0,0 +1,22 @@
+struct VS_OUTPUT {
+   float4 Pos: POSITION;
+   float2 texCoord: TEXCOORD0;
+};
+
+VS_OUTPUT main(float4 Pos: POSITION){
+   VS_OUTPUT Out;
+
+   // Clean up inaccuracies
+   Pos.xy = sign(Pos.xy);
+
+   Out.Pos = float4(Pos.xy, 0, 1);
+   // Image-space
+   Out.texCoord.x = 0.5 * (1 + Pos.x);
+   Out.texCoord.y = 0.5 * (1 - Pos.y);
+
+   return Out;
+}
+
+
+
+
Index: code/trunk/Tutorial/Media/materials/programs/Blur1_ps20.hlsl
===================================================================
--- code/trunk/Tutorial/Media/materials/programs/Blur1_ps20.hlsl	(revision 44)
+++ code/trunk/Tutorial/Media/materials/programs/Blur1_ps20.hlsl	(revision 44)
@@ -0,0 +1,28 @@
+sampler Blur0: register(s0);
+// Simple blur filter
+
+float4 main(float2 texCoord: TEXCOORD0) : COLOR {
+
+	float2 samples[12] = {
+   	-0.326212, -0.405805,
+   	-0.840144, -0.073580,
+   	-0.695914,  0.457137,
+   	-0.203345,  0.620716,
+    	0.962340, -0.194983,
+    	0.473434, -0.480026,
+    	0.519456,  0.767022,
+    	0.185461, -0.893124,
+    	0.507431,  0.064425,
+    	0.896420,  0.412458,
+   	-0.321940, -0.932615,
+   	-0.791559, -0.597705,
+	};
+
+   float4 sum = tex2D(Blur0, texCoord);
+   for (int i = 0; i < 12; i++){
+      sum += tex2D(Blur0, texCoord + 0.025 * samples[i]);
+   }
+   return sum / 13;
+
+}
+
Index: code/trunk/Tutorial/Media/materials/programs/Blur1_vs.glsl
===================================================================
--- code/trunk/Tutorial/Media/materials/programs/Blur1_vs.glsl	(revision 44)
+++ code/trunk/Tutorial/Media/materials/programs/Blur1_vs.glsl	(revision 44)
@@ -0,0 +1,15 @@
+varying vec2 texCoord[5];
+
+void main()                    
+{
+	vec2 inPos = sign(gl_Vertex.xy);
+	gl_Position = vec4(inPos.xy, 0.0, 1.0);
+	
+	texCoord[0]  = (vec2(inPos.x, -inPos.y) + 1.0)/2.0;
+	
+	const float size = 0.01;
+	texCoord[1] = texCoord[0] + vec2(0.0, 1.0)*size;
+	texCoord[2] = texCoord[0] + vec2(0.0, 2.0)*size;
+	texCoord[3] = texCoord[0] + vec2(0.0, -1.0)*size;
+	texCoord[4] = texCoord[0] + vec2(0.0, -2.0)*size;
+}
Index: code/trunk/Tutorial/Media/materials/programs/Blur1_vs11.hlsl
===================================================================
--- code/trunk/Tutorial/Media/materials/programs/Blur1_vs11.hlsl	(revision 44)
+++ code/trunk/Tutorial/Media/materials/programs/Blur1_vs11.hlsl	(revision 44)
@@ -0,0 +1,19 @@
+struct VS_OUTPUT {
+   float4 Pos: POSITION;
+   float2 texCoord: TEXCOORD0;
+};
+
+VS_OUTPUT main(float4 Pos: POSITION){
+   VS_OUTPUT Out;
+
+   // Clean up inaccuracies
+   Pos.xy = sign(Pos.xy);
+
+   Out.Pos = float4(Pos.xy, 0, 1);
+   // Image-space
+   Out.texCoord.x = 0.5 * (1 + Pos.x);
+   Out.texCoord.y = 0.5 * (1 - Pos.y);
+
+   return Out;
+}
+
Index: code/trunk/Tutorial/Media/materials/programs/Blur_ps.glsl
===================================================================
--- code/trunk/Tutorial/Media/materials/programs/Blur_ps.glsl	(revision 44)
+++ code/trunk/Tutorial/Media/materials/programs/Blur_ps.glsl	(revision 44)
@@ -0,0 +1,14 @@
+uniform sampler2D tex0;
+
+varying vec2 texCoord[5];
+
+void main()
+{
+	vec4 sum = texture2D(tex0, texCoord[0]) + 
+			   texture2D(tex0, texCoord[1]) +
+			   texture2D(tex0, texCoord[2]) + 
+			   texture2D(tex0, texCoord[3]) +
+			   texture2D(tex0, texCoord[4]);
+	gl_FragColor = sum / 5.0;
+}
+
Index: code/trunk/Tutorial/Media/materials/programs/Combine_fp.cg
===================================================================
--- code/trunk/Tutorial/Media/materials/programs/Combine_fp.cg	(revision 44)
+++ code/trunk/Tutorial/Media/materials/programs/Combine_fp.cg	(revision 44)
@@ -0,0 +1,15 @@
+float4 Combine_fp
+(
+    in float2 texCoord: TEXCOORD0,
+    
+    uniform sampler RT : register(s0),
+    uniform sampler Sum : register(s1),
+
+    uniform float blur
+) : COLOR
+{
+   float4 render = tex2D(RT, texCoord);
+   float4 sum = tex2D(Sum, texCoord);
+
+   return lerp(render, sum, blur);
+}
Index: code/trunk/Tutorial/Media/materials/programs/DOF_ps.cg
===================================================================
--- code/trunk/Tutorial/Media/materials/programs/DOF_ps.cg	(revision 44)
+++ code/trunk/Tutorial/Media/materials/programs/DOF_ps.cg	(revision 44)
@@ -0,0 +1,47 @@
+// Simple blur filter
+
+const float2 samples[8] = {
+    {-1, 1},
+    {-1, 0},
+    {-1, -1},
+    {0, -1},
+    {1, -1},
+    {1, 0},
+    {1, 1},
+    {0, 1}
+};
+
+float4 blur(
+
+    in float2 texCoord: TEXCOORD0,
+    uniform float sampleDistance: register(c0),
+    uniform sampler Blur0: register(s0)
+
+) : COLOR
+{
+   float4 sum = tex2D(Blur0, texCoord);
+   for (int i = 0; i < 8; ++i){
+      sum += tex2D(Blur0, texCoord + sampleDistance * samples[i]);
+   }
+   return sum / 9;
+}
+
+
+
+float4 blend
+(
+    in float2 texCoord: TEXCOORD0,
+
+    uniform sampler Blur0 : register(s0),
+    uniform sampler Blur1 : register(s1),
+
+    uniform float focus: register(c0),
+    uniform float range: register(c1)
+) : COLOR
+{
+   float4 sharp = tex2D(Blur0, texCoord);
+   float4 blur  = tex2D(Blur1, texCoord);
+
+   // alpha channel of sharp RT has depth info
+   return lerp(sharp, blur, saturate(range * abs(focus - sharp.a)));
+}
Index: code/trunk/Tutorial/Media/materials/programs/DepthShadowmap.hlsl
===================================================================
--- code/trunk/Tutorial/Media/materials/programs/DepthShadowmap.hlsl	(revision 44)
+++ code/trunk/Tutorial/Media/materials/programs/DepthShadowmap.hlsl	(revision 44)
@@ -0,0 +1,309 @@
+/* This file implements standard programs for depth shadow mapping. 
+   These particular ones are suitable for additive lighting models, and
+   include 3 techniques to reduce depth fighting on self-shadowed surfaces,
+   constant bias, gradient (slope-scale) bias, and a fuzzy shadow map comparison*/
+
+
+// Shadow caster vertex program.
+void casterVP(
+	float4 position			: POSITION,
+	out float4 outPos		: POSITION,
+	out float2 outDepth		: TEXCOORD0,
+
+	uniform float4x4 worldViewProj,
+	uniform float4 texelOffsets,
+	uniform float4 depthRange
+	)
+{
+	outPos = mul(worldViewProj, position);
+
+	// fix pixel / texel alignment
+	outPos.xy += texelOffsets.zw * outPos.w;
+	// linear depth storage
+	// offset / scale range output
+#if LINEAR_RANGE
+	outDepth.x = (outPos.z - depthRange.x) * depthRange.w;
+#else
+	outDepth.x = outPos.z;
+#endif
+	outDepth.y = outPos.w;
+}
+
+
+// Shadow caster fragment program for high-precision single-channel textures	
+void casterFP(
+	float2 depth			: TEXCOORD0,
+	out float4 result		: COLOR)
+	
+{
+#if LINEAR_RANGE
+	float finalDepth = depth.x;
+#else
+	float finalDepth = depth.x / depth.y;
+#endif
+	// just smear across all components 
+	// therefore this one needs high individual channel precision
+	result = float4(finalDepth, finalDepth, finalDepth, 1);
+}
+
+
+	
+void receiverVP(
+	float4 position		: POSITION,
+	float4 normal		: NORMAL,
+
+	out float4 outPos			: POSITION,
+	out float4 outColour		: COLOR,
+	out float4 outShadowUV		: TEXCOORD0,
+
+	uniform float4x4 world,
+	uniform float4x4 worldIT,
+	uniform float4x4 worldViewProj,
+	uniform float4x4 texViewProj,
+	uniform float4 lightPosition,
+	uniform float4 lightColour,
+	uniform float4 shadowDepthRange
+	)
+{
+	float4 worldPos = mul(world, position);
+	outPos = mul(worldViewProj, position);
+
+	float3 worldNorm = mul(worldIT, normal).xyz;
+
+	// calculate lighting (simple vertex lighting)
+	float3 lightDir = normalize(
+		lightPosition.xyz -  (worldPos.xyz * lightPosition.w));
+
+	outColour = lightColour * max(dot(lightDir, worldNorm), 0.0);
+
+	// calculate shadow map coords
+	outShadowUV = mul(texViewProj, worldPos);
+#if LINEAR_RANGE
+	// adjust by fixed depth bias, rescale into range
+	outShadowUV.z = (outShadowUV.z - shadowDepthRange.x) * shadowDepthRange.w;
+#endif
+	
+
+
+	
+}
+
+void receiverFP(
+	float4 position			: POSITION,
+	float4 shadowUV			: TEXCOORD0,
+	float4 vertexColour		: COLOR,
+
+	uniform sampler2D shadowMap : register(s0),
+	uniform float inverseShadowmapSize,
+	uniform float fixedDepthBias,
+	uniform float gradientClamp,
+	uniform float gradientScaleBias,
+	uniform float shadowFuzzyWidth,
+	
+	out float4 result		: COLOR)
+{
+	// point on shadowmap
+#if LINEAR_RANGE
+	shadowUV.xy = shadowUV.xy / shadowUV.w;
+#else
+	shadowUV = shadowUV / shadowUV.w;
+#endif
+	float centerdepth = tex2D(shadowMap, shadowUV.xy).x;
+    
+    // gradient calculation
+  	float pixeloffset = inverseShadowmapSize;
+    float4 depths = float4(
+    	tex2D(shadowMap, shadowUV.xy + float2(-pixeloffset, 0)).x,
+    	tex2D(shadowMap, shadowUV.xy + float2(+pixeloffset, 0)).x,
+    	tex2D(shadowMap, shadowUV.xy + float2(0, -pixeloffset)).x,
+    	tex2D(shadowMap, shadowUV.xy + float2(0, +pixeloffset)).x);
+
+	float2 differences = abs( depths.yw - depths.xz );
+	float gradient = min(gradientClamp, max(differences.x, differences.y));
+	float gradientFactor = gradient * gradientScaleBias;
+
+	// visibility function
+	float depthAdjust = gradientFactor + (fixedDepthBias * centerdepth);
+	float finalCenterDepth = centerdepth + depthAdjust;
+
+	// shadowUV.z contains lightspace position of current object
+
+#if FUZZY_TEST
+	// fuzzy test - introduces some ghosting in result and doesn't appear to be needed?
+	//float visibility = saturate(1 + delta_z / (gradient * shadowFuzzyWidth));
+	float visibility = saturate(1 + (finalCenterDepth - shadowUV.z) * shadowFuzzyWidth * shadowUV.w);
+
+	result = vertexColour * visibility;
+#else
+	// hard test
+#if PCF
+	// use depths from prev, calculate diff
+	depths += depthAdjust.xxxx;
+	float final = (finalCenterDepth > shadowUV.z) ? 1.0f : 0.0f;
+	final += (depths.x > shadowUV.z) ? 1.0f : 0.0f;
+	final += (depths.y > shadowUV.z) ? 1.0f : 0.0f;
+	final += (depths.z > shadowUV.z) ? 1.0f : 0.0f;
+	final += (depths.w > shadowUV.z) ? 1.0f : 0.0f;
+	
+	final *= 0.2f;
+
+	result = float4(vertexColour.xyz * final, 1);
+	
+#else
+	result = (finalCenterDepth > shadowUV.z) ? vertexColour : float4(0,0,0,1);
+#endif
+
+#endif
+   
+
+	
+}
+
+
+
+
+// Expand a range-compressed vector
+float3 expand(float3 v)
+{
+	return (v - 0.5) * 2;
+}
+
+
+/* Normal mapping plus depth shadowmapping receiver programs
+*/
+void normalMapShadowReceiverVp(float4 position	: POSITION,
+			 float3 normal		: NORMAL,
+			 float2 uv			: TEXCOORD0,
+			 float3 tangent     : TANGENT0,
+			 
+			 // outputs
+			 out float4 outPos    	 : POSITION,
+			 out float4 outShadowUV	 : TEXCOORD0,
+			 out float2 oUv	 		 : TEXCOORD1,
+			 out float3 oTSLightDir  : TEXCOORD2,
+			 // parameters
+			 uniform float4 lightPosition, // object space
+			 uniform float4x4 world,
+			 uniform float4x4 worldViewProj,
+			 uniform float4x4 texViewProj)
+{
+	float4 worldPos = mul(world, position);
+	outPos = mul(worldViewProj, position);
+
+	// calculate shadow map coords
+	outShadowUV = mul(texViewProj, worldPos);
+#if LINEAR_RANGE
+	// adjust by fixed depth bias, rescale into range
+	outShadowUV.z = (outShadowUV.z - shadowDepthRange.x) * shadowDepthRange.w;
+#endif
+	
+	// pass the main uvs straight through unchanged
+	oUv = uv;
+
+	// calculate tangent space light vector
+	// Get object space light direction
+	// Non-normalised since we'll do that in the fragment program anyway
+	float3 lightDir = lightPosition.xyz -  (position * lightPosition.w);
+
+	// Calculate the binormal (NB we assume both normal and tangent are
+	// already normalised)
+	// NB looks like nvidia cross params are BACKWARDS to what you'd expect
+	// this equates to NxT, not TxN
+	float3 binormal = cross(tangent, normal);
+	
+	// Form a rotation matrix out of the vectors
+	float3x3 rotation = float3x3(tangent, binormal, normal);
+	
+	// Transform the light vector according to this matrix
+	oTSLightDir = mul(rotation, lightDir);
+
+	
+}
+
+
+void normalMapShadowReceiverFp(
+			  float4 shadowUV	: TEXCOORD0,
+			  float2 uv			: TEXCOORD1,
+			  float3 TSlightDir : TEXCOORD2,
+
+			  out float4 result	: COLOR,
+
+			  uniform float4 lightColour,
+			  uniform float inverseShadowmapSize,
+			  uniform float fixedDepthBias,
+			  uniform float gradientClamp,
+			  uniform float gradientScaleBias,
+			  uniform float shadowFuzzyWidth,
+			  
+			  uniform sampler2D   shadowMap : register(s0),
+			  uniform sampler2D   normalMap : register(s1),
+			  uniform samplerCUBE normalCubeMap : register(s2))
+{
+
+	// retrieve normalised light vector, expand from range-compressed
+	float3 lightVec = expand(texCUBE(normalCubeMap, TSlightDir).xyz);
+
+	// get bump map vector, again expand from range-compressed
+	float3 bumpVec = expand(tex2D(normalMap, uv).xyz);
+
+	// Calculate dot product
+	float4 vertexColour = lightColour * dot(bumpVec, lightVec);
+
+
+	// point on shadowmap
+#if LINEAR_RANGE
+	shadowUV.xy = shadowUV.xy / shadowUV.w;
+#else
+	shadowUV = shadowUV / shadowUV.w;
+#endif
+	float centerdepth = tex2D(shadowMap, shadowUV.xy).x;
+    
+    // gradient calculation
+  	float pixeloffset = inverseShadowmapSize;
+    float4 depths = float4(
+    	tex2D(shadowMap, shadowUV.xy + float2(-pixeloffset, 0)).x,
+    	tex2D(shadowMap, shadowUV.xy + float2(+pixeloffset, 0)).x,
+    	tex2D(shadowMap, shadowUV.xy + float2(0, -pixeloffset)).x,
+    	tex2D(shadowMap, shadowUV.xy + float2(0, +pixeloffset)).x);
+
+	float2 differences = abs( depths.yw - depths.xz );
+	float gradient = min(gradientClamp, max(differences.x, differences.y));
+	float gradientFactor = gradient * gradientScaleBias;
+
+	// visibility function
+	float depthAdjust = gradientFactor + (fixedDepthBias * centerdepth);
+	float finalCenterDepth = centerdepth + depthAdjust;
+
+	// shadowUV.z contains lightspace position of current object
+
+#if FUZZY_TEST
+	// fuzzy test - introduces some ghosting in result and doesn't appear to be needed?
+	//float visibility = saturate(1 + delta_z / (gradient * shadowFuzzyWidth));
+	float visibility = saturate(1 + (finalCenterDepth - shadowUV.z) * shadowFuzzyWidth * shadowUV.w);
+
+	result = vertexColour * visibility;
+#else
+	// hard test
+#if PCF
+	// use depths from prev, calculate diff
+	depths += depthAdjust.xxxx;
+	float final = (finalCenterDepth > shadowUV.z) ? 1.0f : 0.0f;
+	final += (depths.x > shadowUV.z) ? 1.0f : 0.0f;
+	final += (depths.y > shadowUV.z) ? 1.0f : 0.0f;
+	final += (depths.z > shadowUV.z) ? 1.0f : 0.0f;
+	final += (depths.w > shadowUV.z) ? 1.0f : 0.0f;
+	
+	final *= 0.2f;
+
+	result = float4(vertexColour.xyz * final, 1);
+	
+#else
+	result = (finalCenterDepth > shadowUV.z) ? vertexColour : float4(0,0,0,1);
+#endif
+
+#endif
+
+
+	
+}
+
Index: code/trunk/Tutorial/Media/materials/programs/DepthShadowmapCasterFp.glsl
===================================================================
--- code/trunk/Tutorial/Media/materials/programs/DepthShadowmapCasterFp.glsl	(revision 44)
+++ code/trunk/Tutorial/Media/materials/programs/DepthShadowmapCasterFp.glsl	(revision 44)
@@ -0,0 +1,16 @@
+
+varying vec2 depth;
+
+void main()
+{
+#if LINEAR_RANGE
+	float finalDepth = depth.x;
+#else
+	float finalDepth = depth.x / depth.y;
+#endif
+	// just smear across all components 
+	// therefore this one needs high individual channel precision
+	gl_FragColor = vec4(finalDepth, finalDepth, finalDepth, 1);
+
+}
+
Index: code/trunk/Tutorial/Media/materials/programs/DepthShadowmapCasterVp.glsl
===================================================================
--- code/trunk/Tutorial/Media/materials/programs/DepthShadowmapCasterVp.glsl	(revision 44)
+++ code/trunk/Tutorial/Media/materials/programs/DepthShadowmapCasterVp.glsl	(revision 44)
@@ -0,0 +1,24 @@
+uniform mat4 worldViewProj;
+uniform vec4 texelOffsets;
+uniform vec4 depthRange;
+
+varying vec2 depth;
+
+void main()
+{
+	gl_Position = ftransform();
+
+	// fix pixel / texel alignment
+	gl_Position.xy += texelOffsets.zw * gl_Position.w;
+	// linear depth storage
+	// offset / scale range output
+#if LINEAR_RANGE
+	depth.x = (gl_Position.z - depthRange.x) * depthRange.w;
+#else
+	depth.x = gl_Position.z;
+#endif
+	depth.y = gl_Position.w;
+
+
+}
+
Index: code/trunk/Tutorial/Media/materials/programs/DepthShadowmapNormalMapReceiverFp.glsl
===================================================================
--- code/trunk/Tutorial/Media/materials/programs/DepthShadowmapNormalMapReceiverFp.glsl	(revision 44)
+++ code/trunk/Tutorial/Media/materials/programs/DepthShadowmapNormalMapReceiverFp.glsl	(revision 44)
@@ -0,0 +1,84 @@
+uniform float inverseShadowmapSize;
+uniform float fixedDepthBias;
+uniform float gradientClamp;
+uniform float gradientScaleBias;
+uniform float shadowFuzzyWidth;
+uniform vec4 lightColour;
+
+uniform sampler2D shadowMap;
+uniform sampler2D normalMap;
+
+varying vec3 tangentLightDir;
+
+
+// Expand a range-compressed vector
+vec3 expand(vec3 v)
+{
+	return (v - 0.5) * 2.0;
+}
+
+void main()
+{
+
+	// get the new normal and diffuse values
+	vec3 normal = normalize(expand(texture2D(normalMap, gl_TexCoord[1].xy).xyz));
+	
+	vec4 vertexColour = clamp(dot(normal, tangentLightDir),0.0,1.0) * lightColour;
+
+
+	vec4 shadowUV = gl_TexCoord[0];
+	// point on shadowmap
+#if LINEAR_RANGE
+	shadowUV.xy = shadowUV.xy / shadowUV.w;
+#else
+	shadowUV = shadowUV / shadowUV.w;
+#endif
+	float centerdepth = texture2D(shadowMap, shadowUV.xy).x;
+    
+    // gradient calculation
+  	float pixeloffset = inverseShadowmapSize;
+    vec4 depths = vec4(
+    	texture2D(shadowMap, shadowUV.xy + vec2(-pixeloffset, 0)).x,
+    	texture2D(shadowMap, shadowUV.xy + vec2(+pixeloffset, 0)).x,
+    	texture2D(shadowMap, shadowUV.xy + vec2(0, -pixeloffset)).x,
+    	texture2D(shadowMap, shadowUV.xy + vec2(0, +pixeloffset)).x);
+
+	vec2 differences = abs( depths.yw - depths.xz );
+	float gradient = min(gradientClamp, max(differences.x, differences.y));
+	float gradientFactor = gradient * gradientScaleBias;
+
+	// visibility function
+	float depthAdjust = gradientFactor + (fixedDepthBias * centerdepth);
+	float finalCenterDepth = centerdepth + depthAdjust;
+
+	// shadowUV.z contains lightspace position of current object
+
+#if FUZZY_TEST
+	// fuzzy test - introduces some ghosting in result and doesn't appear to be needed?
+	//float visibility = saturate(1 + delta_z / (gradient * shadowFuzzyWidth));
+	float visibility = saturate(1 + (finalCenterDepth - shadowUV.z) * shadowFuzzyWidth * shadowUV.w);
+
+	gl_FragColor = vertexColour * visibility;
+#else
+	// hard test
+#if PCF
+	// use depths from prev, calculate diff
+	depths += depthAdjust;
+	float final = (finalCenterDepth > shadowUV.z) ? 1.0 : 0.0;
+	final += (depths.x > shadowUV.z) ? 1.0 : 0.0;
+	final += (depths.y > shadowUV.z) ? 1.0 : 0.0;
+	final += (depths.z > shadowUV.z) ? 1.0 : 0.0;
+	final += (depths.w > shadowUV.z) ? 1.0 : 0.0;
+	
+	final *= 0.2;
+
+	gl_FragColor = vec4(vertexColour.xyz * final, 1);
+	
+#else
+	gl_FragColor = (finalCenterDepth > shadowUV.z) ? vertexColour : vec4(0,0,0,1);
+#endif
+
+#endif
+   
+}
+
Index: code/trunk/Tutorial/Media/materials/programs/DepthShadowmapNormalMapReceiverVp.glsl
===================================================================
--- code/trunk/Tutorial/Media/materials/programs/DepthShadowmapNormalMapReceiverVp.glsl	(revision 44)
+++ code/trunk/Tutorial/Media/materials/programs/DepthShadowmapNormalMapReceiverVp.glsl	(revision 44)
@@ -0,0 +1,42 @@
+attribute vec3 tangent;
+
+uniform mat4 world;
+uniform mat4 worldViewProj;
+uniform mat4 texViewProj;
+uniform vec4 lightPosition; // object space
+uniform vec4 shadowDepthRange;
+
+varying vec3 tangentLightDir;
+
+
+void main()
+{
+	gl_Position = ftransform();
+	
+	vec4 worldPos = world * gl_Vertex;
+
+	// Get object space light direction 
+    vec3 lightDir = normalize(lightPosition.xyz -  (gl_Vertex.xyz * lightPosition.w));
+
+	// calculate shadow map coords
+	gl_TexCoord[0] = texViewProj * worldPos;
+#if LINEAR_RANGE
+	// adjust by fixed depth bias, rescale into range
+	gl_TexCoord[0].z = (gl_TexCoord[0].z - shadowDepthRange.x) * shadowDepthRange.w;
+#endif
+
+	// pass the main uvs straight through unchanged 
+	gl_TexCoord[1] = gl_MultiTexCoord0;
+
+	// Calculate the binormal (NB we assume both normal and tangent are 
+	// already normalised) 
+	vec3 binormal = cross(gl_Normal, tangent); 
+
+	// Form a rotation matrix out of the vectors 
+	mat3 rotation = mat3(tangent, binormal, gl_Normal); 
+    
+	// Transform the light vector according to this matrix 
+	tangentLightDir = normalize(rotation * lightDir); 
+
+}
+
Index: code/trunk/Tutorial/Media/materials/programs/DepthShadowmapReceiverFp.glsl
===================================================================
--- code/trunk/Tutorial/Media/materials/programs/DepthShadowmapReceiverFp.glsl	(revision 44)
+++ code/trunk/Tutorial/Media/materials/programs/DepthShadowmapReceiverFp.glsl	(revision 44)
@@ -0,0 +1,66 @@
+uniform float inverseShadowmapSize;
+uniform float fixedDepthBias;
+uniform float gradientClamp;
+uniform float gradientScaleBias;
+uniform float shadowFuzzyWidth;
+
+uniform sampler2D shadowMap;
+
+void main()
+{
+	vec4 shadowUV = gl_TexCoord[0];
+	// point on shadowmap
+#if LINEAR_RANGE
+	shadowUV.xy = shadowUV.xy / shadowUV.w;
+#else
+	shadowUV = shadowUV / shadowUV.w;
+#endif
+	float centerdepth = texture2D(shadowMap, shadowUV.xy).x;
+    
+    // gradient calculation
+  	float pixeloffset = inverseShadowmapSize;
+    vec4 depths = vec4(
+    	texture2D(shadowMap, shadowUV.xy + vec2(-pixeloffset, 0)).x,
+    	texture2D(shadowMap, shadowUV.xy + vec2(+pixeloffset, 0)).x,
+    	texture2D(shadowMap, shadowUV.xy + vec2(0, -pixeloffset)).x,
+    	texture2D(shadowMap, shadowUV.xy + vec2(0, +pixeloffset)).x);
+
+	vec2 differences = abs( depths.yw - depths.xz );
+	float gradient = min(gradientClamp, max(differences.x, differences.y));
+	float gradientFactor = gradient * gradientScaleBias;
+
+	// visibility function
+	float depthAdjust = gradientFactor + (fixedDepthBias * centerdepth);
+	float finalCenterDepth = centerdepth + depthAdjust;
+
+	// shadowUV.z contains lightspace position of current object
+
+#if FUZZY_TEST
+	// fuzzy test - introduces some ghosting in result and doesn't appear to be needed?
+	//float visibility = saturate(1 + delta_z / (gradient * shadowFuzzyWidth));
+	float visibility = saturate(1 + (finalCenterDepth - shadowUV.z) * shadowFuzzyWidth * shadowUV.w);
+
+	gl_FragColor = vertexColour * visibility;
+#else
+	// hard test
+#if PCF
+	// use depths from prev, calculate diff
+	depths += depthAdjust;
+	float final = (finalCenterDepth > shadowUV.z) ? 1.0 : 0.0;
+	final += (depths.x > shadowUV.z) ? 1.0 : 0.0;
+	final += (depths.y > shadowUV.z) ? 1.0 : 0.0;
+	final += (depths.z > shadowUV.z) ? 1.0 : 0.0;
+	final += (depths.w > shadowUV.z) ? 1.0 : 0.0;
+	
+	final *= 0.2;
+
+	gl_FragColor = vec4(gl_Color.xyz * final, 1);
+	
+#else
+	gl_FragColor = (finalCenterDepth > shadowUV.z) ? gl_Color : vec4(0,0,0,1);
+#endif
+
+#endif
+   
+}
+
Index: code/trunk/Tutorial/Media/materials/programs/DepthShadowmapReceiverVp.glsl
===================================================================
--- code/trunk/Tutorial/Media/materials/programs/DepthShadowmapReceiverVp.glsl	(revision 44)
+++ code/trunk/Tutorial/Media/materials/programs/DepthShadowmapReceiverVp.glsl	(revision 44)
@@ -0,0 +1,32 @@
+uniform mat4 world;
+uniform mat4 worldIT;
+uniform mat4 worldViewProj;
+uniform mat4 texViewProj;
+uniform vec4 lightPosition;
+uniform vec4 lightColour;
+uniform vec4 shadowDepthRange;
+
+
+void main()
+{
+	gl_Position = ftransform();
+	
+	vec4 worldPos = world * gl_Vertex;
+
+	vec3 worldNorm = (worldIT * vec4(gl_Normal, 1)).xyz;
+
+	// calculate lighting (simple vertex lighting)
+	vec3 lightDir = normalize(
+		lightPosition.xyz -  (worldPos.xyz * lightPosition.w));
+
+	gl_FrontColor = lightColour * max(dot(lightDir, worldNorm), 0.0);
+
+	// calculate shadow map coords
+	gl_TexCoord[0] = texViewProj * worldPos;
+#if LINEAR_RANGE
+	// adjust by fixed depth bias, rescale into range
+	gl_TexCoord[0].z = (gl_TexCoord[0].z - shadowDepthRange.x) * shadowDepthRange.w;
+#endif
+
+}
+
Index: code/trunk/Tutorial/Media/materials/programs/Example_Basic.cg
===================================================================
--- code/trunk/Tutorial/Media/materials/programs/Example_Basic.cg	(revision 44)
+++ code/trunk/Tutorial/Media/materials/programs/Example_Basic.cg	(revision 44)
@@ -0,0 +1,272 @@
+/*
+  Basic ambient lighting vertex program
+*/
+void ambientOneTexture_vp(float4 position : POSITION,
+						  float2 uv		  : TEXCOORD0,
+						  
+						  out float4 oPosition : POSITION,
+						  out float2 oUv	   : TEXCOORD0,
+						  out float4 colour    : COLOR,
+
+						  uniform float4x4 worldViewProj,
+						  uniform float4 ambient)
+{
+	oPosition = mul(worldViewProj, position);
+	oUv = uv;
+	colour = ambient;
+}
+
+/*
+  Single-weight-per-vertex hardware skinning, 2 lights
+  The trouble with vertex programs is they're not general purpose, but
+  fixed function hardware skinning is very poorly supported
+*/
+void hardwareSkinningOneWeight_vp(
+	float4 position : POSITION,
+	float3 normal   : NORMAL,
+	float2 uv       : TEXCOORD0,
+	float  blendIdx : BLENDINDICES,
+	
+
+	out float4 oPosition : POSITION,
+	out float2 oUv       : TEXCOORD0,
+	out float4 colour           : COLOR,
+	// Support up to 24 bones of float3x4
+	// vs_1_1 only supports 96 params so more than this is not feasible
+	uniform float3x4   worldMatrix3x4Array[24],
+	uniform float4x4 viewProjectionMatrix,
+	uniform float4   lightPos[2],
+	uniform float4   lightDiffuseColour[2],
+	uniform float4   ambient)
+{
+	// transform by indexed matrix
+	float4 blendPos = float4(mul(worldMatrix3x4Array[blendIdx], position).xyz, 1.0);
+	// view / projection
+	oPosition = mul(viewProjectionMatrix, blendPos);
+	// transform normal
+	float3 norm = mul((float3x3)worldMatrix3x4Array[blendIdx], normal);
+	// Lighting - support point and directional
+	float3 lightDir0 = 	normalize(
+		lightPos[0].xyz -  (blendPos.xyz * lightPos[0].w));
+	float3 lightDir1 = 	normalize(
+		lightPos[1].xyz -  (blendPos.xyz * lightPos[1].w));
+
+	oUv = uv;
+	colour = ambient + 
+		(saturate(dot(lightDir0, norm)) * lightDiffuseColour[0]) + 
+		(saturate(dot(lightDir1, norm)) * lightDiffuseColour[1]);
+	
+}	
+
+/*
+  Single-weight-per-vertex hardware skinning, shadow-caster pass
+*/
+void hardwareSkinningOneWeightCaster_vp(
+	float4 position : POSITION,
+	float3 normal   : NORMAL,
+	float  blendIdx : BLENDINDICES,
+	
+
+	out float4 oPosition : POSITION,
+	out float4 colour    : COLOR,
+	// Support up to 24 bones of float3x4
+	// vs_1_1 only supports 96 params so more than this is not feasible
+	uniform float3x4   worldMatrix3x4Array[24],
+	uniform float4x4 viewProjectionMatrix,
+	uniform float4   ambient)
+{
+	// transform by indexed matrix
+	float4 blendPos = float4(mul(worldMatrix3x4Array[blendIdx], position).xyz, 1.0);
+	// view / projection
+	oPosition = mul(viewProjectionMatrix, blendPos);
+	
+	colour = ambient;
+	
+}	
+
+/*
+  Two-weight-per-vertex hardware skinning, 2 lights
+  The trouble with vertex programs is they're not general purpose, but
+  fixed function hardware skinning is very poorly supported
+*/
+void hardwareSkinningTwoWeights_vp(
+	float4 position : POSITION,
+	float3 normal   : NORMAL,
+	float2 uv       : TEXCOORD0,
+	float4 blendIdx : BLENDINDICES,
+	float4 blendWgt : BLENDWEIGHT,
+	
+
+	out float4 oPosition : POSITION,
+	out float2 oUv       : TEXCOORD0,
+	out float4 colour           : COLOR,
+	// Support up to 24 bones of float3x4
+	// vs_1_1 only supports 96 params so more than this is not feasible
+	uniform float3x4   worldMatrix3x4Array[24],
+	uniform float4x4 viewProjectionMatrix,
+	uniform float4   lightPos[2],
+	uniform float4   lightDiffuseColour[2],
+	uniform float4   ambient)
+{
+	// transform by indexed matrix
+	float4 blendPos = float4(0,0,0,0);
+	int i;
+	for (i = 0; i < 2; ++i)
+	{
+		blendPos += float4(mul(worldMatrix3x4Array[blendIdx[i]], position).xyz, 1.0) * blendWgt[i];
+	}
+	// view / projection
+	oPosition = mul(viewProjectionMatrix, blendPos);
+	// transform normal
+	float3 norm = float3(0,0,0);
+	for (i = 0; i < 2; ++i)
+	{
+		norm += mul((float3x3)worldMatrix3x4Array[blendIdx[i]], normal) * 
+		blendWgt[i];
+	}
+	norm = normalize(norm);
+	// Lighting - support point and directional
+	float3 lightDir0 = 	normalize(
+		lightPos[0].xyz -  (blendPos.xyz * lightPos[0].w));
+	float3 lightDir1 = 	normalize(
+		lightPos[1].xyz -  (blendPos.xyz * lightPos[1].w));
+
+	
+	oUv = uv;
+	colour = float4(0.5, 0.5, 0.5, 1) + 
+		(saturate(dot(lightDir0, norm)) * lightDiffuseColour[0]) + 
+		(saturate(dot(lightDir1, norm)) * lightDiffuseColour[1]);
+	
+}
+
+/*
+  Two-weight-per-vertex hardware skinning, shadow caster pass
+*/
+void hardwareSkinningTwoWeightsCaster_vp(
+	float4 position : POSITION,
+	float3 normal   : NORMAL,
+	float2 uv       : TEXCOORD0,
+	float4 blendIdx : BLENDINDICES,
+	float4 blendWgt : BLENDWEIGHT,
+	
+
+	out float4 oPosition : POSITION,
+	out float4 colour           : COLOR,
+	// Support up to 24 bones of float3x4
+	// vs_1_1 only supports 96 params so more than this is not feasible
+	uniform float3x4   worldMatrix3x4Array[24],
+	uniform float4x4 viewProjectionMatrix,
+	uniform float4   ambient)
+{
+	// transform by indexed matrix
+	float4 blendPos = float4(0,0,0,0);
+	int i;
+	for (i = 0; i < 2; ++i)
+	{
+		blendPos += float4(mul(worldMatrix3x4Array[blendIdx[i]], position).xyz, 1.0) * blendWgt[i];
+	}
+	// view / projection
+	oPosition = mul(viewProjectionMatrix, blendPos);
+	
+
+	colour = ambient;
+		
+	
+}
+
+
+/*
+  Four-weight-per-vertex hardware skinning, 2 lights
+  The trouble with vertex programs is they're not general purpose, but
+  fixed function hardware skinning is very poorly supported
+*/
+void hardwareSkinningFourWeights_vp(
+	float4 position : POSITION,
+	float3 normal   : NORMAL,
+	float2 uv       : TEXCOORD0,
+	float4 blendIdx : BLENDINDICES,
+	float4 blendWgt : BLENDWEIGHT,
+	
+
+	out float4 oPosition : POSITION,
+	out float2 oUv       : TEXCOORD0,
+	out float4 colour           : COLOR,
+	// Support up to 24 bones of float3x4
+	// vs_1_1 only supports 96 params so more than this is not feasible
+	uniform float3x4   worldMatrix3x4Array[24],
+	uniform float4x4 viewProjectionMatrix,
+	uniform float4   lightPos[2],
+	uniform float4   lightDiffuseColour[2],
+	uniform float4   ambient)
+{
+	// transform by indexed matrix
+	float4 blendPos = float4(0,0,0,0);
+	int i;
+	for (i = 0; i < 4; ++i)
+	{
+		blendPos += float4(mul(worldMatrix3x4Array[blendIdx[i]], position).xyz, 1.0) * blendWgt[i];
+	}
+	// view / projection
+	oPosition = mul(viewProjectionMatrix, blendPos);
+	// transform normal
+	float3 norm = float3(0,0,0);
+	for (i = 0; i < 4; ++i)
+	{
+		norm += mul((float3x3)worldMatrix3x4Array[blendIdx[i]], normal) * 
+		blendWgt[i];
+	}
+	norm = normalize(norm);
+	// Lighting - support point and directional
+	float3 lightDir0 = 	normalize(
+		lightPos[0].xyz -  (blendPos.xyz * lightPos[0].w));
+	float3 lightDir1 = 	normalize(
+		lightPos[1].xyz -  (blendPos.xyz * lightPos[1].w));
+
+	
+	oUv = uv;
+	colour = ambient + 
+		(saturate(dot(lightDir0, norm)) * lightDiffuseColour[0]) + 
+		(saturate(dot(lightDir1, norm)) * lightDiffuseColour[1]);
+	
+}
+
+void hardwareMorphAnimation(float3 pos1 : POSITION,
+			  float4 normal		: NORMAL,
+			  float2 uv		  : TEXCOORD0,
+			  float3 pos2	  : TEXCOORD1,
+						  
+			  out float4 oPosition : POSITION,
+			  out float2 oUv	   : TEXCOORD0,
+			  out float4 colour    : COLOR,
+
+			  uniform float4x4 worldViewProj, 
+			  uniform float4 anim_t)
+{
+	// interpolate
+	float4 interp = float4(pos1 + anim_t.x*(pos2 - pos1), 1.0f);
+	
+	oPosition = mul(worldViewProj, interp);
+	oUv = uv;
+	colour = float4(1,0,0,1);
+}
+
+void hardwarePoseAnimation(float3 pos : POSITION,
+			  float4 normal		: NORMAL,
+			  float2 uv		  : TEXCOORD0,
+			  float3 pose1	  : TEXCOORD1,
+			  float3 pose2	  : TEXCOORD2,
+						  
+			  out float4 oPosition : POSITION,
+			  out float2 oUv	   : TEXCOORD0,
+			  out float4 colour    : COLOR,
+
+			  uniform float4x4 worldViewProj, 
+			  uniform float4 anim_t)
+{
+	// interpolate
+	float4 interp = float4(pos + anim_t.x*pose1 + anim_t.y*pose2, 1.0f);
+	
+	oPosition = mul(worldViewProj, interp);
+	oUv = uv;
+	colour = float4(1,0,0,1);
+}
Index: code/trunk/Tutorial/Media/materials/programs/Example_Basic.hlsl
===================================================================
--- code/trunk/Tutorial/Media/materials/programs/Example_Basic.hlsl	(revision 44)
+++ code/trunk/Tutorial/Media/materials/programs/Example_Basic.hlsl	(revision 44)
@@ -0,0 +1,273 @@
+/*
+  Basic ambient lighting vertex program
+*/
+void ambientOneTexture_vp(float4 position : POSITION,
+						  float2 uv		  : TEXCOORD0,
+						  
+						  out float4 oPosition : POSITION,
+						  out float2 oUv	   : TEXCOORD0,
+						  out float4 colour    : COLOR,
+
+						  uniform float4x4 worldViewProj,
+						  uniform float4 ambient)
+{
+	oPosition = mul(worldViewProj, position);
+	oUv = uv;
+	colour = ambient;
+}
+
+/*
+  Single-weight-per-vertex hardware skinning, 2 lights
+  The trouble with vertex programs is they're not general purpose, but
+  fixed function hardware skinning is very poorly supported
+*/
+void hardwareSkinningOneWeight_vp(
+	float4 position : POSITION,
+	float3 normal   : NORMAL,
+	float2 uv       : TEXCOORD0,
+	float  blendIdx : BLENDINDICES,
+	
+
+	out float4 oPosition : POSITION,
+	out float2 oUv       : TEXCOORD0,
+	out float4 colour           : COLOR,
+	// Support up to 24 bones of float3x4
+	// vs_1_1 only supports 96 params so more than this is not feasible
+	uniform float3x4   worldMatrix3x4Array[24],
+	uniform float4x4 viewProjectionMatrix,
+	uniform float4   lightPos[2],
+	uniform float4   lightDiffuseColour[2],
+	uniform float4   ambient)
+{
+	// transform by indexed matrix
+	float4 blendPos = float4(mul(worldMatrix3x4Array[blendIdx], position).xyz, 1.0);
+	// view / projection
+	oPosition = mul(viewProjectionMatrix, blendPos);
+	// transform normal
+	float3 norm = mul((float3x3)worldMatrix3x4Array[blendIdx], normal);
+	// Lighting - support point and directional
+	float3 lightDir0 = 	normalize(
+		lightPos[0].xyz -  (blendPos.xyz * lightPos[0].w));
+	float3 lightDir1 = 	normalize(
+		lightPos[1].xyz -  (blendPos.xyz * lightPos[1].w));
+
+	oUv = uv;
+	colour = ambient + 
+		(saturate(dot(lightDir0, norm)) * lightDiffuseColour[0]) + 
+		(saturate(dot(lightDir1, norm)) * lightDiffuseColour[1]);
+	
+}	
+
+/*
+  Single-weight-per-vertex hardware skinning, shadow-caster pass
+*/
+void hardwareSkinningOneWeightCaster_vp(
+	float4 position : POSITION,
+	float3 normal   : NORMAL,
+	float  blendIdx : BLENDINDICES,
+	
+
+	out float4 oPosition : POSITION,
+	out float4 colour    : COLOR,
+	// Support up to 24 bones of float3x4
+	// vs_1_1 only supports 96 params so more than this is not feasible
+	uniform float3x4   worldMatrix3x4Array[24],
+	uniform float4x4 viewProjectionMatrix,
+	uniform float4   ambient)
+{
+	// transform by indexed matrix
+	float4 blendPos = float4(mul(worldMatrix3x4Array[blendIdx], position).xyz, 1.0);
+	// view / projection
+	oPosition = mul(viewProjectionMatrix, blendPos);
+	
+	colour = ambient;
+	
+}	
+
+/*
+  Two-weight-per-vertex hardware skinning, 2 lights
+  The trouble with vertex programs is they're not general purpose, but
+  fixed function hardware skinning is very poorly supported
+*/
+void hardwareSkinningTwoWeights_vp(
+	float4 position : POSITION,
+	float3 normal   : NORMAL,
+	float2 uv       : TEXCOORD0,
+	float4 blendIdx : BLENDINDICES,
+	float4 blendWgt : BLENDWEIGHT,
+	
+
+	out float4 oPosition : POSITION,
+	out float2 oUv       : TEXCOORD0,
+	out float4 colour           : COLOR,
+	// Support up to 24 bones of float3x4
+	// vs_1_1 only supports 96 params so more than this is not feasible
+	uniform float3x4   worldMatrix3x4Array[24],
+	uniform float4x4 viewProjectionMatrix,
+	uniform float4   lightPos[2],
+	uniform float4   lightDiffuseColour[2],
+	uniform float4   ambient)
+{
+	// transform by indexed matrix
+	float4 blendPos = float4(0,0,0,0);
+	int i;
+	for (i = 0; i < 2; ++i)
+	{
+		blendPos += float4(mul(worldMatrix3x4Array[blendIdx[i]], position).xyz, 1.0) * blendWgt[i];
+	}
+	// view / projection
+	oPosition = mul(viewProjectionMatrix, blendPos);
+	// transform normal
+	float3 norm = float3(0,0,0);
+	for (i = 0; i < 2; ++i)
+	{
+		norm += mul((float3x3)worldMatrix3x4Array[blendIdx[i]], normal) * 
+		blendWgt[i];
+	}
+	norm = normalize(norm);
+	// Lighting - support point and directional
+	float3 lightDir0 = 	normalize(
+		lightPos[0].xyz -  (blendPos.xyz * lightPos[0].w));
+	float3 lightDir1 = 	normalize(
+		lightPos[1].xyz -  (blendPos.xyz * lightPos[1].w));
+
+	
+	oUv = uv;
+	colour = ambient + 
+		(saturate(dot(lightDir0, norm)) * lightDiffuseColour[0]) + 
+		(saturate(dot(lightDir1, norm)) * lightDiffuseColour[1]);
+	
+}
+
+/*
+  Two-weight-per-vertex hardware skinning, shadow caster pass
+*/
+void hardwareSkinningTwoWeightsCaster_vp(
+	float4 position : POSITION,
+	float3 normal   : NORMAL,
+	float2 uv       : TEXCOORD0,
+	float4 blendIdx : BLENDINDICES,
+	float4 blendWgt : BLENDWEIGHT,
+	
+
+	out float4 oPosition : POSITION,
+	out float4 colour           : COLOR,
+	// Support up to 24 bones of float3x4
+	// vs_1_1 only supports 96 params so more than this is not feasible
+	uniform float3x4   worldMatrix3x4Array[24],
+	uniform float4x4 viewProjectionMatrix,
+	uniform float4   ambient)
+{
+	// transform by indexed matrix
+	float4 blendPos = float4(0,0,0,0);
+	int i;
+	for (i = 0; i < 2; ++i)
+	{
+		blendPos += float4(mul(worldMatrix3x4Array[blendIdx[i]], position).xyz, 1.0) * blendWgt[i];
+	}
+	// view / projection
+	oPosition = mul(viewProjectionMatrix, blendPos);
+	
+
+	colour = ambient;
+		
+	
+}
+
+
+/*
+  Four-weight-per-vertex hardware skinning, 2 lights
+  The trouble with vertex programs is they're not general purpose, but
+  fixed function hardware skinning is very poorly supported
+*/
+void hardwareSkinningFourWeights_vp(
+	float4 position : POSITION,
+	float3 normal   : NORMAL,
+	float2 uv       : TEXCOORD0,
+	float4 blendIdx : BLENDINDICES,
+	float4 blendWgt : BLENDWEIGHT,
+	
+
+	out float4 oPosition : POSITION,
+	out float2 oUv       : TEXCOORD0,
+	out float4 colour           : COLOR,
+	// Support up to 24 bones of float3x4
+	// vs_1_1 only supports 96 params so more than this is not feasible
+	uniform float3x4   worldMatrix3x4Array[24],
+	uniform float4x4 viewProjectionMatrix,
+	uniform float4   lightPos[2],
+	uniform float4   lightDiffuseColour[2],
+	uniform float4   ambient)
+{
+	// transform by indexed matrix
+	float4 blendPos = float4(0,0,0,0);
+	int i;
+	for (i = 0; i < 4; ++i)
+	{
+		blendPos += float4(mul(worldMatrix3x4Array[blendIdx[i]], position).xyz, 1.0) * blendWgt[i];
+	}
+	// view / projection
+	oPosition = mul(viewProjectionMatrix, blendPos);
+	// transform normal
+	float3 norm = float3(0,0,0);
+	for (i = 0; i < 4; ++i)
+	{
+		norm += mul((float3x3)worldMatrix3x4Array[blendIdx[i]], normal) * 
+		blendWgt[i];
+	}
+	norm = normalize(norm);
+	// Lighting - support point and directional
+	float3 lightDir0 = 	normalize(
+		lightPos[0].xyz -  (blendPos.xyz * lightPos[0].w));
+	float3 lightDir1 = 	normalize(
+		lightPos[1].xyz -  (blendPos.xyz * lightPos[1].w));
+
+	
+	oUv = uv;
+	colour = ambient + 
+		(saturate(dot(lightDir0, norm)) * lightDiffuseColour[0]) + 
+		(saturate(dot(lightDir1, norm)) * lightDiffuseColour[1]);
+	
+}
+
+void hardwareMorphAnimation(float3 pos1 : POSITION,
+			  float4 normal		: NORMAL,
+			  float2 uv		  : TEXCOORD0,
+			  float3 pos2	  : TEXCOORD1,
+						  
+			  out float4 oPosition : POSITION,
+			  out float2 oUv	   : TEXCOORD0,
+			  out float4 colour    : COLOR,
+
+			  uniform float4x4 worldViewProj, 
+			  uniform float4 anim_t)
+{
+	// interpolate
+	float4 interp = float4(pos1 + anim_t.x*(pos2 - pos1), 1.0f);
+	
+	oPosition = mul(worldViewProj, interp);
+	oUv = uv;
+	colour = float4(1,0,0,1);
+}
+
+void hardwarePoseAnimation(float3 pos : POSITION,
+			  float4 normal		: NORMAL,
+			  float2 uv		  : TEXCOORD0,
+			  float3 pose1	  : TEXCOORD1,
+			  float3 pose2	  : TEXCOORD2,
+						  
+			  out float4 oPosition : POSITION,
+			  out float2 oUv	   : TEXCOORD0,
+			  out float4 colour    : COLOR,
+
+			  uniform float4x4 worldViewProj, 
+			  uniform float4 anim_t)
+{
+	// interpolate
+	float4 interp = float4(pos + anim_t.x*pose1 + anim_t.y*pose2, 1.0f);
+	
+	oPosition = mul(worldViewProj, interp);
+	oUv = uv;
+	colour = float4(1,0,0,1);
+}
+
Index: code/trunk/Tutorial/Media/materials/programs/Example_BumpMapping.cg
===================================================================
--- code/trunk/Tutorial/Media/materials/programs/Example_BumpMapping.cg	(revision 44)
+++ code/trunk/Tutorial/Media/materials/programs/Example_BumpMapping.cg	(revision 44)
@@ -0,0 +1,236 @@
+// General functions
+
+// Expand a range-compressed vector
+float3 expand(float3 v)
+{
+	return (v - 0.5) * 2;
+}
+
+
+/* Bump mapping vertex program
+   In this program, we want to calculate the tangent space light vector
+   on a per-vertex level which will get passed to the fragment program,
+   or to the fixed function dot3 operation, to produce the per-pixel
+   lighting effect. 
+*/
+void main_vp(float4 position	: POSITION,
+			 float3 normal		: NORMAL,
+			 float2 uv			: TEXCOORD0,
+			 float3 tangent     : TANGENT0,
+			 // outputs
+			 out float4 oPosition    : POSITION,
+			 out float2 oUv			 : TEXCOORD0,
+			 out float3 oTSLightDir	 : TEXCOORD1,
+			 // parameters
+			 uniform float4 lightPosition, // object space
+			 uniform float4x4 worldViewProj)
+{
+	// calculate output position
+	oPosition = mul(worldViewProj, position);
+
+	// pass the main uvs straight through unchanged
+	oUv = uv;
+
+	// calculate tangent space light vector
+	// Get object space light direction
+	// Non-normalised since we'll do that in the fragment program anyway
+	float3 lightDir = lightPosition.xyz -  (position * lightPosition.w);
+
+	// Calculate the binormal (NB we assume both normal and tangent are
+	// already normalised)
+	// NB looks like nvidia cross params are BACKWARDS to what you'd expect
+	// this equates to NxT, not TxN
+	float3 binormal = cross(tangent, normal);
+	
+	// Form a rotation matrix out of the vectors
+	float3x3 rotation = float3x3(tangent, binormal, normal);
+	
+	// Transform the light vector according to this matrix
+	oTSLightDir = mul(rotation, lightDir);
+	
+	
+}
+
+/* Bump mapping vertex program for shadow receiving
+   In this program, we want to calculate the tangent space light vector
+   on a per-vertex level which will get passed to the fragment program,
+   or to the fixed function dot3 operation, to produce the per-pixel
+   lighting effect. 
+*/
+void main_shadowreceiver_vp(float4 position	: POSITION,
+			 float3 normal		: NORMAL,
+			 float2 uv			: TEXCOORD0,
+			 float3 tangent     : TANGENT0,
+			 
+			 // outputs
+			 out float4 oPosition    : POSITION,
+			 out float4 uvproj		 : TEXCOORD0,
+			 out float2 oUv	 		 : TEXCOORD1,
+			 out float3 oTSLightDir  : TEXCOORD2,
+			 
+			 // parameters
+			 uniform float4 lightPosition, // object space
+			 uniform float4x4 worldViewProj,
+			 uniform float4x4 worldMatrix,
+			 uniform float4x4 texViewProj)
+{
+	// calculate output position
+	oPosition = mul(worldViewProj, position);
+
+	// pass the main uvs straight through unchanged
+	oUv = uv;
+
+	// calculate tangent space light vector
+	// Get object space light direction
+	// Non-normalised since we'll do that in the fragment program anyway
+	float3 lightDir = lightPosition.xyz -  (position * lightPosition.w);
+
+	// Calculate the binormal (NB we assume both normal and tangent are
+	// already normalised)
+	// NB looks like nvidia cross params are BACKWARDS to what you'd expect
+	// this equates to NxT, not TxN
+	float3 binormal = cross(tangent, normal);
+	
+	// Form a rotation matrix out of the vectors
+	float3x3 rotation = float3x3(tangent, binormal, normal);
+	
+	// Transform the light vector according to this matrix
+	oTSLightDir = mul(rotation, lightDir);
+
+	// Projection
+    uvproj = mul(worldMatrix, position);
+	uvproj = mul(texViewProj, uvproj);
+	
+}
+
+
+void main_fp( float2 uv			: TEXCOORD0,
+			  float3 TSlightDir : TEXCOORD1,
+
+			  out float4 colour	: COLOR,
+
+			  uniform float4 lightDiffuse,
+			  uniform sampler2D   normalMap : register(s0),
+			  uniform samplerCUBE normalCubeMap : register(s1) )
+{
+	// retrieve normalised light vector, expand from range-compressed
+	float3 lightVec = expand(texCUBE(normalCubeMap, TSlightDir).xyz);
+
+	// get bump map vector, again expand from range-compressed
+	float3 bumpVec = expand(tex2D(normalMap, uv).xyz);
+
+	// Calculate dot product
+	colour = lightDiffuse * dot(bumpVec, lightVec);
+	
+}
+
+void main_shadowreceiver_fp(
+			  float4 uvproj		: TEXCOORD0,
+			  float2 uv			: TEXCOORD1,
+			  float3 TSlightDir : TEXCOORD2,
+
+			  out float4 colour	: COLOR,
+
+			  uniform float4 lightDiffuse,
+			  uniform sampler2D   shadowMap : register(s0),
+			  uniform sampler2D   normalMap : register(s1),
+			  uniform samplerCUBE normalCubeMap : register(s2))
+{
+
+
+	// retrieve normalised light vector, expand from range-compressed
+	float3 lightVec = expand(texCUBE(normalCubeMap, TSlightDir).xyz);
+
+	// get bump map vector, again expand from range-compressed
+	float3 bumpVec = expand(tex2D(normalMap, uv).xyz);
+
+	// get shadow value
+	float3 shadow = tex2Dproj(shadowMap, uvproj).xyz;
+
+	// Calculate dot product
+	colour = float4(shadow * lightDiffuse * dot(bumpVec, lightVec), 1.0f);
+	
+}
+
+/* Vertex program which includes specular component */
+void specular_vp(float4 position	: POSITION,
+			 	 float3 normal		: NORMAL,
+			 	 float2 uv			: TEXCOORD0,
+			 	 float3 tangent     : TANGENT0,
+			 	 // outputs
+			 	 out float4 oPosition    : POSITION,
+			 	 out float2 oUv			 : TEXCOORD0,
+			 	 out float3 oTSLightDir	 : TEXCOORD1,
+				 out float3 oTSHalfAngle : TEXCOORD2,
+			 	 // parameters
+				 uniform float4 lightPosition, // object space
+			 	 uniform float3 eyePosition,   // object space
+			 	 uniform float4x4 worldViewProj)
+{
+	// calculate output position
+	oPosition = mul(worldViewProj, position);
+
+	// pass the main uvs straight through unchanged
+	oUv = uv;
+
+	// calculate tangent space light vector
+	// Get object space light direction
+	float3 lightDir = normalize(lightPosition.xyz -  (position * lightPosition.w));
+
+	// Calculate the binormal (NB we assume both normal and tangent are
+	// already normalised)
+	// NB looks like nvidia cross params are BACKWARDS to what you'd expect
+	// this equates to NxT, not TxN
+	float3 binormal = cross(tangent, normal);
+	
+	// Form a rotation matrix out of the vectors
+	float3x3 rotation = float3x3(tangent, binormal, normal);
+	
+	// Transform the light vector according to this matrix
+	oTSLightDir = mul(rotation, lightDir);
+
+	// Calculate half-angle in tangent space
+	float3 eyeDir = normalize(eyePosition - position.xyz);
+	float3 halfAngle = normalize(eyeDir + lightDir);
+	oTSHalfAngle = mul(rotation, halfAngle);
+	
+	
+}
+
+/* Fragment program which supports specular component */
+void specular_fp( float2 uv			: TEXCOORD0,
+			  float3 TSlightDir : TEXCOORD1,
+			  float3 TShalfAngle: TEXCOORD2,
+
+			  out float4 colour	: COLOR,
+
+			  uniform float4 lightDiffuse,
+			  uniform float4 lightSpecular,
+			  uniform sampler2D   normalMap : register(s0),
+			  uniform samplerCUBE normalCubeMap : register(s1), 
+			  uniform samplerCUBE normalCubeMap2 : register(s2)) // we need this second binding to be compatible with ps_1_1, ps_2_0 could reuse the other
+{
+	// retrieve normalised light vector, expand from range-compressed
+	float3 lightVec = expand(texCUBE(normalCubeMap, TSlightDir).xyz);
+
+	// retrieve half angle and normalise through cube map
+	float3 halfAngle = expand(texCUBE(normalCubeMap2, TShalfAngle).xyz);
+
+	// get bump map vector, again expand from range-compressed
+	float3 bumpVec = expand(tex2D(normalMap, uv).xyz);
+
+	// Pre-raise the specular exponent to the eight power
+	// Note we have no 'pow' function in basic fragment programs, if we were willing to accept compatibility
+	// with ps_2_0 / arbfp1 and above, we could have a variable shininess parameter
+	// This is equivalent to 
+	float specFactor = dot(bumpVec, halfAngle);
+	for (int i = 0; i < 3; ++i)
+		specFactor *= specFactor;
+	
+
+	// Calculate dot product for diffuse
+	colour = (lightDiffuse * saturate(dot(bumpVec, lightVec))) + 
+			(lightSpecular * specFactor);
+	
+}
+			 
Index: code/trunk/Tutorial/Media/materials/programs/Example_CelShading.cg
===================================================================
--- code/trunk/Tutorial/Media/materials/programs/Example_CelShading.cg	(revision 44)
+++ code/trunk/Tutorial/Media/materials/programs/Example_CelShading.cg	(revision 44)
@@ -0,0 +1,63 @@
+
+/* Cel shading vertex program for single-pass rendering
+   In this program, we want to calculate the diffuse and specular
+   ramp components, and the edge factor (for doing simple outlining)
+   For the outlining to look good, we need a pretty well curved model.
+*/
+void main_vp(float4 position	: POSITION,
+			 float3 normal		: NORMAL,
+			 // outputs
+			 out float4 oPosition : POSITION,
+			 out float  diffuse		 : TEXCOORD0,
+			 out float  specular	 : TEXCOORD1,
+			 out float  edge		 : TEXCOORD2,
+			 // parameters
+			 uniform float3 lightPosition, // object space
+			 uniform float3 eyePosition,   // object space
+			 uniform float4  shininess,
+			 uniform float4x4 worldViewProj)
+{
+	// calculate output position
+	oPosition = mul(worldViewProj, position);
+
+	// calculate light vector
+	float3 N = normalize(normal);
+	float3 L = normalize(lightPosition - position.xyz);
+	
+	// Calculate diffuse component
+	diffuse = max(dot(N, L) , 0);
+
+	// Calculate specular component
+	float3 E = normalize(eyePosition - position.xyz);
+	float3 H = normalize(L + E);
+	specular = pow(max(dot(N, H), 0), shininess);
+	// Mask off specular if diffuse is 0
+	if (diffuse == 0) specular = 0;
+
+	// Edge detection, dot eye and normal vectors
+	edge = max(dot(N, E), 0);
+}
+
+void main_fp(float diffuseIn 	: TEXCOORD0,
+			 float specularIn	: TEXCOORD1,
+			 float edge		: TEXCOORD2,
+			 
+			 out float4 colour	: COLOR,
+			 
+			 uniform float4 diffuse,
+			 uniform float4 specular,
+			 
+			 uniform sampler1D diffuseRamp,
+			 uniform sampler1D specularRamp,
+			 uniform sampler1D edgeRamp)
+{
+	// Step functions from textures
+	diffuseIn = tex1D(diffuseRamp, diffuseIn).x;
+	specularIn = tex1D(specularRamp, specularIn).x;
+	edge = tex1D(edgeRamp, edge).x;
+
+	colour = edge * ((diffuse * diffuseIn) + 
+					(specular * specularIn));
+}
+			 
+			 
Index: code/trunk/Tutorial/Media/materials/programs/Example_Fresnel.cg
===================================================================
--- code/trunk/Tutorial/Media/materials/programs/Example_Fresnel.cg	(revision 44)
+++ code/trunk/Tutorial/Media/materials/programs/Example_Fresnel.cg	(revision 44)
@@ -0,0 +1,115 @@
+// Vertex program for fresnel reflections / refractions
+void main_vp(
+		float4 pos			: POSITION,
+		float4 normal		: NORMAL,
+		float2 tex			: TEXCOORD0,
+		
+		out float4 oPos		: POSITION,
+		out float3 noiseCoord : TEXCOORD0,
+		out float4 projectionCoord : TEXCOORD1,
+		out float3 oEyeDir : TEXCOORD2, 
+		out float3 oNormal : TEXCOORD3, 
+
+		uniform float4x4 worldViewProjMatrix,
+		uniform float3 eyePosition, // object space
+		uniform float timeVal,
+		uniform float scale,  // the amount to scale the noise texture by
+		uniform float scroll, // the amount by which to scroll the noise
+		uniform float noise  // the noise perturb as a factor of the  time
+		)
+{
+	oPos = mul(worldViewProjMatrix, pos);
+	// Projective texture coordinates, adjust for mapping
+	float4x4 scalemat = float4x4(0.5,   0,   0, 0.5, 
+	                               0,-0.5,   0, 0.5,
+								   0,   0, 0.5, 0.5,
+								   0,   0,   0,   1);
+	projectionCoord = mul(scalemat, oPos);
+	// Noise map coords
+	noiseCoord.xy = (tex + (timeVal * scroll)) * scale;
+	noiseCoord.z = noise * timeVal;
+
+	oEyeDir = normalize(pos.xyz - eyePosition); 
+	oNormal = normal.rgb; 
+	
+}
+
+// Fragment program for distorting a texture using a 3D noise texture
+void main_fp(
+		float3 noiseCoord			: TEXCOORD0,
+		float4 projectionCoord		: TEXCOORD1,
+		float3 eyeDir				: TEXCOORD2,
+		float3 normal				: TEXCOORD3,
+		
+		out float4 col		: COLOR,
+		
+		uniform float4 tintColour,
+		uniform float noiseScale, 
+		uniform float fresnelBias,
+		uniform float fresnelScale,
+		uniform float fresnelPower,
+		uniform sampler2D noiseMap : register(s0),
+		uniform sampler2D reflectMap : register(s1),
+		uniform sampler2D refractMap : register(s2)
+		)
+{
+	// Do the tex projection manually so we can distort _after_
+	float2 final = projectionCoord.xy / projectionCoord.w;
+
+	// Noise
+	float3 noiseNormal = (tex2D(noiseMap, (noiseCoord.xy / 5)).rgb - 0.5).rbg * noiseScale;
+	final += noiseNormal.xz;
+
+	// Fresnel
+	//normal = normalize(normal + noiseNormal.xz);
+	float fresnel = fresnelBias + fresnelScale * pow(1 + dot(eyeDir, normal), fresnelPower);
+
+	// Reflection / refraction
+	float4 reflectionColour = tex2D(reflectMap, final);
+	float4 refractionColour = tex2D(refractMap, final) + tintColour;
+
+	// Final colour
+	col = lerp(refractionColour, reflectionColour, fresnel);
+
+
+}
+
+
+// Old version to match ATI PS 1.3 implementation
+void main_vp_old(
+		float4 pos			: POSITION,
+		float4 normal		: NORMAL,
+		float2 tex			: TEXCOORD0,
+		
+		out float4 oPos		: POSITION,
+		out float fresnel   : COLOR,
+		out float3 noiseCoord : TEXCOORD0,
+		out float4 projectionCoord : TEXCOORD1,
+
+		uniform float4x4 worldViewProjMatrix,
+		uniform float3 eyePosition, // object space
+		uniform float fresnelBias,
+		uniform float fresnelScale,
+		uniform float fresnelPower,
+		uniform float timeVal,
+		uniform float scale,  // the amount to scale the noise texture by
+		uniform float scroll, // the amount by which to scroll the noise
+		uniform float noise  // the noise perturb as a factor of the  time
+		)
+{
+	oPos = mul(worldViewProjMatrix, pos);
+	// Projective texture coordinates, adjust for mapping
+	float4x4 scalemat = float4x4(0.5,   0,   0, 0.5, 
+	                               0,-0.5,   0, 0.5,
+								   0,   0, 0.5, 0.5,
+								   0,   0,   0,   1);
+	projectionCoord = mul(scalemat, oPos);
+	// Noise map coords
+	noiseCoord.xy = (tex + (timeVal * scroll)) * scale;
+	noiseCoord.z = noise * timeVal;
+
+	// calc fresnel factor (reflection coefficient)
+	float3 eyeDir = normalize(pos.xyz - eyePosition);
+	fresnel = fresnelBias + fresnelScale * pow(1 + dot(eyeDir, normal), fresnelPower);
+	
+}
Index: code/trunk/Tutorial/Media/materials/programs/Example_FresnelPS.asm
===================================================================
--- code/trunk/Tutorial/Media/materials/programs/Example_FresnelPS.asm	(revision 44)
+++ code/trunk/Tutorial/Media/materials/programs/Example_FresnelPS.asm	(revision 44)
@@ -0,0 +1,72 @@
+ps.1.4
+  // conversion from Cg generated ARB_fragment_program to ps.1.4 by NFZ
+  // command line args: -profile arbfp1 -entry main_fp
+  // program main_fp
+  // c0 : distortionRange
+  // c1 : tintColour
+  // testure 0 : noiseMap
+  // texture 1 : reflectMap
+  // texture 2 : refractMap
+  // v0.x : fresnel 
+  // t0.xyz : noiseCoord
+  // t1.xyw : projectionCoord 
+
+def c2, 2, 1, 0, 0
+
+  // Cg:	distort.x = tex3D(noiseMap, noiseCoord).x;
+  // arbfp1:	TEX R0.x, fragment.texcoord[0], texture[0], 3D;
+  // sample noise map using noiseCoord in TEX unit 0 
+
+texld r0, t0.xyz
+
+  // get projected texture coordinates from TEX coord 1
+  // will be used in phase 2
+
+texcrd r1.xy, t1_dw.xyw
+mov r1.z, c2.y
+
+  // Cg:	distort.y = tex3D(noiseMap, noiseCoord + yoffset).x;
+  // arbfp1:	ADD R1.xyz, fragment.texcoord[0], c1;
+  // arbfp1:	TEX R1.x, R1, texture[0], 3D;
+  // arbfp1:	MOV R0.y, R1.x;
+
+  // Cg:	distort = (distort * 2 - 1) * distortionRange;
+  // arbfp1:	MAD R0.xy, R0, c0.x, -c0.y;
+  // arbfp1:	MUL R0.xy, R0, u0.x;
+  // (distort * 2 - 1) same as 2*(distort -.5) so use _bx2
+
+
+  // Cg:	final = projectionCoord.xy / projectionCoord.w;
+  // Cg:	final += distort;
+  // arbfp1:	RCP R0.w, fragment.texcoord[1].w;
+  // arbfp1:	MAD R0.xy, fragment.texcoord[1], R0.w, R0;
+  // 	final = (distort *  projectionCoord.w) + projectionCoord.xy
+  // for ps.1.4 have to re-arrange things a bit to perturb projected texture coordinates
+
+mad r0.xyz, r0_bx2, c0.x, r1
+
+phase
+
+  // do dependant texture reads
+  // Cg:	reflectionColour = tex2D(reflectMap, final);
+  // arbfp1:	TEX R0, R0, texture[1], 2D;
+  // sampe reflectMap using dependant read : texunit 1 
+
+texld r1, r0.xyz
+
+  // Cg:	refractionColour = tex2D(refractMap, final) + tintColour;
+  // arbfp1:	TEX R1, R0, texture[2], 2D;
+  // sample refractMap : texunit 2 
+
+texld r2, r0.xyz
+
+  // adding tintColour that is in global c1
+  // arbfp1:	ADD R1, R1, u1;
+
+add r2, r2, c1
+
+  // Cg:	col = lerp(refractionColour, reflectionColour, fresnel);
+  // arbfp1:	ADD R0, R0, -R1;
+  // arbfp1:	MAD result.color, fragment.color.primary.x, R0, R1;
+
+lrp r0, v0.x, r1, r2
Index: code/trunk/Tutorial/Media/materials/programs/Example_Projection.cg
===================================================================
--- code/trunk/Tutorial/Media/materials/programs/Example_Projection.cg	(revision 44)
+++ code/trunk/Tutorial/Media/materials/programs/Example_Projection.cg	(revision 44)
@@ -0,0 +1,28 @@
+
+void generalPurposeProjection_vp(
+		float4 pos			: POSITION,
+		
+		out float4 oPos		: POSITION,
+		out float4 texCoord : TEXCOORD0,
+
+		uniform float4x4 worldViewProjMatrix,
+		uniform float4x4 worldMatrix,
+		uniform float4x4 texViewProjMatrix)
+{
+	oPos = mul(worldViewProjMatrix, pos);
+	// multiply position by world matrix, then by projective view/proj
+	float4 newpos = mul(worldMatrix, pos);
+	texCoord = mul(texViewProjMatrix, newpos);
+	
+}
+
+void generalPurposeProjection_fp(
+		float4 texCoord		: TEXCOORD0,
+		out float4 col		: COLOR,
+		uniform sampler2D texMap)
+{
+	col = tex2Dproj(texMap, texCoord);
+
+}
+		
+
Index: code/trunk/Tutorial/Media/materials/programs/GlassFP.cg
===================================================================
--- code/trunk/Tutorial/Media/materials/programs/GlassFP.cg	(revision 44)
+++ code/trunk/Tutorial/Media/materials/programs/GlassFP.cg	(revision 44)
@@ -0,0 +1,9 @@
+sampler RT : register(s0);
+sampler NormalMap : register(s1);
+
+float4 main_ps(float2 iTexCoord : TEXCOORD0) : COLOR
+{
+	float4 normal = 2 * (tex2D(NormalMap, iTexCoord * 2.5) - 0.5);
+
+	return tex2D(RT, iTexCoord + normal.xy * 0.05);
+}
Index: code/trunk/Tutorial/Media/materials/programs/Grass.cg
===================================================================
--- code/trunk/Tutorial/Media/materials/programs/Grass.cg	(revision 44)
+++ code/trunk/Tutorial/Media/materials/programs/Grass.cg	(revision 44)
@@ -0,0 +1,31 @@
+// Vertex program to wave some grass about
+// Simplistic, assumes base of the grass at 0
+void grass_vp(float4 position : POSITION,
+			  float3 normal   : NORMAL,
+			  float2 uv		  : TEXCOORD0,
+			  out float4 oPosition : POSITION,
+			  out float2 oUv	   : TEXCOORD0,
+			  out float4 colour    : COLOR,
+
+			  uniform float4x4 worldViewProj,
+			  uniform float4 ambient,
+			  uniform float4 objSpaceLight,
+			  uniform float4 lightColour,
+			  uniform float4 offset)
+{
+	float4 mypos = position;
+	//offset = float4(0.5, 0, 0, 0);
+	float4 factor = float4(1,1,1,1) - uv.yyyy;
+	mypos = mypos + offset * factor;
+	oPosition = mul(worldViewProj, mypos);
+
+	oUv = uv;
+	// get vertex light direction (support directional and point)
+	float3 light = normalize(
+		objSpaceLight.xyz -  (position.xyz * objSpaceLight.w));
+	float diffuseFactor = max(dot(normal, light), 0);
+	
+	
+	colour = ambient + diffuseFactor * lightColour;
+}
+
Index: code/trunk/Tutorial/Media/materials/programs/GrayScale.cg
===================================================================
--- code/trunk/Tutorial/Media/materials/programs/GrayScale.cg	(revision 44)
+++ code/trunk/Tutorial/Media/materials/programs/GrayScale.cg	(revision 44)
@@ -0,0 +1,18 @@
+sampler RT : register(s0);
+
+float4 GrayScale_ps(float2 iTexCoord : TEXCOORD0) : COLOR
+{
+    float3 greyscale = dot(tex2D(RT, iTexCoord).rgb, float3(0.3, 0.59, 0.11));
+	return float4(greyscale, 1.0);
+}
+
+float4 Embossed_ps(float2 iTexCoord : TEXCOORD0) : COLOR
+{
+    float4 Color;
+    Color.a = 1.0f;
+    Color.rgb = 0.5f;
+    Color -= tex2D( RT, iTexCoord - 0.001)*2.0f;
+    Color += tex2D( RT, iTexCoord + 0.001)*2.0f;
+    Color.rgb = (Color.r+Color.g+Color.b)/3.0f;
+    return Color;
+}
Index: code/trunk/Tutorial/Media/materials/programs/HeatVision.cg
===================================================================
--- code/trunk/Tutorial/Media/materials/programs/HeatVision.cg	(revision 44)
+++ code/trunk/Tutorial/Media/materials/programs/HeatVision.cg	(revision 44)
@@ -0,0 +1,230 @@
+//////////////////////////////////////////////
+//				 CASTER PASS				//
+//				    HEAT					//
+//////////////////////////////////////////////
+
+// vs_1_1
+void HeatCaster_vp(
+              // in
+              float4 vPos: POSITION,
+              float4 vNormal: NORMAL,
+              
+              // out
+              out float4 oPos: POSITION,
+              out float2 oNDotV: TEXCOORD0,
+              
+              // parameters
+              uniform float4x4 worldViewProj,
+              uniform float3 eyePosition        // object space
+            )
+{
+   float4 eyeDir = float4(eyePosition - vPos.xyz, 0);
+   eyeDir = normalize(eyeDir);
+   oPos   = mul( worldViewProj, vPos );
+   oNDotV = clamp( dot( vNormal, eyeDir ), 0, 1 );
+}
+
+// ps_2_0
+float4 HeatCaster_fp(
+                        // input from vp
+                        float2 iNDotV: TEXCOORD0
+                     ) : COLOR0
+{
+   return iNDotV.x;
+}
+
+
+//////////////////////////////////////////////
+//				 CASTER PASS				//
+//				    COLD					//
+//////////////////////////////////////////////
+
+// vs_1_1
+void ColdCaster_vp(
+              // in
+              float4 vPos: POSITION,
+              float4 vNormal: NORMAL,
+              
+              // out
+              out float4 oPos: POSITION,
+              out float2 oNDotV: TEXCOORD0,
+              
+              // parameters
+              uniform float4x4 worldViewProj,
+              uniform float3 eyePosition        // object space
+            )
+{
+   float4 eyeDir = float4(eyePosition - vPos.xyz, 0);
+   eyeDir = normalize(eyeDir);
+   oPos   = mul( worldViewProj, vPos );
+   oNDotV = clamp( dot( vNormal, eyeDir ), 0, 1 );
+}
+
+// ps_2_0
+float4 ColdCaster_fp(
+                        // input from vp
+                        float2 iNDotV: TEXCOORD0
+                     ) : COLOR0
+{
+   return iNDotV.x / 2;
+}
+
+
+//////////////////////////////////////////////
+//	   PASS 1 - Light to heat conversion	//
+//////////////////////////////////////////////
+
+// vs_1_1
+void LightToHeat_vp(
+                    // in
+                    float4 inPos: POSITION,
+                    
+                    uniform float flipping,
+
+                    // out
+                    out float4 Pos: POSITION,
+                    out float2 uv0: TEXCOORD0
+                   )
+{
+    Pos = float4(inPos.x, flipping * inPos.y, 0.0f, 1.0f);
+    inPos.xy = sign(inPos.xy);
+    uv0  = (float2(inPos.x, -inPos.y) + 1.0f)/2.0f;
+}
+
+
+// ps_2_0
+void LightToHeat_fp(
+                        // input from vp
+                        float4 inDiffuse: COLOR0,
+                        float2 inUV0: TEXCOORD0,
+                        
+                        // out
+                        out float4 outColor: COLOR0,
+                        
+                        // params
+                        uniform float4 random_fractions,
+                        uniform float4 heatBiasScale,
+                        uniform float4 depth_modulator,
+
+                        uniform sampler2D Input,         // output of HeatVisionCaster_fp (NdotV)
+                        uniform sampler2D NoiseMap,
+                        uniform sampler2D HeatLookup
+                     )
+{
+   float  depth, heat, interference;
+
+   //  Output constant color:
+   depth = tex2D( Input, inUV0 );
+   depth *= (depth * depth_modulator);
+
+   heat  = (depth * heatBiasScale.y);
+
+//   if (depth > 0)
+   {
+		interference = -0.5 + tex2D( NoiseMap, inUV0 + float2( random_fractions.x, random_fractions.y ) );
+		interference *= interference;
+		interference *= 1 - heat;
+		heat += interference;//+ heatBiasScale.x;
+   }
+
+/*
+	heatBias isn't used for now
+   if (heat > 0)
+       heat += heatBiasScale.x;
+*/
+
+   // Clamp UVs
+   heat  = max( 0.005, min( 0.995, heat ) );
+   outColor = tex2D( HeatLookup, float2( heat, 0.f ) );
+}
+
+
+//////////////////////////////////////////////
+// PASS 2 - add simple blur (final pass)	//
+//////////////////////////////////////////////
+
+// vs_1_1
+void Blur_vp(
+                    // in
+                    float4 inPos: POSITION,
+                    
+                    uniform float flipping,
+
+                    // out
+                    out float4 Pos: POSITION,
+                    out float2 uv0: TEXCOORD0
+                   )
+{
+    Pos = float4(inPos.x, flipping * inPos.y, 0.0f, 1.0f);
+    inPos.xy = sign(inPos.xy);
+    uv0  = (float2(inPos.x, -inPos.y) + 1.0f)/2.0f;
+}
+
+// ps_2_0
+void Blur_fp(
+                    // input from vp
+                    float4 inDiffuse: COLOR0,
+                    float2 inUV0: TEXCOORD0,
+                    
+                    // out
+                    out float4 outColor: COLOR0,
+                    
+                    // parameters
+                    uniform sampler2D Input,             // output of HeatVision_fp1 (HeatRenderTexture)
+                    uniform float4 blurAmount
+                    )
+{
+   int i;
+   float4 tmpOutColor;
+   float  diffuseGlowFactor;
+   const float2 offsets[4] = 
+   {
+/*
+		// hazy blur
+		-1.8, -1.8,
+		-1.8, 1.8,
+		1.8, -1.8,
+		1.8, 1.8
+*/
+/*
+		// less-hazy blur
+	  -1.0,  2.0,
+	  -1.0, -1.0,
+	   1.0, -1.0,
+	   1.0,  1.0
+*/
+/*
+      -0.326212, -0.405805,
+      -0.840144, -0.073580,
+      -0.695914,  0.457137,
+      -0.203345,  0.620716
+*/
+
+	  -0.3,  0.4,
+	  -0.3, -0.4,
+	   0.3, -0.4,
+	   0.3,  0.4
+
+   };
+
+   tmpOutColor = tex2D( Input, inUV0 );	// UV coords are in image space
+
+   // calculate glow amount
+   diffuseGlowFactor = 0.0113f * (2.0 - max( tmpOutColor.r, tmpOutColor.g ));
+
+   // basic blur filter
+   for (i = 0; i < 4; i++) {
+      tmpOutColor += tex2D( Input, inUV0 + blurAmount.x * diffuseGlowFactor * offsets[i] );
+   }
+
+   tmpOutColor *= 0.25;
+
+   // TIPS (old-skool strikes again!)
+   // Pay attention here! If you use the "out float4 outColor" directly
+   // in your steps while creating the output color (like you remove
+   // the "tmpOutColor" var and just use the "outColor" directly)
+   // your pixel-color output IS CHANGING EACH TIME YOU DO AN ASSIGNMENT TOO!
+   // A temporary variable, instead, acts like a per-pixel double buffer, and
+   // best of all, lead to better performance.
+   outColor = tmpOutColor;
+}
Index: code/trunk/Tutorial/Media/materials/programs/InvertFP.cg
===================================================================
--- code/trunk/Tutorial/Media/materials/programs/InvertFP.cg	(revision 44)
+++ code/trunk/Tutorial/Media/materials/programs/InvertFP.cg	(revision 44)
@@ -0,0 +1,6 @@
+sampler RT : register(s0);
+
+float4 Invert_ps (float2 iTexCoord : TEXCOORD0) : COLOR
+{
+	return 1 - tex2D(RT, iTexCoord);
+}
Index: code/trunk/Tutorial/Media/materials/programs/LaplaceFP.cg
===================================================================
--- code/trunk/Tutorial/Media/materials/programs/LaplaceFP.cg	(revision 44)
+++ code/trunk/Tutorial/Media/materials/programs/LaplaceFP.cg	(revision 44)
@@ -0,0 +1,36 @@
+sampler Image : register(s0);
+
+// The Laplace filter approximates the second order derivate,
+// that is, the rate of change of slope in the image. It can be
+// used for edge detection. The Laplace filter gives negative
+// response on the higher side of the edge and positive response
+// on the lower side.
+
+// This is the filter kernel:
+// 0  1  0
+// 1 -4  1
+// 0  1  0
+
+
+
+float4 Laplace_ps (float2 texCoord: TEXCOORD0,
+			uniform float scale,
+			uniform float pixelSize) : COLOR
+{
+
+    float2 samples[4] = {
+        0, -1,
+       -1,  0,
+        1,  0,
+        0,  1
+    };
+   float4 laplace = -4 * tex2D(Image, texCoord);
+
+   // Sample the neighbor pixels
+   for (int i = 0; i < 4; i++){
+      laplace += tex2D(Image, texCoord + pixelSize * samples[i]);
+   }
+
+   return (0.5 + scale * laplace);
+}
+
Index: code/trunk/Tutorial/Media/materials/programs/Ocean2GLSL.frag
===================================================================
--- code/trunk/Tutorial/Media/materials/programs/Ocean2GLSL.frag	(revision 44)
+++ code/trunk/Tutorial/Media/materials/programs/Ocean2GLSL.frag	(revision 44)
@@ -0,0 +1,71 @@
+/*********************************************************************NVMH3****
+Copyright NVIDIA Corporation 2003
+TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THIS SOFTWARE IS PROVIDED
+*AS IS* AND NVIDIA AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES, EITHER EXPRESS
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY
+AND FITNESS FOR A PARTICULAR PURPOSE.  IN NO EVENT SHALL NVIDIA OR ITS SUPPLIERS
+BE LIABLE FOR ANY SPECIAL, INCIDENTAL, INDIRECT, OR CONSEQUENTIAL DAMAGES
+WHATSOEVER (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS,
+BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR ANY OTHER PECUNIARY LOSS)
+ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF NVIDIA HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+
+Comments:
+	Simple ocean shader with animated bump map and geometric waves
+	Based partly on "Effective Water Simulation From Physical Models", GPU Gems
+
+11 Aug 05: converted from HLSL to GLSL by Jeff Doyle (nfz) to work in Ogre
+
+******************************************************************************/
+
+
+uniform sampler2D NormalMap;
+uniform samplerCube EnvironmentMap;
+uniform vec4 deepColor;
+uniform vec4 shallowColor;
+uniform vec4 reflectionColor;
+uniform float reflectionAmount;
+uniform float reflectionBlur;
+uniform float waterAmount;
+uniform float fresnelPower;
+uniform float fresnelBias;
+uniform float hdrMultiplier;
+
+varying mat3 rotMatrix; // first row of the 3x3 transform from tangent to cube space
+varying vec2 bumpCoord0;
+varying vec2 bumpCoord1;
+varying vec2 bumpCoord2;
+varying vec3 eyeVector;
+
+
+void main(void)
+{
+	// sum normal maps
+	// sample from 3 different points so no texture repetition is noticeable
+    vec4 t0 = texture2D(NormalMap, bumpCoord0) * 2.0 - 1.0;
+    vec4 t1 = texture2D(NormalMap, bumpCoord1) * 2.0 - 1.0;
+    vec4 t2 = texture2D(NormalMap, bumpCoord2) * 2.0 - 1.0;
+    vec3 N = t0.xyz + t1.xyz + t2.xyz;
+
+    N = normalize(rotMatrix * N);
+
+	// reflection
+    vec3 E = normalize(eyeVector);
+    vec3 R = reflect(E, N);
+    // Ogre conversion for cube map lookup
+    R.z = -R.z;
+
+    vec4 reflection = textureCube(EnvironmentMap, R, reflectionBlur);
+    // cheap hdr effect
+    reflection.rgb *= (reflection.r + reflection.g + reflection.b) * hdrMultiplier;
+
+	// fresnel
+    float facing = 1.0 - dot(-E, N);
+    float fresnel = clamp(fresnelBias + pow(facing, fresnelPower), 0.0, 1.0);
+
+    vec4 waterColor = mix(shallowColor, deepColor, facing) * waterAmount;
+
+    reflection = mix(waterColor,  reflection * reflectionColor, fresnel) * reflectionAmount;
+    gl_FragColor = waterColor + reflection;
+}
Index: code/trunk/Tutorial/Media/materials/programs/Ocean2GLSL.vert
===================================================================
--- code/trunk/Tutorial/Media/materials/programs/Ocean2GLSL.vert	(revision 44)
+++ code/trunk/Tutorial/Media/materials/programs/Ocean2GLSL.vert	(revision 44)
@@ -0,0 +1,91 @@
+/*********************************************************************NVMH3****
+Copyright NVIDIA Corporation 2003
+TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THIS SOFTWARE IS PROVIDED
+*AS IS* AND NVIDIA AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES, EITHER EXPRESS
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY
+AND FITNESS FOR A PARTICULAR PURPOSE.  IN NO EVENT SHALL NVIDIA OR ITS SUPPLIERS
+BE LIABLE FOR ANY SPECIAL, INCIDENTAL, INDIRECT, OR CONSEQUENTIAL DAMAGES
+WHATSOEVER (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS,
+BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR ANY OTHER PECUNIARY LOSS)
+ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF NVIDIA HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+
+Comments:
+	Simple ocean shader with animated bump map and geometric waves
+	Based partly on "Effective Water Simulation From Physical Models", GPU Gems
+
+11 Aug 05: converted from HLSL to GLSL by Jeff Doyle (nfz) to work in Ogre
+
+******************************************************************************/
+
+uniform vec3 eyePosition;
+uniform float BumpScale;
+uniform vec2 textureScale;
+uniform vec2 bumpSpeed;
+uniform float time;
+uniform float waveFreq;
+uniform float waveAmp;
+
+varying mat3 rotMatrix; //  transform from tangent to obj space
+varying vec2 bumpCoord0;
+varying vec2 bumpCoord1;
+varying vec2 bumpCoord2;
+varying vec3 eyeVector;
+
+// wave functions
+struct Wave {
+  float freq;  // 2*PI / wavelength
+  float amp;   // amplitude
+  float phase; // speed * 2*PI / wavelength
+  vec2 dir;
+};
+
+
+void main(void)
+{
+
+	#define NWAVES 2
+
+	Wave wave[NWAVES];
+
+	wave[0] = Wave( waveFreq, waveAmp, 0.5, vec2(-1, 0) );
+	wave[1] = Wave( 3.0 * waveFreq, 0.33 * waveAmp, 1.7, vec2(-0.7, 0.7) );
+
+
+    vec4 P = gl_Vertex;
+
+	// sum waves
+	float ddx = 0.0, ddy = 0.0;
+	float deriv;
+	float angle;
+
+	// wave synthesis using two sine waves at different frequencies and phase shift
+	for(int i = 0; i<NWAVES; ++i)
+	{
+		angle = dot(wave[i].dir, P.xz) * wave[i].freq + time * wave[i].phase;
+		P.y += wave[i].amp * sin( angle );
+		// calculate derivate of wave function
+		deriv = wave[i].freq * wave[i].amp * cos(angle);
+		ddx -= deriv * wave[i].dir.x;
+		ddy -= deriv * wave[i].dir.y;
+	}
+
+	// compute the 3x3 tranform from tangent space to object space
+	// compute tangent basis
+    vec3 T = normalize(vec3(1.0, ddy, 0.0)) * BumpScale;
+    vec3 B = normalize(vec3(0.0, ddx, 1.0)) * BumpScale;
+    vec3 N = normalize(vec3(ddx, 1.0, ddy));
+
+	rotMatrix = mat3(T, B, N);
+
+	gl_Position = gl_ModelViewProjectionMatrix * P;
+
+	// calculate texture coordinates for normal map lookup
+	bumpCoord0.xy = gl_MultiTexCoord0.xy * textureScale + time * bumpSpeed;
+	bumpCoord1.xy = gl_MultiTexCoord0.xy * textureScale * 2.0 + time * bumpSpeed * 4.0;
+	bumpCoord2.xy = gl_MultiTexCoord0.xy * textureScale * 4.0 + time * bumpSpeed * 8.0;
+
+
+	eyeVector = P.xyz - eyePosition; // eye position in vertex space
+}
Index: code/trunk/Tutorial/Media/materials/programs/Ocean2HLSL_Cg.frag
===================================================================
--- code/trunk/Tutorial/Media/materials/programs/Ocean2HLSL_Cg.frag	(revision 44)
+++ code/trunk/Tutorial/Media/materials/programs/Ocean2HLSL_Cg.frag	(revision 44)
@@ -0,0 +1,85 @@
+/*********************************************************************NVMH3****
+Copyright NVIDIA Corporation 2003
+TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THIS SOFTWARE IS PROVIDED
+*AS IS* AND NVIDIA AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES, EITHER EXPRESS
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY
+AND FITNESS FOR A PARTICULAR PURPOSE.  IN NO EVENT SHALL NVIDIA OR ITS SUPPLIERS
+BE LIABLE FOR ANY SPECIAL, INCIDENTAL, INDIRECT, OR CONSEQUENTIAL DAMAGES
+WHATSOEVER (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS,
+BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR ANY OTHER PECUNIARY LOSS)
+ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF NVIDIA HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+
+Comments:
+	Simple ocean shader with animated bump map and geometric waves
+	Based partly on "Effective Water Simulation From Physical Models", GPU Gems
+
+11 Aug 05: heavily modified by Jeff Doyle (nfz) for Ogre
+
+******************************************************************************/
+
+
+
+struct v2f {
+	float4 Position  : POSITION;  // in clip space
+	float3 rotMatrix1 : TEXCOORD0; // first row of the 3x3 transform from tangent to obj space
+	float3 rotMatrix2 : TEXCOORD1; // second row of the 3x3 transform from tangent to obj space
+	float3 rotMatrix3 : TEXCOORD2; // third row of the 3x3 transform from tangent to obj space
+
+	float2 bumpCoord0 : TEXCOORD3;
+	float2 bumpCoord1 : TEXCOORD4;
+	float2 bumpCoord2 : TEXCOORD5;
+
+	float3 eyeVector  : TEXCOORD6;
+};
+
+
+float4 main(v2f IN,
+			uniform sampler2D NormalMap,
+			uniform samplerCUBE EnvironmentMap,
+			uniform float4 deepColor,
+			uniform float4 shallowColor,
+			uniform float4 reflectionColor,
+			uniform float reflectionAmount,
+			uniform float reflectionBlur,
+			uniform float waterAmount,
+			uniform float fresnelPower,
+			uniform float fresnelBias,
+			uniform float hdrMultiplier
+			) : COLOR
+{
+	// sum normal maps
+	// sample from 3 different points so no texture repetition is noticeable
+    float4 t0 = tex2D(NormalMap, IN.bumpCoord0) * 2.0 - 1.0;
+    float4 t1 = tex2D(NormalMap, IN.bumpCoord1) * 2.0 - 1.0;
+    float4 t2 = tex2D(NormalMap, IN.bumpCoord2) * 2.0 - 1.0;
+    float3 N = t0.xyz + t1.xyz + t2.xyz;
+
+    float3x3 m; // tangent to world matrix
+    m[0] = IN.rotMatrix1;
+    m[1] = IN.rotMatrix2;
+    m[2] = IN.rotMatrix3;
+
+    N = normalize( mul( N, m ) );
+
+	// reflection
+    float3 E = normalize(IN.eyeVector);
+    float4 R;
+    R.xyz = reflect(E, N);
+    // Ogre conversion for cube map lookup
+    R.z = -R.z;
+    R.w = reflectionBlur;
+    float4 reflection = texCUBEbias(EnvironmentMap, R);
+    // cheap hdr effect
+    reflection.rgb *= (reflection.r + reflection.g + reflection.b) * hdrMultiplier;
+
+	// fresnel
+    float facing = 1.0 - max(dot(-E, N), 0);
+    float fresnel = saturate(fresnelBias + pow(facing, fresnelPower));
+
+    float4 waterColor = lerp(shallowColor, deepColor, facing) * waterAmount;
+
+    reflection = lerp(waterColor,  reflection * reflectionColor, fresnel) * reflectionAmount;
+    return waterColor + reflection;
+}
Index: code/trunk/Tutorial/Media/materials/programs/Ocean2HLSL_Cg.vert
===================================================================
--- code/trunk/Tutorial/Media/materials/programs/Ocean2HLSL_Cg.vert	(revision 44)
+++ code/trunk/Tutorial/Media/materials/programs/Ocean2HLSL_Cg.vert	(revision 44)
@@ -0,0 +1,108 @@
+/*********************************************************************NVMH3****
+Copyright NVIDIA Corporation 2003
+TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THIS SOFTWARE IS PROVIDED
+*AS IS* AND NVIDIA AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES, EITHER EXPRESS
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY
+AND FITNESS FOR A PARTICULAR PURPOSE.  IN NO EVENT SHALL NVIDIA OR ITS SUPPLIERS
+BE LIABLE FOR ANY SPECIAL, INCIDENTAL, INDIRECT, OR CONSEQUENTIAL DAMAGES
+WHATSOEVER (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS,
+BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR ANY OTHER PECUNIARY LOSS)
+ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF NVIDIA HAS
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+
+Comments:
+	Simple ocean shader with animated bump map and geometric waves
+	Based partly on "Effective Water Simulation From Physical Models", GPU Gems
+
+11 Aug 05: heavily modified by Jeff Doyle (nfz) for Ogre
+
+******************************************************************************/
+
+struct a2v {
+	float4 Position : POSITION;   // in object space
+	float2 TexCoord : TEXCOORD0;
+};
+
+struct v2f {
+	float4 Position  : POSITION;  // in clip space
+	float3 rotMatrix1 : TEXCOORD0; // first row of the 3x3 transform from tangent to obj space
+	float3 rotMatrix2 : TEXCOORD1; // second row of the 3x3 transform from tangent to obj space
+	float3 rotMatrix3 : TEXCOORD2; // third row of the 3x3 transform from tangent to obj space
+
+	float2 bumpCoord0 : TEXCOORD3;
+	float2 bumpCoord1 : TEXCOORD4;
+	float2 bumpCoord2 : TEXCOORD5;
+
+	float3 eyeVector  : TEXCOORD6;
+};
+
+// wave functions
+
+struct Wave {
+  float freq;  // 2*PI / wavelength
+  float amp;   // amplitude
+  float phase; // speed * 2*PI / wavelength
+  float2 dir;
+};
+
+v2f main(a2v IN,
+		uniform float4x4 WorldViewProj,
+		uniform float3 eyePosition,
+		uniform float BumpScale,
+		uniform float2 textureScale,
+		uniform float2 bumpSpeed,
+		uniform float time,
+		uniform float waveFreq,
+		uniform float waveAmp
+        )
+{
+	v2f OUT;
+
+	#define NWAVES 2
+	Wave wave[NWAVES] = {
+		{ 1.0, 1.0, 0.5, float2(-1, 0) },
+		{ 2.0, 0.5, 1.7, float2(-0.7, 0.7) }
+	};
+
+    wave[0].freq = waveFreq;
+    wave[0].amp = waveAmp;
+
+    wave[1].freq = waveFreq * 3.0;
+    wave[1].amp = waveAmp * 0.33;
+
+    float4 P = IN.Position;
+
+	// sum waves
+	float ddx = 0.0, ddy = 0.0;
+	float deriv;
+	float angle;
+
+	// wave synthesis using two sine waves at different frequencies and phase shift
+	for(int i = 0; i<NWAVES; ++i)
+	{
+		angle = dot(wave[i].dir, P.xz) * wave[i].freq + time * wave[i].phase;
+		P.y += wave[i].amp * sin( angle );
+		// calculate derivate of wave function
+		deriv = wave[i].freq * wave[i].amp * cos(angle);
+		ddx -= deriv * wave[i].dir.x;
+		ddy -= deriv * wave[i].dir.y;
+	}
+
+	// compute the 3x3 tranform from tangent space to object space
+	// first rows are the tangent and binormal scaled by the bump scale
+
+	OUT.rotMatrix1.xyz = BumpScale * normalize(float3(1, ddy, 0)); // Binormal
+	OUT.rotMatrix2.xyz = BumpScale * normalize(float3(0, ddx, 1)); // Tangent
+	OUT.rotMatrix3.xyz = normalize(float3(ddx, 1, ddy)); // Normal
+
+	OUT.Position = mul(WorldViewProj, P);
+
+	// calculate texture coordinates for normal map lookup
+	OUT.bumpCoord0.xy = IN.TexCoord*textureScale + time * bumpSpeed;
+	OUT.bumpCoord1.xy = IN.TexCoord*textureScale * 2.0 + time * bumpSpeed * 4.0;
+	OUT.bumpCoord2.xy = IN.TexCoord*textureScale * 4.0 + time * bumpSpeed * 8.0;
+
+	OUT.eyeVector = P.xyz - eyePosition; // eye position in vertex space
+	return OUT;
+}
Index: code/trunk/Tutorial/Media/materials/programs/OffsetMapping.cg
===================================================================
--- code/trunk/Tutorial/Media/materials/programs/OffsetMapping.cg	(revision 44)
+++ code/trunk/Tutorial/Media/materials/programs/OffsetMapping.cg	(revision 44)
@@ -0,0 +1,97 @@
+/* Bump mapping with Parallax offset vertex program 
+   In this program, we want to calculate the tangent space light end eye vectors 
+   which will get passed to the fragment program to produce the per-pixel bump map 
+   with parallax offset effect. 
+*/ 
+
+/* Vertex program that moves light and eye vectors into texture tangent space at vertex */ 
+
+void main_vp(float4 position   : POSITION, 
+              float3 normal      : NORMAL, 
+              float2 uv         : TEXCOORD0, 
+              float3 tangent     : TANGENT0, 
+              // outputs 
+              out float4 oPosition    : POSITION, 
+              out float2 oUv          : TEXCOORD0, 
+              out float3 oLightDir    : TEXCOORD1, // tangent space 
+             out float3 oEyeDir       : TEXCOORD2, // tangent space 
+             out float3 oHalfAngle    : TEXCOORD3, // 
+              // parameters 
+              uniform float4 lightPosition, // object space 
+              uniform float3 eyePosition,   // object space 
+              uniform float4x4 worldViewProj) 
+{  
+   // calculate output position 
+   oPosition = mul(worldViewProj, position); 
+
+   // pass the main uvs straight through unchanged 
+   oUv = uv; 
+
+   // calculate tangent space light vector 
+   // Get object space light direction 
+   float3 lightDir = normalize(lightPosition.xyz -  (position * lightPosition.w));
+   float3 eyeDir = eyePosition - position.xyz; 
+    
+   // Calculate the binormal (NB we assume both normal and tangent are 
+   // already normalised) 
+   // NB looks like nvidia cross params are BACKWARDS to what you'd expect 
+   // this equates to NxT, not TxN 
+   float3 binormal = cross(tangent, normal); 
+    
+   // Form a rotation matrix out of the vectors 
+   float3x3 rotation = float3x3(tangent, binormal, normal); 
+    
+   // Transform the light vector according to this matrix 
+   lightDir = normalize(mul(rotation, lightDir)); 
+   eyeDir = normalize(mul(rotation, eyeDir)); 
+
+   oLightDir = lightDir; 
+   oEyeDir = eyeDir; 
+   oHalfAngle = normalize(eyeDir + lightDir); 
+}
+
+// General functions
+
+// Expand a range-compressed vector
+float3 expand(float3 v)
+{
+	return (v - 0.5) * 2;
+}
+
+void main_fp(float2 uv : TEXCOORD0,
+	float3 lightDir : TEXCOORD1,
+	float3 eyeDir : TEXCOORD2,
+	float3 halfAngle : TEXCOORD3,
+	uniform float3 lightDiffuse,
+	uniform float3 lightSpecular,
+	uniform float4 scaleBias,
+	uniform sampler2D normalHeightMap,
+	uniform sampler2D diffuseMap,
+	out float4 oColor : COLOR)
+{
+	// get the height using the tex coords
+	float height = tex2D(normalHeightMap, uv).a;
+
+	// scale and bias factors	
+	float scale = scaleBias.x;
+	float bias = scaleBias.y;
+
+	// calculate displacement	
+	float displacement = (height * scale) + bias;
+	
+	float3 uv2 = float3(uv, 1);
+	
+	// calculate the new tex coord to use for normal and diffuse
+	float2 newTexCoord = ((eyeDir * displacement) + uv2).xy;
+	
+	// get the new normal and diffuse values
+	float3 normal = expand(tex2D(normalHeightMap, newTexCoord).xyz);
+	float3 diffuse = tex2D(diffuseMap, newTexCoord).xyz;
+	
+	float3 specular = pow(saturate(dot(normal, halfAngle)), 32) * lightSpecular;
+	float3 col = diffuse * saturate(dot(normal, lightDir)) * lightDiffuse + specular;
+		
+	oColor = float4(col, 1);
+}
+
+
Index: code/trunk/Tutorial/Media/materials/programs/OffsetMapping.hlsl
===================================================================
--- code/trunk/Tutorial/Media/materials/programs/OffsetMapping.hlsl	(revision 44)
+++ code/trunk/Tutorial/Media/materials/programs/OffsetMapping.hlsl	(revision 44)
@@ -0,0 +1,135 @@
+/* Offset mapping including a shadow element and multiple lights in one pass */ 
+void integratedshadows_vp(float4 position   : POSITION, 
+              float3 normal      : NORMAL, 
+              float2 uv         : TEXCOORD0, 
+              float3 tangent     : TANGENT0, 
+              // outputs 
+              out float4 oPosition    : POSITION, 
+              out float2 oUv          : TEXCOORD0, 
+              out float3 oLightDir    : TEXCOORD1, // tangent space 
+             out float3 oEyeDir       : TEXCOORD2, // tangent space 
+			 out float3 oSpotDirection : TEXCOORD3, // tangent space
+              out float3 oLightDir1    : TEXCOORD4, // tangent space 
+              out float3 oSpotDirection1    : TEXCOORD5, // tangent space 
+			 out float4 oShadowUV1 : TEXCOORD6,
+			 out float4 oShadowUV2 : TEXCOORD7,
+              // parameters 
+              uniform float4 lightPosition, // object space 
+              uniform float4 lightPosition1, // object space 
+              uniform float3 eyePosition,   // object space 
+ 			  uniform float3 spotDirection, // object space
+ 			  uniform float3 spotDirection1, // object space
+              uniform float4x4 worldViewProj,
+			  uniform float4x4 worldMatrix,
+			  uniform float4x4 texViewProj1,
+			  uniform float4x4 texViewProj2) 
+{  
+   // calculate output position 
+   oPosition = mul(worldViewProj, position); 
+
+   float4 worldPos = mul(worldMatrix, position);
+   oShadowUV1 = mul(texViewProj1, worldPos);
+   oShadowUV2 = mul(texViewProj2, worldPos);
+   
+   
+
+   // pass the main uvs straight through unchanged 
+   oUv = uv; 
+
+   // calculate tangent space light vector 
+   // Get object space light direction 
+   float3 lightDir = normalize(lightPosition.xyz -  (position * lightPosition.w));
+   float3 lightDir1 = normalize(lightPosition1.xyz -  (position * lightPosition1.w));
+   float3 eyeDir = eyePosition - position.xyz; 
+    
+   // Calculate the binormal (NB we assume both normal and tangent are 
+   // already normalised) 
+   // NB looks like nvidia cross params are BACKWARDS to what you'd expect 
+   // this equates to NxT, not TxN 
+   float3 binormal = cross(tangent, normal); 
+    
+   // Form a rotation matrix out of the vectors 
+   float3x3 rotation = float3x3(tangent, binormal, normal); 
+    
+   // Transform the light vector according to this matrix 
+   lightDir = normalize(mul(rotation, lightDir)); 
+   lightDir1 = normalize(mul(rotation, lightDir1)); 
+   eyeDir = normalize(mul(rotation, eyeDir)); 
+
+   oLightDir = lightDir; 
+   oLightDir1 = lightDir1; 
+   oEyeDir = eyeDir; 
+   oSpotDirection = normalize(mul(rotation, -spotDirection));
+   oSpotDirection1 = normalize(mul(rotation, -spotDirection1));
+}
+
+// Expand a range-compressed vector
+float3 expand(float3 v)
+{
+	return (v - 0.5) * 2;
+}
+
+void integratedshadows_fp(
+	float2 uv : TEXCOORD0,
+	float3 lightDir : TEXCOORD1,
+	float3 eyeDir : TEXCOORD2,
+	float3 spotDir : TEXCOORD3,
+	float3 lightDir1 : TEXCOORD4,
+	float3 spotDir1 : TEXCOORD5,
+	float4 shadowUV1 : TEXCOORD6,
+	float4 shadowUV2 : TEXCOORD7,
+	uniform float3 lightDiffuse,
+	uniform float4 scaleBias,
+    uniform float4 spotParams,
+	uniform float3 lightDiffuse1,
+    uniform float4 spotParams1,
+	uniform sampler2D normalHeightMap : register(s0),
+	uniform sampler2D diffuseMap : register(s1),
+	uniform sampler2D shadowMap1 : register(s2),
+	uniform sampler2D shadowMap2 : register(s3),
+	out float4 oColour : COLOR)
+{
+	// get the height using the tex coords
+	float height = tex2D(normalHeightMap, uv).a;
+
+	// scale and bias factors	
+	float scale = scaleBias.x;
+	float bias = scaleBias.y;
+
+	// calculate displacement	
+	float displacement = (height * scale) + bias;
+	
+	float3 uv2 = float3(uv, 1);
+
+	float3 scaledEyeDir = eyeDir * displacement;
+	
+	// calculate the new tex coord to use for normal and diffuse
+	float2 newTexCoord = (scaledEyeDir + uv2).xy;
+	
+	// get the new normal and diffuse values
+	float3 normal = expand(tex2D(normalHeightMap, newTexCoord).xyz);
+	float3 diffuse = tex2D(diffuseMap, newTexCoord).xyz;
+	
+	float3 col1 = diffuse * saturate(dot(normal, lightDir)) * lightDiffuse;
+	// factor in spotlight angle
+	float rho = saturate(dot(spotDir, lightDir));
+	// factor = (rho - cos(outer/2) / cos(inner/2) - cos(outer/2)) ^ falloff
+	float spotFactor = pow(
+		saturate(rho - spotParams.y) / (spotParams.x - spotParams.y), spotParams.z);
+	col1 = col1 * spotFactor;
+	float3 col2 = diffuse * saturate(dot(normal, lightDir1)) * lightDiffuse1;
+	// factor in spotlight angle
+	rho = saturate(dot(spotDir1, lightDir1));
+	// factor = (rho - cos(outer/2) / cos(inner/2) - cos(outer/2)) ^ falloff
+	spotFactor = pow(
+		saturate(rho - spotParams1.y) / (spotParams1.x - spotParams1.y), spotParams1.z);
+	col2 = col2 * spotFactor;
+
+	// shadow textures
+	col1 = col1 * tex2Dproj(shadowMap1, shadowUV1);
+	col2 = col2 * tex2Dproj(shadowMap2, shadowUV2);
+
+	oColour = float4(col1 + col2, 1);
+
+}
+
Index: code/trunk/Tutorial/Media/materials/programs/OffsetMappingFp.glsl
===================================================================
--- code/trunk/Tutorial/Media/materials/programs/OffsetMappingFp.glsl	(revision 44)
+++ code/trunk/Tutorial/Media/materials/programs/OffsetMappingFp.glsl	(revision 44)
@@ -0,0 +1,69 @@
+uniform vec4 lightDiffuse;
+uniform vec4 scaleBias;
+uniform vec4 spotParams;
+uniform vec4 lightDiffuse1;
+uniform vec4 spotParams1;
+
+uniform sampler2D normalHeightMap;
+uniform sampler2D diffuseMap;
+uniform sampler2D shadowMap1;
+uniform sampler2D shadowMap2;
+
+
+
+varying vec3 tangentEyeDir;
+varying vec3 tangentLightDir[2];
+varying vec3 tangentSpotDir[2];
+varying vec4 shadowUV[2];
+
+
+// Expand a range-compressed vector
+vec3 expand(vec3 v)
+{
+	return (v - 0.5) * 2.0;
+}
+
+
+void main()
+{
+	// get the height using the tex coords
+	float height = texture2D(normalHeightMap, gl_TexCoord[0].xy).a;
+	// scale and bias factors	
+	float scale = scaleBias.x;
+	float bias = scaleBias.y;
+
+	// calculate displacement	
+	float displacement = (height * scale) + bias;
+	//float displacement = (height * 0.04) - 0.02;
+	
+	vec3 scaledEyeDir = tangentEyeDir * displacement;
+	
+	// calculate the new tex coord to use for normal and diffuse
+	vec2 newTexCoord = (scaledEyeDir + gl_TexCoord[0].xyz).xy;
+	
+	// get the new normal and diffuse values
+	vec3 normal = expand(texture2D(normalHeightMap, newTexCoord).xyz);
+	vec4 diffuse = texture2D(diffuseMap, newTexCoord);
+	
+	vec4 col1 = diffuse * clamp(dot(normal, tangentLightDir[0]),0.0,1.0) * lightDiffuse;
+	// factor in spotlight angle
+	float rho = clamp(dot(tangentSpotDir[0], tangentLightDir[0]),0.0,1.0);
+	// factor = (rho - cos(outer/2) / cos(inner/2) - cos(outer/2)) ^ falloff
+	float spotFactor = pow(
+		clamp(rho - spotParams.y,0.0,1.0) / (spotParams.x - spotParams.y), spotParams.z);
+	col1 = col1 * spotFactor;
+	vec4 col2 = diffuse * clamp(dot(normal, tangentLightDir[1]),0.0,1.0) * lightDiffuse1;
+	// factor in spotlight angle
+	rho = clamp(dot(tangentSpotDir[1], tangentLightDir[1]),0.0,1.0);
+	// factor = (rho - cos(outer/2) / cos(inner/2) - cos(outer/2)) ^ falloff
+	spotFactor = pow(
+		clamp(rho - spotParams1.y,0.0,1.0) / (spotParams1.x - spotParams1.y), spotParams1.z);
+	col2 = col2 * spotFactor;
+
+	// shadow textures
+	col1 = col1 * texture2DProj(shadowMap1, shadowUV[0]);
+	col2 = col2 * texture2DProj(shadowMap2, shadowUV[1]);
+
+	gl_FragColor = col1 + col2;
+
+}
Index: code/trunk/Tutorial/Media/materials/programs/OffsetMappingVp.glsl
===================================================================
--- code/trunk/Tutorial/Media/materials/programs/OffsetMappingVp.glsl	(revision 44)
+++ code/trunk/Tutorial/Media/materials/programs/OffsetMappingVp.glsl	(revision 44)
@@ -0,0 +1,54 @@
+attribute vec3 tangent;
+
+uniform vec4 lightPosition; // object space 
+uniform vec4 lightPosition1; // object space 
+uniform vec4 eyePosition;   // object space 
+uniform vec4 spotDirection; // object space
+uniform vec4 spotDirection1; // object space
+uniform mat4 worldViewProj; // not actually used but here for compat with HLSL
+uniform mat4 worldMatrix;
+uniform mat4 texViewProj1;
+uniform mat4 texViewProj2;
+
+
+varying vec3 tangentEyeDir;
+varying vec3 tangentLightDir[2];
+varying vec3 tangentSpotDir[2];
+varying vec4 shadowUV[2];
+
+void main()
+{
+	gl_Position = ftransform();
+
+	vec4 worldPos = worldMatrix * gl_Vertex;
+
+	shadowUV[0] = texViewProj1 * worldPos;
+	shadowUV[1] = texViewProj2 * worldPos;
+
+	// pass the main uvs straight through unchanged 
+	gl_TexCoord[0] = gl_MultiTexCoord0;
+
+	// calculate tangent space light vector 
+	// Get object space light direction 
+    vec3 lightDir = normalize(lightPosition.xyz -  (gl_Vertex.xyz * lightPosition.w));
+	vec3 lightDir1 = normalize(lightPosition1.xyz -  (gl_Vertex.xyz * lightPosition1.w));
+	
+	vec3 eyeDir = (eyePosition - gl_Vertex).xyz; 
+
+	// Calculate the binormal (NB we assume both normal and tangent are 
+	// already normalised) 
+	vec3 binormal = cross(gl_Normal, tangent); 
+
+	// Form a rotation matrix out of the vectors 
+	mat3 rotation = mat3(tangent, binormal, gl_Normal); 
+    
+	// Transform the light vector according to this matrix 
+	tangentLightDir[0] = normalize(rotation * lightDir); 
+	tangentLightDir[1] = normalize(rotation * lightDir1); 
+	// Invert the Y on the eye dir since we'll be using this to alter UVs and
+	// GL has Y inverted
+	tangentEyeDir = normalize(rotation * eyeDir) * vec3(1, -1, 1); 
+
+	tangentSpotDir[0] = normalize(rotation * -spotDirection.xyz);
+	tangentSpotDir[1] = normalize(rotation * -spotDirection1.xyz);	
+}
Index: code/trunk/Tutorial/Media/materials/programs/OffsetMapping_specular.asm
===================================================================
--- code/trunk/Tutorial/Media/materials/programs/OffsetMapping_specular.asm	(revision 44)
+++ code/trunk/Tutorial/Media/materials/programs/OffsetMapping_specular.asm	(revision 44)
@@ -0,0 +1,44 @@
+// Pixel Shader for doing bump mapping with parallax plus diffuse and specular lighting by nfz 
+
+// uv               TEXCOORD0 
+// lightDir            TEXCOORD1 
+// eyeDir            TEXCOORD2 
+// half               TEXCOORD3 
+
+// lightDiffuse         c0 
+// lightSpecular      c1 
+// Parallax scale and bias c2 
+// normal/height map   texunit 0 - height map in alpha channel 
+// diffuse texture      texunit 1 
+
+ps.1.4 
+
+
+texld r0, t0               // get height 
+texcrd r2.xyz, t0            // get uv coordinates 
+texcrd r3.xyz, t2            // get eyedir vector 
+
+
+mad r0.xyz, r0.a, c2.x, c2.y   // displacement = height * scale + bias 
+mad r2.xyz, r3, r0, r2         // newtexcoord = eyedir * displacement + uv 
+
+phase 
+
+texld r0, r2.xyz            // get normal N using newtexcoord 
+texld r1, r2.xyz            // get diffuse texture using newtexcoord 
+texcrd r4.xyz, t1            // get lightdir vector 
+texcrd r5.xyz, t3            // get half angle vector 
+
+dp3_sat r5.rgb, r0_bx2, r5         // N dot H - spec calc 
+dp3_sat r4.rgb, r0_bx2, r4         // N dot L - diffuse calc 
++ mul r5.a, r5.r, r5.r 
+mul r0.rgb, r4, r1            // colour = diffusetex * N dot L 
++ mul r5.a, r5.a, r5.a 
+
+mul r5.rgb, r5.a, r5.a          
+mul r5.rgb, r5, r5          
+mul r5.rgb, r5, r5          
+mul r5.rgb, r5, c1            // specular = (N dot H)^32 * specularlight 
+
+mad r0.rgb, r0, c0, r5         // colour = diffusetex * (N dot L)* diffuselight + specular 
++ mov r0.a, c2.b 
Index: code/trunk/Tutorial/Media/materials/programs/OldMovieFP.cg
===================================================================
--- code/trunk/Tutorial/Media/materials/programs/OldMovieFP.cg	(revision 44)
+++ code/trunk/Tutorial/Media/materials/programs/OldMovieFP.cg	(revision 44)
@@ -0,0 +1,54 @@
+sampler RT : register(s0);
+sampler SplotchesTx : register(s1);
+sampler Texture2 : register(s2);
+sampler SepiaTx : register(s3);
+
+float2 calcSpriteAddr(float2 texCoord, float DirtFrequency, float period)
+{
+   return texCoord + tex1D(Texture2, period  * DirtFrequency);
+}
+
+float4 getSplotches(float2 spriteAddr)
+{
+   // get sprite address into paged texture coords space
+   spriteAddr = spriteAddr / 6.3f;
+   //spriteAddr = spriteAddr - frac(spriteAddr);
+   spriteAddr = spriteAddr - (spriteAddr /33.3f);
+
+   return tex2D(SplotchesTx, spriteAddr);
+}
+
+float4 OldMovie_ps (float2 texCoord  : TEXCOORD0,
+				uniform float time_cycle_period,
+				uniform float flicker,
+				uniform float DirtFrequency,
+				uniform float3 luminance,
+				uniform float frameJitter,
+				uniform float lumiShift
+				) : COLOR
+{
+
+   // get sprite address
+   float2 spriteAddr = calcSpriteAddr(texCoord, DirtFrequency, time_cycle_period);
+
+    // add some dark and light splotches to the film
+   float4 splotches = getSplotches(spriteAddr);
+   float4 specs = 1.0f - getSplotches(spriteAddr / 3.0f);
+
+   // convert color to base luminance
+   float4 base = tex2D(RT, texCoord + float2(0, spriteAddr.y * frameJitter));
+   float lumi = dot(base.rgb, luminance);
+   // randomly shift luminance
+   lumi -= spriteAddr.x * lumiShift;
+   // tone map luminance
+   base.rgb = tex1D(SepiaTx, lumi );
+
+   // calc flicker speed
+   float darken = frac(flicker * time_cycle_period);
+
+   // we want darken to cycle between 0.6 and 1.0
+   darken = abs(darken - 0.5f) * 0.4f + 0.6f;
+   // composite dirt onto film
+   return base * splotches * darken + specs;
+}
+
Index: code/trunk/Tutorial/Media/materials/programs/OldTV.cg
===================================================================
--- code/trunk/Tutorial/Media/materials/programs/OldTV.cg	(revision 44)
+++ code/trunk/Tutorial/Media/materials/programs/OldTV.cg	(revision 44)
@@ -0,0 +1,42 @@
+
+
+sampler Image: register(s0);
+sampler Rand: register(s1);
+sampler Noise: register(s2);
+
+float4 OldTV_ps(float2 pos: TEXCOORD1, float2 img: TEXCOORD0,
+    uniform float distortionFreq: register(c3),
+    uniform float distortionScale: register(c4),
+    uniform float distortionRoll: register(c5),
+    uniform float interference: register(c7),
+    uniform float frameLimit: register(c8),
+    uniform float frameShape: register(c0),
+    uniform float frameSharpness: register(c1),
+    uniform float time_0_X: register(c2),
+    uniform float sin_time_0_X: register(c6)
+
+) : COLOR {
+   // Define a frame shape
+   float f = (1 - pos.x * pos.x) * (1 - pos.y * pos.y);
+   float frame = saturate(frameSharpness * (pow(f, frameShape) - frameLimit));
+
+   // Interference ... just a texture filled with rand()
+   float rand = tex3D(Rand, float3(1.5 * pos, time_0_X)) - 0.2;
+
+   // Some signed noise for the distortion effect
+   float noisy = tex3D(Noise, float3(0, 0.5 * pos.y, 0.1 * time_0_X)) - 0.5;
+
+   // Repeat a 1 - x^2 (0 < x < 1) curve and roll it with sinus.
+   float dst = frac(pos.y * distortionFreq + distortionRoll * sin_time_0_X);
+   dst *= (1 - dst);
+   // Make sure distortion is highest in the center of the image
+   dst /= 1 + distortionScale * abs(pos.y);
+
+   // ... and finally distort
+   img.x += distortionScale * noisy * dst;
+   float4 image = tex2D(Image, img);
+
+   // Combine frame, distorted image and interference
+   return frame * (interference * rand + image);
+}
+
Index: code/trunk/Tutorial/Media/materials/programs/PosterizeFP.cg
===================================================================
--- code/trunk/Tutorial/Media/materials/programs/PosterizeFP.cg	(revision 44)
+++ code/trunk/Tutorial/Media/materials/programs/PosterizeFP.cg	(revision 44)
@@ -0,0 +1,17 @@
+sampler RT : register(s0);
+
+float4 Posterize_ps (float2 iTexCoord : TEXCOORD0) : COLOR
+{
+
+	float nColors = 8;
+	float gamma = 0.6;
+
+	float4 texCol = tex2D(RT, iTexCoord);
+	float3 tc = texCol.xyz;
+	tc = pow(tc, gamma);
+	tc = tc * nColors;
+	tc = floor(tc);
+	tc = tc / nColors;
+	tc = pow(tc,1.0/gamma);
+	return float4(tc,texCol.w);
+}
Index: code/trunk/Tutorial/Media/materials/programs/SharpenEdgesFP.cg
===================================================================
--- code/trunk/Tutorial/Media/materials/programs/SharpenEdgesFP.cg	(revision 44)
+++ code/trunk/Tutorial/Media/materials/programs/SharpenEdgesFP.cg	(revision 44)
@@ -0,0 +1,23 @@
+sampler RT: register(s0);
+
+float4 sharpenEdges_fp(float2 iTexCoord: TEXCOORD0, uniform float2 vTexelSize) : COLOR
+{
+
+	float2 usedTexelED[8] = {
+		-1, -1,
+		 0, -1,
+		 1, -1,
+		-1,  0,
+		 1,  0,
+		-1,  1,
+		 0,  1,
+	     1,  1,
+	};
+
+	float4 cAvgColor= 9 * tex2D (RT, iTexCoord);
+
+	for(int t=0; t<8; t++)
+		cAvgColor -= tex2D(RT, iTexCoord + vTexelSize * usedTexelED[t]);
+
+	return cAvgColor;
+}
Index: code/trunk/Tutorial/Media/materials/programs/StdQuad_vp.cg
===================================================================
--- code/trunk/Tutorial/Media/materials/programs/StdQuad_vp.cg	(revision 44)
+++ code/trunk/Tutorial/Media/materials/programs/StdQuad_vp.cg	(revision 44)
@@ -0,0 +1,113 @@
+void StdQuad_vp
+(
+    in float4 inPos : POSITION,
+
+    out float4 pos : POSITION,
+    out float2 uv0 : TEXCOORD0,
+
+    uniform float4x4 worldViewProj
+)
+{
+    // Use standardise transform, so work accord with render system specific (RS depth, requires texture flipping, etc)
+    pos = mul(worldViewProj, inPos);
+
+    // The input positions adjusted by texel offsets, so clean up inaccuracies
+    inPos.xy = sign(inPos.xy);
+
+    // Convert to image-space
+    uv0 = (float2(inPos.x, -inPos.y) + 1.0f) * 0.5f;
+}
+
+void StdQuad_Tex2_vp
+(
+    in float4 inPos : POSITION,
+
+    out float4 pos : POSITION,
+    out float2 uv0 : TEXCOORD0,
+    out float2 uv1 : TEXCOORD1,
+
+    uniform float4x4 worldViewProj
+)
+{
+    // Use standardise transform, so work accord with render system specific (RS depth, requires texture flipping, etc)
+    pos = mul(worldViewProj, inPos);
+
+    // The input positions adjusted by texel offsets, so clean up inaccuracies
+    inPos.xy = sign(inPos.xy);
+
+    // Convert to image-space
+    uv0 = (float2(inPos.x, -inPos.y) + 1.0f) * 0.5f;
+    uv1 = uv0;
+}
+
+void StdQuad_Tex2a_vp
+(
+    in float4 inPos : POSITION,
+
+    out float4 pos : POSITION,
+    out float2 uv0 : TEXCOORD0,
+    out float2 uv1 : TEXCOORD1,
+
+    uniform float4x4 worldViewProj
+)
+{
+    // Use standardise transform, so work accord with render system specific (RS depth, requires texture flipping, etc)
+    pos = mul(worldViewProj, inPos);
+
+    // The input positions adjusted by texel offsets, so clean up inaccuracies
+    inPos.xy = sign(inPos.xy);
+
+    // Convert to image-space
+    uv0 = (float2(inPos.x, -inPos.y) + 1.0f) * 0.5f;
+    uv1 = inPos.xy;
+}
+
+void StdQuad_Tex3_vp
+(
+    in float4 inPos : POSITION,
+
+    out float4 pos : POSITION,
+    out float2 uv0 : TEXCOORD0,
+    out float2 uv1 : TEXCOORD1,
+    out float2 uv2 : TEXCOORD2,
+
+    uniform float4x4 worldViewProj
+)
+{
+    // Use standardise transform, so work accord with render system specific (RS depth, requires texture flipping, etc)
+    pos = mul(worldViewProj, inPos);
+
+    // The input positions adjusted by texel offsets, so clean up inaccuracies
+    inPos.xy = sign(inPos.xy);
+
+    // Convert to image-space
+    uv0 = (float2(inPos.x, -inPos.y) + 1.0f) * 0.5f;
+    uv1 = uv0;
+    uv2 = uv0;
+}
+
+void StdQuad_Tex4_vp
+(
+    in float4 inPos : POSITION,
+
+    out float4 pos : POSITION,
+    out float2 uv0 : TEXCOORD0,
+    out float2 uv1 : TEXCOORD1,
+    out float2 uv2 : TEXCOORD2,
+    out float2 uv3 : TEXCOORD3,
+
+    uniform float4x4 worldViewProj
+)
+{
+    // Use standardise transform, so work accord with render system specific (RS depth, requires texture flipping, etc)
+    pos = mul(worldViewProj, inPos);
+
+    // The input positions adjusted by texel offsets, so clean up inaccuracies
+    inPos.xy = sign(inPos.xy);
+
+    // Convert to image-space
+    uv0 = (float2(inPos.x, -inPos.y) + 1.0f) * 0.5f;
+    uv1 = uv0;
+    uv2 = uv0;
+    uv3 = uv0;
+}
Index: code/trunk/Tutorial/Media/materials/programs/StdQuad_vp.glsl
===================================================================
--- code/trunk/Tutorial/Media/materials/programs/StdQuad_vp.glsl	(revision 44)
+++ code/trunk/Tutorial/Media/materials/programs/StdQuad_vp.glsl	(revision 44)
@@ -0,0 +1,11 @@
+varying vec2 uv;
+
+void main()                    
+{
+	gl_Position = ftransform();
+	
+	vec2 inPos = sign(gl_Vertex.xy);
+	
+	uv = (vec2(inPos.x, -inPos.y) + 1.0)/2.0;
+}
+
Index: code/trunk/Tutorial/Media/materials/programs/TilingFP.cg
===================================================================
--- code/trunk/Tutorial/Media/materials/programs/TilingFP.cg	(revision 44)
+++ code/trunk/Tutorial/Media/materials/programs/TilingFP.cg	(revision 44)
@@ -0,0 +1,33 @@
+sampler RT : register(s0);
+
+float4 Tiling_ps(float4 inPos : POSITION,
+				float2 iTexCoord : TEXCOORD0,
+				uniform half NumTiles,
+				uniform half Threshhold) : COLOR
+{
+
+
+	half3 EdgeColor = {0.7, 0.7, 0.7};
+
+    half size = 1.0/NumTiles;
+    half2 Pbase = iTexCoord - fmod(iTexCoord, size.xx);
+    half2 PCenter = Pbase + (size/2.0).xx;
+    half2 st = (iTexCoord - Pbase)/size;
+    half4 c1 = (half4)0;
+    half4 c2 = (half4)0;
+    half4 invOff = half4((1-EdgeColor),1);
+    if (st.x > st.y) { c1 = invOff; }
+    half threshholdB =  1.0 - Threshhold;
+    if (st.x > threshholdB) { c2 = c1; }
+    if (st.y > threshholdB) { c2 = c1; }
+    half4 cBottom = c2;
+    c1 = (half4)0;
+    c2 = (half4)0;
+    if (st.x > st.y) { c1 = invOff; }
+    if (st.x < Threshhold) { c2 = c1; }
+    if (st.y < Threshhold) { c2 = c1; }
+    half4 cTop = c2;
+    half4 tileColor = tex2D(RT, PCenter);
+    half4 result = tileColor + cTop - cBottom;
+    return result;
+}
Index: code/trunk/Tutorial/Media/materials/programs/crowdVp.glsl
===================================================================
--- code/trunk/Tutorial/Media/materials/programs/crowdVp.glsl	(revision 44)
+++ code/trunk/Tutorial/Media/materials/programs/crowdVp.glsl	(revision 44)
@@ -0,0 +1,62 @@
+uniform mat4 viewProjectionMatrix;
+uniform float numBones;
+uniform vec4 worldMatrix3x4Array[240];
+uniform vec4 lightDiffuseColour;
+uniform vec4 ambient;
+uniform vec4 lightPos;
+
+attribute vec4 blendIndices;
+attribute vec4 blendWeights;
+
+
+void main()
+{
+	vec3 blendPos = vec3(0,0,0);
+	vec3 blendNorm = vec3(0,0,0);
+	
+	vec3 tmpPos = vec3(0,0,0);
+	vec3 tmpNorm = vec3(0,0,0);
+
+
+	int instanceOffset = int(gl_MultiTexCoord1.x) * 3 * int(numBones);
+	for (int bone = 0; bone < 2; ++bone)
+	{
+		// perform matrix multiplication manually since no 3x4 matrices
+		for (int row = 0; row < 3; ++row)
+		{
+		    int idx = instanceOffset + int(blendIndices[bone]) * 3 + row;
+			vec4 blendMatrixRow = worldMatrix3x4Array[idx];
+			tmpPos[row] = dot(blendMatrixRow, gl_Vertex);
+#if SHADOW_CASTER
+#else
+			tmpNorm[row] = dot(blendMatrixRow.xyz, gl_Normal);
+#endif
+			
+		}
+		// now weight this into final 
+		blendPos += tmpPos * blendWeights[bone];
+#if SHADOW_CASTER
+#else
+		blendNorm += tmpNorm * blendWeights[bone];
+#endif
+	}
+
+	// apply view / projection to position
+	gl_Position = viewProjectionMatrix * vec4(blendPos, 1);
+
+	
+#if SHADOW_CASTER
+	gl_FrontColor = ambient;
+#else
+	// simple lighting model
+	vec3 lightDir = normalize(
+		lightPos.xyz -  (blendPos.xyz * lightPos.w));
+	gl_FrontColor = ambient 
+		+ clamp(dot(lightDir, blendNorm), 0.0, 1.0) * lightDiffuseColour;
+#endif
+    gl_FrontSecondaryColor = vec4(0);
+	gl_TexCoord[0] = gl_MultiTexCoord0;
+
+	
+}
+
Index: code/trunk/Tutorial/Media/materials/programs/hdr.cg
===================================================================
--- code/trunk/Tutorial/Media/materials/programs/hdr.cg	(revision 44)
+++ code/trunk/Tutorial/Media/materials/programs/hdr.cg	(revision 44)
@@ -0,0 +1,25 @@
+void morningskybox_fp (
+	float2 uv : TEXCOORD0,
+	out float4 colour : COLOR,
+
+	uniform sampler2D tex : register(s0) )
+{
+	colour = tex2D(tex, uv);
+
+	// blow out the light a bit
+	colour *= 1.7;
+}
+void morningcubemap_fp (
+	float3 uv : TEXCOORD0,
+	out float4 colour : COLOR,
+
+	uniform samplerCUBE tex : register(s0) )
+{
+	colour = texCUBE(tex, uv);
+
+	// blow out the light a bit
+	colour *= 1.7;
+}
+
+
+
Index: code/trunk/Tutorial/Media/materials/programs/hdr.hlsl
===================================================================
--- code/trunk/Tutorial/Media/materials/programs/hdr.hlsl	(revision 44)
+++ code/trunk/Tutorial/Media/materials/programs/hdr.hlsl	(revision 44)
@@ -0,0 +1,228 @@
+// RGBE mode utilities
+// RGB each carry a mantissa, A carries a shared exponent
+// The exponent is calculated based on the largest colour channel
+
+
+float3 decodeRGBE8(in float4 rgbe)
+{
+    // get exponent (-128 since it can be +ve or -ve)
+	float exp = rgbe.a * 255 - 128;
+	
+	// expand out the rgb value
+	return rgbe.rgb * exp2(exp);
+}
+
+float4 encodeRGBE8(in float3 rgb)
+{
+	float4 ret;
+
+    // What is the largest colour channel?
+	float highVal = max(rgb.r, max(rgb.g, rgb.b));
+	
+	// Take the logarithm, clamp it to a whole value
+	float exp = ceil(log2(highVal));
+
+    // Divide the components by the shared exponent
+	ret.rgb = rgb / exp2(exp);
+	
+	// Store the shared exponent in the alpha channel
+	ret.a = (exp + 128) / 255;
+
+	return ret;
+}
+
+
+static const float4 LUMINENCE_FACTOR  = float4(0.27f, 0.67f, 0.06f, 0.0f);
+static const float MIDDLE_GREY = 0.72f;
+static const float FUDGE = 0.001f;
+static const float L_WHITE = 1.5f;
+static const float4 BRIGHT_LIMITER = float4(0.6f, 0.6f, 0.6f, 0.0f);
+
+
+/** Tone mapping function 
+@note Only affects rgb, not a
+@param inColour The HDR colour
+@param lum The scene lumninence 
+@returns Tone mapped colour
+*/
+float4 toneMap(float4 inColour, float lum)
+{
+	// From Reinhard et al
+	// "Photographic Tone Reproduction for Digital Images"
+	
+	// Initial luminence scaling (equation 2)
+    inColour.rgb *= MIDDLE_GREY / (FUDGE + lum);
+
+	// Control white out (equation 4 nom)
+    inColour.rgb *= (1.0f + inColour / L_WHITE);
+
+	// Final mapping (equation 4 denom)
+	inColour.rgb /= (1.0f + inColour);
+	
+	return inColour;
+
+}
+
+/* Downsample a 2x2 area and convert to greyscale
+*/
+float4 downscale2x2Luminence(
+	float2 uv : TEXCOORD0,
+	uniform float2 texelSize, // depends on size of source texture
+	uniform sampler2D inRTT : register(s0)
+    ) : COLOR
+{
+	
+    float4 accum = float4(0.0f, 0.0f, 0.0f, 0.0f);
+
+	float2 texOffset[4] = {
+		-0.5, -0.5,
+		-0.5,  0.5, 
+		 0.5, -0.5,
+		 0.5, 0.5 };
+
+	for( int i = 0; i < 4; i++ )
+    {
+        // Get colour from source
+        accum += tex2D(inRTT, uv + texelSize * texOffset[i]);
+    }
+    
+	// Adjust the accumulated amount by lum factor
+	// Cannot use float3's here because it generates dependent texture errors because of swizzle
+	float lum = dot(accum, LUMINENCE_FACTOR);
+	// take average of 4 samples
+	lum *= 0.25;
+	return lum;
+
+}
+
+/* Downsample a 3x3 area 
+ * This shader is used multiple times on different source sizes, so texel size has to be configurable
+*/
+float4 downscale3x3(
+	float2 uv : TEXCOORD0,
+	uniform float2 texelSize, // depends on size of source texture
+	uniform sampler2D inRTT : register(s0)
+    ) : COLOR
+{
+	
+    float4 accum = float4(0.0f, 0.0f, 0.0f, 0.0f);
+
+	float2 texOffset[9] = {
+		-1.0, -1.0,
+		 0.0, -1.0,
+		 1.0, -1.0,
+		-1.0,  0.0,
+		 0.0,  0.0,
+		 1.0,  0.0,
+		-1.0,  1.0,
+		 0.0,  1.0,
+		 1.0,  1.0
+	};
+
+	for( int i = 0; i < 9; i++ )
+    {
+        // Get colour from source
+        accum += tex2D(inRTT, uv + texelSize * texOffset[i]);
+    }
+    
+	// take average of 9 samples
+	accum *= 0.1111111111111111;
+	return accum;
+
+}
+
+/* Downsample a 3x3 area from main RTT and perform a brightness pass
+*/
+float4 downscale3x3brightpass(
+	float2 uv : TEXCOORD0,
+	uniform float2 texelSize, // depends on size of source texture
+	uniform sampler2D inRTT : register(s0),
+	uniform sampler2D inLum : register(s1)
+    ) : COLOR
+{
+	
+    float4 accum = float4(0.0f, 0.0f, 0.0f, 0.0f);
+
+	float2 texOffset[9] = {
+		-1.0, -1.0,
+		 0.0, -1.0,
+		 1.0, -1.0,
+		-1.0,  0.0,
+		 0.0,  0.0,
+		 1.0,  0.0,
+		-1.0,  1.0,
+		 0.0,  1.0,
+		 1.0,  1.0
+	};
+
+	for( int i = 0; i < 9; i++ )
+    {
+        // Get colour from source
+        accum += tex2D(inRTT, uv + texelSize * texOffset[i]);
+    }
+    
+	// take average of 9 samples
+	accum *= 0.1111111111111111;
+
+    // Reduce bright and clamp
+    accum = max(float4(0.0f, 0.0f, 0.0f, 1.0f), accum - BRIGHT_LIMITER);
+
+	// Sample the luminence texture
+	float4 lum = tex2D(inLum, float2(0.5f, 0.5f));
+	
+	// Tone map result
+	return toneMap(accum, lum.r);
+
+}
+
+/* Gaussian bloom, requires offsets and weights to be provided externally
+*/
+float4 bloom(
+		float2 uv : TEXCOORD0,
+		uniform float2 sampleOffsets[15],
+		uniform float4 sampleWeights[15],	
+		uniform sampler2D inRTT : register(s0)
+		) : COLOR
+{
+    float4 accum = float4(0.0f, 0.0f, 0.0f, 1.0f);
+	float2 sampleUV;
+    
+    for( int i = 0; i < 15; i++ )
+    {
+        // Sample from adjacent points, 7 each side and central
+        sampleUV = uv + sampleOffsets[i];
+        accum += sampleWeights[i] * tex2D(inRTT, sampleUV);
+    }
+    
+    return accum;
+	
+}
+		
+
+/* Final scene composition, with tone mapping
+*/
+float4 finalToneMapping(
+	float2 uv : TEXCOORD0,
+	uniform sampler2D inRTT : register(s0),
+	uniform sampler2D inBloom : register(s1),
+	uniform sampler2D inLum : register(s2)
+    ) : COLOR
+{
+	// Get main scene colour
+    float4 sceneCol = tex2D(inRTT, uv);
+
+	// Get luminence value
+	float4 lum = tex2D(inLum, float2(0.5f, 0.5f));
+
+	// tone map this
+	float4 toneMappedSceneCol = toneMap(sceneCol, lum.r);
+	
+	// Get bloom colour
+    float4 bloom = tex2D(inBloom, uv);
+
+	// Add scene & bloom
+	return float4(toneMappedSceneCol.rgb + bloom.rgb, 1.0f);
+     	
+}
+
+
Index: code/trunk/Tutorial/Media/materials/programs/hdr_bloom.glsl
===================================================================
--- code/trunk/Tutorial/Media/materials/programs/hdr_bloom.glsl	(revision 44)
+++ code/trunk/Tutorial/Media/materials/programs/hdr_bloom.glsl	(revision 44)
@@ -0,0 +1,22 @@
+uniform sampler2D inRTT;
+
+uniform vec4 sampleOffsets[15];
+uniform vec4 sampleWeights[15];
+
+varying vec2 uv;
+
+void main(void)
+{
+    vec4 accum = vec4(0.0, 0.0, 0.0, 1.0);
+	vec2 sampleUV;
+    
+    for( int i = 0; i < 15; i++ )
+    {
+        // Sample from adjacent points, 7 each side and central
+        sampleUV = uv + sampleOffsets[i].xy;
+        accum += sampleWeights[i] * texture2D(inRTT, sampleUV);
+    }
+    
+    gl_FragColor = accum;
+	
+}
Index: code/trunk/Tutorial/Media/materials/programs/hdr_downscale2x2luminence.glsl
===================================================================
--- code/trunk/Tutorial/Media/materials/programs/hdr_downscale2x2luminence.glsl	(revision 44)
+++ code/trunk/Tutorial/Media/materials/programs/hdr_downscale2x2luminence.glsl	(revision 44)
@@ -0,0 +1,24 @@
+uniform sampler2D inRTT;
+uniform vec2 texelSize;
+
+varying vec2 uv;
+
+void main(void)
+{
+	
+    vec4 accum = vec4(0.0, 0.0, 0.0, 0.0);
+	vec4 LUMINENCE_FACTOR  = vec4(0.27, 0.67, 0.06, 0.0);
+
+    // Get colour from source
+    accum += texture2D(inRTT, uv + texelSize * vec2(-0.5, -0.5));
+    accum += texture2D(inRTT, uv + texelSize * vec2(-0.5, 0.5));
+    accum += texture2D(inRTT, uv + texelSize * vec2(0.5, 0.5));
+    accum += texture2D(inRTT, uv + texelSize * vec2(0.5, -0.5));
+    
+	// Adjust the accumulated amount by lum factor
+	float lum = dot(accum, LUMINENCE_FACTOR);
+	// take average of 4 samples
+	lum *= 0.25;
+	gl_FragColor = vec4(lum, lum, lum, 1.0);
+
+}
Index: code/trunk/Tutorial/Media/materials/programs/hdr_downscale3x3.glsl
===================================================================
--- code/trunk/Tutorial/Media/materials/programs/hdr_downscale3x3.glsl	(revision 44)
+++ code/trunk/Tutorial/Media/materials/programs/hdr_downscale3x3.glsl	(revision 44)
@@ -0,0 +1,26 @@
+uniform sampler2D inRTT;
+uniform vec2 texelSize;
+
+varying vec2 uv;
+
+void main(void)
+{
+    vec4 accum = vec4(0.0, 0.0, 0.0, 0.0);
+
+    // Get colour from source
+    accum += texture2D(inRTT, uv + texelSize * vec2(-1.0, -1.0));
+    accum += texture2D(inRTT, uv + texelSize * vec2( 0.0, -1.0));
+    accum += texture2D(inRTT, uv + texelSize * vec2( 1.0, -1.0));
+    accum += texture2D(inRTT, uv + texelSize * vec2(-1.0,  0.0));
+    accum += texture2D(inRTT, uv + texelSize * vec2( 0.0,  0.0));
+    accum += texture2D(inRTT, uv + texelSize * vec2( 1.0,  0.0));
+    accum += texture2D(inRTT, uv + texelSize * vec2(-1.0,  1.0));
+    accum += texture2D(inRTT, uv + texelSize * vec2( 0.0,  1.0));
+    accum += texture2D(inRTT, uv + texelSize * vec2( 1.0,  1.0));
+    
+	// take average of 9 samples
+	accum *= 0.1111111111111111;
+
+	gl_FragColor = accum;
+
+}
Index: code/trunk/Tutorial/Media/materials/programs/hdr_downscale3x3brightpass.glsl
===================================================================
--- code/trunk/Tutorial/Media/materials/programs/hdr_downscale3x3brightpass.glsl	(revision 44)
+++ code/trunk/Tutorial/Media/materials/programs/hdr_downscale3x3brightpass.glsl	(revision 44)
@@ -0,0 +1,37 @@
+uniform sampler2D inRTT;
+uniform sampler2D inLum;
+uniform vec2 texelSize;
+
+varying vec2 uv;
+const vec4 BRIGHT_LIMITER = vec4(0.6, 0.6, 0.6, 0.0);
+
+// declare external function
+vec4 toneMap(in vec4 inColour, in float lum);
+
+void main(void)
+{
+    vec4 accum = vec4(0.0, 0.0, 0.0, 0.0);
+
+    accum += texture2D(inRTT, uv + texelSize * vec2(-1.0, -1.0));
+    accum += texture2D(inRTT, uv + texelSize * vec2( 0.0, -1.0));
+    accum += texture2D(inRTT, uv + texelSize * vec2( 1.0, -1.0));
+    accum += texture2D(inRTT, uv + texelSize * vec2(-1.0,  0.0));
+    accum += texture2D(inRTT, uv + texelSize * vec2( 0.0,  0.0));
+    accum += texture2D(inRTT, uv + texelSize * vec2( 1.0,  0.0));
+    accum += texture2D(inRTT, uv + texelSize * vec2(-1.0,  1.0));
+    accum += texture2D(inRTT, uv + texelSize * vec2( 0.0,  1.0));
+    accum += texture2D(inRTT, uv + texelSize * vec2( 1.0,  1.0));
+    
+	// take average of 9 samples
+	accum *= 0.1111111111111111;
+
+    // Reduce bright and clamp
+    accum = max(vec4(0.0, 0.0, 0.0, 1.0), accum - BRIGHT_LIMITER);
+
+	// Sample the luminence texture
+	vec4 lum = texture2D(inLum, vec2(0.5, 0.5));
+	
+	// Tone map result
+	gl_FragColor = toneMap(accum, lum.r);
+
+}
Index: code/trunk/Tutorial/Media/materials/programs/hdr_finalToneMapping.glsl
===================================================================
--- code/trunk/Tutorial/Media/materials/programs/hdr_finalToneMapping.glsl	(revision 44)
+++ code/trunk/Tutorial/Media/materials/programs/hdr_finalToneMapping.glsl	(revision 44)
@@ -0,0 +1,28 @@
+uniform sampler2D inRTT;
+uniform sampler2D inBloom;
+uniform sampler2D inLum;
+
+varying vec2 uv;
+
+// declare external function
+vec4 toneMap(in vec4 inColour, in float lum);
+
+void main(void)
+{
+	// Get main scene colour
+    vec4 sceneCol = texture2D(inRTT, uv);
+
+	// Get luminence value
+	vec4 lum = texture2D(inLum, vec2(0.5, 0.5));
+
+	// tone map this
+	vec4 toneMappedSceneCol = toneMap(sceneCol, lum.r);
+	
+	// Get bloom colour
+    vec4 bloom = texture2D(inBloom, uv);
+
+	// Add scene & bloom
+	gl_FragColor = vec4(toneMappedSceneCol.rgb + bloom.rgb, 1.0);
+    
+}
+
Index: code/trunk/Tutorial/Media/materials/programs/hdr_tonemap_util.glsl
===================================================================
--- code/trunk/Tutorial/Media/materials/programs/hdr_tonemap_util.glsl	(revision 44)
+++ code/trunk/Tutorial/Media/materials/programs/hdr_tonemap_util.glsl	(revision 44)
@@ -0,0 +1,29 @@
+const float MIDDLE_GREY = 0.72;
+const float FUDGE = 0.001;
+const float L_WHITE = 1.5;
+
+/** Tone mapping function 
+@note Only affects rgb, not a
+@param inColour The HDR colour
+@param lum The scene lumninence 
+@returns Tone mapped colour
+*/
+vec4 toneMap(in vec4 inColour, in float lum)
+{
+	// From Reinhard et al
+	// "Photographic Tone Reproduction for Digital Images"
+	
+	// Initial luminence scaling (equation 2)
+    inColour.rgb *= MIDDLE_GREY / (FUDGE + lum);
+
+	// Control white out (equation 4 nom)
+    inColour.rgb *= (1.0 + inColour.rgb / L_WHITE);
+
+	// Final mapping (equation 4 denom)
+	inColour.rgb /= (1.0 + inColour.rgb);
+	
+	return inColour;
+
+}
+
+
Index: code/trunk/Tutorial/Media/materials/programs/instancing.cg
===================================================================
--- code/trunk/Tutorial/Media/materials/programs/instancing.cg	(revision 44)
+++ code/trunk/Tutorial/Media/materials/programs/instancing.cg	(revision 44)
@@ -0,0 +1,125 @@
+
+
+void instancing_vp(uniform float3x4   worldMatrix3x4Array[80], float4 position : POSITION,
+						float3 normal : NORMAL,
+						float2 uv : TEXCOORD0,
+						float index : TEXCOORD1,
+						uniform float4x4 viewProjectionMatrix,
+						uniform float4 lightPos,
+						uniform float4 ambient,
+						uniform float4 lightDiffuseColour,
+						out float4 oPosition : POSITION,
+						out float2 oUv : TEXCOORD0,
+						out float4 Color : COLOR )
+{
+	// transform by indexed matrix
+	float4 transformedPos = float4(mul(worldMatrix3x4Array[index], position).xyz, 1.0);
+	
+	// view / projection
+	oPosition = mul(viewProjectionMatrix, transformedPos);
+	oUv = uv;
+
+	float3 norm = mul((float3x3)worldMatrix3x4Array[index], normal);
+	
+	float3 lightDir = 	normalize(
+		lightPos.xyz -  (transformedPos.xyz * lightPos.w));
+
+	Color = ambient + saturate(dot(lightDir, norm)) * lightDiffuseColour;
+	
+	
+}
+
+/*
+  Instancing shadow-caster pass
+*/
+void instancingCaster_vp(
+	float4 position : POSITION,
+	float3 normal   : NORMAL,
+	float index     : TEXCOORD1,
+
+	out float4 oPosition : POSITION,
+	out float4 colour    : COLOR,
+	// Support up to 80 bones of float3x4
+	uniform float3x4   worldMatrix3x4Array[80],
+	uniform float4x4 viewProjectionMatrix,
+	uniform float4   ambient)
+{
+	// transform by indexed matrix
+	float4 transformedPos = float4(mul(worldMatrix3x4Array[index], position).xyz, 1.0);
+
+	// view / projection
+	oPosition = mul(viewProjectionMatrix, transformedPos);
+	
+	colour = ambient;
+	
+}
+void crowd_vp(
+	float4 position : POSITION,
+	float3 normal   : NORMAL,
+	float2 uv       : TEXCOORD0,
+	float4  blendIdx : BLENDINDICES,
+	float4	blendWgt : BLENDWEIGHT,
+	float   index : TEXCOORD1,
+
+	out float4 oPosition : POSITION,
+	out float2 oUv       : TEXCOORD0,
+	out float4 colour           : COLOR,
+	// Support up to 20 bones of float3x4
+	// vs_2_0 only supports 256 params so more than this is not feasible
+	uniform float4x4 viewProjectionMatrix,
+	uniform float numBones,
+	uniform float3x4   worldMatrix3x4Array[80],
+	uniform float4 lightDiffuseColour,
+	uniform float4 ambient,
+	uniform float4 lightPos)
+{
+	// transform by indexed matrix
+	float4 blendPos = float4(0,0,0,0);
+	int i;
+	for (i = 0; i < 4; ++i)
+	{
+		blendPos += float4(mul(worldMatrix3x4Array[index*numBones+blendIdx[i]], position).xyz, 1.0) * blendWgt[i];
+	}
+	// view / projection
+	oPosition = mul(viewProjectionMatrix, blendPos);
+	oUv = uv;
+	float3 norm = float3(0,0,0);
+	for (i = 0; i < 4; ++i)
+	{
+		norm += mul((float3x3)worldMatrix3x4Array[index*numBones+blendIdx[i]], normal)* blendWgt[i];
+	}
+	float3 lightDir = 	normalize(
+		lightPos.xyz -  (blendPos.xyz * lightPos.w));
+
+	colour = ambient + saturate(dot(lightDir, norm)) * lightDiffuseColour;
+
+	
+}
+
+/*
+  Single-weight-per-vertex hardware skinning, shadow-caster pass
+*/
+void crowdCaster_vp(
+	float4 position : POSITION,
+	float3 normal   : NORMAL,
+	float  blendIdx : BLENDINDICES,
+	float index     : TEXCOORD1,
+
+	out float4 oPosition : POSITION,
+	out float4 colour    : COLOR,
+	// Support up to 24 bones of float3x4
+	// vs_1_1 only supports 96 params so more than this is not feasible
+	uniform float3x4   worldMatrix3x4Array[80],
+	uniform float4x4 viewProjectionMatrix,
+	uniform float numBones,
+	uniform float4   ambient)
+{
+	// transform by indexed matrix
+	float4 blendPos = float4(mul(worldMatrix3x4Array[index*numBones+blendIdx], position).xyz, 1.0);
+
+	// view / projection
+	oPosition = mul(viewProjectionMatrix, blendPos);
+	
+	colour = ambient;
+	
+}	
Index: code/trunk/Tutorial/Media/materials/programs/instancingVp.glsl
===================================================================
--- code/trunk/Tutorial/Media/materials/programs/instancingVp.glsl	(revision 44)
+++ code/trunk/Tutorial/Media/materials/programs/instancingVp.glsl	(revision 44)
@@ -0,0 +1,39 @@
+uniform vec4 worldMatrix3x4Array[240];
+uniform mat4 viewProjectionMatrix;
+uniform vec4 lightPos;
+uniform vec4 ambient;
+uniform vec4 lightDiffuseColour;
+
+void main()
+{
+
+	// transform by indexed matrix
+	// perform matrix multiplication manually since no 3x4 matrices
+	vec3 transformedPos;
+	vec3 transformedNorm;
+	int instanceOffset = int(gl_MultiTexCoord1.x) * 3;
+	for (int row = 0; row < 3; ++row)
+	{
+		vec4 matrixRow = worldMatrix3x4Array[instanceOffset + row];
+		transformedPos[row] = dot(matrixRow, gl_Vertex);
+#if SHADOW_CASTER
+#else
+		transformedNorm[row] = dot(matrixRow.xyz, gl_Normal);
+#endif
+		
+	}
+	
+	// view / projection
+	gl_Position = viewProjectionMatrix * vec4(transformedPos,1);
+	gl_TexCoord[0] = gl_MultiTexCoord0;
+    gl_FrontSecondaryColor = vec4(0);
+	
+#if SHADOW_CASTER
+	gl_FrontColor = ambient;
+#else
+	vec3 lightDir = normalize(
+		lightPos.xyz -  (transformedPos.xyz * lightPos.w));
+	gl_FrontColor = ambient + clamp(dot(lightDir, transformedNorm),0.0,1.0) * lightDiffuseColour;
+#endif
+	
+}
Index: code/trunk/Tutorial/Media/materials/programs/oceanGLSL.frag
===================================================================
--- code/trunk/Tutorial/Media/materials/programs/oceanGLSL.frag	(revision 44)
+++ code/trunk/Tutorial/Media/materials/programs/oceanGLSL.frag	(revision 44)
@@ -0,0 +1,45 @@
+// oceanGLSL.frag
+// fragment program for Ocean water simulation
+// 05 Aug 2005
+// adapted for Ogre by nfz
+// converted from HLSL to GLSL
+// original shader source from Render Monkey 1.6 Reflections Refractions.rfx
+
+// 06 Aug 2005: moved uvw calculation from fragment program into vertex program 
+
+uniform float fadeBias;
+uniform float fadeExp;
+uniform vec4 waterColor;
+uniform sampler3D Noise;
+uniform samplerCube skyBox;
+
+varying vec3 uvw;
+varying vec3 normal;
+varying vec3 vVec;
+
+void main(void)
+{
+   vec3 noisy = texture3D(Noise, uvw).xyz;
+   
+   // convert to signed noise
+   vec3 bump = 2.0 * noisy - 1.0;
+   bump.xz *= 0.15;
+   // Make sure the normal always points upwards
+   // note that Ogres y axis is vertical (RM Z axis is vertical)
+   bump.y = 0.8 * abs(bump.y) + 0.2;
+   // Offset the surface normal with the bump
+   bump = normalize(normal + bump);
+
+   // Find the reflection vector
+   vec3 normView = normalize(vVec);
+   vec3 reflVec = reflect(normView, bump);
+   // Ogre has z flipped for cubemaps
+   reflVec.z = -reflVec.z;
+   vec4 refl = textureCube(skyBox, reflVec);
+
+   // set up for fresnel calc
+   float lrp = 1.0 - dot(-normView, bump);
+   
+   // Interpolate between the water color and reflection for fresnel effect
+   gl_FragColor = mix(waterColor, refl, clamp(fadeBias + pow(lrp, fadeExp), 0.0, 1.0) );
+}
Index: code/trunk/Tutorial/Media/materials/programs/oceanGLSL.vert
===================================================================
--- code/trunk/Tutorial/Media/materials/programs/oceanGLSL.vert	(revision 44)
+++ code/trunk/Tutorial/Media/materials/programs/oceanGLSL.vert	(revision 44)
@@ -0,0 +1,32 @@
+// oceanGLSL.vert
+// vertex program for Ocean water simulation
+// 05 Aug 2005
+// adapted for Ogre by nfz
+// converted from HLSL to GLSL
+// original shader source from Render Monkey 1.6 Reflections Refractions.rfx
+
+// 06 Aug 2005: moved uvw calculation from fragment program into vertex program 
+
+uniform vec3 scale;
+uniform vec3 eyePosition;
+uniform vec2 waveSpeed;
+uniform float noiseSpeed;
+uniform float time_0_X;
+
+varying vec3 uvw;
+varying vec3 normal;
+varying vec3 vVec;
+
+void main(void)
+{
+   gl_Position = ftransform();
+   
+   //  the view vector needs to be in vertex space
+   vVec = gl_Vertex.xyz - eyePosition;
+   normal = gl_Normal;
+   // uvw is the calculated uvw coordinates based on vertex position
+   uvw = gl_Vertex.xyz * scale.xyz;
+   uvw.xz += waveSpeed * time_0_X;
+   uvw.y += uvw.z + noiseSpeed * time_0_X;
+   
+}
Index: code/trunk/Tutorial/Media/materials/programs/oceanHLSL_Cg.frag
===================================================================
--- code/trunk/Tutorial/Media/materials/programs/oceanHLSL_Cg.frag	(revision 44)
+++ code/trunk/Tutorial/Media/materials/programs/oceanHLSL_Cg.frag	(revision 44)
@@ -0,0 +1,44 @@
+// oceanHLSL_Cg.frag
+// fragment program for Ocean water simulation
+// 04 Aug 2005
+// adapted for Ogre by nfz
+// original shader source from Render Monkey 1.6 Reflections Refractions.rfx
+// can be used in both Cg and HLSL compilers
+
+// 06 Aug 2005: moved uvw calculation from fragment program into vertex program 
+
+float4 main(float3 uvw: TEXCOORD0, float3 normal: TEXCOORD1, float3 vVec: TEXCOORD2,
+	uniform float fadeBias,
+	uniform float fadeExp,
+	uniform float4 waterColor,
+	uniform sampler Noise,
+	uniform sampler skyBox
+
+) : COLOR
+{
+
+   float3 noisy = tex3D(Noise, uvw).xyz;
+
+   // convert to Signed noise 
+   float3 bump = 2 * noisy - 1;
+   bump.xz *= 0.15;
+   // Make sure the normal always points upwards
+   // note that Ogres y axis is vertical (RM Z axis is vertical)
+   bump.y = 0.8 * abs(bump.y) + 0.2;
+   // Offset the surface normal with the bump
+   bump = normalize(normal + bump);
+
+   // Find the reflection vector
+   float3 normView = normalize(vVec);
+   float3 reflVec = reflect(normView, bump);
+   // Ogre has z flipped for cubemaps
+   reflVec.z = -reflVec.z;
+   float4 refl = texCUBE(skyBox, reflVec);
+
+   // set up for fresnel calc
+   float lrp = 1 - dot(-normView, bump);
+   
+   // Interpolate between the water color and reflection for fresnel effect
+   return lerp(waterColor, refl, saturate(fadeBias + pow(lrp, fadeExp)));
+
+}
Index: code/trunk/Tutorial/Media/materials/programs/oceanHLSL_Cg.vert
===================================================================
--- code/trunk/Tutorial/Media/materials/programs/oceanHLSL_Cg.vert	(revision 44)
+++ code/trunk/Tutorial/Media/materials/programs/oceanHLSL_Cg.vert	(revision 44)
@@ -0,0 +1,41 @@
+// oceanHLSL_Cg.vert
+// vertex program for Ocean water simulation
+// 04 Aug 2005
+// adapted for Ogre by nfz
+// original shader source from Render Monkey 1.6 Reflections Refractions.rfx
+// can be used in both Cg and HLSL compilers
+
+// 06 Aug 2005: moved uvw calculation from fragment program into vertex program 
+
+struct VS_OUTPUT {
+   float4 Pos:    POSITION;
+   float3 uvw:    TEXCOORD0;
+   float3 normal: TEXCOORD1;
+   float3 vVec:   TEXCOORD2;
+};
+
+VS_OUTPUT main(float4 Pos: POSITION, float3 normal: NORMAL,
+	uniform float4x4 worldViewProj_matrix,
+	uniform float3 scale,
+	uniform float2 waveSpeed,
+	uniform float noiseSpeed,
+	uniform float time_0_X,
+	uniform float3 eyePosition
+
+)
+{
+   VS_OUTPUT Out;
+
+   Out.Pos = mul(worldViewProj_matrix, Pos);
+   
+   // uvw is the calculated uvw coordinates based on vertex position
+   Out.uvw = Pos.xyz * scale;
+   Out.uvw.xz += waveSpeed * time_0_X;
+   Out.uvw.y += Out.uvw.z + noiseSpeed * time_0_X;
+   
+   //  the view vector needs to be in vertex space
+   Out.vVec = Pos.xyz - eyePosition;
+   Out.normal = normal;
+
+   return Out;
+}
Index: code/trunk/Tutorial/Media/materials/programs/skinningTwoWeightsShadowCasterVp.glsl
===================================================================
--- code/trunk/Tutorial/Media/materials/programs/skinningTwoWeightsShadowCasterVp.glsl	(revision 44)
+++ code/trunk/Tutorial/Media/materials/programs/skinningTwoWeightsShadowCasterVp.glsl	(revision 44)
@@ -0,0 +1,40 @@
+// Example GLSL program for skinning with two bone weights per vertex
+
+attribute vec4 blendIndices;
+attribute vec4 blendWeights;
+
+// 3x4 matrix, passed as vec4's for compatibility with GL 2.0
+// GL 2.0 supports 3x4 matrices
+// Support 24 bones ie 24*3, but use 72 since our parser can pick that out for sizing
+uniform vec4 worldMatrix3x4Array[72];
+uniform mat4 viewProjectionMatrix;
+uniform vec4 ambient;
+
+void main()
+{
+	vec3 blendPos = vec3(0,0,0);
+
+	for (int bone = 0; bone < 2; ++bone)
+	{
+		// perform matrix multiplication manually since no 3x4 matrices
+        // ATI GLSL compiler can't handle indexing an array within an array so calculate the inner index first
+	    int idx = int(blendIndices[bone]) * 3;
+        // ATI GLSL compiler can't handle unrolling the loop so do it manually
+        // ATI GLSL has better performance when mat4 is used rather than using individual dot product
+        // There is a bug in ATI mat4 constructor (Cat 7.2) when indexed uniform array elements are used as vec4 parameter so manually assign
+		mat4 worldMatrix;
+		worldMatrix[0] = worldMatrix3x4Array[idx];
+		worldMatrix[1] = worldMatrix3x4Array[idx + 1];
+		worldMatrix[2] = worldMatrix3x4Array[idx + 2];
+		worldMatrix[3] = vec4(0);
+		// now weight this into final 
+		blendPos += (gl_Vertex * worldMatrix).xyz * blendWeights[bone];
+	}
+
+	// apply view / projection to position
+	gl_Position = viewProjectionMatrix * vec4(blendPos, 1);
+	
+	gl_FrontSecondaryColor = vec4(0,0,0,0);
+	gl_FrontColor = ambient;
+	gl_TexCoord[0] = gl_MultiTexCoord0;
+}
Index: code/trunk/Tutorial/Media/materials/programs/skinningTwoWeightsVp.glsl
===================================================================
--- code/trunk/Tutorial/Media/materials/programs/skinningTwoWeightsVp.glsl	(revision 44)
+++ code/trunk/Tutorial/Media/materials/programs/skinningTwoWeightsVp.glsl	(revision 44)
@@ -0,0 +1,57 @@
+// Example GLSL program for skinning with two bone weights per vertex
+
+attribute vec4 blendIndices;
+attribute vec4 blendWeights;
+
+// 3x4 matrix, passed as vec4's for compatibility with GL 2.0
+// GL 2.0 supports 3x4 matrices
+// Support 24 bones ie 24*3, but use 72 since our parser can pick that out for sizing
+uniform vec4 worldMatrix3x4Array[72];
+uniform mat4 viewProjectionMatrix;
+uniform vec4 lightPos[2];
+uniform vec4 lightDiffuseColour[2];
+
+void main()
+{
+	vec3 blendPos = vec3(0,0,0);
+	vec3 blendNorm = vec3(0,0,0);
+	
+	for (int bone = 0; bone < 2; ++bone)
+	{
+		// perform matrix multiplication manually since no 3x4 matrices
+        // ATI GLSL compiler can't handle indexing an array within an array so calculate the inner index first
+	    int idx = int(blendIndices[bone]) * 3;
+        // ATI GLSL compiler can't handle unrolling the loop so do it manually
+        // ATI GLSL has better performance when mat4 is used rather than using individual dot product
+        // There is a bug in ATI mat4 constructor (Cat 7.2) when indexed uniform array elements are used as vec4 parameter so manually assign
+		mat4 worldMatrix;
+		worldMatrix[0] = worldMatrix3x4Array[idx];
+		worldMatrix[1] = worldMatrix3x4Array[idx + 1];
+		worldMatrix[2] = worldMatrix3x4Array[idx + 2];
+		worldMatrix[3] = vec4(0);
+		// now weight this into final 
+	    float weight = blendWeights[bone];
+		blendPos += (gl_Vertex * worldMatrix).xyz * weight;
+		
+		mat3 worldRotMatrix = mat3(worldMatrix[0].xyz, worldMatrix[1].xyz, worldMatrix[2].xyz);
+		blendNorm += (gl_Normal * worldRotMatrix) * weight;
+
+	}
+
+	// apply view / projection to position
+	gl_Position = viewProjectionMatrix * vec4(blendPos, 1);
+
+	// simple vertex lighting model
+	vec3 lightDir0 = normalize(
+		lightPos[0].xyz -  (blendPos.xyz * lightPos[0].w));
+	vec3 lightDir1 = normalize(
+		lightPos[1].xyz -  (blendPos.xyz * lightPos[1].w));
+		
+	gl_FrontSecondaryColor = vec4(0);
+	gl_FrontColor = vec4(0.5, 0.5, 0.5, 1.0) 
+		+ clamp(dot(lightDir0, blendNorm), 0.0, 1.0) * lightDiffuseColour[0]
+		+ clamp(dot(lightDir1, blendNorm), 0.0, 1.0) * lightDiffuseColour[1];
+
+	gl_TexCoord[0] = gl_MultiTexCoord0;
+	
+}
Index: code/trunk/Tutorial/Media/materials/programs/varianceshadowcasterfp.cg
===================================================================
--- code/trunk/Tutorial/Media/materials/programs/varianceshadowcasterfp.cg	(revision 44)
+++ code/trunk/Tutorial/Media/materials/programs/varianceshadowcasterfp.cg	(revision 44)
@@ -0,0 +1,65 @@
+/////////////////////////////////////////////////////////////////////////////////
+//
+// shadowcasterfp.cg
+//
+// Hamilton Chong
+// (c) 2006
+//
+// This is an example fragment shader for shadow caster objects.  
+//
+/////////////////////////////////////////////////////////////////////////////////
+
+
+// Define outputs from vertex shader.
+struct VertexOut
+{
+  float4 position   : POSITION;     // can't rely on access to this
+  float4 pos  	    : TEXCOORD0;    // position of fragment (in homogeneous coordinates)
+  float4 normal     : TEXCOORD1;    // un-normalized normal in object space
+  float4 modelPos   : TEXCOORD2;    // coordinates of model in object space at this point
+};
+
+struct FragmentOut
+{
+    float4 color  : COLOR0;
+};
+
+FragmentOut main( VertexOut        In,                     // fragment to process
+                  uniform float    uDepthOffset,           // offset amount (constant in eye space)
+                  uniform float4x4 uProjection             // projection matrix
+              )
+{
+    FragmentOut Out;
+
+    // compute the "normalized device coordinates" (no viewport applied yet)
+    float4 postproj = In.pos / In.pos.w;
+
+    // get the normalized normal of the geometry seen at this point
+    float4 normal = normalize(In.normal);
+
+
+    // -- Computing Depth Bias Quantities -----------------------------
+
+    // We now compute the change in z that would signify a push in the z direction
+    // by 1 unit in eye space.  Note that eye space z is related in a nonlinear way to
+    // screen space z, so this is not just a constant.  
+    // ddepth below is how much screen space z at this point would change for that push.
+    // NOTE: computation of ddepth likely differs from OpenGL's glPolygonOffset "unit"
+    //  computation, which is allowed to be vendor specific.
+    float4 dpwdz = mul(uProjection, float4(0.0, 0.0, 1.0, 0.0));
+    float4 dpdz = (dpwdz - (postproj * dpwdz.w)) / In.pos.w;
+    float  ddepth = abs(dpdz.z);
+
+    // -- End depth bias helper section --------------------------------   
+
+    // We now compute the depth of the fragment.  This is the actual depth value plus
+    // our depth bias.  The depth bias depends on how uncertain we are about the z value
+    // plus some constant push in the z direction.  The exact coefficients to use are
+    // up to you, but at least it should be somewhat intuitive now what the tradeoffs are.
+    float depthval = postproj.z /* + (0.5 * dzlen)*/ + (uDepthOffset * ddepth);
+    depthval = (0.5 * depthval) + 0.5; // put into [0,1] range instead of [-1,1] 
+
+    
+    Out.color = float4(depthval, depthval * depthval, depthval, 0.0);
+    return Out;
+}
Index: code/trunk/Tutorial/Media/materials/programs/varianceshadowcastervp.cg
===================================================================
--- code/trunk/Tutorial/Media/materials/programs/varianceshadowcastervp.cg	(revision 44)
+++ code/trunk/Tutorial/Media/materials/programs/varianceshadowcastervp.cg	(revision 44)
@@ -0,0 +1,44 @@
+/////////////////////////////////////////////////////////////////////////////////
+//
+// shadowcastervp.cg
+//
+// Hamilton Chong
+// (c) 2006
+//
+// This is an example vertex shader for shadow caster objects.  
+//
+/////////////////////////////////////////////////////////////////////////////////
+
+
+// Define inputs from application.
+struct VertexIn
+{
+  float4 position : POSITION;       // vertex position in object space
+  float4 normal   : NORMAL;         // vertex normal in object space
+};
+
+// Define outputs from vertex shader.
+struct VertexOut
+{
+  float4 position   : POSITION;     // post projection position coordinates
+  float4 pos  	    : TEXCOORD0;    // ditto. Not all hardware allows access values bound to POSITION in fp.
+  float4 normal     : TEXCOORD1;    // normal in object space (to be interpolated)
+  float4 modelPos   : TEXCOORD2;    // position in object space (to be interpolated) 
+};
+
+VertexOut main( VertexIn         In,                   // vertex to process
+                uniform float4x4 uModelViewProjection  // model-view-projection matrix
+              )
+{
+    VertexOut Out;   // output data
+    
+    // Transform vertex position into post projective (homogenous screen) space.
+    Out.position = mul(uModelViewProjection, In.position);
+    Out.pos      = mul(uModelViewProjection, In.position);
+
+    // copy over data to interpolate using perspective correct interpolation
+    Out.normal = float4(In.normal.x, In.normal.y, In.normal.z, 0.0);
+    Out.modelPos = In.position;
+
+    return Out;
+}
Index: code/trunk/Tutorial/Media/materials/programs/varianceshadowreceiverfp.cg
===================================================================
--- code/trunk/Tutorial/Media/materials/programs/varianceshadowreceiverfp.cg	(revision 44)
+++ code/trunk/Tutorial/Media/materials/programs/varianceshadowreceiverfp.cg	(revision 44)
@@ -0,0 +1,107 @@
+/////////////////////////////////////////////////////////////////////////////////
+//
+// shadowreceiverfp.cg
+//
+// Hamilton Chong
+// (c) 2006
+//
+// This is an example fragment shader for shadow receiver objects.  
+//
+/////////////////////////////////////////////////////////////////////////////////
+
+
+sampler2D ShadowMap : TEXUNIT0;
+
+// Define outputs from vertex shader.
+struct Vertex
+{
+  float4 position       : POSITION;     // fragment position in post projective space
+  float4 shadowCoord    : TEXCOORD0;    // fragment position in shadow map coordinates
+  float  diffuse        : TEXCOORD1;    // diffuse shading value
+};
+
+struct Fragment
+{
+    float4 color  : COLOR0;
+};
+
+Fragment main(Vertex        In, 
+              uniform float uSTexWidth,
+              uniform float uSTexHeight)
+{
+    Fragment Out;
+
+    // compute the shadow coordinates for texture lookup
+    // NOTE: texture_viewproj_matrix maps z into [0,1] range, not [-1,1], so
+    //  have to make sure shadow caster stores depth values with same convention.
+    float4 scoord = In.shadowCoord / In.shadowCoord.w;
+
+
+    // -- Bilinear Filtering of Sample -------------------------------------------- 
+
+    // One could use scoord.xy to look up the shadow map for depth testing, but
+    // we'll be implementing a simple "percentage closest filtering" algorithm instead.
+    // This mimics the behavior of turning on bilinear filtering on NVIDIA hardware
+    // when also performing shadow comparisons.  This causes bilinear filtering of
+    // depth tests.  Note that this is NOT the same as bilinear filtering the depth
+    // values and then doing the depth comparison.  The two operations are not 
+    // commutative.  PCF is explicitly about filtering the test values since
+    // testing filtered z values is often meaningless.  
+
+    // Real percentage closest filtering should sample from the entire footprint
+    // on the shadow map, not just seek the closest four sample points.  Such 
+    // an improvement is for future work.
+
+    
+    // NOTE: Assuming OpenGL convention for texture lookups with integers in centers.
+    //  DX convention is to have integers mark sample corners
+    float2 tcoord;
+    tcoord.x = (scoord.x * uSTexWidth) - 0.5;
+    tcoord.y = (scoord.y * uSTexHeight) - 0.5;
+    float x0 = floor(tcoord.x);
+    float x1 = ceil(tcoord.x);
+    float fracx = frac(tcoord.x);
+    float y0 = floor(tcoord.y);
+    float y1 = ceil(tcoord.y);
+    float fracy = frac(tcoord.y);
+    
+    // sample coordinates in [0,1]^2 domain
+    float2 t00, t01, t10, t11;
+    float invWidth  = 1.0 / uSTexWidth;
+    float invHeight = 1.0 / uSTexHeight;
+    t00 = float2((x0+0.5) * invWidth, (y0+0.5) * invHeight);
+    t10 = float2((x1+0.5) * invWidth, (y0+0.5) * invHeight);
+    t01 = float2((x0+0.5) * invWidth, (y1+0.5) * invHeight);
+    t11 = float2((x1+0.5) * invWidth, (y1+0.5) * invHeight);
+    
+    // grab the samples
+    float2 z00 = tex2D(ShadowMap, t00).xy;
+    float2 z01 = tex2D(ShadowMap, t01).xy;
+    float2 z10 = tex2D(ShadowMap, t10).xy;
+    float2 z11 = tex2D(ShadowMap, t11).xy;
+
+    // bilinear filter the sample data
+    float2 d0 = ((1.0 - fracx) * z00) + (fracx * z10);
+    float2 d1 = ((1.0 - fracx) * z01) + (fracx * z11);
+    float2 datum = ((1.0 - fracy) * d0) + (fracy * d1);
+
+    // -- Variance Shadow Mapping ---------------------------------------------------
+
+    float zVariance = datum.y - (datum.x * datum.x);
+    float zDeviation = scoord.z - datum.x;
+    zDeviation = (zDeviation < 0.0) ? 0.0 : zDeviation;
+    float visibility = zVariance / (zVariance + (zDeviation * zDeviation));
+    float ztest = (scoord.z < datum.x) ? 1.0:0.0;  // filtering depth ok, because used only for small variance
+    visibility = (zVariance > 0.0) ? visibility : ztest; // if variance too small, we get garbage
+    //0.0000001
+
+    // determine that all geometry within pixel border of shadow map (and outside) is lit
+    float filterBorder = max(invWidth, invHeight);
+    visibility = (all(abs(scoord.xy-0.5)<=0.5-filterBorder)) ? visibility : 1.0;
+
+    // ------------------------------------------------------------------------------
+
+    visibility *= In.diffuse;
+    Out.color = float4(visibility, visibility, visibility, 0.0);
+    return Out;
+}
Index: code/trunk/Tutorial/Media/materials/programs/varianceshadowreceivervp.cg
===================================================================
--- code/trunk/Tutorial/Media/materials/programs/varianceshadowreceivervp.cg	(revision 44)
+++ code/trunk/Tutorial/Media/materials/programs/varianceshadowreceivervp.cg	(revision 44)
@@ -0,0 +1,47 @@
+/////////////////////////////////////////////////////////////////////////////////
+//
+// shadowreceivervp.cg
+//
+// Hamilton Chong
+// (c) 2006
+//
+// This is an example vertex shader for shadow receiver objects.  
+//
+/////////////////////////////////////////////////////////////////////////////////
+
+// Define inputs from application.
+struct VertexIn
+{
+  float4 position       : POSITION;     // vertex position in object space
+  float4 normal         : NORMAL;       // vertex normal in object space
+};
+
+// Define outputs from vertex shader.
+struct Vertex
+{
+  float4 position       : POSITION;     // vertex position in post projective space
+  float4 shadowCoord    : TEXCOORD0;    // vertex position in shadow map coordinates
+  float  diffuse        : TEXCOORD1;    // diffuse shading value
+};
+
+Vertex main(VertexIn         In,
+            uniform float4x4 uModelViewProjection,   // model-view-projection matrix
+            uniform float4   uLightPosition,         // light position in object space
+            uniform float4x4 uModel,                 // model matrix
+            uniform float4x4 uTextureViewProjection  // shadow map's view projection matrix
+            )
+{
+    Vertex Out;
+
+    // compute diffuse shading
+    float3 lightDirection = normalize(uLightPosition.xyz - In.position.xyz);
+    Out.diffuse = dot(In.normal.xyz, lightDirection);
+
+    // compute shadow map lookup coordinates
+    Out.shadowCoord = mul(uTextureViewProjection, mul(uModel, In.position));
+
+    // compute vertex's homogenous screen-space coordinates
+    Out.position = mul(uModelViewProjection, In.position);
+
+    return Out;
+}
Index: code/trunk/Tutorial/Media/materials/scripts/BlackAndWhite.material
===================================================================
--- code/trunk/Tutorial/Media/materials/scripts/BlackAndWhite.material	(revision 44)
+++ code/trunk/Tutorial/Media/materials/scripts/BlackAndWhite.material	(revision 44)
@@ -0,0 +1,34 @@
+fragment_program Ogre/Compositor/B&W_FP cg
+{
+	source GrayScale.cg
+	entry_point GrayScale_ps
+	profiles ps_2_0 arbfp1
+}
+
+material Ogre/Compositor/BlackAndWhite
+{
+	technique
+	{
+
+		pass
+		{
+			depth_check off
+
+			vertex_program_ref Ogre/Compositor/StdQuad_Cg_vp
+			{
+			}
+
+			fragment_program_ref Ogre/Compositor/B&W_FP
+			{
+			}
+
+			texture_unit
+			{
+				texture RT
+                tex_coord_set 0
+				tex_address_mode clamp
+				filtering linear linear linear
+			}
+		}
+	}
+}
Index: code/trunk/Tutorial/Media/materials/scripts/Bloom.material
===================================================================
--- code/trunk/Tutorial/Media/materials/scripts/Bloom.material	(revision 44)
+++ code/trunk/Tutorial/Media/materials/scripts/Bloom.material	(revision 44)
@@ -0,0 +1,178 @@
+//DirectX 9.0 HLSL Vertex Shader vs_1_1
+vertex_program Blur0_vs11 hlsl
+{
+	source Blur0_vs11.hlsl
+	target vs_1_1
+	entry_point main
+}
+
+//DirectX 9.0 HLSL Pixel Shader ps_2_0
+fragment_program Blur0_ps20 hlsl
+{
+	source Blur0_ps20.hlsl
+	target ps_2_0
+	entry_point main
+}
+
+//DirectX 9.0 HLSL Vertex Shader vs_1_1
+vertex_program Blur1_vs11 hlsl
+{
+	source Blur1_vs11.hlsl
+	target vs_1_1
+	entry_point main
+}
+
+//DirectX 9.0 HLSL Pixel Shader ps_2_0
+fragment_program Blur1_ps20 hlsl
+{
+	source Blur1_ps20.hlsl
+	target ps_2_0
+	entry_point main
+}
+
+vertex_program Blur0_vs_glsl glsl
+{
+	source Blur0_vs.glsl
+}
+vertex_program Blur1_vs_glsl glsl
+{
+	source Blur1_vs.glsl
+}
+fragment_program Blur_ps_glsl glsl
+{
+	source Blur_ps.glsl
+	default_params
+	{
+		param_named tex0 int 0
+	}
+}
+
+//Effect: Bloom
+material Ogre/Compositor/Blur0
+{
+	technique
+	{
+		//Rendering Pass: Blur0 (pass index: #1 )
+		pass
+		{
+			//State: D3DRS_CULLMODE, Value : D3DCULL_NONE
+			cull_hardware none
+			cull_software none
+			depth_check off
+
+			fragment_program_ref Blur0_ps20
+			{
+			}
+			vertex_program_ref Blur0_vs11
+			{
+			}
+			texture_unit RT
+			{
+                tex_coord_set 0
+				tex_address_mode clamp
+				filtering linear linear linear
+			}
+		}
+	}
+	technique
+	{
+		//Rendering Pass: Blur0 (pass index: #1 )
+		pass
+		{
+			cull_hardware none
+			cull_software none
+			depth_check off
+
+			fragment_program_ref Blur_ps_glsl
+			{
+			}
+			vertex_program_ref Blur0_vs_glsl
+			{
+			}
+			texture_unit RT
+			{
+                tex_coord_set 0
+				tex_address_mode clamp
+				filtering linear linear linear
+			}
+		}
+	}
+}
+
+material Ogre/Compositor/Blur1
+{
+	technique
+	{
+
+		//Rendering Pass: Blur1 (pass index: #2 )
+		pass
+		{
+			cull_hardware none
+			cull_software none
+			depth_check off
+
+			fragment_program_ref Blur1_ps20
+			{
+			}
+			vertex_program_ref Blur1_vs11
+			{
+			}
+			texture_unit
+			{
+                tex_coord_set 0
+				tex_address_mode clamp
+				filtering linear linear linear
+			}
+		}
+	}
+	technique
+	{
+
+		//Rendering Pass: Blur1 (pass index: #2 )
+		pass
+		{
+			cull_hardware none
+			cull_software none
+			depth_func always_pass
+
+			fragment_program_ref Blur_ps_glsl
+			{
+			}
+			vertex_program_ref Blur1_vs_glsl
+			{
+			}
+			texture_unit
+			{
+                tex_coord_set 0
+				tex_address_mode clamp
+				filtering linear linear linear
+			}
+		}
+	}
+}
+
+/// Overlay quad
+material Ogre/Compositor/BloomBlend
+{
+    technique
+    {
+        pass
+        {
+            lighting on
+            diffuse 0.0 0.0 0.0 0.6
+            specular 0.0 0.0 0.0 0.0
+            ambient 0.0 0.0 0.0
+            emissive 1.0 1.0 1.0
+            cull_hardware none
+            depth_check off
+            scene_blend alpha_blend
+
+            texture_unit
+            {
+                tex_coord_set 0
+				tex_address_mode clamp
+				filtering linear linear linear
+            }
+        }
+    }
+}
Index: code/trunk/Tutorial/Media/materials/scripts/DOF.material
===================================================================
--- code/trunk/Tutorial/Media/materials/scripts/DOF.material	(revision 44)
+++ code/trunk/Tutorial/Media/materials/scripts/DOF.material	(revision 44)
@@ -0,0 +1,94 @@
+fragment_program DOF_Blur_ps cg
+{
+	source DOF_ps.cg
+	entry_point blur
+	profiles ps_2_0 arbfp1
+}
+
+fragment_program DOF_Blend_ps cg
+{
+	source DOF_ps.cg
+	entry_point blend
+	profiles ps_2_0 arbfp1
+}
+
+//Effect: Depth of Field
+material Ogre/Compositor/DOF_Blur0
+{
+	technique
+	{
+		//Rendering Pass: Blur0 (pass index: #1 )
+		pass
+		{
+			//State: D3DRS_CULLMODE, Value : D3DCULL_NONE
+			cull_hardware none
+			cull_software none
+			depth_check off
+
+			fragment_program_ref DOF_Blur_ps
+			{
+			    param_named sampleDistance float 0.1
+			}
+			vertex_program_ref Ogre/Compositor/StdQuad_Tex2a_vp
+			{
+			}
+			texture_unit
+			{
+			    // texture will get added at runtime
+                tex_coord_set 0
+				tex_address_mode wrap
+				filtering trilinear
+			}
+		}
+	}
+}
+
+// cheat here by copying from DOF_Blur0
+material Ogre/Compositor/DOF_Blur1 : Ogre/Compositor/DOF_Blur0
+{
+	technique
+	{
+		//Rendering Pass: Blur0 (pass index: #1 )
+		pass
+		{
+		    // use the same pixel shader as DOF_Blur0
+			fragment_program_ref
+			{
+			    // override value from copied DOF_Blur0 material
+			    param_named sampleDistance float 0.1
+			}
+		}
+	}
+}
+
+material Ogre/Compositor/DOF_Blend
+{
+    technique
+    {
+        pass
+        {
+			fragment_program_ref DOF_Blend_ps
+			{
+			    param_named focus float 0.66
+			    param_named range float 1.0
+			}
+			vertex_program_ref Ogre/Compositor/StdQuad_Tex2a_vp
+			{
+			}
+            texture_unit Blur0
+            {
+			    // texture will get added at runtime
+                tex_coord_set 0
+				tex_address_mode clamp
+				filtering trilinear
+            }
+            texture_unit Blur1
+            {
+			    // texture will get added at runtime
+                tex_coord_set 0
+				tex_address_mode clamp
+				filtering trilinear
+            }
+        }
+    }
+}
Index: code/trunk/Tutorial/Media/materials/scripts/DepthShadowmap.material
===================================================================
--- code/trunk/Tutorial/Media/materials/scripts/DepthShadowmap.material	(revision 44)
+++ code/trunk/Tutorial/Media/materials/scripts/DepthShadowmap.material	(revision 44)
@@ -0,0 +1,595 @@
+
+// ***-- Begin HLSL section --**
+
+vertex_program Ogre/DepthShadowmap/CasterVP_HLSL hlsl
+{
+    source DepthShadowmap.hlsl
+    entry_point casterVP
+    target vs_2_0
+
+	preprocessor_defines LINEAR_RANGE=0
+
+    default_params
+    {
+        param_named_auto worldViewProj worldviewproj_matrix
+		param_named_auto texelOffsets texel_offsets
+		//param_named_auto depthRange scene_depth_range
+    }
+}
+
+
+fragment_program Ogre/DepthShadowmap/CasterFP_HLSL hlsl
+{
+    source DepthShadowmap.hlsl
+    entry_point casterFP
+    target ps_2_0
+
+	preprocessor_defines LINEAR_RANGE=0
+
+    default_params
+    {
+    }
+}
+
+
+vertex_program Ogre/DepthShadowmap/ReceiverVP_HLSL hlsl
+{
+    source DepthShadowmap.hlsl
+    entry_point receiverVP
+    target vs_2_0
+
+	preprocessor_defines LINEAR_RANGE=0
+
+    default_params
+    {
+        param_named_auto world world_matrix
+        param_named_auto worldIT inverse_transpose_world_matrix
+		param_named_auto worldViewProj worldviewproj_matrix
+		param_named_auto texViewProj texture_viewproj_matrix
+		param_named_auto lightPosition light_position 0
+		param_named_auto lightColour light_diffuse_colour 0
+		//param_named_auto shadowDepthRange shadow_scene_depth_range 0
+    }
+}
+
+
+fragment_program Ogre/DepthShadowmap/ReceiverFP_HLSL hlsl
+{
+    source DepthShadowmap.hlsl
+    entry_point receiverFP
+	target ps_2_0
+
+	preprocessor_defines LINEAR_RANGE=0,FUZZY_TEST=0,PCF=0
+
+	default_params
+    {
+        param_named inverseShadowmapSize float 0.0009765625
+		param_named fixedDepthBias float 0.0005
+		param_named gradientClamp float 0.0098
+		param_named gradientScaleBias float 0
+		//param_named shadowFuzzyWidth float 1
+    }
+}
+
+fragment_program Ogre/DepthShadowmap/ReceiverFPPCF_HLSL hlsl
+{
+    source DepthShadowmap.hlsl
+    entry_point receiverFP
+	target ps_2_0
+
+	preprocessor_defines LINEAR_RANGE=0,FUZZY_TEST=0,PCF=1
+
+	default_params
+    {
+        param_named inverseShadowmapSize float 0.0009765625
+		param_named gradientClamp float 0.0098
+		param_named gradientScaleBias float 0
+		//param_named shadowFuzzyWidth float 1
+    }
+}
+vertex_program Ogre/DepthShadowmap/NormalMapReceiverVP_HLSL hlsl
+{
+    source DepthShadowmap.hlsl
+    entry_point normalMapShadowReceiverVp
+    target vs_2_0
+
+	preprocessor_defines LINEAR_RANGE=0
+
+    default_params
+    {
+        param_named_auto world world_matrix
+		param_named_auto worldViewProj worldviewproj_matrix
+		param_named_auto texViewProj texture_viewproj_matrix
+		param_named_auto lightPosition light_position_object_space 0
+		//param_named_auto shadowDepthRange shadow_scene_depth_range 0
+    }
+}
+
+fragment_program Ogre/DepthShadowmap/NormalMapReceiverFP_HLSL hlsl
+{
+    source DepthShadowmap.hlsl
+    entry_point normalMapShadowReceiverFp
+	target ps_2_0
+
+	preprocessor_defines LINEAR_RANGE=0,FUZZY_TEST=0,PCF=0
+
+	default_params
+    {
+		param_named_auto lightColour light_diffuse_colour 0
+        param_named inverseShadowmapSize float 0.0009765625
+		param_named fixedDepthBias float 0.0005
+		param_named gradientClamp float 0.0098
+		param_named gradientScaleBias float 0
+		//param_named shadowFuzzyWidth float 1
+    }
+}
+fragment_program Ogre/DepthShadowmap/NormalMapReceiverFPPCF_HLSL hlsl
+{
+    source DepthShadowmap.hlsl
+    entry_point normalMapShadowReceiverFp
+	target ps_2_0
+
+	preprocessor_defines LINEAR_RANGE=0,FUZZY_TEST=0,PCF=1
+
+	default_params
+    {
+		param_named_auto lightColour light_diffuse_colour 0
+        param_named inverseShadowmapSize float 0.0009765625
+		param_named fixedDepthBias float 0.0005
+		param_named gradientClamp float 0.0098
+		param_named gradientScaleBias float 0
+		//param_named shadowFuzzyWidth float 1
+    }
+}
+
+
+
+// **-- End HLSL Section --**
+
+// **-- Begin GLSL Section --**
+vertex_program Ogre/DepthShadowmap/CasterVP_GLSL glsl
+{
+    source DepthShadowmapCasterVp.glsl
+
+	preprocessor_defines LINEAR_RANGE=0
+
+    default_params
+    {
+        param_named_auto worldViewProj worldviewproj_matrix
+		param_named_auto texelOffsets texel_offsets
+		//param_named_auto depthRange scene_depth_range
+    }
+}
+
+
+fragment_program Ogre/DepthShadowmap/CasterFP_GLSL glsl
+{
+    source DepthShadowmapCasterFp.glsl
+
+	preprocessor_defines LINEAR_RANGE=0
+
+    default_params
+    {
+    }
+}
+
+
+vertex_program Ogre/DepthShadowmap/ReceiverVP_GLSL glsl
+{
+    source DepthShadowmapReceiverVp.glsl
+
+	preprocessor_defines LINEAR_RANGE=0
+
+    default_params
+    {
+        param_named_auto world world_matrix
+        param_named_auto worldIT inverse_transpose_world_matrix
+		param_named_auto worldViewProj worldviewproj_matrix
+		param_named_auto texViewProj texture_viewproj_matrix
+		param_named_auto lightPosition light_position 0
+		param_named_auto lightColour light_diffuse_colour 0
+		//param_named_auto shadowDepthRange shadow_scene_depth_range 0
+    }
+}
+
+
+fragment_program Ogre/DepthShadowmap/ReceiverFP_GLSL glsl
+{
+    source DepthShadowmapReceiverFp.glsl
+
+	preprocessor_defines LINEAR_RANGE=0,FUZZY_TEST=0,PCF=0
+
+	default_params
+    {
+		param_named shadowMap int 0
+        param_named inverseShadowmapSize float 0.0009765625
+		param_named fixedDepthBias float 0.0005
+		param_named gradientClamp float 0.0098
+		param_named gradientScaleBias float 0
+		//param_named shadowFuzzyWidth float 1
+    }
+}
+
+fragment_program Ogre/DepthShadowmap/ReceiverFPPCF_GLSL glsl
+{
+    source DepthShadowmapReceiverFp.glsl
+
+	preprocessor_defines LINEAR_RANGE=0,FUZZY_TEST=0,PCF=1
+
+	default_params
+    {
+        param_named inverseShadowmapSize float 0.0009765625
+		param_named gradientClamp float 0.0098
+		param_named gradientScaleBias float 0
+		//param_named shadowFuzzyWidth float 1
+    }
+}
+vertex_program Ogre/DepthShadowmap/NormalMapReceiverVP_GLSL glsl
+{
+    source DepthShadowmapNormalMapReceiverVp.glsl
+
+	preprocessor_defines LINEAR_RANGE=0
+
+    default_params
+    {
+        param_named_auto world world_matrix
+		param_named_auto worldViewProj worldviewproj_matrix
+		param_named_auto texViewProj texture_viewproj_matrix
+		param_named_auto lightPosition light_position_object_space 0
+		//param_named_auto shadowDepthRange shadow_scene_depth_range 0
+    }
+}
+
+fragment_program Ogre/DepthShadowmap/NormalMapReceiverFP_GLSL glsl
+{
+    source DepthShadowmapNormalMapReceiverFp.glsl
+
+	preprocessor_defines LINEAR_RANGE=0,FUZZY_TEST=0,PCF=0
+
+	default_params
+    {
+		param_named_auto lightColour light_diffuse_colour 0
+        param_named inverseShadowmapSize float 0.0009765625
+		param_named fixedDepthBias float 0.0005
+		param_named gradientClamp float 0.0098
+		param_named gradientScaleBias float 0
+		//param_named shadowFuzzyWidth float 1
+
+		param_named shadowMap int 0
+		param_named normalMap int 1
+    }
+}
+fragment_program Ogre/DepthShadowmap/NormalMapReceiverFPPCF_GLSL glsl
+{
+    source DepthShadowmapNormalMapReceiverFp.glsl
+
+	preprocessor_defines LINEAR_RANGE=0,FUZZY_TEST=0,PCF=1
+
+	default_params
+    {
+		param_named_auto lightColour light_diffuse_colour 0
+        param_named inverseShadowmapSize float 0.0009765625
+		param_named fixedDepthBias float 0.0005
+		param_named gradientClamp float 0.0098
+		param_named gradientScaleBias float 0
+		//param_named shadowFuzzyWidth float 1
+
+		param_named shadowMap int 0
+		param_named normalMap int 1
+    }
+}
+
+// **-- End GLSL Section --**
+
+// **-- Begin Unified Section --**
+vertex_program Ogre/DepthShadowmap/CasterVP unified
+{
+	delegate Ogre/DepthShadowmap/CasterVP_GLSL
+	delegate Ogre/DepthShadowmap/CasterVP_HLSL
+}
+fragment_program Ogre/DepthShadowmap/CasterFP unified
+{
+	delegate Ogre/DepthShadowmap/CasterFP_GLSL
+	delegate Ogre/DepthShadowmap/CasterFP_HLSL
+}
+vertex_program Ogre/DepthShadowmap/ReceiverVP unified
+{
+	delegate Ogre/DepthShadowmap/ReceiverVP_GLSL
+	delegate Ogre/DepthShadowmap/ReceiverVP_HLSL
+}
+fragment_program Ogre/DepthShadowmap/ReceiverFP unified
+{
+	delegate Ogre/DepthShadowmap/ReceiverFP_GLSL
+	delegate Ogre/DepthShadowmap/ReceiverFP_HLSL
+}
+fragment_program Ogre/DepthShadowmap/ReceiverFPPCF unified
+{
+	delegate Ogre/DepthShadowmap/ReceiverFPPCF_GLSL
+	delegate Ogre/DepthShadowmap/ReceiverFPPCF_HLSL
+}
+vertex_program Ogre/DepthShadowmap/NormalMapReceiverVP unified
+{
+	delegate Ogre/DepthShadowmap/NormalMapReceiverVP_HLSL
+	delegate Ogre/DepthShadowmap/NormalMapReceiverVP_GLSL
+}
+vertex_program Ogre/DepthShadowmap/NormalMapReceiverFP unified
+{
+	delegate Ogre/DepthShadowmap/NormalMapReceiverFP_HLSL
+	delegate Ogre/DepthShadowmap/NormalMapReceiverFP_GLSL
+}
+vertex_program Ogre/DepthShadowmap/NormalMapReceiverFPPCF unified
+{
+	delegate Ogre/DepthShadowmap/NormalMapReceiverFPPCF_HLSL
+	delegate Ogre/DepthShadowmap/NormalMapReceiverFPPCF_GLSL
+}
+
+// **-- End Unified Section --**
+
+
+
+// Generic Shadow caster material (floating point shadowmap)
+material Ogre/DepthShadowmap/Caster/Float
+{
+	technique
+    {
+        pass 
+        {
+            vertex_program_ref Ogre/DepthShadowmap/CasterVP
+            {
+            }
+            fragment_program_ref Ogre/DepthShadowmap/CasterFP
+            {
+            }
+        }
+    }
+}
+
+// Generic Shadow receiver material (floating point shadowmap)
+material Ogre/DepthShadowmap/Receiver/Float
+{
+	technique
+    {
+        pass 
+        {
+            vertex_program_ref Ogre/DepthShadowmap/ReceiverVP
+            {
+            }
+            fragment_program_ref Ogre/DepthShadowmap/ReceiverFP
+            {
+            }
+            texture_unit ShadowMap
+            {
+                tex_address_mode clamp
+                filtering none
+            }
+        }
+    }
+}
+
+
+// Specific receiver material for rockwall
+material Ogre/DepthShadowmap/Receiver/RockWall
+{
+
+	// This is the preferred technique which uses both vertex and
+	// fragment programs, supports coloured lights
+	technique
+	{
+		// Base ambient pass
+		pass
+		{
+			// base colours, not needed for rendering, but as information
+			// to lighting pass categorisation routine
+			ambient 1 1 1
+			diffuse 0 0 0 
+			specular 0 0 0 0 
+			// Really basic vertex program
+			vertex_program_ref Ogre/BasicVertexPrograms/AmbientOneTextureUnified
+			{
+			}
+			
+		}
+		// Now do the lighting pass
+		// NB we don't do decal texture here because this is repeated per light
+		pass lighting
+		{
+			// base colours, not needed for rendering, but as information
+			// to lighting pass categorisation routine
+			ambient 0 0 0 
+			
+			// do this for each light
+			iteration once_per_light
+
+		
+			scene_blend add
+
+			// Vertex program reference
+			vertex_program_ref Ogre/DepthShadowmap/ReceiverVP
+			{
+			}
+			shadow_receiver_vertex_program_ref Ogre/DepthShadowmap/ReceiverVP
+			{
+			}
+
+			// Fragment program
+			fragment_program_ref Ogre/DepthShadowmap/ReceiverFP
+			{
+			}
+			shadow_receiver_fragment_program_ref Ogre/DepthShadowmap/ReceiverFP
+			{
+			}
+
+			// shadowmap texture will be bound by code
+
+		}
+		
+		// Decal pass
+		pass
+		{
+			// base colours, not needed for rendering, but as information
+			// to lighting pass categorisation routine
+			lighting off
+			// Really basic vertex program
+			vertex_program_ref Ogre/BasicVertexPrograms/AmbientOneTextureUnified
+			{
+				param_named ambient float4 1 1 1 1
+			}
+			scene_blend dest_colour zero
+
+
+			texture_unit
+			{
+				texture rockwall.tga
+			}
+			
+		}
+	}
+
+
+}
+
+// Specific receiver material for Athene
+material Ogre/DepthShadowmap/Receiver/Athene
+{
+
+	// This is the preferred technique which uses both vertex and
+	// fragment programs, supports coloured lights
+	technique
+	{
+		// Base ambient pass
+		pass
+		{
+			// base colours, not needed for rendering, but as information
+			// to lighting pass categorisation routine
+			ambient 1 1 1
+			diffuse 0 0 0 
+			specular 0 0 0 0 
+			// Really basic vertex program
+			vertex_program_ref Ogre/BasicVertexPrograms/AmbientOneTextureUnified
+			{
+			}
+			
+		}
+		// Now do the lighting pass
+		// NB we don't do decal texture here because this is repeated per light
+		pass lighting
+		{
+			// base colours, not needed for rendering, but as information
+			// to lighting pass categorisation routine
+			ambient 0 0 0 
+			
+			// do this for each light
+			iteration once_per_light
+
+		
+			scene_blend add
+
+			// Vertex program reference
+			vertex_program_ref Ogre/DepthShadowmap/NormalMapReceiverVP
+			{
+			}
+			shadow_receiver_vertex_program_ref Ogre/DepthShadowmap/NormalMapReceiverVP
+			{
+			}
+
+			// Fragment program
+			fragment_program_ref Ogre/DepthShadowmap/NormalMapReceiverFP
+			{
+			}
+			shadow_receiver_fragment_program_ref Ogre/DepthShadowmap/NormalMapReceiverFP
+			{
+			}
+
+			// shadowmap texture will be bound by code
+
+			// Base bump map
+			texture_unit
+			{
+				texture atheneNormalMap.png
+				colour_op replace
+			}
+			// Normalisation cube map
+			texture_unit
+			{
+				cubic_texture nm.png combinedUVW
+				tex_coord_set 1
+				tex_address_mode clamp
+			}
+
+		}
+		
+		// Decal pass
+		pass
+		{
+			// base colours, not needed for rendering, but as information
+			// to lighting pass categorisation routine
+			lighting off
+			// Really basic vertex program
+			vertex_program_ref Ogre/BasicVertexPrograms/AmbientOneTextureUnified
+			{
+				param_named ambient float4 1 1 1 1
+			}
+			scene_blend dest_colour zero
+
+
+			texture_unit
+			{
+				texture egyptrockyfull.jpg 
+			}
+			
+		}
+	}
+
+
+}
+
+
+
+// Specialisation to use PCF
+material Ogre/DepthShadowmap/Receiver/Float/PCF : Ogre/DepthShadowmap/Receiver/Float
+{
+	technique
+	{
+		pass
+		{
+			// override just receiver program 
+			fragment_program_ref Ogre/DepthShadowmap/ReceiverFPPCF
+			{
+			}
+			
+		}
+	}
+}
+
+// Specialisation to use PCF
+material Ogre/DepthShadowmap/Receiver/RockWall/PCF : Ogre/DepthShadowmap/Receiver/RockWall
+{
+	technique
+	{
+		pass lighting
+		{
+			// override just receiver program 
+			shadow_receiver_fragment_program_ref Ogre/DepthShadowmap/ReceiverFPPCF
+			{
+			}
+			
+		}
+	}
+}
+// Specialisation to use PCF
+material Ogre/DepthShadowmap/Receiver/Athene/PCF : Ogre/DepthShadowmap/Receiver/Athene
+{
+	technique
+	{
+		pass lighting
+		{
+			// override just receiver program 
+			shadow_receiver_fragment_program_ref Ogre/DepthShadowmap/NormalMapReceiverFPPCF
+			{
+			}
+			
+		}
+	}
+}
+
+
Index: code/trunk/Tutorial/Media/materials/scripts/Embossed.material
===================================================================
--- code/trunk/Tutorial/Media/materials/scripts/Embossed.material	(revision 44)
+++ code/trunk/Tutorial/Media/materials/scripts/Embossed.material	(revision 44)
@@ -0,0 +1,33 @@
+fragment_program Ogre/Compositor/Embossed_FP cg
+{
+	source GrayScale.cg
+	entry_point Embossed_ps
+	profiles ps_2_0 arbfp1
+}
+
+material Ogre/Compositor/Embossed
+{
+	technique
+	{
+
+		pass
+		{
+			depth_check off
+
+			vertex_program_ref Ogre/Compositor/StdQuad_Cg_vp
+			{
+			}
+
+			fragment_program_ref Ogre/Compositor/Embossed_FP
+			{
+			}
+
+			texture_unit RT
+			{
+                tex_coord_set 0
+				tex_address_mode clamp
+				filtering linear linear linear
+			}
+		}
+	}
+}
Index: code/trunk/Tutorial/Media/materials/scripts/Example-DynTex.material
===================================================================
--- code/trunk/Tutorial/Media/materials/scripts/Example-DynTex.material	(revision 44)
+++ code/trunk/Tutorial/Media/materials/scripts/Example-DynTex.material	(revision 44)
@@ -0,0 +1,86 @@
+
+material Examples/DynaTest
+{
+	technique
+	{
+		pass
+		{
+			texture_unit
+			{
+				texture DynaTex 2d
+			}
+			depth_write off
+			scene_blend alpha_blend
+			lighting off
+		}
+	}
+}
+
+
+material Examples/DynaTest2
+{
+	technique
+	{
+		pass
+		{
+			texture_unit
+			{
+				texture DynaTex 2d
+			}
+			diffuse 0.8 0.8 0.8
+			specular 0.7 0.7 0.7 40.0
+			ambient 0.5 0.5 0.5
+		}
+	}
+}
+
+material Examples/DynaTest3
+{
+	technique
+	{
+		pass
+		{
+			texture_unit
+			{
+				texture DynaTex 2d
+			}
+			diffuse 0.2 0.8 0.8
+			specular 0.4 0.7 0.7 30.0
+			ambient 0.2 0.5 1.0
+			depth_write off
+			scene_blend alpha_blend
+		}
+	}
+}
+
+material Examples/DynaTest4
+{
+	technique
+	{
+		pass
+		{
+			texture_unit
+			{
+				texture DynaTex 2d
+			}
+			diffuse 0.8 0.8 0.8
+			specular 0.7 0.7 0.4 20.0
+			ambient 1.0 0.5 0.2
+		}
+	}
+}
+
+material Examples/VTDarkStuff
+{
+	technique
+	{
+		pass
+		{
+			diffuse 0.0 0.0 0.0
+			ambient 0.1 0.1 0.15
+			cull_hardware none
+			lighting on
+		}
+		
+	}
+}
Index: code/trunk/Tutorial/Media/materials/scripts/Example-Water.material
===================================================================
--- code/trunk/Tutorial/Media/materials/scripts/Example-Water.material	(revision 44)
+++ code/trunk/Tutorial/Media/materials/scripts/Example-Water.material	(revision 44)
@@ -0,0 +1,183 @@
+
+material Examples/Water0
+{
+	technique
+	{
+		pass
+		{
+			scene_blend colour_blend
+			depth_write off
+
+			texture_unit
+			{
+				texture Water01.jpg
+				env_map spherical
+				scroll_anim 0.01 0.01
+			}
+		}
+	}
+}
+material Examples/Water1
+{
+	technique
+	{
+		pass
+		{
+			scene_blend colour_blend
+			depth_write off
+
+			texture_unit
+			{
+				texture BeachStones.jpg
+				scale 0.25 0.25
+			}
+
+			texture_unit
+			{
+				texture Water01.jpg
+				env_map spherical
+				scroll_anim 0.01 0.01
+			}
+		}
+	}
+}
+material Examples/Water2
+{
+	technique
+	{
+		pass
+		{
+			scene_blend colour_blend
+			depth_write off
+
+			texture_unit
+			{
+				texture Water01.jpg
+				scroll_anim 0.01 0.01
+			}
+		}
+	}
+}
+material Examples/Water3
+{
+	technique
+	{
+		pass
+		{
+			scene_blend colour_blend
+			depth_write off
+
+			texture_unit
+			{
+				texture Water02.jpg
+				env_map spherical
+				scroll_anim 0.01 0.01
+				rotate_anim 0.03
+			}
+		}
+	}
+}
+material Examples/Water4
+{
+	technique
+	{
+		pass
+		{
+			cull_hardware none
+			cull_software none
+
+			texture_unit
+			{
+				texture Water02.jpg
+				env_map spherical
+				scroll_anim 0.01 0.01
+			}
+		}
+	}
+}
+material Examples/Water5
+{
+	technique
+	{
+		pass
+		{
+			cull_hardware none
+			cull_software none
+
+			texture_unit
+			{
+				texture BeachStones.jpg
+				scale 0.25 0.25
+			}
+
+			texture_unit
+			{
+				texture Water01.jpg
+				env_map spherical
+				scroll_anim 0.01 0.01
+			}
+		}
+	}
+}
+material Examples/Water6
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+
+			texture_unit
+			{
+				cubic_texture cubescene.jpg combinedUVW
+				tex_address_mode clamp
+				env_map cubic_reflection
+			}
+		}
+	}
+}
+material Examples/Water7
+{
+	technique
+	{
+		pass
+		{
+			cull_hardware none
+			cull_software none
+
+			texture_unit
+			{
+				texture BeachStones.jpg
+				scale 0.25 0.25
+			}
+
+			texture_unit
+			{
+				cubic_texture cubescene.jpg combinedUVW
+				tex_address_mode clamp
+				env_map cubic_reflection
+			}
+		}
+	}
+}
+material Examples/Water8
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			scene_blend add
+			depth_write off
+			cull_hardware none
+			cull_software none
+
+			texture_unit
+			{
+				cubic_texture cubescene.jpg combinedUVW
+				tex_address_mode clamp
+				env_map cubic_reflection
+			}
+		}
+	}
+}
Index: code/trunk/Tutorial/Media/materials/scripts/Example.material
===================================================================
--- code/trunk/Tutorial/Media/materials/scripts/Example.material	(revision 44)
+++ code/trunk/Tutorial/Media/materials/scripts/Example.material	(revision 44)
@@ -0,0 +1,1044 @@
+
+material Examples/EnvMappedRustySteel
+{
+	technique
+	{
+		pass
+		{
+
+			texture_unit
+			{
+				texture RustySteel.jpg
+			}
+
+			texture_unit
+			{
+				texture spheremap.png
+				colour_op_ex add src_texture src_current
+				colour_op_multipass_fallback one one
+				env_map spherical
+			}
+		}
+	}
+}
+material Examples/OgreLogo
+{
+	technique
+	{
+		pass
+		{
+			ambient 0.8 0.8 0.8
+
+			texture_unit
+			{
+				texture ogrelogo.png
+			}
+		}
+	}
+}
+material Examples/DarkMaterial
+{
+	technique
+	{
+		pass
+		{
+			ambient 0.1 0.1 0.1
+
+			texture_unit
+			{
+				texture BeachStones.jpg
+			}
+		}
+	}
+}
+material Examples/SpaceSkyBox
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			depth_write off
+
+			texture_unit
+			{
+				cubic_texture stevecube.jpg separateUV
+				tex_address_mode clamp
+			}
+		}
+	}
+}
+material Examples/SceneSkyBox1
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			depth_write off
+
+			texture_unit
+			{
+				cubic_texture cubemap_fr.jpg cubemap_bk.jpg cubemap_lf.jpg cubemap_rt.jpg cubemap_up.jpg cubemap_dn.jpg separateUV
+				tex_address_mode clamp
+			}
+		}
+	}
+}
+material Examples/SceneCubeMap1
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+
+			texture_unit
+			{
+				cubic_texture cubemap.jpg combinedUVW
+				tex_address_mode clamp
+				env_map cubic_reflection
+			}
+		}
+	}
+}
+material Examples/SceneSkyBox2
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			depth_write off
+
+			texture_unit
+			{
+				cubic_texture cubescene_fr.jpg cubescene_bk.jpg cubescene_lf.jpg cubescene_rt.jpg cubescene_up.jpg cubescene_dn.jpg separateUV
+				tex_address_mode clamp
+			}
+		}
+	}
+}
+material Examples/SceneCubeMap2
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+
+			texture_unit
+			{
+				cubic_texture cubescene.jpg combinedUVW
+				tex_address_mode clamp
+				env_map cubic_reflection
+			}
+		}
+	}
+}
+
+material Examples/CloudyNoonSkyBox
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			depth_write off
+
+			texture_unit
+			{
+				cubic_texture cloudy_noon.jpg separateUV
+				tex_address_mode clamp
+			}
+		}
+	}
+}
+
+material Examples/StormySkyBox
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			depth_write off
+
+			texture_unit
+			{
+				cubic_texture stormy.jpg separateUV
+				tex_address_mode clamp
+			}
+		}
+	}
+}
+
+
+fragment_program Examples/MorningSkyBoxHDRfp cg
+{
+	source hdr.cg
+	entry_point morningskybox_fp
+	profiles ps_2_0 arbfp1
+
+}
+material Examples/MorningSkyBox
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			depth_write off
+
+			texture_unit
+			{
+				cubic_texture morning.jpg separateUV
+				tex_address_mode clamp
+			}
+		}
+	}
+
+	// HDR technique (fake)
+	technique
+	{
+		scheme HDR
+
+		pass
+		{
+			lighting off
+			depth_write off
+
+			vertex_program_ref Ogre/BasicVertexPrograms/AmbientOneTexture
+			{
+				param_named_auto worldViewProj worldviewproj_matrix
+				param_named ambient float4 1 1 1 1
+			}
+			fragment_program_ref Examples/MorningSkyBoxHDRfp
+			{
+			}
+
+			texture_unit
+			{
+				cubic_texture morning.jpg separateUV
+				tex_address_mode clamp
+			}
+		}
+	}
+}
+fragment_program Examples/MorningCubeMapHDRfp cg
+{
+	source hdr.cg
+	entry_point morningcubemap_fp
+	profiles ps_2_0 arbfp1
+
+}
+material Examples/MorningCubeMap
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+
+			texture_unit
+			{
+				cubic_texture morning.jpg combinedUVW
+				tex_address_mode clamp
+				env_map cubic_reflection
+			}
+		}
+	}
+	// HDR technique (fake)
+	technique
+	{
+		scheme HDR
+
+		pass
+		{
+			lighting off
+
+			fragment_program_ref Examples/MorningCubeMapHDRfp
+			{
+			}
+			texture_unit
+			{
+				cubic_texture morning.jpg combinedUVW
+				tex_address_mode clamp
+				env_map cubic_reflection
+			}
+		}
+	}
+}
+
+
+material Examples/EveningSkyBox
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			depth_write off
+
+			texture_unit
+			{
+				cubic_texture evening.jpg separateUV
+				tex_address_mode clamp
+			}
+		}
+	}
+}
+
+material Examples/CloudySky
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			depth_write off
+
+			texture_unit
+			{
+				texture clouds.jpg
+				scroll_anim 0.15 0
+			}
+		}
+	}
+}
+material Examples/RustySteel
+{
+	technique
+	{
+		pass
+		{
+
+			texture_unit
+			{
+				texture RustySteel.jpg
+			}
+		}
+	}
+}
+material Examples/Chrome
+{
+	technique
+	{
+		pass
+		{
+
+			texture_unit
+			{
+				texture Chrome.jpg
+				env_map spherical
+			}
+		}
+	}
+}
+material Examples/SpaceSkyPlane
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			depth_write off
+			fog_override true none
+
+			texture_unit
+			{
+				texture spacesky.jpg
+			}
+		}
+	}
+}
+material Examples/TextureEffect1
+{
+	technique
+	{
+		pass
+		{
+			ambient 0.75 0.75 0.75
+			cull_hardware none
+			cull_software none
+
+			texture_unit
+			{
+				texture BumpyMetal.jpg
+				rotate_anim 0.2
+				wave_xform scale_x sine 1 0.1 0 5
+				wave_xform scale_y sine 0.5 0.2 0.5 3
+			}
+		}
+	}
+}
+material Examples/TextureEffect2
+{
+	technique
+	{
+		pass
+		{
+
+			texture_unit
+			{
+				texture Water02.jpg
+				scroll_anim 0.5 0
+			}
+		}
+	}
+}
+material Examples/TextureEffect3
+{
+	technique
+	{
+		pass
+		{
+			ambient 0.7 0.7 0.7
+			cull_hardware none
+			cull_software none
+
+			texture_unit
+			{
+				texture Water01.jpg
+				scroll_anim -0.25 0.1
+			}
+
+			texture_unit
+			{
+				texture Water01.jpg
+				colour_op_ex add src_texture src_current
+				colour_op_multipass_fallback one one
+				scroll_anim -0.1 0.25
+			}
+		}
+	}
+}
+material Examples/TextureEffect4
+{
+	technique
+	{
+		pass
+		{
+			ambient 0.3 0.3 0.3
+			scene_blend colour_blend
+			cull_hardware none
+			cull_software none
+
+			texture_unit
+			{
+				texture Water02.jpg
+				scroll_anim 0.01 0.01
+			}
+		}
+	}
+}
+material Examples/BumpyMetal
+{
+	technique
+	{
+		pass
+		{
+			ambient 0.75 0.75 0.75
+			cull_hardware none
+			cull_software none
+
+			texture_unit
+			{
+				texture BumpyMetal.jpg
+			}
+		}
+	}
+}
+material Examples/TransparentTest
+{
+	technique
+	{
+		pass
+		{
+			ambient 0.2 0.2 0.2
+			scene_blend add
+			depth_write off
+
+			texture_unit
+			{
+				texture Water01.jpg
+				scroll_anim 0.25 0
+			}
+
+			texture_unit
+			{
+				texture Water01.jpg
+				wave_xform scroll_y sine 0 0.1 0 0.5
+			}
+		}
+	}
+}
+material Examples/Flare
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			scene_blend add
+			depth_write off
+
+			texture_unit
+			{
+				texture flare.png
+			}
+		}
+	}
+}
+material Examples/Flare2
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			scene_blend add
+			depth_write off
+
+			texture_unit
+			{
+				texture flaretrail.png
+			}
+		}
+	}
+}
+material Examples/FlarePointSprite
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			scene_blend add
+			depth_write off
+
+			point_sprites on
+			point_size 2
+			point_size_attenuation on
+
+			texture_unit
+			{
+				texture flare.png
+			}
+		}
+	}
+}
+
+material Examples/Droplet
+{
+	technique
+	{
+		pass
+		{
+			scene_blend colour_blend
+			depth_write off
+
+			texture_unit
+			{
+				texture basic_droplet.png
+			}
+		}
+	}
+}
+material Examples/Hilite/Yellow
+{
+	technique
+	{
+		pass
+		{
+
+			texture_unit
+			{
+				texture dkyellow.png
+			}
+		}
+	}
+}
+material Examples/Rocky
+{
+	technique
+	{
+		pass
+		{
+			ambient 0.2 0.2 0.2
+
+			texture_unit
+			{
+				texture egyptrockyfull.jpg
+			}
+		}
+	}
+}
+material Examples/10PointBlock
+{
+	technique
+	{
+		pass
+		{
+
+			texture_unit
+			{
+				texture 10points.png
+			}
+		}
+	}
+}
+material Material__25
+{
+	technique
+	{
+		pass
+		{
+
+			texture_unit
+			{
+				texture texmap2.jpg
+			}
+		}
+	}
+}
+material 2 - Default
+{
+	technique
+	{
+		pass
+		{
+
+			texture_unit
+			{
+				texture MtlPlat2.jpg
+			}
+		}
+	}
+}
+material Material #8
+{
+	technique
+	{
+		pass
+		{
+
+			texture_unit
+			{
+				texture BODY.jpg
+			}
+		}
+	}
+}
+material Material #3
+{
+	technique
+	{
+		pass
+		{
+
+			texture_unit
+			{
+				texture HEAD4.jpg
+			}
+		}
+	}
+}
+material Material #9
+{
+	technique
+	{
+		pass
+		{
+
+			texture_unit
+			{
+				texture LEGS.jpg
+			}
+		}
+	}
+}
+
+material Examples/Fish
+{
+	technique
+	{
+		pass
+		{
+			texture_unit
+			{
+				texture steelhead.png
+			}
+		}
+	}
+}
+material Examples/Ninja
+{
+	technique
+	{
+		pass
+		{
+		
+			texture_unit
+			{
+				texture nskingr.jpg
+			}
+		}
+	}
+}
+
+material Examples/Robot
+{
+	// Hardware skinning techniique
+	technique
+	{
+		pass
+		{
+			vertex_program_ref Ogre/HardwareSkinningOneWeight
+			{
+				param_named_auto worldMatrix3x4Array world_matrix_array_3x4
+				param_named_auto viewProjectionMatrix viewproj_matrix
+				param_named_auto lightPos[0] light_position 0
+				param_named_auto lightPos[1] light_position 1
+				param_named_auto lightDiffuseColour[0] light_diffuse_colour 0
+				param_named_auto lightDiffuseColour[1] light_diffuse_colour 1
+				param_named_auto ambient ambient_light_colour
+			
+			}
+			// alternate shadow caster program
+			shadow_caster_vertex_program_ref Ogre/HardwareSkinningOneWeightShadowCaster
+			{
+				param_named_auto worldMatrix3x4Array world_matrix_array_3x4
+				param_named_auto viewProjectionMatrix viewproj_matrix
+				param_named_auto ambient ambient_light_colour
+			
+			}
+
+			texture_unit
+			{
+				texture r2skin.jpg
+			}
+		}
+	}
+
+	// Software blending technique
+	technique
+	{
+		pass
+		{
+
+			texture_unit
+			{
+				texture r2skin.jpg
+			}
+		}
+	}
+}
+
+material Examples/GrassFloor
+{
+	technique
+	{
+		pass
+		{
+			texture_unit
+			{
+				texture grass_1024.jpg
+			}
+		}
+	}
+}
+
+vertex_program Examples/GrassWaverVp cg
+{
+	source Grass.cg
+	entry_point grass_vp
+	profiles vs_1_1 arbvp1
+}
+
+material Examples/GrassBlades
+{
+	// Vertex program waving grass
+    technique
+    {
+        pass
+        {
+			vertex_program_ref Examples/GrassWaverVp
+			{
+				param_named_auto worldViewProj worldviewproj_matrix
+				param_named_auto ambient ambient_light_colour
+				param_named_auto objSpaceLight light_position_object_space 0
+				param_named_auto lightColour light_diffuse_colour 0
+				param_named_auto offset custom 999
+			}
+			alpha_rejection greater 150 
+			scene_blend alpha_blend
+		    cull_hardware none
+            cull_software none
+            texture_unit
+            {
+                texture gras_02.png 
+            }
+        }
+    }
+
+	// Non-vertex program technique (no waving)
+	technique
+    {
+        pass
+        {
+			alpha_rejection greater 150 
+			scene_blend alpha_blend
+		    cull_hardware none
+            cull_software none
+            texture_unit
+            {
+                texture gras_02.png 
+            }
+        }
+    }
+}
+
+material Examples/Rockwall
+{
+	technique
+	{
+		pass
+		{
+			texture_unit
+			{
+				texture rockwall.tga
+			}
+		}
+	}
+}
+
+material Examples/Aureola
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			scene_blend alpha_blend
+			depth_write off
+			cull_hardware none
+
+			texture_unit
+			{
+				texture aureola.png PF_BYTE_LA
+				tex_address_mode clamp
+			}
+		}
+	}
+}
+
+// Test hardware morph animation
+material Examples/HardwareMorphAnimation
+{
+	technique
+	{
+		pass
+		{
+			
+			vertex_program_ref Ogre/HardwareMorphAnimation
+			{
+				// all default
+			}
+
+			texture_unit
+			{
+				tex_coord_set 0
+				colour_op_ex source1 src_current src_current
+			}
+			// need to define these texture units otherwise GL won't use the uv sets			
+			texture_unit
+			{
+				tex_coord_set 1
+				// also need to set blending to ignore texture which is GL warning texture
+				colour_op_ex source1 src_current src_current
+			}
+			texture_unit
+			{
+				tex_coord_set 2
+				colour_op_ex source1 src_current src_current
+			}
+		
+		}
+	}
+}
+
+// Test hardware pose animation
+material Examples/HardwarePoseAnimation
+{
+	technique
+	{
+		pass
+		{
+			
+			vertex_program_ref Ogre/HardwarePoseAnimation
+			{
+				// all default
+			}
+			texture_unit
+			{
+				tex_coord_set 0
+				colour_op_ex source1 src_current src_current
+			}
+			// need to define these texture units otherwise GL won't use the uv sets			
+			texture_unit
+			{
+				tex_coord_set 1
+				// also need to set blending to ignore texture which is GL warning texture
+				colour_op_ex source1 src_current src_current
+			}
+			texture_unit
+			{
+				tex_coord_set 2
+				colour_op_ex source1 src_current src_current
+			}
+
+		
+		}
+	}
+}
+
+material RustyBarrel
+{
+	technique
+	{
+		pass
+		{
+			ambient 0.5 0.5 0.5 1.0
+			diffuse 1.0 1.0 1.0 1.0
+			specular 0.0 0.0 0.0 1.0 12.5
+			emissive 0.0 0.0 0.0 1.0
+			texture_unit
+			{
+				texture RustyBarrel.png
+				filtering trilinear
+			}
+		}
+	}
+}
+
+material WoodPallet
+{
+	receive_shadows on
+	technique
+	{
+		pass
+		{
+			ambient 0.5 0.5 0.5 1.0
+			diffuse 1.0 1.0 1.0 1.0
+			specular 0.0 0.0 0.0 1.0 12.5
+
+			texture_unit
+			{
+				texture WoodPallet.png
+				filtering trilinear
+			}
+		}
+	}
+}
+
+material Examples/LightRibbonTrail
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			scene_blend add
+			depth_write off
+
+			texture_unit
+			{
+				texture ribbonband.png 1d
+				tex_address_mode clamp
+				filtering none
+			}
+		}
+	}
+}
+
+material Examples/TudorHouse
+{
+	technique
+	{
+		pass
+		{
+			texture_unit
+			{
+				texture fw12b.jpg
+				tex_address_mode clamp
+			}
+		}
+	}
+}
+
+material jaiqua
+{
+	// Hardware skinning techniique
+	technique
+	{
+		pass
+		{
+			vertex_program_ref Ogre/HardwareSkinningTwoWeights
+			{
+			
+			}
+			// alternate shadow caster program
+			shadow_caster_vertex_program_ref Ogre/HardwareSkinningTwoWeightsShadowCaster
+			{
+				param_named_auto worldMatrix3x4Array world_matrix_array_3x4
+				param_named_auto viewProjectionMatrix viewproj_matrix
+				param_named_auto ambient ambient_light_colour
+			
+			}
+
+			texture_unit
+			{
+				texture blue_jaiqua.jpg
+				tex_address_mode clamp
+			}
+		}
+	}
+
+	// Software blending technique
+	technique
+	{
+		pass
+		{
+			texture_unit
+			{
+				texture blue_jaiqua.jpg
+				tex_address_mode clamp
+			}
+		}
+	}
+	
+}
+
+
+material Examples/Plane/IntegratedShadows
+{
+	technique
+	{
+		pass
+		{
+			// Single-pass shadowing
+			texture_unit
+			{
+				texture MtlPlat2.jpg
+			}
+			texture_unit
+			{
+				// standard modulation blend
+				content_type shadow
+				tex_address_mode clamp
+			}
+		}
+	}
+	
+}
Index: code/trunk/Tutorial/Media/materials/scripts/Examples-Advanced.material
===================================================================
--- code/trunk/Tutorial/Media/materials/scripts/Examples-Advanced.material	(revision 44)
+++ code/trunk/Tutorial/Media/materials/scripts/Examples-Advanced.material	(revision 44)
@@ -0,0 +1,1167 @@
+// -------------------------------
+// Cel Shading Section
+// -------------------------------
+vertex_program Ogre/CelShadingVP cg
+{
+	source Example_CelShading.cg
+	entry_point main_vp
+	profiles vs_1_1 arbvp1
+
+	default_params
+	{
+		param_named_auto lightPosition light_position_object_space 0
+		param_named_auto eyePosition camera_position_object_space
+		param_named_auto worldViewProj worldviewproj_matrix
+		param_named shininess float 10 
+	}
+}
+
+fragment_program Ogre/CelShadingFP cg
+{
+	source Example_CelShading.cg
+	entry_point main_fp
+	profiles ps_1_1 arbfp1 fp20
+}
+
+
+material Examples/CelShading
+{
+	technique
+	{
+		pass
+		{
+			vertex_program_ref Ogre/CelShadingVP
+			{
+				// map shininess from custom renderable param 1
+				param_named_auto shininess custom 1
+			}
+			fragment_program_ref Ogre/CelShadingFP
+			{
+				// map diffuse from custom renderable param 2
+				param_named_auto diffuse custom 2
+				// map specular from custom renderable param 2
+				param_named_auto specular custom 3
+			}
+			texture_unit
+			{
+				texture cel_shading_diffuse.png 1d
+				tex_address_mode clamp
+				filtering none
+			}
+			texture_unit
+			{
+				texture cel_shading_specular.png 1d
+				tex_address_mode clamp
+				filtering none
+				tex_coord_set 1
+			}
+			texture_unit
+			{
+				texture cel_shading_edge.png 1d
+				tex_address_mode clamp
+				filtering none
+				tex_coord_set 2
+			}
+		}
+	}
+	
+}
+
+
+
+//------------------------
+// Bump mapping section
+//------------------------
+
+// Bump map vertex program, support for this is required
+vertex_program Examples/BumpMapVP cg
+{
+	source Example_BumpMapping.cg
+	entry_point main_vp
+	profiles vs_1_1 arbvp1
+}
+
+// Bump map fragment program, support for this is optional
+fragment_program Examples/BumpMapFP cg
+{
+	source Example_BumpMapping.cg
+	entry_point main_fp
+	profiles ps_1_1 arbfp1 fp20
+}
+
+// Bump map vertex program shadow receiver
+vertex_program Examples/BumpMapVPShadowRcv cg
+{
+	source Example_BumpMapping.cg
+	entry_point main_shadowreceiver_vp
+	profiles vs_1_1 arbvp1
+}
+// Bump map fragment program shadow receiver, support for this is optional
+fragment_program Examples/BumpMapFPShadowRcv cg
+{
+	source Example_BumpMapping.cg
+	entry_point main_shadowreceiver_fp
+	profiles ps_1_1 arbfp1 fp20
+}
+
+
+// Bump map with specular vertex program, support for this is required
+vertex_program Examples/BumpMapVPSpecular cg
+{
+	source Example_BumpMapping.cg
+	entry_point specular_vp
+	profiles vs_1_1 arbvp1
+}
+
+// Bump map fragment program, support for this is optional
+fragment_program Examples/BumpMapFPSpecular cg
+{
+	source Example_BumpMapping.cg
+	entry_point specular_fp
+	profiles ps_1_1 arbfp1 fp20
+}
+
+// Single light material, less passes (one pass on a 4-unit card)
+material Examples/BumpMapping/SingleLight
+{
+	// Preferred technique, uses vertex and fragment programs
+	// to support a single coloured light
+	technique
+	{
+		pass
+		{
+			// base colours, not needed for rendering, but as information
+			// to lighting pass categorisation routine
+			ambient 0 0 0 
+			// Vertex program reference
+			vertex_program_ref Examples/BumpMapVP
+			{
+				param_named_auto lightPosition light_position_object_space 0
+				param_named_auto worldViewProj worldviewproj_matrix
+			}
+
+			// Fragment program
+			fragment_program_ref Examples/BumpMapFP
+			{
+				param_named_auto lightDiffuse light_diffuse_colour 0 
+			}
+			
+			// Base bump map
+			texture_unit
+			{
+				texture NMBumpsOut.png
+				colour_op replace
+			}
+			// Normalisation cube map
+			texture_unit
+			{
+				cubic_texture nm.png combinedUVW
+				tex_coord_set 1
+				tex_address_mode clamp
+			}
+			// Decal
+			texture_unit
+			{
+				texture RustySteel.jpg
+			}
+		}
+	}
+	// Fallback technique, uses vertex program but only fixed-function
+	// fragment shading, which does not support coloured light
+	technique
+	{
+		pass
+		{
+			// base colours, not needed for rendering, but as information
+			// to lighting pass categorisation routine
+			ambient 0 0 0 
+			// Vertex program reference
+			vertex_program_ref Examples/BumpMapVP
+			{
+				param_named_auto lightPosition light_position_object_space 0
+				param_named_auto worldViewProj worldviewproj_matrix
+			}
+
+			// Base bump map
+			texture_unit
+			{
+				texture NMBumpsOut.png
+				colour_op replace
+			}
+			// Normalisation cube map
+			texture_unit
+			{
+				cubic_texture nm.png combinedUVW
+				tex_coord_set 1
+				tex_address_mode clamp
+				colour_op_ex dotproduct src_texture src_current
+				colour_op_multipass_fallback dest_colour zero
+			}
+			// Decal
+			texture_unit
+			{
+				texture RustySteel.jpg
+			}
+		}
+	}
+}
+
+// Any number of lights, diffuse
+material Examples/BumpMapping/MultiLight
+{
+
+	// This is the preferred technique which uses both vertex and
+	// fragment programs, supports coloured lights
+	technique
+	{
+		// Base ambient pass
+		pass
+		{
+			// base colours, not needed for rendering, but as information
+			// to lighting pass categorisation routine
+			ambient 1 1 1
+			diffuse 0 0 0 
+			specular 0 0 0 0 
+			// Really basic vertex program
+			// NB we don't use fixed function here because GL does not like
+			// mixing fixed function and vertex programs, depth fighting can
+			// be an issue
+			vertex_program_ref Ogre/BasicVertexPrograms/AmbientOneTexture
+			{
+				param_named_auto worldViewProj worldviewproj_matrix
+				param_named_auto ambient ambient_light_colour
+			}
+			
+		}
+		// Now do the lighting pass
+		// NB we don't do decal texture here because this is repeated per light
+		pass
+		{
+			// base colours, not needed for rendering, but as information
+			// to lighting pass categorisation routine
+			ambient 0 0 0 
+			
+			// do this for each light
+			iteration once_per_light
+
+		
+			scene_blend add
+
+			// Vertex program reference
+			vertex_program_ref Examples/BumpMapVP
+			{
+				param_named_auto lightPosition light_position_object_space 0
+				param_named_auto worldViewProj worldviewproj_matrix
+			}
+
+			// Fragment program
+			fragment_program_ref Examples/BumpMapFP
+			{
+				param_named_auto lightDiffuse light_diffuse_colour 0 
+			}
+			
+			// Base bump map
+			texture_unit
+			{
+				texture NMBumpsOut.png
+				colour_op replace
+			}
+			// Normalisation cube map
+			texture_unit
+			{
+				cubic_texture nm.png combinedUVW
+				tex_coord_set 1
+				tex_address_mode clamp
+			}
+		}
+		
+		// Decal pass
+		pass
+		{
+			// base colours, not needed for rendering, but as information
+			// to lighting pass categorisation routine
+			lighting off
+			// Really basic vertex program
+			// NB we don't use fixed function here because GL does not like
+			// mixing fixed function and vertex programs, depth fighting can
+			// be an issue
+			vertex_program_ref Ogre/BasicVertexPrograms/AmbientOneTexture
+			{
+				param_named_auto worldViewProj worldviewproj_matrix
+				param_named ambient float4 1 1 1 1
+			}
+			scene_blend dest_colour zero
+			texture_unit
+			{
+				texture RustedMetal.jpg 
+			}
+			
+		}
+	}
+
+	// This is the fallback which cards which don't have fragment program 
+	// support will use
+	// Note that it still requires vertex program support
+	technique
+	{
+		// Base ambient pass
+		pass
+		{
+			// base colours, not needed for rendering, but as information
+			// to lighting pass categorisation routine
+			ambient 1 1 1
+			diffuse 0 0 0 
+			specular 0 0 0 0
+			// Really basic vertex program
+			// NB we don't use fixed function here because GL does not like
+			// mixing fixed function and vertex programs, depth fighting can
+			// be an issue
+			vertex_program_ref Ogre/BasicVertexPrograms/AmbientOneTexture
+			{
+				param_named_auto worldViewProj worldviewproj_matrix
+				param_named_auto ambient ambient_light_colour
+			}
+			
+		}
+		// Now do the lighting pass
+		// NB we don't do decal texture here because this is repeated per light
+		pass
+		{
+			// base colours, not needed for rendering, but as information
+			// to lighting pass categorisation routine
+			ambient 0 0 0 
+			// do this for each light
+			iteration once_per_light
+
+		
+			scene_blend add
+
+			// Vertex program reference
+			vertex_program_ref Examples/BumpMapVP
+			{
+				param_named_auto lightPosition light_position_object_space 0
+				param_named_auto worldViewProj worldviewproj_matrix
+			}
+			
+			// Base bump map
+			texture_unit
+			{
+				texture NMBumpsOut.png
+				colour_op replace
+			}
+			// Normalisation cube map, with dot product on bump map
+			texture_unit
+			{
+				cubic_texture nm.png combinedUVW
+				tex_coord_set 1
+				tex_address_mode clamp
+				colour_op_ex dotproduct src_texture src_current
+				colour_op_multipass_fallback dest_colour zero
+			}
+		}
+		
+		// Decal pass
+		pass
+		{
+			lighting off
+			// Really basic vertex program
+			// NB we don't use fixed function here because GL does not like
+			// mixing fixed function and vertex programs, depth fighting can
+			// be an issue
+			vertex_program_ref Ogre/BasicVertexPrograms/AmbientOneTexture
+			{
+				param_named_auto worldViewProj worldviewproj_matrix
+				param_named ambient float4 1 1 1 1
+			}
+			scene_blend dest_colour zero
+			texture_unit
+			{
+				texture RustedMetal.jpg 
+			}
+			
+		}
+
+	}
+}
+
+// Any number of lights, diffuse and specular
+material Examples/BumpMapping/MultiLightSpecular
+{
+
+	// This is the preferred technique which uses both vertex and
+	// fragment programs, supports coloured lights
+	technique
+	{
+		// Base ambient pass
+		pass
+		{
+			// base colours, not needed for rendering, but as information
+			// to lighting pass categorisation routine
+			ambient 1 1 1
+			diffuse 0 0 0 
+			specular 0 0 0 0
+			// Really basic vertex program
+			// NB we don't use fixed function here because GL does not like
+			// mixing fixed function and vertex programs, depth fighting can
+			// be an issue
+			vertex_program_ref Ogre/BasicVertexPrograms/AmbientOneTexture
+			{
+				param_named_auto worldViewProj worldviewproj_matrix
+				param_named_auto ambient ambient_light_colour
+			}
+			
+		}
+		// Now do the lighting pass
+		// NB we don't do decal texture here because this is repeated per light
+		pass
+		{
+			// base colours, not needed for rendering, but as information
+			// to lighting pass categorisation routine
+			ambient 0 0 0 
+			// do this for each light
+			iteration once_per_light
+
+		
+			scene_blend add
+
+			// Vertex program reference
+			vertex_program_ref Examples/BumpMapVPSpecular
+			{
+				param_named_auto lightPosition light_position_object_space 0
+				param_named_auto eyePosition camera_position_object_space
+				param_named_auto worldViewProj worldviewproj_matrix
+			}
+
+			// Fragment program
+			fragment_program_ref Examples/BumpMapFPSpecular
+			{
+				param_named_auto lightDiffuse light_diffuse_colour 0 
+				param_named_auto lightSpecular light_specular_colour 0
+			}
+			
+			// Base bump map
+			texture_unit
+			{
+				texture NMBumpsOut.png
+				colour_op replace
+			}
+			// Normalisation cube map
+			texture_unit
+			{
+				cubic_texture nm.png combinedUVW
+				tex_coord_set 1
+				tex_address_mode clamp
+			}
+			// Normalisation cube map #2
+			texture_unit
+			{
+				cubic_texture nm.png combinedUVW
+				tex_coord_set 2
+				tex_address_mode clamp
+			}
+		}
+		
+		// Decal pass
+		pass
+		{
+			lighting off
+			// Really basic vertex program
+			// NB we don't use fixed function here because GL does not like
+			// mixing fixed function and vertex programs, depth fighting can
+			// be an issue
+			vertex_program_ref Ogre/BasicVertexPrograms/AmbientOneTexture
+			{
+				param_named_auto worldViewProj worldviewproj_matrix
+				param_named ambient float4 1 1 1 1
+			}
+			scene_blend dest_colour zero
+			texture_unit
+			{
+				texture RustedMetal.jpg 
+			}
+			
+		}
+	}
+
+	// This is the fallback which cards which don't have fragment program 
+	// support will use, NB does not support specular colour
+	// Note that it still requires vertex program support
+	technique
+	{
+		// Base ambient pass
+		pass
+		{
+			// base colours, not needed for rendering, but as information
+			// to lighting pass categorisation routine
+			ambient 1 1 1
+			diffuse 0 0 0 
+			specular 0 0 0 0
+			// Really basic vertex program
+			// NB we don't use fixed function here because GL does not like
+			// mixing fixed function and vertex programs, depth fighting can
+			// be an issue
+			vertex_program_ref Ogre/BasicVertexPrograms/AmbientOneTexture
+			{
+				param_named_auto worldViewProj worldviewproj_matrix
+				param_named_auto ambient ambient_light_colour
+			}
+			
+		}
+		// Now do the lighting pass
+		// NB we don't do decal texture here because this is repeated per light
+		pass
+		{
+			// base colours, not needed for rendering, but as information
+			// to lighting pass categorisation routine
+			ambient 0 0 0 
+			// do this for each light
+			iteration once_per_light
+
+		
+			scene_blend add
+
+			// Vertex program reference
+			vertex_program_ref Examples/BumpMapVP
+			{
+				param_named_auto lightPosition light_position_object_space 0
+				param_named_auto worldViewProj worldviewproj_matrix
+			}
+			
+			// Base bump map
+			texture_unit
+			{
+				texture NMBumpsOut.png
+				colour_op replace
+			}
+			// Normalisation cube map, with dot product on bump map
+			texture_unit
+			{
+				cubic_texture nm.png combinedUVW
+				tex_coord_set 1
+				tex_address_mode clamp
+				colour_op_ex dotproduct src_texture src_current
+				colour_op_multipass_fallback dest_colour zero
+			}
+		}
+		
+		// Decal pass
+		pass
+		{
+			lighting off
+			// Really basic vertex program
+			// NB we don't use fixed function here because GL does not like
+			// mixing fixed function and vertex programs, depth fighting can
+			// be an issue
+			vertex_program_ref Ogre/BasicVertexPrograms/AmbientOneTexture
+			{
+				param_named_auto worldViewProj worldviewproj_matrix
+				param_named ambient float4 1 1 1 1
+			}
+			scene_blend dest_colour zero
+			texture_unit
+			{
+				texture RustedMetal.jpg 
+			}
+			
+		}
+
+	}
+}
+
+//---------------------------
+// Projective texture section
+//---------------------------
+
+
+vertex_program Examples/TexProjectionVP cg
+{
+	source Example_Projection.cg
+	entry_point generalPurposeProjection_vp
+	profiles vs_1_1 arbvp1
+}
+
+fragment_program Examples/TexProjectionFP cg
+{
+	source Example_Projection.cg
+	entry_point generalPurposeProjection_fp
+	// sorry, ps_1_1 can't do this, fp20 can though
+	profiles ps_2_0 arbfp1 fp20
+}
+
+material Examples/GeneralTexProjection
+{
+	technique
+	{
+		pass 
+		{
+			
+			vertex_program_ref Examples/TexProjectionVP
+			{
+				param_named_auto worldViewProjMatrix worldviewproj_matrix
+				param_named_auto worldMatrix world_matrix
+				// You'll need to update the tex projection, I suggest using
+				// the Frustum class
+				//param_named_auto texWorldViewProj worldviewproj_matrix
+			}
+			fragment_program_ref Examples/TexProjectionFP
+			{
+				// no params
+			}
+			texture_unit
+			{
+				// Project the OGRE logo
+				texture ogrelogo.png
+				tex_address_mode clamp
+			}
+		}
+		
+			
+	}
+    
+}
+
+//----------------------------
+// Distortion effects
+//----------------------------
+
+vertex_program Examples/FresnelRefractReflectVP cg
+{
+	source Example_Fresnel.cg
+	entry_point main_vp
+	profiles vs_1_1 arbvp1
+}
+vertex_program Examples/FresnelRefractReflectVPold cg
+{
+	source Example_Fresnel.cg
+	entry_point main_vp_old
+	profiles vs_1_1 arbvp1
+}
+
+fragment_program Examples/FresnelRefractReflectFP cg
+{
+	source Example_Fresnel.cg
+	entry_point main_fp
+	// sorry, ps_1_1 and fp20 can't do this
+	profiles ps_2_0 arbfp1
+}
+
+fragment_program Examples/FresnelRefractReflectPS asm
+{
+	source Example_FresnelPS.asm
+	// sorry, only for ps_1_4 :)
+	syntax ps_1_4
+
+}
+
+material Examples/FresnelReflectionRefraction
+{
+	// ps_2_0 / arbfp1
+	technique
+	{
+		pass 
+		{
+			
+			vertex_program_ref Examples/FresnelRefractReflectVP
+			{
+				param_named_auto worldViewProjMatrix worldviewproj_matrix
+				param_named_auto eyePosition camera_position_object_space
+				param_named_auto timeVal time 0.05
+				param_named scroll float 1  
+				param_named scale float 1 
+				param_named noise float 1 
+				// scroll and noisePos will need updating per frame
+			}
+			fragment_program_ref Examples/FresnelRefractReflectFP
+			{
+				param_named fresnelBias float -0.1 
+				param_named fresnelScale float 1.8 
+				param_named fresnelPower float 8  
+				param_named tintColour float4 0 0.0.05 0.05 1
+				param_named noiseScale float 0.05 
+			}
+			// Noise
+			texture_unit
+			{
+				// Perlin noise volume
+				texture waves2.dds
+				// min / mag filtering, no mip
+				filtering linear linear none
+			}
+			// Reflection
+			texture_unit
+			{
+				// Will be filled in at runtime
+				texture Reflection
+				tex_address_mode clamp
+				// needed by ps.1.4
+				tex_coord_set 1
+			}
+			// Refraction
+			texture_unit
+			{
+				// Will be filled in at runtime
+				texture Refraction
+				tex_address_mode clamp
+				// needed by ps.1.4
+				tex_coord_set 2
+			}
+		}
+		
+			
+	}
+
+	// ATI 8500 +
+	technique
+	{
+		pass
+		{
+			vertex_program_ref Examples/FresnelRefractReflectVPold
+			{
+				param_named_auto worldViewProjMatrix worldviewproj_matrix
+				param_named_auto eyePosition camera_position_object_space
+				param_named fresnelBias float -0.3
+				param_named fresnelScale float 1.4
+				param_named fresnelPower float 8
+				param_named_auto timeVal time_0_1 20
+				param_named scroll float 1 
+				param_named scale float 4 
+				param_named noise float 1
+				// scroll and noisePos will need updating per frame
+			}
+
+			// for ATI RADEON 8500 - 9200
+			fragment_program_ref Examples/FresnelRefractReflectPS
+			{
+				// distortionRange
+				param_indexed 0  float 0.025  
+				// tintColour
+				param_indexed 1  float4 0.05 0.12 0.15 1
+			}
+
+			// Noise
+			texture_unit
+			{
+				// Perlin noise volume
+				texture perlinvolume.dds 3d
+				// min / mag filtering, no mip
+				filtering linear linear none
+			}
+			// Reflection
+			texture_unit
+			{
+				// Will be filled in at runtime
+				texture Reflection
+				tex_address_mode clamp
+				// needed by ps.1.4
+				tex_coord_set 1
+			}
+			// Refraction
+			texture_unit
+			{
+				// Will be filled in at runtime
+				texture Refraction
+				tex_address_mode clamp
+				// needed by ps.1.4
+				tex_coord_set 2
+			}
+		}
+	}    
+}
+
+// Normal-mapped Athene statue
+material Examples/Athene/NormalMapped
+{
+
+	// This is the preferred technique which uses both vertex and
+	// fragment programs, supports coloured lights
+	technique
+	{
+		// Base ambient pass
+		pass
+		{
+			// base colours, not needed for rendering, but as information
+			// to lighting pass categorisation routine
+			ambient 1 1 1
+			diffuse 0 0 0 
+			specular 0 0 0 0 
+			// Really basic vertex program
+			// NB we don't use fixed function here because GL does not like
+			// mixing fixed function and vertex programs, depth fighting can
+			// be an issue
+			vertex_program_ref Ogre/BasicVertexPrograms/AmbientOneTexture
+			{
+				param_named_auto worldViewProj worldviewproj_matrix
+				param_named_auto ambient ambient_light_colour
+			}
+			
+		}
+		// Now do the lighting pass
+		// NB we don't do decal texture here because this is repeated per light
+		pass
+		{
+			// base colours, not needed for rendering, but as information
+			// to lighting pass categorisation routine
+			ambient 0 0 0 
+			
+			// do this for each light
+			iteration once_per_light
+
+		
+			scene_blend add
+
+			// Vertex program reference
+			vertex_program_ref Examples/BumpMapVP
+			{
+				param_named_auto lightPosition light_position_object_space 0
+				param_named_auto worldViewProj worldviewproj_matrix
+			}
+
+			// Fragment program
+			fragment_program_ref Examples/BumpMapFP
+			{
+				param_named_auto lightDiffuse light_diffuse_colour 0 
+			}
+
+			// texture shadow receiver program
+			shadow_receiver_vertex_program_ref Examples/BumpMapVPShadowRcv
+			{
+				param_named_auto lightPosition light_position_object_space 0
+				param_named_auto worldViewProj worldviewproj_matrix
+				param_named_auto worldMatrix world_matrix
+				param_named_auto texViewProj texture_viewproj_matrix
+			}
+			// Additive texture shadow receiver program
+			shadow_receiver_fragment_program_ref Examples/BumpMapFPShadowRcv
+			{
+				param_named_auto lightDiffuse light_diffuse_colour 0 
+			}
+			
+			// Base bump map
+			texture_unit
+			{
+				texture atheneNormalMap.png
+				colour_op replace
+			}
+			// Normalisation cube map
+			texture_unit
+			{
+				cubic_texture nm.png combinedUVW
+				tex_coord_set 1
+				tex_address_mode clamp
+			}
+		}
+		
+		// Decal pass
+		pass
+		{
+			// base colours, not needed for rendering, but as information
+			// to lighting pass categorisation routine
+			lighting off
+			// Really basic vertex program
+			// NB we don't use fixed function here because GL does not like
+			// mixing fixed function and vertex programs, depth fighting can
+			// be an issue
+			vertex_program_ref Ogre/BasicVertexPrograms/AmbientOneTexture
+			{
+				param_named_auto worldViewProj worldviewproj_matrix
+				param_named ambient float4 1 1 1 1
+			}
+			scene_blend dest_colour zero
+			texture_unit
+			{
+				texture egyptrockyfull.jpg 
+			}
+			
+		}
+	}
+
+	// This is the fallback which cards which don't have fragment program 
+	// support will use
+	// Note that it still requires vertex program support
+	technique
+	{
+		// Base ambient pass
+		pass
+		{
+			// base colours, not needed for rendering, but as information
+			// to lighting pass categorisation routine
+			ambient 1 1 1
+			diffuse 0 0 0 
+			specular 0 0 0 0
+			// Really basic vertex program
+			// NB we don't use fixed function here because GL does not like
+			// mixing fixed function and vertex programs, depth fighting can
+			// be an issue
+			vertex_program_ref Ogre/BasicVertexPrograms/AmbientOneTexture
+			{
+				param_named_auto worldViewProj worldviewproj_matrix
+				param_named_auto ambient ambient_light_colour
+			}
+			
+		}
+		// Now do the lighting pass
+		// NB we don't do decal texture here because this is repeated per light
+		pass
+		{
+			// base colours, not needed for rendering, but as information
+			// to lighting pass categorisation routine
+			ambient 0 0 0 
+			// do this for each light
+			iteration once_per_light
+
+		
+			scene_blend add
+
+			// Vertex program reference
+			vertex_program_ref Examples/BumpMapVP
+			{
+				param_named_auto lightPosition light_position_object_space 0
+				param_named_auto worldViewProj worldviewproj_matrix
+			}
+			
+			// Base bump map
+			texture_unit
+			{
+				texture atheneNormalMap.png
+				colour_op replace
+			}
+			// Normalisation cube map, with dot product on bump map
+			texture_unit
+			{
+				cubic_texture nm.png combinedUVW
+				tex_coord_set 1
+				tex_address_mode clamp
+				colour_op_ex dotproduct src_texture src_current
+				colour_op_multipass_fallback dest_colour zero
+			}
+		}
+		
+		// Decal pass
+		pass
+		{
+			lighting off
+			// Really basic vertex program
+			// NB we don't use fixed function here because GL does not like
+			// mixing fixed function and vertex programs, depth fighting can
+			// be an issue
+			vertex_program_ref Ogre/BasicVertexPrograms/AmbientOneTexture
+			{
+				param_named_auto worldViewProj worldviewproj_matrix
+				param_named ambient float4 1 1 1 1
+			}
+			scene_blend dest_colour zero
+			texture_unit
+			{
+				texture egyptrockyfull.jpg
+			}
+			
+		}
+
+	}
+}
+
+// Basic Athene statue
+material Examples/Athene/Basic
+{
+
+	technique
+	{
+		pass
+		{
+			ambient 0.3 0.3 0.3
+			diffuse 1.0 1.0 0.9
+
+			texture_unit
+			{
+				texture egyptrockyfull.jpg 
+			}
+			
+		}
+	}
+}
+
+
+// Any number of lights, diffuse and specular
+material Examples/Athene/NormalMappedSpecular
+{
+
+	// This is the preferred technique which uses both vertex and
+	// fragment programs, supports coloured lights
+	technique
+	{
+		// Base ambient pass
+		pass
+		{
+			// base colours, not needed for rendering, but as information
+			// to lighting pass categorisation routine
+			ambient 1 1 1
+			diffuse 0 0 0 
+			specular 0 0 0 0
+			// Really basic vertex program
+			// NB we don't use fixed function here because GL does not like
+			// mixing fixed function and vertex programs, depth fighting can
+			// be an issue
+			vertex_program_ref Ogre/BasicVertexPrograms/AmbientOneTexture
+			{
+				param_named_auto worldViewProj worldviewproj_matrix
+				param_named_auto ambient ambient_light_colour
+			}
+			
+		}
+		// Now do the lighting pass
+		// NB we don't do decal texture here because this is repeated per light
+		pass
+		{
+			// base colours, not needed for rendering, but as information
+			// to lighting pass categorisation routine
+			ambient 0 0 0 
+			// do this for each light
+			iteration once_per_light
+
+		
+			scene_blend add
+
+			// Vertex program reference
+			vertex_program_ref Examples/BumpMapVPSpecular
+			{
+				param_named_auto lightPosition light_position_object_space 0
+				param_named_auto eyePosition camera_position_object_space
+				param_named_auto worldViewProj worldviewproj_matrix
+			}
+
+			// Fragment program
+			fragment_program_ref Examples/BumpMapFPSpecular
+			{
+				param_named_auto lightDiffuse light_diffuse_colour 0 
+				param_named_auto lightSpecular light_specular_colour 0
+			}
+			
+			// Base bump map
+			texture_unit
+			{
+				texture atheneNormalMap.png
+				colour_op replace
+			}
+			// Normalisation cube map
+			texture_unit
+			{
+				cubic_texture nm.png combinedUVW
+				tex_coord_set 1
+				tex_address_mode clamp
+			}
+			// Normalisation cube map #2
+			texture_unit
+			{
+				cubic_texture nm.png combinedUVW
+				tex_coord_set 2
+				tex_address_mode clamp
+			}
+		}
+		
+		// Decal pass
+		pass
+		{
+			lighting off
+			// Really basic vertex program
+			// NB we don't use fixed function here because GL does not like
+			// mixing fixed function and vertex programs, depth fighting can
+			// be an issue
+			vertex_program_ref Ogre/BasicVertexPrograms/AmbientOneTexture
+			{
+				param_named_auto worldViewProj worldviewproj_matrix
+				param_named ambient float4 1 1 1 1
+			}
+			scene_blend dest_colour zero
+			texture_unit
+			{
+				texture egyptrockyfull.jpg 
+			}
+			
+		}
+	}
+
+	// This is the fallback which cards which don't have fragment program 
+	// support will use, NB does not support specular colour
+	// Note that it still requires vertex program support
+	technique
+	{
+		// Base ambient pass
+		pass
+		{
+			// base colours, not needed for rendering, but as information
+			// to lighting pass categorisation routine
+			ambient 1 1 1
+			diffuse 0 0 0 
+			specular 0 0 0 0
+			// Really basic vertex program
+			// NB we don't use fixed function here because GL does not like
+			// mixing fixed function and vertex programs, depth fighting can
+			// be an issue
+			vertex_program_ref Ogre/BasicVertexPrograms/AmbientOneTexture
+			{
+				param_named_auto worldViewProj worldviewproj_matrix
+				param_named_auto ambient ambient_light_colour
+			}
+			
+		}
+		// Now do the lighting pass
+		// NB we don't do decal texture here because this is repeated per light
+		pass
+		{
+			// base colours, not needed for rendering, but as information
+			// to lighting pass categorisation routine
+			ambient 0 0 0 
+			// do this for each light
+			iteration once_per_light
+
+		
+			scene_blend add
+
+			// Vertex program reference
+			vertex_program_ref Examples/BumpMapVP
+			{
+				param_named_auto lightPosition light_position_object_space 0
+				param_named_auto worldViewProj worldviewproj_matrix
+			}
+			
+			// Base bump map
+			texture_unit
+			{
+				texture atheneNormalMap.png
+				colour_op replace
+			}
+			// Normalisation cube map, with dot product on bump map
+			texture_unit
+			{
+				cubic_texture nm.png combinedUVW
+				tex_coord_set 1
+				tex_address_mode clamp
+				colour_op_ex dotproduct src_texture src_current
+				colour_op_multipass_fallback dest_colour zero
+			}
+		}
+		
+		// Decal pass
+		pass
+		{
+			lighting off
+			// Really basic vertex program
+			// NB we don't use fixed function here because GL does not like
+			// mixing fixed function and vertex programs, depth fighting can
+			// be an issue
+			vertex_program_ref Ogre/BasicVertexPrograms/AmbientOneTexture
+			{
+				param_named_auto worldViewProj worldviewproj_matrix
+				param_named ambient float4 1 1 1 1
+			}
+			scene_blend dest_colour zero
+			texture_unit
+			{
+				texture egyptrockyfull.jpg 
+			}
+			
+		}
+
+	}
+}
+
Index: code/trunk/Tutorial/Media/materials/scripts/Examples.compositor
===================================================================
--- code/trunk/Tutorial/Media/materials/scripts/Examples.compositor	(revision 44)
+++ code/trunk/Tutorial/Media/materials/scripts/Examples.compositor	(revision 44)
@@ -0,0 +1,592 @@
+// Manuel's bloom
+// Needs a scene-sized rtt, but does only one render of the scene
+compositor Bloom
+{
+    technique
+    {
+        // Temporary textures
+        texture rt0 128 128 PF_A8R8G8B8
+        texture rt1 128 128 PF_A8R8G8B8
+
+        target rt1
+        {
+            // Render output from previous compositor (or original scene)
+            input previous
+        }
+
+        target rt0
+        {
+            // Start with clear texture
+            input none
+            // Vertical blur pass
+            pass render_quad
+            {
+                // Renders a fullscreen quad with a material
+                material Ogre/Compositor/Blur0
+                input 0 rt1
+            }
+        }
+
+        target rt1
+        {
+            // Start with clear texture
+            input none
+            // Horizontal blur pass
+            pass render_quad
+            {
+                // Renders a fullscreen quad with a material
+                material Ogre/Compositor/Blur1
+                input 0 rt0
+            }
+        }
+
+        target_output
+        {
+            // Start with clear output
+            input previous
+            // Draw a fullscreen quad
+            pass render_quad
+            {
+                // Renders a fullscreen quad with a material
+                material Ogre/Compositor/BloomBlend
+                input 0 rt1
+            }
+        }
+    }
+}
+
+compositor Glass
+{
+    technique
+    {
+        texture rt0 target_width target_height PF_R8G8B8
+
+        target rt0 { input previous }
+
+        target_output
+        {
+            // Start with clear output
+            input none
+
+            pass render_quad
+            {
+                material Ogre/Compositor/GlassPass
+                input 0 rt0
+            }
+        }
+    }
+}
+
+compositor "Old TV"
+{
+    technique
+    {
+        texture rt0 target_width target_height PF_R8G8B8
+
+        // render scene to a texture
+        target rt0 { input previous }
+
+        target_output
+        {
+            // Start with clear output
+            input none
+
+            pass render_quad
+            {
+                // convert the previous render target to a black and white image, add some noise, distort it,
+                // then render to scene aligned quad
+                material Ogre/Compositor/OldTV
+                input 0 rt0
+            }
+        }
+    }
+}
+
+
+// Black and white effect
+compositor B&W
+{
+    technique
+    {
+        // Temporary textures
+        texture rt0 target_width target_height PF_A8R8G8B8
+
+        target rt0
+        {
+            // Render output from previous compositor (or original scene)
+            input previous
+        }
+
+        target_output
+        {
+            // Start with clear output
+            input none
+            // Draw a fullscreen quad with the black and white image
+            pass render_quad
+            {
+                // Renders a fullscreen quad with a material
+                material Ogre/Compositor/BlackAndWhite
+                input 0 rt0
+            }
+        }
+    }
+}
+
+//compositor DOF // based on Blur but final pass does depth of field
+//{
+//    technique
+//    {
+//        // Temporary textures
+//        texture rt0 target_width target_height PF_A8R8G8B8
+//        texture rt1 target_width target_height PF_A8R8G8B8
+//
+//        target rt1
+//        {
+//            // Render output from previous compositor (or original scene)
+//            input previous
+//        }
+//
+//        target rt0
+//        {
+//            // Start with clear texture
+//            input none
+//            // Vertical blur pass
+//            pass render_quad
+//            {
+//                // Renders a fullscreen quad with a material
+//                material Ogre/Compositor/DOF_Blur0
+//                input 0 rt1
+//            }
+//        }
+//
+//        target rt1
+//        {
+//            // Start with clear texture
+//            input none
+//            // Horizontal blur pass
+//            pass render_quad
+//            {
+//                // Renders a fullscreen quad with a material
+//                material Ogre/Compositor/DOF_Blur1
+//                input 0 rt0
+//            }
+//        }
+//
+//        target_output
+//        {
+//            // Start with clear output
+//            input none
+//            // Draw a fullscreen quad
+//            pass render_quad
+//            {
+//                // Renders a fullscreen quad with a material
+//                material Ogre/Compositor/DOF_Blend
+//                input 0 rt0
+//                input 1 rt1
+//            }
+//        }
+//    }
+//}
+
+// Embossed (fake bump) effect
+compositor Embossed
+{
+    technique
+    {
+        // Temporary textures
+        texture rt0 target_width target_height PF_A8R8G8B8
+
+        target rt0
+        {
+            // Render output from previous compositor (or original scene)
+            input previous
+        }
+
+        target_output
+        {
+            // Start with clear output
+            input none
+            // Draw a fullscreen quad with the black and white image
+            pass render_quad
+            {
+                // Renders a fullscreen quad with a material
+                material Ogre/Compositor/Embossed
+                input 0 rt0
+            }
+        }
+    }
+}
+
+// SharpenEdges
+compositor Sharpen Edges
+{
+    technique
+    {
+        // Temporary textures
+        texture rt0 target_width target_height PF_A8R8G8B8
+
+        target rt0
+        {
+            // Render output from previous compositor (or original scene)
+            input previous
+        }
+
+        target_output
+        {
+            // Start with clear output
+            input none
+            // Draw a fullscreen quad with the black and white image
+            pass render_quad
+            {
+                // Renders a fullscreen quad with a material
+                material Ogre/Compositor/SharpenEdges
+                input 0 rt0
+            }
+        }
+    }
+}
+
+// Invert
+compositor Invert
+{
+    technique
+    {
+        // Temporary textures
+        texture rt0 target_width target_height PF_A8R8G8B8
+
+        target rt0
+        {
+            // Render output from previous compositor (or original scene)
+            input previous
+        }
+
+        target_output
+        {
+            // Start with clear output
+            input none
+            // Draw a fullscreen quad with the black and white image
+            pass render_quad
+            {
+                // Renders a fullscreen quad with a material
+                material Ogre/Compositor/Invert
+                input 0 rt0
+            }
+        }
+    }
+}
+
+// Posterize
+compositor Posterize
+{
+    technique
+    {
+        // Temporary textures
+        texture rt0 target_width target_height PF_A8R8G8B8
+
+        target rt0
+        {
+            // Render output from previous compositor (or original scene)
+            input previous
+        }
+
+        target_output
+        {
+            // Start with clear output
+            input none
+            // Draw a fullscreen quad with the black and white image
+            pass render_quad
+            {
+                // Renders a fullscreen quad with a material
+                material Ogre/Compositor/Posterize
+                input 0 rt0
+            }
+        }
+    }
+}
+
+// Laplace
+compositor Laplace
+{
+    technique
+    {
+        // Temporary textures
+        texture rt0 target_width target_height PF_A8R8G8B8
+
+        target rt0
+        {
+            // Render output from previous compositor (or original scene)
+            input previous
+        }
+
+        target_output
+        {
+            // Start with clear output
+            input none
+            // Draw a fullscreen quad with the black and white image
+            pass render_quad
+            {
+                // Renders a fullscreen quad with a material
+                material Ogre/Compositor/Laplace
+                input 0 rt0
+            }
+        }
+    }
+}
+
+// Tiling
+compositor Tiling
+{
+    technique
+    {
+        // Temporary textures
+        texture rt0 target_width target_height PF_A8R8G8B8
+
+        target rt0
+        {
+            // Render output from previous compositor (or original scene)
+            input previous
+        }
+
+        target_output
+        {
+            // Start with clear output
+            input none
+            // Draw a fullscreen quad with the black and white image
+            pass render_quad
+            {
+                // Renders a fullscreen quad with a material
+                material Ogre/Compositor/Tiling
+                input 0 rt0
+            }
+        }
+    }
+}
+
+// Old Movie
+compositor Old Movie
+{
+    technique
+    {
+        // Temporary textures
+        texture rt0 target_width target_height PF_A8R8G8B8
+
+        target rt0
+        {
+            // Render output from previous compositor (or original scene)
+            input previous
+        }
+
+        target_output
+        {
+            // Start with clear output
+            input none
+            // Draw a fullscreen quad with the black and white image
+            pass render_quad
+            {
+                // Renders a fullscreen quad with a material
+                material Ogre/Compositor/OldMovie
+                input 0 rt0
+            }
+        }
+    }
+}
+
+// HDR
+compositor HDR
+{
+	// floating point only for now
+	technique
+	{
+        // Temporary textures
+		// Fullsize HDR render target, used as tone mapping source
+        texture rt_full target_width target_height PF_FLOAT16_RGB
+		// Targets used for luminance evaluation (3x3 downsample, point filtering)
+		texture rt_lum0 1 1 PF_FLOAT16_RGB
+		texture rt_lum1 4 4 PF_FLOAT16_RGB
+		texture rt_lum2 16 16 PF_FLOAT16_RGB
+		texture rt_lum3 64 64 PF_FLOAT16_RGB
+		texture rt_lum4 128 128 PF_FLOAT16_RGB
+		// Bright-pass filtered target (tone mapped)
+		texture rt_brightpass 128 128 PF_R8G8B8
+		// Bloom filter targets
+		texture rt_bloom0 128 128 PF_R8G8B8
+		texture rt_bloom1 128 128 PF_R8G8B8
+
+
+		target rt_full
+		{
+			// No input, render differently
+			input none
+
+			// Use float target HDR material scheme (unclamped shaders)
+			material_scheme HDR
+
+			pass clear
+			{
+			}
+
+			pass render_scene
+			{
+			}
+
+		}
+
+		// Downsample the original HDR scene to extract luminence value
+		target rt_lum4
+		{
+            input none
+            pass render_quad
+            {
+                // Downsample using a 2x2 filter and convert to greyscale
+                material Ogre/Compositor/HDR/Downsample2x2Luminence
+                input 0 rt_full
+                identifier 994
+            }
+		}
+		target rt_lum3
+		{
+            input none
+            pass render_quad
+            {
+				// Downsample using a 3x3 filter
+                material Ogre/Compositor/HDR/Downsample3x3
+                input 0 rt_lum4
+                identifier 993
+            }
+		}
+		target rt_lum2
+		{
+            input none
+            pass render_quad
+            {
+                // Downsample using a 3x3 filter
+                material Ogre/Compositor/HDR/Downsample3x3
+                input 0 rt_lum3
+                identifier 992
+            }
+		}
+		target rt_lum1
+		{
+            input none
+            pass render_quad
+            {
+                // Downsample using a 3x3 filter
+                material Ogre/Compositor/HDR/Downsample3x3
+                input 0 rt_lum2
+                identifier 991
+            }
+		}
+		target rt_lum0
+		{
+            input none
+            pass render_quad
+            {
+                // Downsample using a 3x3 filter
+                material Ogre/Compositor/HDR/Downsample3x3
+                input 0 rt_lum1
+                identifier 990
+            }
+		}
+
+
+		target rt_brightpass
+		{
+            input none
+            pass render_quad
+            {
+                // Downsample using a 3x3 filter, hi-pass and tone map
+                material Ogre/Compositor/HDR/Downsample3x3Brightpass
+                input 0 rt_full
+		        input 1 rt_lum0
+				identifier 800
+            }
+		}
+
+		target rt_bloom1
+		{
+			input none
+			pass render_quad
+			{
+				// Blur horizontally
+				material Ogre/Compositor/HDR/GaussianBloom
+				input 0 rt_brightpass
+				identifier 701
+			}
+		}
+		target rt_bloom0
+		{
+			input none
+			pass render_quad
+			{
+				// Blur horizontally
+				material Ogre/Compositor/HDR/GaussianBloom
+				input 0 rt_bloom1
+				identifier 700
+			}
+		}
+
+
+		// Final output combines tone mapping of the original scene, with an
+		// exposure setting passed in as a GPU parameter, and an additive bloom
+		// effect
+		target_output
+		{
+			input none
+			pass render_quad
+			{
+				material Ogre/Compositor/HDR/ToneMapping
+				input 0 rt_full
+				input 1 rt_bloom0
+				input 2 rt_lum0
+			}
+		}
+
+
+	}
+
+}
+
+
+// Gaussian blur effect
+compositor Gaussian Blur
+{
+    technique
+    {
+        // Temporary textures
+        texture rt0 target_width target_height PF_A8R8G8B8
+        texture rt1 target_width target_height PF_A8R8G8B8
+
+        target rt0
+        {
+            // Render output from previous compositor (or original scene)
+            input previous
+        }
+
+        target rt1
+        {
+            // Blur horizontally
+            input none
+			pass render_quad
+			{
+				material Ogre/Compositor/HDR/GaussianBloom
+				input 0 rt0
+				identifier 700
+			}
+        }
+
+		target_output
+        {
+            // Start with clear output
+            input none
+            // Blur vertically
+            pass render_quad
+            {
+                // Renders a fullscreen quad with a material
+				material Ogre/Compositor/HDR/GaussianBloom
+                input 0 rt1
+				identifier 701
+            }
+        }
+    }
+}
+
Index: code/trunk/Tutorial/Media/materials/scripts/Examples.program
===================================================================
--- code/trunk/Tutorial/Media/materials/scripts/Examples.program	(revision 44)
+++ code/trunk/Tutorial/Media/materials/scripts/Examples.program	(revision 44)
@@ -0,0 +1,158 @@
+//---------------------------------------------------
+// This file includes a number of basic GPU programs
+// for use in many materials. 
+//---------------------------------------------------
+
+
+// A really basic ambient pass program, support for one texture coodinate set
+vertex_program Ogre/BasicVertexPrograms/AmbientOneTexture cg
+{
+	source Example_Basic.cg
+	entry_point ambientOneTexture_vp
+	profiles vs_1_1 arbvp1
+
+	default_params
+	{
+		param_named_auto worldViewProj worldviewproj_matrix
+		param_named_auto ambient ambient_light_colour
+	}
+	
+}
+// A really basic ambient pass program, support for one texture coodinate set
+vertex_program Ogre/BasicVertexPrograms/AmbientOneTextureHLSL hlsl
+{
+	source Example_Basic.hlsl
+	entry_point ambientOneTexture_vp
+	target vs_1_1
+
+	default_params
+	{
+		param_named_auto worldViewProj worldviewproj_matrix
+		param_named_auto ambient ambient_light_colour
+	}
+}
+// A really basic ambient pass program, support for one texture coodinate set
+vertex_program Ogre/BasicVertexPrograms/AmbientOneTextureGLSL glsl
+{
+	source AmbientOneTexture.glsl
+
+	default_params
+	{
+		param_named_auto ambient ambient_light_colour
+	}
+}
+
+vertex_program Ogre/BasicVertexPrograms/AmbientOneTextureUnified unified
+{
+	delegate Ogre/BasicVertexPrograms/AmbientOneTextureGLSL
+	delegate Ogre/BasicVertexPrograms/AmbientOneTextureHLSL
+}
+
+
+// Same as below, but for use when rendering texture shadows
+vertex_program Ogre/HardwareSkinningOneWeightShadowCaster cg
+{
+	source Example_Basic.cg
+	entry_point hardwareSkinningOneWeightCaster_vp
+	profiles vs_1_1 arbvp1
+	includes_skeletal_animation true
+}
+// Basic hardware skinning using one indexed weight per vertex
+vertex_program Ogre/HardwareSkinningOneWeight cg
+{
+   source Example_Basic.cg
+   entry_point hardwareSkinningOneWeight_vp
+   profiles vs_1_1 arbvp1
+   includes_skeletal_animation true   
+}
+// Same as below, but for use when rendering texture shadows
+vertex_program Ogre/HardwareSkinningTwoWeightsShadowCasterCg cg
+{
+	source Example_Basic.cg
+	entry_point hardwareSkinningTwoWeightsCaster_vp
+	profiles vs_1_1 arbvp1
+	includes_skeletal_animation true
+}
+
+vertex_program Ogre/HardwareSkinningTwoWeightsShadowCasterGLSL glsl
+{
+	source skinningTwoWeightsShadowCasterVp.glsl
+	includes_skeletal_animation true
+}
+
+vertex_program Ogre/HardwareSkinningTwoWeightsShadowCaster unified
+{
+	delegate Ogre/HardwareSkinningTwoWeightsShadowCasterGLSL
+	delegate Ogre/HardwareSkinningTwoWeightsShadowCasterCg
+}
+
+// Basic hardware skinning using two indexed weights per vertex
+vertex_program Ogre/HardwareSkinningTwoWeightsCg cg
+{
+   source Example_Basic.cg
+   entry_point hardwareSkinningTwoWeights_vp
+   profiles vs_1_1 arbvp1
+   includes_skeletal_animation true
+}
+
+vertex_program Ogre/HardwareSkinningTwoWeightsGLSL glsl
+{
+   source skinningTwoWeightsVp.glsl
+   includes_skeletal_animation true
+}
+
+vertex_program Ogre/HardwareSkinningTwoWeights unified
+{
+	delegate Ogre/HardwareSkinningTwoWeightsGLSL
+	delegate Ogre/HardwareSkinningTwoWeightsCg
+	
+   default_params
+   {
+   		param_named_auto worldMatrix3x4Array world_matrix_array_3x4
+		param_named_auto viewProjectionMatrix viewproj_matrix
+		param_named_auto lightPos[0] light_position 0
+		param_named_auto lightPos[1] light_position 1
+		param_named_auto lightDiffuseColour[0] light_diffuse_colour 0
+		param_named_auto lightDiffuseColour[1] light_diffuse_colour 1
+   }
+}
+
+// Basic hardware skinning using four indexed weights per vertex
+vertex_program Ogre/HardwareSkinningFourWeights cg
+{
+   source Example_Basic.cg
+   entry_point hardwareSkinningFourWeights_vp
+   profiles vs_1_1 arbvp1
+   includes_skeletal_animation true
+
+}
+// Basic hardware morph animation 
+vertex_program Ogre/HardwareMorphAnimation cg
+{
+	source Example_Basic.cg
+	entry_point hardwareMorphAnimation
+	profiles vs_1_1 arbvp1
+
+	includes_morph_animation true
+	default_params
+	{
+		param_named_auto worldViewProj worldviewproj_matrix
+		param_named_auto anim_t animation_parametric
+	}
+}
+// Basic hardware pose animation supporting 2 active poses
+vertex_program Ogre/HardwarePoseAnimation cg
+{
+	source Example_Basic.cg
+	entry_point hardwarePoseAnimation
+	profiles vs_1_1 arbvp1
+
+	includes_pose_animation 2
+	default_params
+	{
+		param_named_auto worldViewProj worldviewproj_matrix
+		param_named_auto anim_t animation_parametric
+	}
+}
+
+
Index: code/trunk/Tutorial/Media/materials/scripts/Glass.material
===================================================================
--- code/trunk/Tutorial/Media/materials/scripts/Glass.material	(revision 44)
+++ code/trunk/Tutorial/Media/materials/scripts/Glass.material	(revision 44)
@@ -0,0 +1,40 @@
+fragment_program Ogre/Compositor/GlassFP cg
+{
+	source GlassFP.cg
+	entry_point main_ps
+	profiles ps_2_0 arbfp1
+}
+
+material Ogre/Compositor/GlassPass
+{
+	technique
+	{
+		pass
+		{
+			depth_check off
+
+			vertex_program_ref Ogre/Compositor/StdQuad_Cg_vp
+			{
+			}
+
+			fragment_program_ref Ogre/Compositor/GlassFP
+			{
+			}
+
+			texture_unit RT
+			{
+                tex_coord_set 0
+				tex_address_mode clamp
+				filtering linear linear linear
+			}
+
+			texture_unit
+			{
+				texture WaterNormal1.tga 2d
+                tex_coord_set 1
+				//tex_address_mode clamp
+				filtering linear linear linear
+			}
+		}
+	}
+}
Index: code/trunk/Tutorial/Media/materials/scripts/HeatVision.material
===================================================================
--- code/trunk/Tutorial/Media/materials/scripts/HeatVision.material	(revision 44)
+++ code/trunk/Tutorial/Media/materials/scripts/HeatVision.material	(revision 44)
@@ -0,0 +1,209 @@
+///////////////////////////////////
+//			 PASS 0
+//		HEAT CASTERS PASS
+///////////////////////////////////
+
+vertex_program Fury/HeatVision/HeatCaster_vp cg
+{
+   source HeatVision.cg
+   entry_point HeatCaster_vp
+   profiles vs_1_1 arbvp1
+}
+
+fragment_program Fury/HeatVision/HeatCaster_fp cg
+{
+   source HeatVision.cg
+   entry_point HeatCaster_fp
+   profiles ps_2_0 arbfp1
+}
+
+material Fury/HeatVision/HeatCaster
+{
+    technique
+    {
+        pass
+        {
+            vertex_program_ref Fury/HeatVision/HeatCaster_vp
+            {
+                param_named_auto eyePosition camera_position_object_space
+                param_named_auto worldViewProj worldviewproj_matrix
+            }
+
+            fragment_program_ref Fury/HeatVision/HeatCaster_fp
+            {
+            }
+        }
+    }
+}
+
+///////////////////////////////////
+//			 PASS 0
+//		HEAT CASTERS PASS
+///////////////////////////////////
+
+vertex_program Fury/HeatVision/ColdCaster_vp cg
+{
+   source HeatVision.cg
+   entry_point ColdCaster_vp
+   profiles vs_1_1 arbvp1
+}
+
+fragment_program Fury/HeatVision/ColdCaster_fp cg
+{
+   source HeatVision.cg
+   entry_point ColdCaster_fp
+   profiles ps_2_0 arbfp1
+}
+
+material Fury/HeatVision/ColdCaster
+{
+    technique
+    {
+        pass
+        {
+            vertex_program_ref Fury/HeatVision/ColdCaster_vp
+            {
+                param_named_auto eyePosition camera_position_object_space
+                param_named_auto worldViewProj worldviewproj_matrix
+            }
+
+            fragment_program_ref Fury/HeatVision/ColdCaster_fp
+            {
+            }
+        }
+    }
+}
+
+///////////////////////////////////
+//			  PASS 1
+//  LIGHT TO HEAT CONVERSION PASS
+///////////////////////////////////
+
+vertex_program Fury/HeatVision/LightToHeat_vp cg
+{
+   source HeatVision.cg
+   entry_point LightToHeat_vp
+   profiles vs_1_1 arbvp1
+
+    default_params
+    {
+        param_named_auto flipping render_target_flipping
+    }
+}
+
+fragment_program Fury/HeatVision/LightToHeat_fp cg
+{
+   source HeatVision.cg
+   entry_point LightToHeat_fp
+   profiles ps_2_0 arbfp1
+}
+
+material Fury/HeatVision/LightToHeat
+{
+    technique
+    {
+        // pass 1
+        pass
+        {
+			cull_hardware none
+			cull_software none
+			depth_func always_pass
+
+            vertex_program_ref Fury/HeatVision/LightToHeat_vp
+            {
+            }
+
+            fragment_program_ref Fury/HeatVision/LightToHeat_fp
+            {
+                // these should be *really* random!
+                param_named random_fractions float4 0.3 0.7 0 0
+
+                param_named depth_modulator float4 0.6 0 0 0
+
+                // this one can be fixed
+                param_named heatBiasScale float4 0.0 1.0 0 0
+            }
+
+            // INPUT (from scene, where entities has "Fury/HeatVision/Caster" material for heat emanation)
+            texture_unit
+            {
+                tex_coord_set 0
+                filtering linear linear none
+                tex_address_mode clamp
+            }
+
+            // Noise map
+            texture_unit
+            {
+                texture HeatNoise.tga
+                tex_coord_set 0
+            }
+
+            // heat conversion texture
+            texture_unit
+            {
+                texture HeatLookup.tga
+                tex_coord_set 0
+                filtering point point none
+            }
+        }
+    }
+
+}
+
+
+///////////////////////////////////
+//			  PASS 2
+//			 BLUR PASS
+///////////////////////////////////
+
+vertex_program Fury/HeatVision/Blur_vp cg
+{
+   source HeatVision.cg
+   entry_point Blur_vp
+   profiles vs_1_1 arbvp1
+
+    default_params
+    {
+        param_named_auto flipping render_target_flipping
+    }
+}
+
+fragment_program Fury/HeatVision/Blur_fp cg
+{
+   source HeatVision.cg
+   entry_point Blur_fp
+   profiles ps_2_0 arbfp1
+}
+
+material Fury/HeatVision/Blur
+{
+    technique
+    {
+        // pass 1
+        pass
+        {
+			cull_hardware none
+			cull_software none
+			depth_func always_pass
+
+            vertex_program_ref Fury/HeatVision/Blur_vp
+            {
+            }
+
+            fragment_program_ref Fury/HeatVision/Blur_fp
+            {
+                param_named blurAmount float4 0.5 0 0 0
+            }
+
+            // INPUT (from previous)
+            texture_unit
+            {
+                texture Input
+                tex_coord_set 0
+                filtering linear linear none
+                tex_address_mode clamp
+            }
+        }
+    }
+}
Index: code/trunk/Tutorial/Media/materials/scripts/Hurt.material
===================================================================
--- code/trunk/Tutorial/Media/materials/scripts/Hurt.material	(revision 44)
+++ code/trunk/Tutorial/Media/materials/scripts/Hurt.material	(revision 44)
@@ -0,0 +1,18 @@
+/// Just a simple red quad blended over the scene
+material RedQuad
+{
+    technique
+    {
+        pass
+        {
+            lighting on
+            diffuse 0.0 0.0 0.0 0.5
+            specular 0.0 0.0 0.0 1.0 
+            ambient 0.0 0.0 0.0
+            emissive 1.0 0.0 0.0
+            cull_hardware none
+            depth_check off
+            scene_blend alpha_blend
+        }
+    }
+}
Index: code/trunk/Tutorial/Media/materials/scripts/Invert.material
===================================================================
--- code/trunk/Tutorial/Media/materials/scripts/Invert.material	(revision 44)
+++ code/trunk/Tutorial/Media/materials/scripts/Invert.material	(revision 44)
@@ -0,0 +1,36 @@
+fragment_program Ogre/Compositor/InvertFP cg
+{
+	source InvertFP.cg
+	entry_point Invert_ps
+	profiles ps_2_0 arbfp1
+}
+
+material Ogre/Compositor/Invert
+{
+	technique
+	{
+
+		pass
+		{
+			cull_hardware none
+			cull_software none
+			depth_func always_pass
+
+			vertex_program_ref Ogre/Compositor/StdQuad_Tex2a_vp
+			{
+			}
+
+			fragment_program_ref Ogre/Compositor/InvertFP
+			{
+			}
+
+			texture_unit RT
+			{
+                tex_coord_set 0
+				tex_address_mode clamp
+				filtering trilinear
+			}
+
+		}
+	}
+}
Index: code/trunk/Tutorial/Media/materials/scripts/Laplace.material
===================================================================
--- code/trunk/Tutorial/Media/materials/scripts/Laplace.material	(revision 44)
+++ code/trunk/Tutorial/Media/materials/scripts/Laplace.material	(revision 44)
@@ -0,0 +1,39 @@
+fragment_program Ogre/Compositor/LaplaceFP cg
+{
+	source LaplaceFP.cg
+	entry_point Laplace_ps
+	profiles ps_2_0 arbfp1
+}
+
+material Ogre/Compositor/Laplace
+{
+    technique
+    {
+
+		pass
+		{
+			cull_hardware none
+			cull_software none
+			depth_func always_pass
+
+			vertex_program_ref Ogre/Compositor/StdQuad_Tex2a_vp
+			{
+			}
+
+			fragment_program_ref Ogre/Compositor/LaplaceFP
+			{
+				param_named pixelSize float 0.0031
+				param_named scale float 1.0
+			}
+
+
+			texture_unit RT
+			{
+                tex_coord_set 0
+				tex_address_mode clamp
+				filtering trilinear
+			}
+
+		}
+	}
+}
Index: code/trunk/Tutorial/Media/materials/scripts/MotionBlur.material
===================================================================
--- code/trunk/Tutorial/Media/materials/scripts/MotionBlur.material	(revision 44)
+++ code/trunk/Tutorial/Media/materials/scripts/MotionBlur.material	(revision 44)
@@ -0,0 +1,84 @@
+fragment_program Ogre/Compositor/Combine_fp cg
+{
+	source Combine_fp.cg
+	profiles ps_2_0 arbfp1
+	entry_point Combine_fp
+
+	default_params
+	{
+		param_named blur float 0.8
+	}
+}
+
+material Ogre/Compositor/Combine
+{
+	technique
+	{
+		pass
+		{
+			depth_check off
+
+			fragment_program_ref Ogre/Compositor/Combine_fp
+			{
+			}
+
+			vertex_program_ref Ogre/Compositor/StdQuad_Cg_vp
+			{
+			}
+
+			texture_unit RT
+			{
+				tex_address_mode clamp
+				filtering linear linear none
+                tex_coord_set 0
+			}
+
+			texture_unit SUM
+			{
+				tex_address_mode clamp
+				filtering linear linear none
+                tex_coord_set 0
+			}
+		}
+	}
+}
+
+material Ogre/Compositor/Copyback
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			depth_check off
+
+			texture_unit Temp
+			{
+				tex_address_mode clamp
+				filtering linear linear none
+				colour_op replace
+                tex_coord_set 0
+			}
+		}
+	}
+}
+
+material Ogre/Compositor/MotionBlur
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			depth_check off
+
+			texture_unit Sum
+			{
+				tex_address_mode clamp
+				filtering linear linear none
+				colour_op replace
+                tex_coord_set 0
+			}
+		}
+	}
+}
Index: code/trunk/Tutorial/Media/materials/scripts/Ocean.controls
===================================================================
--- code/trunk/Tutorial/Media/materials/scripts/Ocean.controls	(revision 44)
+++ code/trunk/Tutorial/Media/materials/scripts/Ocean.controls	(revision 44)
@@ -0,0 +1,90 @@
+[1. Ocean2 Cg]
+material = Ocean2_Cg
+control = Wavelet Scale, BumpScale, GPU_VERTEX, 0, 2, 0
+control = Texture Scale X, textureScale, GPU_VERTEX, 0, 40, 0
+control = Texture Scale Y, textureScale, GPU_VERTEX, 0, 40, 1
+control = Wavelet Speed X, bumpSpeed, GPU_VERTEX, -0.1, 0.1, 0
+control = Wavelet Speed Y, bumpSpeed, GPU_VERTEX, -0.1, 0.1, 1
+control = Wave Frequency, waveFreq, GPU_VERTEX, 0, 0.05, 0
+control = Wave Amplitude, waveAmp, GPU_VERTEX, 0, 25, 0
+
+control = Deep Color [Red], deepColor, GPU_FRAGMENT, 0, 1, 0
+control = Deep Color [Green], deepColor, GPU_FRAGMENT, 0, 1, 1
+control = Deep Color [Blue], deepColor, GPU_FRAGMENT, 0, 1, 2
+
+control = Shallow Color [Red], shallowColor, GPU_FRAGMENT, 0, 1, 0
+control = Shallow Color [Green], shallowColor, GPU_FRAGMENT, 0, 1, 1
+control = Shallow Color [Blue], shallowColor, GPU_FRAGMENT, 0, 1, 2
+
+control = Reflection Color [Red], reflectionColor, GPU_FRAGMENT, 0, 1, 0
+control = Reflection Color [Green], reflectionColor, GPU_FRAGMENT, 0, 1, 1
+control = Reflection Color [Blue], reflectionColor, GPU_FRAGMENT, 0, 1, 2
+
+control = Reflection Amount, reflectionAmount, GPU_FRAGMENT, 0, 1, 0
+control = Reflection Blur, reflectionBlur, GPU_FRAGMENT, 0, 8, 0
+control = Water Amount, waterAmount, GPU_FRAGMENT, 0, 1, 0
+control = Fresnel Power, fresnelPower, GPU_FRAGMENT, 0, 10, 0
+control = Fresnel Bias, fresnelBias, GPU_FRAGMENT, 0, 1, 0
+control = HDR Mulitplier, hdrMultiplier, GPU_FRAGMENT, 0, 2, 0
+
+[1a. Ocean2 HLSL/GLSL]
+material = Ocean2_HLSL_GLSL
+control = Wavelet Scale, BumpScale, GPU_VERTEX, 0, 2, 0
+control = Texture Scale X, textureScale, GPU_VERTEX, 0, 40, 0
+control = Texture Scale Y, textureScale, GPU_VERTEX, 0, 40, 1
+control = Wavelet Speed X, bumpSpeed, GPU_VERTEX, -0.1, 0.1, 0
+control = Wavelet Speed Y, bumpSpeed, GPU_VERTEX, -0.1, 0.1, 1
+control = Wave Frequency, waveFreq, GPU_VERTEX, 0, 0.05, 0
+control = Wave Amplitude, waveAmp, GPU_VERTEX, 0, 25, 0
+
+control = Deep Color [Red], deepColor, GPU_FRAGMENT, 0, 1, 0
+control = Deep Color [Green], deepColor, GPU_FRAGMENT, 0, 1, 1
+control = Deep Color [Blue], deepColor, GPU_FRAGMENT, 0, 1, 2
+
+control = Shallow Color [Red], shallowColor, GPU_FRAGMENT, 0, 1, 0
+control = Shallow Color [Green], shallowColor, GPU_FRAGMENT, 0, 1, 1
+control = Shallow Color [Blue], shallowColor, GPU_FRAGMENT, 0, 1, 2
+
+control = Reflection Color [Red], reflectionColor, GPU_FRAGMENT, 0, 1, 0
+control = Reflection Color [Green], reflectionColor, GPU_FRAGMENT, 0, 1, 1
+control = Reflection Color [Blue], reflectionColor, GPU_FRAGMENT, 0, 1, 2
+
+control = Reflection Amount, reflectionAmount, GPU_FRAGMENT, 0, 1, 0
+control = Reflection Blur, reflectionBlur, GPU_FRAGMENT, 0, 8, 0
+control = Water Amount, waterAmount, GPU_FRAGMENT, 0, 1, 0
+control = Fresnel Power, fresnelPower, GPU_FRAGMENT, 0, 10, 0
+control = Fresnel Bias, fresnelBias, GPU_FRAGMENT, 0, 1, 0
+control = HDR Mulitplier, hdrMultiplier, GPU_FRAGMENT, 0, 2, 0
+
+[2. Ocean1 HLSL/GLSL]
+material = OceanHLSL_GLSL
+control = scale x, scale, GPU_VERTEX, 0, 0.1, 0
+control = scale y, scale, GPU_VERTEX, 0, 0.1, 1
+control = scale z, scale, GPU_VERTEX, 0, 0.1, 2
+control = Wave Speed X, waveSpeed, GPU_VERTEX, 0, 1, 0
+control = Wave Speed Y, waveSpeed, GPU_VERTEX, 0, 1, 1
+control = Noise Speed, noiseSpeed, GPU_VERTEX, 0, 1, 0
+
+control = Fade Bias, fadeBias, GPU_FRAGMENT, 0, 1, 0
+control = Fade Exponent, fadeExp, GPU_FRAGMENT, 0, 20, 0
+control = Water Color (r), waterColor, GPU_FRAGMENT, 0, 1, 0
+control = Water Color (g), waterColor, GPU_FRAGMENT, 0, 1, 1
+control = Water Color (b), waterColor, GPU_FRAGMENT, 0, 1, 2
+
+[3. Ocean1 Cg]
+material = OceanCg
+control = scale x, scale, GPU_VERTEX, 0, 0.1, 0
+control = scale y, scale, GPU_VERTEX, 0, 0.1, 1
+control = scale z, scale, GPU_VERTEX, 0, 0.1, 2
+control = Wave Speed X, waveSpeed, GPU_VERTEX, 0, 1, 0
+control = Wave Speed Y, waveSpeed, GPU_VERTEX, 0, 1, 1
+control = Noise Speed, noiseSpeed, GPU_VERTEX, 0, 1, 0
+
+control = Fade Bias, fadeBias, GPU_FRAGMENT, 0, 1, 0
+control = Fade Exponent, fadeExp, GPU_FRAGMENT, 0, 20, 0
+control = Water Color (r), waterColor, GPU_FRAGMENT, 0, 1, 0
+control = Water Color (g), waterColor, GPU_FRAGMENT, 0, 1, 1
+control = Water Color (b), waterColor, GPU_FRAGMENT, 0, 1, 2
+
+
+
Index: code/trunk/Tutorial/Media/materials/scripts/Ocean.material
===================================================================
--- code/trunk/Tutorial/Media/materials/scripts/Ocean.material	(revision 44)
+++ code/trunk/Tutorial/Media/materials/scripts/Ocean.material	(revision 44)
@@ -0,0 +1,427 @@
+vertex_program HLSL/OceanVS hlsl
+{
+	source oceanHLSL_Cg.vert
+	entry_point main
+	target vs_1_1
+
+
+	default_params
+	{
+		param_named_auto worldViewProj_matrix worldviewproj_matrix
+		param_named_auto eyePosition camera_position_object_space
+		param_named scale float3 0.012 0.005 0.03
+		param_named_auto time_0_X time_0_x 100.0
+	}
+}
+
+fragment_program HLSL/OceanFS hlsl
+{
+	source oceanHLSL_Cg.frag
+	entry_point main
+	target ps_2_0
+
+}
+
+vertex_program GLSL/OceanVS glsl
+{
+	source oceanGLSL.vert
+
+	default_params
+	{
+		param_named_auto eyePosition camera_position_object_space
+		param_named scale float3 0.012 0.005 0.03
+		param_named_auto time_0_X time_0_x 100.0
+	}
+}
+
+fragment_program GLSL/OceanFS glsl
+{
+	source oceanGLSL.frag
+
+	default_params
+	{
+		param_named Noise int 0
+		param_named skyBox int 1
+	}
+}
+
+material OceanHLSL_GLSL
+{
+	technique
+	{
+		pass
+		{
+			vertex_program_ref HLSL/OceanVS
+			{
+				param_named waveSpeed float2 0.0 0.168
+				param_named noiseSpeed float 0.155
+			}
+
+			fragment_program_ref HLSL/OceanFS
+			{
+				param_named fadeBias float 0.336
+				param_named fadeExp float 5.546
+				param_named waterColor float4 0.0 0.244 0.395 1.0
+			}
+
+			texture_unit
+			{
+				texture NoiseVolume.dds 3d
+				tex_coord_set 0
+				filtering linear linear none
+			}
+
+			texture_unit
+			{
+				cubic_texture morning.jpg combinedUVW
+				tex_address_mode clamp
+				tex_coord_set 1
+			}
+
+		}
+
+	}
+
+	technique
+	{
+		pass
+		{
+			vertex_program_ref GLSL/OceanVS
+			{
+				param_named waveSpeed float2 0.0 0.168
+				param_named noiseSpeed float 0.155
+			}
+
+			fragment_program_ref GLSL/OceanFS
+			{
+				param_named fadeBias float 0.336
+				param_named fadeExp float 5.546
+				param_named waterColor float4 0.0 0.244 0.395 1.0
+			}
+
+			texture_unit
+			{
+				texture NoiseVolume.dds 3d
+				tex_coord_set 0
+				filtering linear linear none
+				tex_address_mode wrap
+			}
+
+			texture_unit
+			{
+				cubic_texture morning.jpg combinedUVW
+				tex_address_mode clamp
+				tex_coord_set 1
+			}
+
+		}
+
+	}
+
+}
+
+
+vertex_program Cg/OceanVS cg
+{
+	source oceanHLSL_Cg.vert
+	entry_point main
+	profiles vs_1_1 arbvp1
+
+
+	default_params
+	{
+		param_named_auto worldViewProj_matrix worldviewproj_matrix
+		param_named_auto eyePosition camera_position_object_space
+		param_named scale float3 0.012 0.005 0.03
+		param_named_auto time_0_X time_0_x 100.0
+	}
+}
+
+fragment_program Cg/OceanFS cg
+{
+	source oceanHLSL_Cg.frag
+	entry_point main
+	profiles ps_2_0 arbfp1
+
+}
+
+material OceanCg
+{
+	technique
+	{
+		pass
+		{
+			vertex_program_ref Cg/OceanVS
+			{
+				param_named waveSpeed float2 0.0 0.168
+				param_named noiseSpeed float 0.155
+			}
+
+			fragment_program_ref Cg/OceanFS
+			{
+				param_named fadeBias float 0.336
+				param_named fadeExp float 5.546
+				param_named waterColor float4 0.0 0.244 0.395 1.0
+			}
+
+			texture_unit
+			{
+				texture NoiseVolume.dds 3d
+				tex_coord_set 0
+				filtering linear linear none
+			}
+
+			texture_unit
+			{
+				cubic_texture morning.jpg combinedUVW
+				tex_address_mode clamp
+				tex_coord_set 1
+			}
+
+		}
+
+	}
+}
+
+
+vertex_program Cg/Ocean2VS cg
+{
+	source Ocean2HLSL_Cg.vert
+	entry_point main
+	profiles vs_1_1 arbvp1
+
+
+	default_params
+	{
+		param_named_auto WorldViewProj worldviewproj_matrix
+		param_named_auto eyePosition camera_position_object_space
+	}
+}
+
+fragment_program Cg/Ocean2FS cg
+{
+	source Ocean2HLSL_Cg.frag
+	entry_point main
+	profiles ps_2_0 arbfp1
+
+}
+
+material Ocean2_Cg
+{
+	technique
+	{
+		pass
+		{
+			vertex_program_ref Cg/Ocean2VS
+			{
+				param_named BumpScale float 0.2
+				param_named textureScale float2 25 26
+				param_named bumpSpeed float2 0.015 0.005
+				param_named_auto time time_0_x 100.0
+				param_named waveFreq float 0.028
+				param_named waveAmp float 1.8
+			}
+
+			fragment_program_ref Cg/Ocean2FS
+			{
+				param_named deepColor float4 0 0.3 0.5 1.0
+				param_named shallowColor float4 0 1 1 1.0
+				param_named reflectionColor float4 0.95 1 1 1.0
+				param_named reflectionAmount float 1.0
+				param_named reflectionBlur float 0.0
+				param_named waterAmount float 0.3
+				param_named fresnelPower float 5.0
+				param_named fresnelBias float 0.328
+				param_named hdrMultiplier float 0.471
+			}
+
+			texture_unit
+			{
+				texture waves2.dds
+				tex_coord_set 0
+				filtering linear linear linear
+			}
+
+			texture_unit
+			{
+				cubic_texture morning.jpg combinedUVW
+				tex_address_mode clamp
+				tex_coord_set 1
+				filtering linear linear linear
+			}
+
+		}
+
+	}
+}
+
+
+vertex_program HLSL/Ocean2VS hlsl
+{
+	source Ocean2HLSL_Cg.vert
+	entry_point main
+	target vs_1_1
+
+
+	default_params
+	{
+		param_named_auto WorldViewProj worldviewproj_matrix
+		param_named_auto eyePosition camera_position_object_space
+	}
+}
+
+fragment_program HLSL/Ocean2FS hlsl
+{
+	source Ocean2HLSL_Cg.frag
+	entry_point main
+	target ps_2_0
+
+}
+
+vertex_program GLSL/Ocean2VS glsl
+{
+	source Ocean2GLSL.vert
+
+}
+
+fragment_program GLSL/Ocean2FS glsl
+{
+	source Ocean2GLSL.frag
+}
+
+material Ocean2_HLSL_GLSL
+{
+	technique HLSL
+	{
+		pass
+		{
+			vertex_program_ref HLSL/Ocean2VS
+			{
+				param_named BumpScale float 0.2
+				param_named textureScale float2 25 26
+				param_named bumpSpeed float2 0.015 0.005
+				param_named_auto time time_0_x 100.0
+				param_named waveFreq float 0.028
+				param_named waveAmp float 1.8
+			}
+
+			fragment_program_ref HLSL/Ocean2FS
+			{
+				param_named deepColor float4 0 0.3 0.5 1.0
+				param_named shallowColor float4 0 1 1 1.0
+				param_named reflectionColor float4 0.95 1 1 1.0
+				param_named reflectionAmount float 1.0
+				param_named reflectionBlur float 0.0
+				param_named waterAmount float 0.3
+				param_named fresnelPower float 5.0
+				param_named fresnelBias float 0.328
+				param_named hdrMultiplier float 0.471
+			}
+
+			texture_unit
+			{
+				texture waves2.dds
+				tex_coord_set 0
+				filtering linear linear linear
+			}
+
+			texture_unit
+			{
+				cubic_texture morning.jpg combinedUVW
+				tex_address_mode clamp
+				filtering linear linear linear
+				tex_coord_set 1
+			}
+
+		}
+
+	}
+
+	technique GLSL
+	{
+		pass
+		{
+			vertex_program_ref GLSL/Ocean2VS
+			{
+				param_named_auto eyePosition camera_position_object_space
+				param_named_auto time time_0_x 100.0
+				param_named BumpScale float 0.2
+				param_named textureScale float2 25 26
+				param_named bumpSpeed float2 0.015 0.005
+				param_named waveFreq float 0.028
+				param_named waveAmp float 1.8
+			}
+
+			fragment_program_ref GLSL/Ocean2FS
+			{
+				param_named deepColor float4 0 0.3 0.5 1.0
+				param_named shallowColor float4 0 1 1 1.0
+				param_named reflectionColor float4 0.95 1 1 1.0
+				param_named reflectionAmount float 1.0
+				param_named reflectionBlur float 0.0
+				param_named waterAmount float 0.3
+				param_named fresnelPower float 5.0
+				param_named fresnelBias float 0.328
+				param_named hdrMultiplier float 0.471
+				param_named NormalMap int 0
+				param_named EnvironmentMap int 1
+			}
+
+			texture_unit
+			{
+				texture waves2.dds
+				tex_coord_set 0
+				filtering linear linear linear
+			}
+
+			texture_unit
+			{
+				cubic_texture morning.jpg combinedUVW
+				tex_address_mode clamp
+				tex_coord_set 1
+				filtering linear linear linear
+			}
+
+		}
+
+	}
+}
+
+material SkyBox
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			depth_write off
+			depth_check off
+
+			texture_unit
+			{
+				cubic_texture morning.jpg separateUV
+				tex_address_mode clamp
+			}
+		}
+	}
+}
+
+material LightFlare
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			scene_blend add
+			depth_write off
+
+			texture_unit
+			{
+				texture flare.png
+			}
+		}
+	}
+}
+
+
Index: code/trunk/Tutorial/Media/materials/scripts/OffsetMapping.material
===================================================================
--- code/trunk/Tutorial/Media/materials/scripts/OffsetMapping.material	(revision 44)
+++ code/trunk/Tutorial/Media/materials/scripts/OffsetMapping.material	(revision 44)
@@ -0,0 +1,242 @@
+// Bump map with Parallax offset vertex program, support for this is required 
+vertex_program Examples/OffsetMappingVP cg 
+{ 
+   source OffsetMapping.cg 
+   entry_point main_vp 
+   profiles vs_1_1 arbvp1 
+} 
+
+// Bump map with parallax fragment program 
+fragment_program Examples/OffsetMappingFP cg
+{ 
+   source OffsetMapping.cg
+   entry_point main_fp
+   profiles ps_2_0 arbfp1
+} 
+
+// Bump map with parallax fragment program 
+fragment_program Examples/OffsetMappingPS asm 
+{ 
+   source OffsetMapping_specular.asm 
+   // sorry, only for ps_1_4 and above:) 
+   syntax ps_1_4 
+} 
+
+
+material Examples/OffsetMapping/Specular 
+{ 
+
+  // This is the preferred technique which uses both vertex and 
+   // fragment programs, supports coloured lights 
+   technique 
+   { 
+      // do the lighting  and bump mapping with parallax pass 
+      pass 
+      { 
+       
+         // Vertex program reference 
+         vertex_program_ref Examples/OffsetMappingVP 
+         { 
+            param_named_auto lightPosition light_position_object_space 0 
+            param_named_auto eyePosition camera_position_object_space 
+            param_named_auto worldViewProj worldviewproj_matrix 
+         } 
+
+         // Fragment program 
+         fragment_program_ref Examples/OffsetMappingFP
+         { 
+            param_named_auto lightDiffuse light_diffuse_colour 0 
+            param_named_auto lightSpecular light_specular_colour 0 
+            // Parallax Height scale and bias 
+            param_named scaleBias float4 0.04 -0.02 1 0 
+         } 
+          
+         // Normal + height(alpha) map 
+         texture_unit 
+         { 
+            texture rockwall_NH.tga
+            tex_coord_set 0 
+         } 
+
+         // Base diffuse texture map 
+         texture_unit 
+         { 
+            texture rockwall.tga
+            tex_coord_set 1 
+         } 
+      } 
+   } 
+
+
+   // This is the preferred technique which uses both vertex and 
+   // fragment programs, supports coloured lights 
+   technique 
+   { 
+      // do the lighting  and bump mapping with parallax pass 
+      pass 
+      { 
+       
+         // Vertex program reference 
+         vertex_program_ref Examples/OffsetMappingVP 
+         { 
+            param_named_auto lightPosition light_position_object_space 0 
+            param_named_auto eyePosition camera_position_object_space 
+            param_named_auto worldViewProj worldviewproj_matrix 
+         } 
+
+         // Fragment program 
+         fragment_program_ref Examples/OffsetMappingPS 
+         { 
+            param_indexed_auto 0 light_diffuse_colour 0 
+            param_indexed_auto 1 light_specular_colour 0 
+            // Parallax Height scale and bias 
+            param_indexed 2 float4 0.04 -0.02 1 0 
+         } 
+          
+         // Normal + height(alpha) map 
+         texture_unit 
+         { 
+            texture rockwall_NH.tga
+            tex_coord_set 0 
+         } 
+
+         // Base diffuse texture map 
+         texture_unit 
+         { 
+            texture rockwall.tga
+            tex_coord_set 1 
+         } 
+      } 
+   } 
+   
+   // Simple no-shader fallback
+   technique 
+   { 
+      pass 
+      { 
+         // Base diffuse texture map 
+         texture_unit 
+         { 
+            texture rockwall.tga
+         } 
+	  }
+   }
+
+}
+
+
+
+// Single-pass offset mapping with shadows
+vertex_program Examples/OffsetMappingIntegratedShadowsVPhlsl hlsl 
+{ 
+   source OffsetMapping.hlsl
+   entry_point integratedshadows_vp 
+   target vs_2_0
+} 
+vertex_program Examples/OffsetMappingIntegratedShadowsVPglsl glsl 
+{ 
+   source OffsetMappingVp.glsl
+} 
+
+// Single-pass offset mapping with shadows
+fragment_program Examples/OffsetMappingIntegratedShadowsFPhlsl hlsl
+{ 
+   source OffsetMapping.hlsl
+   entry_point integratedshadows_fp
+   target ps_2_0
+} 
+fragment_program Examples/OffsetMappingIntegratedShadowsFPglsl glsl
+{
+	source OffsetMappingFp.glsl
+	default_params
+	{
+		// assign samplers as required by GLSL
+		param_named normalHeightMap int 0
+		param_named diffuseMap int 1
+		param_named shadowMap1 int 2
+		param_named shadowMap2 int 3
+	}
+}
+// Single-pass offset mapping with shadows
+vertex_program Examples/OffsetMappingIntegratedShadowsVP unified
+{
+	delegate Examples/OffsetMappingIntegratedShadowsVPhlsl
+	delegate Examples/OffsetMappingIntegratedShadowsVPglsl
+}
+// Single-pass offset mapping with shadows
+fragment_program Examples/OffsetMappingIntegratedShadowsFP unified
+{
+	delegate Examples/OffsetMappingIntegratedShadowsFPhlsl
+	delegate Examples/OffsetMappingIntegratedShadowsFPglsl
+}
+
+
+
+material Examples/OffsetMapping/IntegratedShadows 
+{ 
+
+   technique 
+   { 
+      // do the lighting  and bump mapping with parallax pass 
+      pass 
+      { 
+       
+         // Vertex program reference 
+         vertex_program_ref Examples/OffsetMappingIntegratedShadowsVP
+         { 
+            param_named_auto lightPosition light_position_object_space 0
+            param_named_auto eyePosition camera_position_object_space 
+            param_named_auto worldViewProj worldviewproj_matrix 
+			param_named_auto spotDirection light_direction_object_space 0
+
+            param_named_auto lightPosition1 light_position_object_space 1
+			param_named_auto spotDirection1 light_direction_object_space 1
+			// shadow texture projections
+			param_named_auto worldMatrix world_matrix
+			param_named_auto texViewProj1 texture_viewproj_matrix 0
+			param_named_auto texViewProj2 texture_viewproj_matrix 1
+         } 
+
+         // Fragment program 
+         fragment_program_ref Examples/OffsetMappingIntegratedShadowsFP
+         { 
+            param_named_auto lightDiffuse light_diffuse_colour 0 
+			param_named_auto spotParams spotlight_params 0
+
+			param_named_auto lightDiffuse1 light_diffuse_colour 1
+			param_named_auto spotParams1 spotlight_params 1
+            // Parallax Height scale and bias 
+            param_named scaleBias float4 0.04 -0.02 1 0 
+         } 
+          
+         // Normal + height(alpha) map 
+         texture_unit 
+         { 
+            texture rockwall_NH.tga
+            tex_coord_set 0 
+         } 
+
+         // Base diffuse texture map 
+         texture_unit 
+         { 
+            texture rockwall.tga
+            tex_coord_set 1 
+         } 
+
+		 // shadowmap 1
+		 texture_unit
+		 {
+		 	content_type shadow
+		 }
+		 // shadowmap 2
+		 texture_unit
+		 {
+		 	content_type shadow
+		 }
+      } 
+   } 
+
+
+
+}
+
Index: code/trunk/Tutorial/Media/materials/scripts/Ogre.material
===================================================================
--- code/trunk/Tutorial/Media/materials/scripts/Ogre.material	(revision 44)
+++ code/trunk/Tutorial/Media/materials/scripts/Ogre.material	(revision 44)
@@ -0,0 +1,119 @@
+
+material Ogre/Earring
+{
+	technique
+	{
+		pass
+		{
+			ambient 0.5 0.5 0
+			diffuse 1 1 0
+
+			texture_unit
+			{
+				texture spheremap.png
+				colour_op_ex add src_texture src_current
+				colour_op_multipass_fallback one one
+				env_map spherical
+			}
+		}
+	}
+}
+material Ogre/Skin
+{
+	technique
+	{
+		pass
+		{
+			ambient 0.7 0.7 0.7
+			cull_hardware none
+
+			texture_unit
+			{
+				texture GreenSkin.jpg
+				tex_address_mode mirror
+			}
+		}
+	}
+}
+material Ogre/Tusks
+{
+	technique
+	{
+		pass
+		{
+			ambient 0.5 0.5 0.4
+			diffuse 1 1 0.8
+
+			texture_unit
+			{
+				texture dirt01.jpg
+				colour_op_ex add src_texture src_current
+				colour_op_multipass_fallback one one
+			}
+		}
+	}
+}
+material Ogre/Eyes
+{
+	technique
+	{
+		pass
+		{
+
+			texture_unit
+			{
+				texture WeirdEye.png
+			}
+		}
+	}
+}
+material Cursor/default
+{
+	technique
+	{
+		pass
+		{
+			scene_blend alpha_blend
+
+			texture_unit
+			{
+				texture cursor.png
+				tex_address_mode clamp
+			}
+		}
+	}
+}
+material Core/StatsBlockBorder/Down
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			scene_blend alpha_blend
+			depth_check off
+
+			texture_unit
+			{
+				texture ogreborder.png
+			}
+		}
+	}
+}
+material Core/StatsBlockBorder/Up
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			scene_blend alpha_blend
+			depth_check off
+
+			texture_unit
+			{
+				texture ogreborderUp.png
+			}
+		}
+	}
+}
Index: code/trunk/Tutorial/Media/materials/scripts/OldMovie.material
===================================================================
--- code/trunk/Tutorial/Media/materials/scripts/OldMovie.material	(revision 44)
+++ code/trunk/Tutorial/Media/materials/scripts/OldMovie.material	(revision 44)
@@ -0,0 +1,67 @@
+fragment_program Ogre/Compositor/OldMovieFP cg
+{
+	source OldMovieFP.cg
+	entry_point OldMovie_ps
+	profiles ps_2_0 arbfp1
+}
+
+material Ogre/Compositor/OldMovie
+{
+    technique
+    {
+
+		pass
+		{
+			cull_hardware none
+			cull_software none
+			depth_func always_pass
+
+			vertex_program_ref Ogre/Compositor/StdQuad_Tex2a_vp
+			{
+			}
+
+			fragment_program_ref Ogre/Compositor/OldMovieFP
+			{
+				param_named_auto time_cycle_period time 20
+				param_named flicker float 0.4
+				param_named DirtFrequency float 0.0005
+				param_named luminance float3 0.30 0.59 0.11
+				param_named frameJitter float 0.004
+				param_named lumiShift float 0.03
+			}
+
+			texture_unit RT
+			{
+                tex_coord_set 0
+				tex_address_mode clamp
+				filtering trilinear
+			}
+
+			texture_unit SplotchesTx
+			{
+				texture 8x8PagesSplotches2.png 2d
+                tex_coord_set 1
+				tex_address_mode wrap
+				filtering trilinear
+			}
+
+			texture_unit
+			{
+				texture 1D_Noise.png 1d
+                tex_coord_set 2
+				tex_address_mode wrap
+				filtering point point none
+			}
+
+
+			texture_unit SepiaTx
+			{
+				texture Sepia1D.tga 1d
+                tex_coord_set 3
+				tex_address_mode mirror
+				filtering point point none
+			}
+
+		}
+	}
+}
Index: code/trunk/Tutorial/Media/materials/scripts/OldTV.material
===================================================================
--- code/trunk/Tutorial/Media/materials/scripts/OldTV.material	(revision 44)
+++ code/trunk/Tutorial/Media/materials/scripts/OldTV.material	(revision 44)
@@ -0,0 +1,59 @@
+fragment_program Ogre/Compositor/OldTV_FP cg
+{
+	source OldTV.cg
+	entry_point OldTV_ps
+	profiles ps_2_0 arbfp1
+}
+
+material Ogre/Compositor/OldTV
+{
+	technique
+	{
+
+		pass
+		{
+			depth_check off
+
+			vertex_program_ref Ogre/Compositor/StdQuad_Tex2a_vp
+			{
+			}
+
+			fragment_program_ref Ogre/Compositor/OldTV_FP
+			{
+                param_named_auto time_0_X time_0_x 120
+                param_named_auto sin_time_0_X sintime_0_x 120
+
+                param_named distortionFreq float 2.7
+                param_named distortionScale float 2.5
+                param_named distortionRoll float 0.93
+                param_named interference float 0.5
+                param_named frameLimit float 0.40
+                param_named frameShape float 0.26
+                param_named frameSharpness float 6.0
+			}
+
+			texture_unit 0
+			{
+                tex_coord_set 0
+				tex_address_mode clamp
+				filtering linear linear linear
+			}
+
+			texture_unit 1
+			{
+				texture Random3D.dds 3d
+                tex_coord_set 1
+				tex_address_mode wrap
+				filtering linear linear linear
+			}
+
+			texture_unit 2
+			{
+				texture NoiseVolume.dds 3d
+                tex_coord_set 2
+				tex_address_mode wrap
+				filtering linear linear linear
+			}
+		}
+	}
+}
Index: code/trunk/Tutorial/Media/materials/scripts/Posterize.material
===================================================================
--- code/trunk/Tutorial/Media/materials/scripts/Posterize.material	(revision 44)
+++ code/trunk/Tutorial/Media/materials/scripts/Posterize.material	(revision 44)
@@ -0,0 +1,36 @@
+fragment_program Ogre/Compositor/PosterizeFP cg
+{
+	source PosterizeFP.cg
+	entry_point Posterize_ps
+	profiles ps_2_0 arbfp1
+}
+
+material Ogre/Compositor/Posterize
+{
+    technique
+    {
+
+		pass
+		{
+			cull_hardware none
+			cull_software none
+			depth_func always_pass
+
+			vertex_program_ref Ogre/Compositor/StdQuad_Tex2a_vp
+			{
+			}
+
+			fragment_program_ref Ogre/Compositor/PosterizeFP
+			{
+			}
+
+			texture_unit RT
+			{
+                tex_coord_set 0
+				tex_address_mode clamp
+				filtering trilinear
+			}
+
+		}
+	}
+}
Index: code/trunk/Tutorial/Media/materials/scripts/RZR-002.material
===================================================================
--- code/trunk/Tutorial/Media/materials/scripts/RZR-002.material	(revision 44)
+++ code/trunk/Tutorial/Media/materials/scripts/RZR-002.material	(revision 44)
@@ -0,0 +1,15 @@
+
+material RZR-002
+{
+	technique
+	{
+		pass
+		{
+
+			texture_unit
+			{
+				texture RZR-002.png
+			}
+		}
+	}
+}
Index: code/trunk/Tutorial/Media/materials/scripts/SharpenEdges.material
===================================================================
--- code/trunk/Tutorial/Media/materials/scripts/SharpenEdges.material	(revision 44)
+++ code/trunk/Tutorial/Media/materials/scripts/SharpenEdges.material	(revision 44)
@@ -0,0 +1,60 @@
+fragment_program Ogre/Compositor/SharpenEdgesFP_cg cg
+{
+	source SharpenEdgesFP.cg
+    entry_point sharpenEdges_fp
+	profiles ps_2_0 arbfp1
+}
+
+fragment_program Ogre/Compositor/SharpenEdgesFP_ps_2_a hlsl
+{
+	source SharpenEdgesFP.cg
+    entry_point sharpenEdges_fp
+	target ps_2_a
+}
+
+fragment_program Ogre/Compositor/SharpenEdgesFP unified
+{
+	delegate Ogre/Compositor/SharpenEdgesFP_ps_2_a
+	delegate Ogre/Compositor/SharpenEdgesFP_cg
+
+	default_params
+	{
+		param_named_auto vTexelSize inverse_texture_size 0
+	}
+}
+
+material Ogre/Compositor/SharpenEdges
+{
+    technique
+    {
+
+		pass
+		{
+			cull_hardware none
+			cull_software none
+			depth_func always_pass
+
+			//DirectX 9.0 HLSL Vertex Shader vs_1_1
+			//vertex_program_ref PostFilters/SharpenEdgesVP
+			//{
+			//}
+
+			vertex_program_ref Ogre/Compositor/StdQuad_Tex2a_vp
+			{
+			}
+
+			//DirectX 9.0 HLSL Pixel Shader ps_2_0
+			fragment_program_ref Ogre/Compositor/SharpenEdgesFP
+			{
+			}
+
+			texture_unit
+			{
+                tex_coord_set 0
+				tex_address_mode clamp
+				filtering trilinear
+			}
+
+		}
+	}
+}
Index: code/trunk/Tutorial/Media/materials/scripts/StdQuad_vp.program
===================================================================
--- code/trunk/Tutorial/Media/materials/scripts/StdQuad_vp.program	(revision 44)
+++ code/trunk/Tutorial/Media/materials/scripts/StdQuad_vp.program	(revision 44)
@@ -0,0 +1,71 @@
+vertex_program Ogre/Compositor/StdQuad_Cg_vp cg
+{
+	source StdQuad_vp.cg
+	entry_point StdQuad_vp
+	profiles vs_1_1 arbvp1
+
+	default_params
+	{
+		param_named_auto worldViewProj worldviewproj_matrix
+	}
+}
+
+vertex_program Ogre/Compositor/StdQuad_Tex2_vp cg
+{
+	source StdQuad_vp.cg
+	entry_point StdQuad_Tex2_vp
+	profiles vs_1_1 arbvp1
+
+	default_params
+	{
+		param_named_auto worldViewProj worldviewproj_matrix
+	}
+}
+
+vertex_program Ogre/Compositor/StdQuad_Tex2a_vp cg
+{
+	source StdQuad_vp.cg
+	entry_point StdQuad_Tex2a_vp
+	profiles vs_1_1 arbvp1
+
+	default_params
+	{
+		param_named_auto worldViewProj worldviewproj_matrix
+	}
+}
+
+vertex_program Ogre/Compositor/StdQuad_Tex3_vp cg
+{
+	source StdQuad_vp.cg
+	entry_point StdQuad_Tex3_vp
+	profiles vs_1_1 arbvp1
+
+	default_params
+	{
+		param_named_auto worldViewProj worldviewproj_matrix
+	}
+}
+
+vertex_program Ogre/Compositor/StdQuad_Tex4_vp cg
+{
+	source StdQuad_vp.cg
+	entry_point StdQuad_Tex4_vp
+	profiles vs_1_1 arbvp1
+
+	default_params
+	{
+		param_named_auto worldViewProj worldviewproj_matrix
+	}
+}
+
+vertex_program Ogre/Compositor/StdQuad_GLSL_vp glsl
+{
+	source StdQuad_vp.glsl
+}
+
+
+vertex_program Ogre/Compositor/StdQuad_vp unified
+{
+	delegate Ogre/Compositor/StdQuad_GLSL_vp
+	delegate Ogre/Compositor/StdQuad_Cg_vp
+}
Index: code/trunk/Tutorial/Media/materials/scripts/Tiling.material
===================================================================
--- code/trunk/Tutorial/Media/materials/scripts/Tiling.material	(revision 44)
+++ code/trunk/Tutorial/Media/materials/scripts/Tiling.material	(revision 44)
@@ -0,0 +1,39 @@
+fragment_program Ogre/Compositor/TilingFP cg
+{
+	source TilingFP.cg
+	entry_point Tiling_ps
+	profiles ps_2_0 arbfp1
+}
+
+material Ogre/Compositor/Tiling
+{
+    technique
+    {
+
+		pass
+		{
+			cull_hardware none
+			cull_software none
+			depth_func always_pass
+
+			vertex_program_ref Ogre/Compositor/StdQuad_Tex2a_vp
+			{
+			}
+
+			//DirectX 9.0 HLSL Pixel Shader ps_2_0
+			fragment_program_ref Ogre/Compositor/TilingFP
+			{
+				param_named NumTiles float 75.0
+				param_named Threshhold float 0.15
+			}
+
+			texture_unit RT
+			{
+                tex_coord_set 0
+				tex_address_mode clamp
+				filtering trilinear
+			}
+
+		}
+	}
+}
Index: code/trunk/Tutorial/Media/materials/scripts/VarianceShadowmap.material
===================================================================
--- code/trunk/Tutorial/Media/materials/scripts/VarianceShadowmap.material	(revision 44)
+++ code/trunk/Tutorial/Media/materials/scripts/VarianceShadowmap.material	(revision 44)
@@ -0,0 +1,103 @@
+
+// Shadow Caster __________________________________________________
+
+
+vertex_program VarianceShadowMapping/ShadowCasterVP cg
+{
+    source varianceshadowcastervp.cg
+    entry_point main
+    profiles arbvp1 vs_2_x
+
+    default_params
+    {
+        param_named_auto uModelViewProjection worldviewproj_matrix
+    }
+}
+
+fragment_program VarianceShadowMapping/ShadowCasterFP cg
+{
+    source varianceshadowcasterfp.cg
+    entry_point main
+    profiles arbfp1 ps_2_x
+
+    default_params
+    {
+        param_named      uDepthOffset float       1.0
+        param_named_auto uProjection              projection_matrix
+    }
+}
+
+material VarianceShadowMapping/ShadowCaster
+{
+    technique default
+    {
+        // Z-write only pass
+        pass Z-write
+        {
+            //Instead of using depth_bias, we'll be implementing it manually
+
+            vertex_program_ref VarianceShadowMapping/ShadowCasterVP
+            {
+            }
+            fragment_program_ref VarianceShadowMapping/ShadowCasterFP
+            {
+            }
+        }
+    }
+}
+
+
+
+// Shadow Receiver ________________________________________________
+
+vertex_program VarianceShadowMapping/ShadowReceiverVP cg
+{
+    source varianceshadowreceivervp.cg
+    entry_point main
+    profiles arbvp1 vs_2_x
+
+    default_params
+    {
+        param_named_auto uModelViewProjection   worldviewproj_matrix
+        param_named_auto uLightPosition         light_position_object_space 0
+        param_named_auto uModel                 world_matrix
+        param_named_auto uTextureViewProjection texture_viewproj_matrix
+    }
+}
+
+fragment_program VarianceShadowMapping/ShadowReceiverFP cg
+{
+    source varianceshadowreceiverfp.cg
+    entry_point main
+    profiles arbfp1 ps_2_x
+
+    default_params
+    {
+        param_named uSTexWidth  float 512.0
+        param_named uSTexHeight float 512.0
+    }
+}
+
+material VarianceShadowMapping/ShadowReceiver
+{
+    technique default
+    {
+        pass lighting
+        {
+            vertex_program_ref VarianceShadowMapping/ShadowReceiverVP
+            {
+            }
+
+            fragment_program_ref VarianceShadowMapping/ShadowReceiverFP
+            {
+            }
+
+            // we won't rely on hardware specific filtering of z-tests
+            texture_unit ShadowMap
+            {
+                tex_address_mode clamp
+                filtering none
+            }
+        }
+    }
+}
Index: code/trunk/Tutorial/Media/materials/scripts/facial.material
===================================================================
--- code/trunk/Tutorial/Media/materials/scripts/facial.material	(revision 44)
+++ code/trunk/Tutorial/Media/materials/scripts/facial.material	(revision 44)
@@ -0,0 +1,85 @@
+
+material drbunsen_head
+{
+	technique
+	{
+		pass
+		{
+			ambient 0.25 0.25 0.25
+			diffuse 1.0 1.0 1.0
+
+			texture_unit
+			{
+				texture Dr_Bunsen_Head.jpg
+			}
+		}
+	}
+}
+
+material drbunsen_teeth
+{
+	technique
+	{
+		pass
+		{
+			ambient 0.25 0.25 0.25
+			diffuse 1.0 1.0 1.0
+
+		}
+	}
+}
+
+material drbunsen_tongue
+{
+	technique
+	{
+		pass
+		{
+			ambient 0.25 0.25 0.25
+			diffuse 1.0 0.1 0.1
+
+		}
+	}
+}
+
+material drbunsen_gums
+{
+	technique
+	{
+		pass
+		{
+			ambient 0.25 0.25 0.25
+			diffuse 1.0 0.1 0.1
+
+		}
+	}
+}
+
+material drbunsen_glasses
+{
+	technique
+	{
+		pass
+		{
+			depth_write off
+			scene_blend modulate
+			ambient 0.25 0.25 0.25
+			diffuse 0.75 0.75 0.75
+
+		}
+	}
+}
+
+material drbunsen_glasses_frame
+{
+	technique
+	{
+		pass
+		{
+			ambient 0.25 0.25 0.25
+			diffuse 0.35 0.18 0 1
+
+		}
+	}
+}
+
Index: code/trunk/Tutorial/Media/materials/scripts/hdr.material
===================================================================
--- code/trunk/Tutorial/Media/materials/scripts/hdr.material	(revision 44)
+++ code/trunk/Tutorial/Media/materials/scripts/hdr.material	(revision 44)
@@ -0,0 +1,286 @@
+// Downsample a 2x2 area & turn into luminence (unclamped)
+fragment_program Ogre/Compositor/HDR/downscale2x2LuminenceHLSL_fp hlsl
+{
+	source hdr.hlsl
+	entry_point downscale2x2Luminence
+	target ps_2_0
+}
+fragment_program Ogre/Compositor/HDR/downscale2x2LuminenceGLSL_fp glsl
+{
+	source hdr_downscale2x2luminence.glsl
+	default_params
+	{
+		param_named inRTT int 0
+	}
+}
+fragment_program Ogre/Compositor/HDR/downscale2x2Luminence_fp unified
+{
+	delegate Ogre/Compositor/HDR/downscale2x2LuminenceGLSL_fp
+	delegate Ogre/Compositor/HDR/downscale2x2LuminenceHLSL_fp
+	default_params
+	{
+	    param_named_auto texelSize inverse_texture_size 0
+	}
+}
+
+material Ogre/Compositor/HDR/Downsample2x2Luminence
+{
+	technique
+	{
+		pass
+		{
+			cull_hardware none
+			cull_software none
+			depth_check off
+
+			vertex_program_ref Ogre/Compositor/StdQuad_vp
+			{
+			}
+			fragment_program_ref Ogre/Compositor/HDR/downscale2x2Luminence_fp
+			{
+			}
+
+			texture_unit
+			{
+                tex_coord_set 0
+				tex_address_mode clamp
+				filtering none 
+			}
+		}
+	}
+}
+
+// Downsample a 3x3 area
+fragment_program Ogre/Compositor/HDR/downscale3x3HLSL_fp hlsl
+{
+	source hdr.hlsl
+	entry_point downscale3x3
+	target ps_2_0
+}
+fragment_program Ogre/Compositor/HDR/downscale3x3GLSL_fp glsl
+{
+	source hdr_downscale3x3.glsl
+	default_params
+	{
+		param_named inRTT int 0
+	}
+}
+fragment_program Ogre/Compositor/HDR/downscale3x3_fp unified
+{
+	delegate Ogre/Compositor/HDR/downscale3x3GLSL_fp
+	delegate Ogre/Compositor/HDR/downscale3x3HLSL_fp
+	default_params
+	{
+	    param_named_auto texelSize inverse_texture_size 0
+	}
+}
+
+
+material Ogre/Compositor/HDR/Downsample3x3
+{
+	technique
+	{
+		pass
+		{
+			cull_hardware none
+			cull_software none
+			depth_check off
+
+			vertex_program_ref Ogre/Compositor/StdQuad_vp
+			{
+			}
+			fragment_program_ref Ogre/Compositor/HDR/downscale3x3_fp
+			{
+			}
+
+			texture_unit
+			{
+                tex_coord_set 0
+				tex_address_mode clamp
+				filtering none 
+			}
+		}
+	}
+}
+
+// Downsample a 3x3 area and perform a brightness filter pass
+fragment_program Ogre/Compositor/HDR/downscale3x3brightpassHLSL_fp hlsl
+{
+	source hdr.hlsl
+	entry_point downscale3x3brightpass
+	target ps_2_0
+}
+fragment_program Ogre/Compositor/HDR/utils_fp glsl
+{
+	source hdr_tonemap_util.glsl
+}
+fragment_program Ogre/Compositor/HDR/downscale3x3brightpassGLSL_fp glsl
+{
+	source hdr_downscale3x3brightpass.glsl
+	// re-use common functions
+	attach Ogre/Compositor/HDR/utils_fp
+	default_params
+	{
+		param_named inRTT int 0
+		param_named inLum int 1
+	}
+}
+fragment_program Ogre/Compositor/HDR/downscale3x3brightpass_fp unified
+{
+	delegate Ogre/Compositor/HDR/downscale3x3brightpassGLSL_fp
+	delegate Ogre/Compositor/HDR/downscale3x3brightpassHLSL_fp
+	default_params
+	{
+	    param_named_auto texelSize inverse_texture_size 0
+	}
+}
+
+
+material Ogre/Compositor/HDR/Downsample3x3Brightpass
+{
+	technique
+	{
+		pass
+		{
+			cull_hardware none
+			cull_software none
+			depth_check off
+
+			vertex_program_ref Ogre/Compositor/StdQuad_vp
+			{
+			}
+			fragment_program_ref Ogre/Compositor/HDR/downscale3x3brightpass_fp
+			{
+			}
+
+			// Scene 
+			texture_unit
+			{
+                tex_coord_set 0
+				tex_address_mode clamp
+				filtering none 
+			}
+			// Luminence 
+			texture_unit
+			{
+				tex_address_mode clamp
+				filtering none 
+			}
+		}
+	}
+}
+
+// Bloom an area using gaussian distribution
+fragment_program Ogre/Compositor/HDR/bloomHLSL_fp hlsl
+{
+	source hdr.hlsl
+	entry_point bloom
+	target ps_2_0
+}
+fragment_program Ogre/Compositor/HDR/bloomGLSL_fp glsl
+{
+	source hdr_bloom.glsl
+	default_params
+	{
+		param_named inRTT int 0
+	}
+}
+fragment_program Ogre/Compositor/HDR/bloom_fp unified
+{
+	delegate Ogre/Compositor/HDR/bloomGLSL_fp
+	delegate Ogre/Compositor/HDR/bloomHLSL_fp
+}
+
+
+material Ogre/Compositor/HDR/GaussianBloom
+{
+	technique
+	{
+		pass
+		{
+			cull_hardware none
+			cull_software none
+			depth_check off
+
+			vertex_program_ref Ogre/Compositor/StdQuad_vp
+			{
+			}
+			fragment_program_ref Ogre/Compositor/HDR/bloom_fp
+			{
+			}
+
+			// Input 
+			texture_unit
+			{
+                tex_coord_set 0
+				tex_address_mode clamp
+				filtering none 
+			}
+		}
+	}
+}
+
+
+// Perform final tone mapping
+fragment_program Ogre/Compositor/HDR/finaltonemappingHLSL_fp hlsl
+{
+	source hdr.hlsl
+	entry_point finalToneMapping
+	target ps_2_0
+}
+fragment_program Ogre/Compositor/HDR/finaltonemappingGLSL_fp glsl
+{
+	source hdr_finalToneMapping.glsl
+	// re-use common functions
+	attach Ogre/Compositor/HDR/utils_fp
+	default_params
+	{
+		param_named inRTT int 0
+		param_named inBloom int 1
+		param_named inLum int 2
+	}
+}
+fragment_program Ogre/Compositor/HDR/finaltonemapping_fp unified
+{
+	delegate Ogre/Compositor/HDR/finaltonemappingHLSL_fp
+	delegate Ogre/Compositor/HDR/finaltonemappingGLSL_fp
+}
+
+material Ogre/Compositor/HDR/ToneMapping
+{
+	technique
+	{
+		pass
+		{
+			cull_hardware none
+			cull_software none
+			depth_check off
+
+			vertex_program_ref Ogre/Compositor/StdQuad_vp
+			{
+			}
+			fragment_program_ref Ogre/Compositor/HDR/finaltonemapping_fp
+			{
+			}
+
+			// Scene 
+			texture_unit
+			{
+                tex_coord_set 0
+				tex_address_mode clamp
+			}
+			// Bloom
+			texture_unit
+			{
+				tex_address_mode clamp
+			}
+			// Luminence 
+			texture_unit
+			{
+				tex_address_mode clamp
+			}
+		}
+	}
+}
+
+
Index: code/trunk/Tutorial/Media/materials/scripts/instancing.material
===================================================================
--- code/trunk/Tutorial/Media/materials/scripts/instancing.material	(revision 44)
+++ code/trunk/Tutorial/Media/materials/scripts/instancing.material	(revision 44)
@@ -0,0 +1,131 @@
+
+vertex_program InstancingCg cg
+{
+	source instancing.cg
+	profiles vs_2_0
+	entry_point instancing_vp
+
+	default_params
+	{
+		param_named_auto ambient ambient_light_colour
+		param_named_auto lightDiffuseColour light_diffuse_colour 0
+		param_named_auto lightPos light_position 0
+		param_named_auto viewProjectionMatrix viewproj_matrix
+		param_named_auto worldMatrix3x4Array world_matrix_array_3x4
+	}
+}
+vertex_program InstancingShadowCasterCg cg
+{
+   	source instancing.cg
+	profiles vs_2_0
+	entry_point instancingCaster_vp
+	default_params
+	{
+		param_named_auto ambient ambient_light_colour
+		param_named_auto viewProjectionMatrix viewproj_matrix
+		param_named_auto worldMatrix3x4Array world_matrix_array_3x4
+	}
+}
+vertex_program CrowdCg cg
+{
+	source instancing.cg
+	profiles vs_2_0
+	entry_point crowd_vp
+	default_params
+	{
+		param_named_auto viewProjectionMatrix viewproj_matrix
+		param_named_auto numBones custom 0
+		param_named_auto worldMatrix3x4Array world_matrix_array_3x4
+		param_named_auto lightPos light_position 0
+		param_named_auto lightDiffuseColour light_diffuse_colour 0
+		param_named_auto ambient ambient_light_colour
+	}
+}
+vertex_program CrowdShadowCasterCg cg
+{
+	source instancing.cg
+	profiles vs_2_0
+	entry_point crowdCaster_vp
+	default_params
+	{
+		param_named_auto viewProjectionMatrix viewproj_matrix
+		param_named_auto numBones custom 0
+		param_named_auto worldMatrix3x4Array world_matrix_array_3x4
+		param_named_auto ambient ambient_light_colour
+	}
+}
+
+
+vertex_program InstancingGLSL glsl
+{
+	source instancingVp.glsl
+	preprocessor_defines SHADOW_CASTER=0
+	default_params
+	{
+		param_named_auto ambient ambient_light_colour
+		param_named_auto lightDiffuseColour light_diffuse_colour 0
+		param_named_auto lightPos light_position 0
+		param_named_auto viewProjectionMatrix viewproj_matrix
+		param_named_auto worldMatrix3x4Array world_matrix_array_3x4
+	}
+}
+vertex_program InstancingShadowCasterGLSL glsl
+{
+   	source instancingVp.glsl
+	preprocessor_defines SHADOW_CASTER=1
+	default_params
+	{
+		param_named_auto ambient ambient_light_colour
+		param_named_auto viewProjectionMatrix viewproj_matrix
+		param_named_auto worldMatrix3x4Array world_matrix_array_3x4
+	}
+}
+vertex_program CrowdGLSL glsl
+{
+	source crowdVp.glsl
+	preprocessor_defines SHADOW_CASTER=0
+	default_params
+	{
+		param_named_auto viewProjectionMatrix viewproj_matrix
+		param_named_auto numBones custom 0
+		param_named_auto worldMatrix3x4Array world_matrix_array_3x4
+		param_named_auto lightPos light_position 0
+		param_named_auto lightDiffuseColour light_diffuse_colour 0
+		param_named_auto ambient ambient_light_colour
+	}
+}
+vertex_program CrowdShadowCasterGLSL glsl
+{
+	source crowdVp.glsl
+	preprocessor_defines SHADOW_CASTER=1
+	default_params
+	{
+		param_named_auto viewProjectionMatrix viewproj_matrix
+		param_named_auto numBones custom 0
+		param_named_auto worldMatrix3x4Array world_matrix_array_3x4
+		param_named_auto ambient ambient_light_colour
+	}
+}
+
+
+vertex_program Instancing unified
+{
+	delegate InstancingGLSL
+	delegate InstancingCg
+}
+vertex_program InstancingShadowCaster unified
+{
+	delegate InstancingShadowCasterGLSL
+	delegate InstancingShadowCasterCg
+}
+vertex_program Crowd unified
+{
+	delegate CrowdGLSL
+	delegate CrowdCg
+}
+vertex_program CrowdShadowCaster unified
+{
+	delegate CrowdShadowCasterGLSL
+	delegate CrowdShadowCasterCg
+}
+
Index: code/trunk/Tutorial/Media/materials/scripts/smoke.material
===================================================================
--- code/trunk/Tutorial/Media/materials/scripts/smoke.material	(revision 44)
+++ code/trunk/Tutorial/Media/materials/scripts/smoke.material	(revision 44)
@@ -0,0 +1,19 @@
+
+material Examples/Smoke
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			scene_blend alpha_blend
+			depth_write off
+
+			texture_unit
+			{
+				texture smoke.png
+				tex_address_mode clamp
+			}
+		}
+	}
+}
Index: code/trunk/Tutorial/Media/overlays/BasicOgreGuiTemplates.inc
===================================================================
--- code/trunk/Tutorial/Media/overlays/BasicOgreGuiTemplates.inc	(revision 44)
+++ code/trunk/Tutorial/Media/overlays/BasicOgreGuiTemplates.inc	(revision 44)
@@ -0,0 +1,47 @@
+// Ogre overlay scripts
+template container BorderPanel(SS/Templates/BasicBorderPanel)
+{
+	left 0
+	top 0
+	width 1
+	height 1
+	material Core/StatsBlockCenter
+    	border_size 0.06 0.06 0.06665 0.06665
+    	border_material Core/StatsBlockBorder
+    	border_topleft_uv     0.0000 0.0000 0.1914 0.2031
+	border_top_uv         0.1914 0.0000 0.8086 0.2031
+	border_topright_uv    0.8086 0.0000 1.0000 0.2031
+	border_left_uv        0.0000 0.2031 0.1914 0.7852
+	border_right_uv       0.8086 0.2031 1.0000 0.7852
+	border_bottomleft_uv  0.0000 0.7852 0.1914 1.0000
+        border_bottom_uv      0.1914 0.7852 0.8086 1.0000
+	border_bottomright_uv 0.8086 0.7852 1.0000 1.0000
+}
+
+template container BorderPanel(SS/Templates/BasicSmallBorderPanel) : SS/Templates/BasicBorderPanel
+{
+    border_size 0.04 0.04 0.04665 0.04665
+}
+
+
+template element TextArea(SS/Templates/BasicText)
+{
+	font_name Ogre
+	char_height 0.08
+	colour_top 1 1 0
+	colour_bottom 1 0.2 0.2
+	left 0.03
+	top 0.02
+	width 0.12
+	height 0.09
+}
+
+template container Panel(SS/Templates/BasicPanel)
+{
+	left 0 
+	top 0
+	width 1
+	height 1
+	material Core/StatsBlockCenter
+}
+
Index: code/trunk/Tutorial/Media/overlays/Compositor.overlay
===================================================================
--- code/trunk/Tutorial/Media/overlays/Compositor.overlay	(revision 44)
+++ code/trunk/Tutorial/Media/overlays/Compositor.overlay	(revision 44)
@@ -0,0 +1,66 @@
+Example/CompositorOverlay
+{
+	zorder 500
+	// Stats block
+	container BorderPanel(Core/CompositorPanel)
+	{
+		metrics_mode pixels
+		vert_align top
+		left 5 
+		top 5
+		width 500
+		height 55
+		material Core/StatsBlockCenter
+        	border_size 1 1 1 1
+        	border_material Core/StatsBlockBorder
+        	border_topleft_uv     0.0000 1.0000 0.0039 0.9961
+	    	border_top_uv         0.0039 1.0000 0.9961 0.9961
+	    	border_topright_uv    0.9961 1.0000 1.0000 0.9961
+	    	border_left_uv        0.0000 0.9961 0.0039 0.0039
+	    	border_right_uv       0.9961 0.9961 1.0000 0.0039
+	    	border_bottomleft_uv  0.0000 0.0039 0.0039 0.0000
+        	border_bottom_uv      0.0039 0.0039 0.9961 0.0000
+	    	border_bottomright_uv 0.9961 0.0039 1.0000 0.0000
+
+
+		element TextArea(Example/Compositor/Desc)
+		{
+			metrics_mode pixels
+			left 5
+			top 5
+			width 180
+			height 30
+			font_name BlueHighway
+			char_height 16
+			caption Use keys 1-8 to toggle each compositor
+			colour_top 0.5 0.7 0.5
+			colour_bottom 0.3 0.5 0.3
+		}
+		element TextArea(Example/Compositor/ActiveLabel)
+		{
+			metrics_mode pixels
+			left 5
+			top 20
+			width 90
+			height 30
+			font_name BlueHighway
+			char_height 16
+			caption Active Compositors:
+			colour_top 0.5 0.7 0.5
+			colour_bottom 0.3 0.5 0.3
+		}
+		element TextArea(Example/Compositor/ActiveText)
+		{
+			metrics_mode pixels
+			left 155
+			top 20
+			width 90
+			height 30
+			font_name BlueHighway
+			char_height 16
+			caption Current:
+			colour_top 0.5 0.7 0.5
+			colour_bottom 0.3 0.5 0.3
+		}
+	}
+}
Index: code/trunk/Tutorial/Media/overlays/DP3.overlay
===================================================================
--- code/trunk/Tutorial/Media/overlays/DP3.overlay	(revision 44)
+++ code/trunk/Tutorial/Media/overlays/DP3.overlay	(revision 44)
@@ -0,0 +1,105 @@
+Example/DP3Overlay
+{
+	zorder 500
+	// Stats block
+	container BorderPanel(Core/DP3Panel)
+	{
+		metrics_mode pixels
+		vert_align top
+		left 5 
+		top 5
+		width 500
+		height 70
+		material Core/StatsBlockCenter
+        	border_size 1 1 1 1
+        	border_material Core/StatsBlockBorder
+        	border_topleft_uv     0.0000 1.0000 0.0039 0.9961
+	    	border_top_uv         0.0039 1.0000 0.9961 0.9961
+	    	border_topright_uv    0.9961 1.0000 1.0000 0.9961
+	    	border_left_uv        0.0000 0.9961 0.0039 0.0039
+	    	border_right_uv       0.9961 0.9961 1.0000 0.0039
+	    	border_bottomleft_uv  0.0000 0.0039 0.0039 0.0000
+        	border_bottom_uv      0.0039 0.0039 0.9961 0.0000
+	    	border_bottomright_uv 0.9961 0.0039 1.0000 0.0000
+
+		element TextArea(Example/DP3/Light)
+		{
+			metrics_mode pixels
+			left 5
+			top 5
+			width 180
+			height 30
+			font_name BlueHighway
+			char_height 16
+			caption [1,2,3] toggle lights
+			colour_top 0.5 0.7 0.5
+			colour_bottom 0.3 0.5 0.3
+		}
+
+		element TextArea(Example/DP3/Object)
+		{
+			metrics_mode pixels
+			left 5
+			top 20
+			width 180
+			height 30
+			font_name BlueHighway
+			char_height 16
+			caption [O] change objects
+			colour_top 0.5 0.7 0.5
+			colour_bottom 0.3 0.5 0.3
+		}
+		element TextArea(Example/DP3/ObjectInfo)
+		{
+			metrics_mode pixels
+			left 155
+			top 20
+			width 90
+			height 30
+			font_name BlueHighway
+			char_height 16
+			caption Current:
+			colour_top 0.5 0.7 0.5
+			colour_bottom 0.3 0.5 0.3
+		}
+
+		element TextArea(Example/DP3/Materials)
+		{
+			metrics_mode pixels
+			left 5
+			top 35
+			width 90
+			height 30
+			font_name BlueHighway
+			char_height 16
+			caption [M] Change material
+			colour_top 0.5 0.7 0.5
+			colour_bottom 0.3 0.5 0.3
+		}
+		element TextArea(Example/DP3/MaterialInfo)
+		{
+			metrics_mode pixels
+			left 155
+			top 35
+			width 90
+			height 30
+			font_name BlueHighway
+			char_height 16
+			caption Current:
+			colour_top 0.5 0.7 0.5
+			colour_bottom 0.3 0.5 0.3
+		}
+		element TextArea(Example/DP3/Info)
+		{
+			metrics_mode pixels
+			left 5
+			top 50
+			width 250
+			height 30
+			font_name BlueHighway
+			char_height 16
+			colour_top 0.5 0.7 0.5
+			colour_bottom 0.3 0.5 0.3
+		}
+	}
+}
Index: code/trunk/Tutorial/Media/overlays/Example-CubeMapping.overlay
===================================================================
--- code/trunk/Tutorial/Media/overlays/Example-CubeMapping.overlay	(revision 44)
+++ code/trunk/Tutorial/Media/overlays/Example-CubeMapping.overlay	(revision 44)
@@ -0,0 +1,139 @@
+Example/CubeMappingOverlay
+{
+	zorder 500
+	// Stats block
+	container BorderPanel(Core/CubeMappingPanel)
+	{
+		metrics_mode pixels
+		vert_align top
+		left 5 
+		top 5
+		width 250
+		height 130
+		material Core/StatsBlockCenter
+        	border_size 1 1 1 1
+        	border_material Core/StatsBlockBorder
+        	border_topleft_uv     0.0000 1.0000 0.0039 0.9961
+	    	border_top_uv         0.0039 1.0000 0.9961 0.9961
+	    	border_topright_uv    0.9961 1.0000 1.0000 0.9961
+	    	border_left_uv        0.0000 0.9961 0.0039 0.0039
+	    	border_right_uv       0.9961 0.9961 1.0000 0.0039
+	    	border_bottomleft_uv  0.0000 0.0039 0.0039 0.0000
+        	border_bottom_uv      0.0039 0.0039 0.9961 0.0000
+	    	border_bottomright_uv 0.9961 0.0039 1.0000 0.0000
+
+		element TextArea(Example/CubeMapping/Displacement)
+		{
+			metrics_mode pixels
+			left 5
+			top 5
+			width 90
+			height 30
+			font_name BlueHighway
+			char_height 16
+			caption [1/2] Displacement:
+			colour_top 0.5 0.7 0.5
+			colour_bottom 0.3 0.5 0.3
+		}
+
+		element TextArea(Example/CubeMapping/Density)
+		{
+			metrics_mode pixels
+			left 5
+			top 20
+			width 90
+			height 30
+			font_name BlueHighway
+			char_height 16
+			caption [3/4] Noise density:
+			colour_top 0.5 0.7 0.5
+			colour_bottom 0.3 0.5 0.3
+		}
+
+		element TextArea(Example/CubeMapping/TimeDensity)
+		{
+			metrics_mode pixels
+			left 5
+			top 35
+			width 90
+			height 30
+			font_name BlueHighway
+			char_height 16
+			caption [5/6] Time density:
+			colour_top 0.5 0.7 0.5
+			colour_bottom 0.3 0.5 0.3
+		}
+
+
+		element TextArea(Example/CubeMapping/Noise)
+		{
+			metrics_mode pixels
+			left 5
+			top 50
+			width 90
+			height 30
+			font_name BlueHighway
+			char_height 16
+			caption [N] Noise: _not_set_
+			colour_top 0.5 0.7 0.5
+			colour_bottom 0.3 0.5 0.3
+		}
+
+		element TextArea(Example/CubeMapping/Material)
+		{
+			metrics_mode pixels
+			left 5
+			top 65
+			width 90
+			height 30
+			font_name BlueHighway
+			char_height 16
+			caption [M] Material: *UNIMPLEMENTED*
+			colour_top 0.5 0.7 0.5
+			colour_bottom 0.3 0.5 0.3
+		}
+
+		element TextArea(Example/CubeMapping/Object)
+		{
+			metrics_mode pixels
+			left 5
+			top 80
+			width 90
+			height 30
+			font_name BlueHighway
+			char_height 16
+			caption [O] Object:
+			colour_top 0.5 0.7 0.5
+			colour_bottom 0.3 0.5 0.3
+		}
+
+		element TextArea(Example/CubeMapping/CubeMap)
+		{
+			metrics_mode pixels
+			left 5
+			top 95
+			width 90
+			height 30
+			font_name BlueHighway
+			char_height 16
+			caption [C] CubeMap:
+			colour_top 0.5 0.7 0.5
+			colour_bottom 0.3 0.5 0.3
+		}
+		
+		element TextArea(Example/CubeMapping/Random)
+		{
+			metrics_mode pixels
+			left 5
+			top 110
+			width 90
+			height 30
+			font_name BlueHighway
+			char_height 16
+			caption [SPACE] Go random!
+			colour_top 0.5 0.7 0.5
+			colour_bottom 0.3 0.5 0.3
+		}
+
+	}
+}
Index: code/trunk/Tutorial/Media/overlays/Example-DynTex.overlay
===================================================================
--- code/trunk/Tutorial/Media/overlays/Example-DynTex.overlay	(revision 44)
+++ code/trunk/Tutorial/Media/overlays/Example-DynTex.overlay	(revision 44)
@@ -0,0 +1,194 @@
+Example/DynTexOverlay
+{
+	zorder 500
+	// Stats block
+	container BorderPanel(Core/DynTexPanel)
+	{
+		metrics_mode pixels
+		vert_align top
+		left 5 
+		top 5
+		width 200
+		height 100
+		material Core/StatsBlockCenter
+        	border_size 1 1 1 1
+        	border_material Core/StatsBlockBorder
+        	border_topleft_uv     0.0000 1.0000 0.0039 0.9961
+	    	border_top_uv         0.0039 1.0000 0.9961 0.9961
+	    	border_topright_uv    0.9961 1.0000 1.0000 0.9961
+	    	border_left_uv        0.0000 0.9961 0.0039 0.0039
+	    	border_right_uv       0.9961 0.9961 1.0000 0.0039
+	    	border_bottomleft_uv  0.0000 0.0039 0.0039 0.0000
+        	border_bottom_uv      0.0039 0.0039 0.9961 0.0000
+	    	border_bottomright_uv 0.9961 0.0039 1.0000 0.0000
+
+		element TextArea(Example/DynTex/Note)
+		{
+			metrics_mode pixels
+			left 5
+			top 5
+			width 90
+			height 30
+			font_name BlueHighway
+			char_height 16
+			caption Reaction parameters
+			colour_top 0.7 0.9 0.7
+			colour_bottom 0.5 0.7 0.5
+		}
+
+		element TextArea(Example/DynTex/Param_K)
+		{
+			metrics_mode pixels
+			left 5
+			top 20
+			width 90
+			height 30
+			font_name BlueHighway
+			char_height 16
+			caption [1/2]K:
+			colour_top 0.5 0.7 0.5
+			colour_bottom 0.3 0.5 0.3
+		}
+
+		element TextArea(Example/DynTex/Param_F)
+		{
+			metrics_mode pixels
+			left 5
+			top 35
+			width 90
+			height 30
+			font_name BlueHighway
+			char_height 16
+			caption [3/4]F:
+			colour_top 0.5 0.7 0.5
+			colour_bottom 0.3 0.5 0.3
+		}
+
+		element TextArea(Example/DynTex/Param_A0)
+		{
+			metrics_mode pixels
+			left 5
+			top 50
+			width 90
+			height 30
+			font_name BlueHighway
+			char_height 16
+			caption [5/6]Diffusion 1:
+			colour_top 0.5 0.7 0.5
+			colour_bottom 0.3 0.5 0.3
+		}
+
+		element TextArea(Example/DynTex/Param_A1)
+		{
+			metrics_mode pixels
+			left 5
+			top 65
+			width 90
+			height 30
+			font_name BlueHighway
+			char_height 16
+			caption [7/8]Diffusion 2:
+			colour_top 0.5 0.7 0.5
+			colour_bottom 0.3 0.5 0.3
+		}
+
+		element TextArea(Example/DynTex/Zero)
+		{
+			metrics_mode pixels
+			left 5
+			top 80
+			width 90
+			height 30
+			font_name BlueHighway
+			char_height 16
+			caption [0]Reset initial conditions
+			colour_top 0.5 0.7 0.5
+			colour_bottom 0.3 0.5 0.3
+		}
+
+
+	}
+}
+Example/VolTexOverlay
+{
+	zorder 500
+	// Stats block
+	container BorderPanel(Example/VolTexPanel)
+	{
+		metrics_mode pixels
+		vert_align top
+		left 5 
+		top 5
+		width 200
+		height 70
+		material Core/StatsBlockCenter
+        	border_size 1 1 1 1
+        	border_material Core/StatsBlockBorder
+        	border_topleft_uv     0.0000 1.0000 0.0039 0.9961
+	    	border_top_uv         0.0039 1.0000 0.9961 0.9961
+	    	border_topright_uv    0.9961 1.0000 1.0000 0.9961
+	    	border_left_uv        0.0000 0.9961 0.0039 0.0039
+	    	border_right_uv       0.9961 0.9961 1.0000 0.0039
+	    	border_bottomleft_uv  0.0000 0.0039 0.0039 0.0000
+        	border_bottom_uv      0.0039 0.0039 0.9961 0.0000
+	    	border_bottomright_uv 0.9961 0.0039 1.0000 0.0000
+
+		element TextArea(Example/VolTex/Note)
+		{
+			metrics_mode pixels
+			left 5
+			top 5
+			width 90
+			height 30
+			font_name BlueHighway
+			char_height 16
+			caption Julia parameters
+			colour_top 0.7 0.9 0.7
+			colour_bottom 0.5 0.7 0.5
+		}
+
+		element TextArea(Example/VolTex/Param_real)
+		{
+			metrics_mode pixels
+			left 5
+			top 20
+			width 90
+			height 30
+			font_name BlueHighway
+			char_height 16
+			caption [1/2]real:
+			colour_top 0.5 0.7 0.5
+			colour_bottom 0.3 0.5 0.3
+		}
+
+		element TextArea(Example/VolTex/Param_imag)
+		{
+			metrics_mode pixels
+			left 5
+			top 35
+			width 90
+			height 30
+			font_name BlueHighway
+			char_height 16
+			caption [3/4]imag:
+			colour_top 0.5 0.7 0.5
+			colour_bottom 0.3 0.5 0.3
+		}
+
+		element TextArea(Example/VolTex/Param_theta)
+		{
+			metrics_mode pixels
+			left 5
+			top 50
+			width 90
+			height 30
+			font_name BlueHighway
+			char_height 16
+			caption [5/6]theta:
+			colour_top 0.5 0.7 0.5
+			colour_bottom 0.3 0.5 0.3
+		}
+
+
+	}
+}
Index: code/trunk/Tutorial/Media/overlays/Example-Water.overlay
===================================================================
--- code/trunk/Tutorial/Media/overlays/Example-Water.overlay	(revision 44)
+++ code/trunk/Tutorial/Media/overlays/Example-Water.overlay	(revision 44)
@@ -0,0 +1,168 @@
+Example/WaterOverlay
+{
+	zorder 500
+	// Stats block
+	container BorderPanel(Core/WaterPanel)
+	{
+		metrics_mode pixels
+		vert_align top
+		left 5 
+		top 5
+		width 400
+		height 87
+		material Core/StatsBlockCenter
+        	border_size 1 1 1 1
+        	border_material Core/StatsBlockBorder
+        	border_topleft_uv     0.0000 1.0000 0.0039 0.9961
+	    	border_top_uv         0.0039 1.0000 0.9961 0.9961
+	    	border_topright_uv    0.9961 1.0000 1.0000 0.9961
+	    	border_left_uv        0.0000 0.9961 0.0039 0.0039
+	    	border_right_uv       0.9961 0.9961 1.0000 0.0039
+	    	border_bottomleft_uv  0.0000 0.0039 0.0039 0.0000
+        	border_bottom_uv      0.0039 0.0039 0.9961 0.0000
+	    	border_bottomright_uv 0.9961 0.0039 1.0000 0.0000
+
+		    
+		element TextArea(Example/Water/Normals)
+		{
+			metrics_mode pixels
+			left 5
+			top 5
+			width 90
+			height 30
+			font_name BlueHighway
+			char_height 16
+			caption [N]Normals:
+			colour_top 0.5 0.7 0.5
+			colour_bottom 0.3 0.5 0.3
+		}
+
+		element TextArea(Example/Water/Rain)
+		{
+			metrics_mode pixels
+			left 5
+			top 20
+			width 90
+			height 30
+			font_name BlueHighway
+			char_height 16
+			caption [SPACE]Rain
+			colour_top 0.5 0.7 0.5
+			colour_bottom 0.3 0.5 0.3
+		}
+
+		element TextArea(Example/Water/SkyBox)
+		{
+			metrics_mode pixels
+			left 5
+			top 35
+			width 90
+			height 30
+			font_name BlueHighway
+			char_height 16
+			caption [B]SkyBox: 
+			colour_top 0.5 0.7 0.5
+			colour_bottom 0.3 0.5 0.3
+		}
+
+		element TextArea(Example/Water/Depth)
+		{
+			metrics_mode pixels
+			left 5
+			top 50
+			width 90
+			height 30
+			font_name BlueHighway
+			char_height 16
+			caption [U/J]Head depth:
+			colour_top 0.5 0.7 0.5
+			colour_bottom 0.3 0.5 0.3
+		}
+
+		element TextArea(Example/Water/Material)
+		{
+			metrics_mode pixels
+			left 5
+			top 65
+			width 90
+			height 30
+			font_name BlueHighway
+			char_height 16
+			caption [M]Material:
+			colour_top 0.5 0.7 0.5
+			colour_bottom 0.3 0.5 0.3
+		}
+
+		element TextArea(Example/Water/Note)
+		{
+			metrics_mode pixels
+			left 200
+			top 5
+			width 90
+			height 30
+			font_name BlueHighway
+			char_height 16
+			caption Careful with these values!
+			colour_top 0.7 0.9 0.7
+			colour_bottom 0.5 0.7 0.5
+		}
+
+		element TextArea(Example/Water/Param_C)
+		{
+			metrics_mode pixels
+			left 200
+			top 20
+			width 90
+			height 30
+			font_name BlueHighway
+			char_height 16
+			caption [1/2]Ripple speed:
+			colour_top 0.5 0.7 0.5
+			colour_bottom 0.3 0.5 0.3
+		}
+
+		element TextArea(Example/Water/Param_D)
+		{
+			metrics_mode pixels
+			left 200
+			top 35
+			width 90
+			height 30
+			font_name BlueHighway
+			char_height 16
+			caption [3/4]Distance:
+			colour_top 0.5 0.7 0.5
+			colour_bottom 0.3 0.5 0.3
+		}
+
+		element TextArea(Example/Water/Param_U)
+		{
+			metrics_mode pixels
+			left 200
+			top 50
+			width 90
+			height 30
+			font_name BlueHighway
+			char_height 16
+			caption [5/6]Viscosity:
+			colour_top 0.5 0.7 0.5
+			colour_bottom 0.3 0.5 0.3
+		}
+
+		element TextArea(Example/Water/Param_T)
+		{
+			metrics_mode pixels
+			left 200
+			top 65
+			width 90
+			height 30
+			font_name BlueHighway
+			char_height 16
+			caption [7/8]Time period:
+			colour_top 0.5 0.7 0.5
+			colour_bottom 0.3 0.5 0.3
+		}
+
+
+	}
+}
Index: code/trunk/Tutorial/Media/overlays/Shadows.overlay
===================================================================
--- code/trunk/Tutorial/Media/overlays/Shadows.overlay	(revision 44)
+++ code/trunk/Tutorial/Media/overlays/Shadows.overlay	(revision 44)
@@ -0,0 +1,92 @@
+Example/ShadowsOverlay
+{
+	zorder 500
+	// Stats block
+	container BorderPanel(Core/ShadowsPanel)
+	{
+		metrics_mode pixels
+		vert_align top
+		left 5 
+		top 5
+		width 500
+		height 55
+		material Core/StatsBlockCenter
+        	border_size 1 1 1 1
+        	border_material Core/StatsBlockBorder
+        	border_topleft_uv     0.0000 1.0000 0.0039 0.9961
+	    	border_top_uv         0.0039 1.0000 0.9961 0.9961
+	    	border_topright_uv    0.9961 1.0000 1.0000 0.9961
+	    	border_left_uv        0.0000 0.9961 0.0039 0.0039
+	    	border_right_uv       0.9961 0.9961 1.0000 0.0039
+	    	border_bottomleft_uv  0.0000 0.0039 0.0039 0.0000
+        	border_bottom_uv      0.0039 0.0039 0.9961 0.0000
+	    	border_bottomright_uv 0.9961 0.0039 1.0000 0.0000
+
+
+		element TextArea(Example/Shadows/ShadowTechnique)
+		{
+			metrics_mode pixels
+			left 5
+			top 5
+			width 180
+			height 30
+			font_name BlueHighway
+			char_height 16
+			caption [O] Shadow Technique
+			colour_top 0.5 0.7 0.5
+			colour_bottom 0.3 0.5 0.3
+		}
+		element TextArea(Example/Shadows/ShadowTechniqueInfo)
+		{
+			metrics_mode pixels
+			left 155
+			top 5
+			width 90
+			height 30
+			font_name BlueHighway
+			char_height 16
+			caption Current:
+			colour_top 0.5 0.7 0.5
+			colour_bottom 0.3 0.5 0.3
+		}
+
+		element TextArea(Example/Shadows/Materials)
+		{
+			metrics_mode pixels
+			left 5
+			top 20
+			width 90
+			height 30
+			font_name BlueHighway
+			char_height 16
+			caption [M] Athene Material
+			colour_top 0.5 0.7 0.5
+			colour_bottom 0.3 0.5 0.3
+		}
+		element TextArea(Example/Shadows/MaterialInfo)
+		{
+			metrics_mode pixels
+			left 155
+			top 20
+			width 90
+			height 30
+			font_name BlueHighway
+			char_height 16
+			caption Current:
+			colour_top 0.5 0.7 0.5
+			colour_bottom 0.3 0.5 0.3
+		}
+		element TextArea(Example/Shadows/Info)
+		{
+			metrics_mode pixels
+			left 5
+			top 35
+			width 250
+			height 30
+			font_name BlueHighway
+			char_height 16
+			colour_top 0.5 0.7 0.5
+			colour_bottom 0.3 0.5 0.3
+		}
+	}
+}
Index: code/trunk/Tutorial/Media/particle/Example-Water.particle
===================================================================
--- code/trunk/Tutorial/Media/particle/Example-Water.particle	(revision 44)
+++ code/trunk/Tutorial/Media/particle/Example-Water.particle	(revision 44)
@@ -0,0 +1,35 @@
+Examples/Water/Rain
+{
+    material        Examples/Droplet
+    particle_width  100
+    particle_height 300
+    cull_each       true
+    quota           100
+    // Make common direction straight down (faster than self oriented)
+    billboard_type  oriented_common
+    common_direction 0 -1 0
+    
+    // Area emitter
+    emitter Box
+    {
+        angle           0
+        emission_rate   20
+        time_to_live    5
+        direction       0 -1 0
+        velocity    	1000
+        colour_range_start  0.3 1 0.3
+        colour_range_end    0.7 1 0.7
+        width           3000
+        height          3000
+        depth           0
+    }
+
+    // Gravity
+    affector LinearForce
+    {
+        force_vector      0 -1000 0
+        force_application add
+    }
+
+}
+
Index: code/trunk/Tutorial/Media/particle/Example.particle
===================================================================
--- code/trunk/Tutorial/Media/particle/Example.particle	(revision 44)
+++ code/trunk/Tutorial/Media/particle/Example.particle	(revision 44)
@@ -0,0 +1,395 @@
+// Example particle systems
+
+// Exudes greeny particles which float upwards
+Examples/GreenyNimbus
+{
+    material        Examples/FlarePointSprite
+	point_rendering	true
+	// point rendering means size is controlled by material
+	// provide fallback sizes for hardware that doesn't support point sprite
+    particle_width  30
+    particle_height 30
+    cull_each       false
+	cull_each       false
+    quota           10000
+    billboard_type  point
+    
+    // Area emitter
+    emitter Box
+    {
+        angle           30
+        emission_rate   30
+        time_to_live    5
+        direction       0 1 0
+        velocity    	0
+        colour_range_start  1 1 0
+        colour_range_end    0.3 1 0.3
+        width           60
+        height          60
+        depth           60
+    }
+
+    // Make em float upwards
+    affector LinearForce
+    {
+        force_vector      0 100 0
+        force_application add
+    }
+
+    // Fader
+    affector ColourFader
+    {
+        red -0.25
+        green -0.25
+        blue -0.25
+    }
+
+
+}
+
+// A sparkly purple fountain
+Examples/PurpleFountain
+{
+    material        Examples/Flare2
+    particle_width  20
+    particle_height 40
+    cull_each       false
+    quota           10000
+    billboard_type  oriented_self
+    
+    // Area emitter
+    emitter Point
+    {
+        angle           15
+        emission_rate   75
+        time_to_live    3
+        direction       0 1 0
+        velocity_min    250
+        velocity_max    300
+        colour_range_start  0 0 0
+        colour_range_end    1 1 1
+    }
+
+    // Gravity
+    affector LinearForce
+    {
+        force_vector      0 -100 0
+        force_application add
+    }
+
+    // Fader
+    affector ColourFader
+    {
+        red -0.25
+        green -0.25
+        blue -0.25
+    }
+}
+
+
+// A downpour
+Examples/Rain
+{
+    material        Examples/Droplet
+    particle_width  20
+    particle_height 100
+    cull_each       true
+    quota           10000
+    // Make common direction straight down (faster than self oriented)
+    billboard_type  oriented_common
+    common_direction 0 -1 0
+    
+    // Area emitter
+    emitter Box
+    {
+        angle           0
+        emission_rate   100
+        time_to_live    5
+        direction       0 -1 0
+        velocity    	50
+        colour_range_start  0.3 1 0.3
+        colour_range_end    0.7 1 0.7
+        width           1000
+        height          1000
+        depth           0
+    }
+
+    // Gravity
+    affector LinearForce
+    {
+        force_vector      0 -200 0
+        force_application add
+    }
+
+}
+
+// A jet engine (of sorts)
+Examples/JetEngine1
+{
+	material 		Examples/Flare
+	particle_width 	25
+	particle_height	25
+	cull_each		false
+	quota			200
+	billboard_type	point
+
+	emitter Point
+	{
+		angle 5
+		emission_rate 100
+        time_to_live    1
+        direction       0 -1 0
+        velocity_min    250
+        velocity_max    300
+        colour_range_start  1 1 0.5
+        colour_range_end    1 0.8 0.3
+		
+	}
+	affector ColourFader
+	{
+		red -0.25
+		green -1
+		blue -1
+	}
+	
+}
+Examples/JetEngine2
+{
+	material 		Examples/Flare
+	particle_width 	15
+	particle_height	15
+	cull_each		false
+	quota			200
+	billboard_type	point
+
+	emitter Point
+	{
+		angle 3
+		emission_rate 100
+        time_to_live    1
+        direction       0 -1 0
+        velocity_min    350
+        velocity_max    400
+        colour_range_start  0.5 1 1
+        colour_range_end    0.3 0.8 1
+		
+	}
+	affector ColourFader
+	{
+		red -1
+		green -1
+		blue -0.5
+	}
+	
+}
+
+// Exudes aureola particles which around the model float upwards
+Examples/Aureola
+{
+    material        Examples/Aureola
+    particle_width  200
+    particle_height 200
+    cull_each       false
+    quota           100
+    billboard_type  perpendicular_common
+    common_direction 0 1 0
+    common_up_vector 0 0 1
+
+    // Area emitter
+    emitter Box
+    {
+        angle           30
+        emission_rate   4
+        time_to_live    5
+        position        0 -100 0
+        direction       0 1 0
+        velocity_min  	0
+        velocity_max  	30
+        colour_range_start  0.3 0.3 0.3 0.0
+        colour_range_end    0.8 0.8 0.8 0.0
+        width           10
+        height          10
+        depth           30
+    }
+
+    // Make em float upwards
+    affector LinearForce
+    {
+        force_vector      0 70 0
+        force_application add
+    }
+
+    // Fader
+    affector ColourFader2
+    {
+        red1 +0.4
+        green1 +0.4
+        blue1 +0.4
+        alpha1 +0.7
+
+        red2 -0.25
+        green2 -0.25
+        blue2 -0.25
+        alpha2 -0.3333
+
+        state_change 3.5
+    }
+
+    // Rotater
+    affector Rotator
+    {
+        rotation_range_start 0
+        rotation_range_end 360
+        rotation_speed_range_start 0
+        rotation_speed_range_end 180
+    }
+}
+
+
+Examples/Swarm
+{
+	quota	3000
+	material	Examples/Flare2
+	particle_width	12
+	particle_height	24
+	cull_each	true
+	renderer	billboard
+	sorted	true
+	local_space	false
+	billboard_type	oriented_self
+
+	emitter Box
+	{
+		angle	180
+		colour	1 1 1 1
+		colour_range_start	1 1 1 1
+		colour_range_end	1 1 1 1
+		direction	0 1 0
+		emission_rate	30
+		position	0 0 0
+		velocity	50
+		velocity_min	50
+		velocity_max	1
+		time_to_live	20
+		time_to_live_min	20
+		time_to_live_max	20
+		duration	0
+		duration_min	0
+		duration_max	0
+		repeat_delay	0
+		repeat_delay_min	0
+		repeat_delay_max	0
+		width	80
+		height	80
+		depth	80
+	}
+
+	affector ColourFader
+	{
+		red	-0.05
+		green	0
+		blue	0
+		alpha	0
+	}
+
+	affector DeflectorPlane
+	{
+		plane_point	0 -50 0
+		plane_normal	0 1 0
+		bounce	1
+	}
+
+	affector DeflectorPlane
+	{
+		plane_point	0 50 0
+		plane_normal	0 -1 0
+		bounce	1
+	}
+
+	affector DeflectorPlane
+	{
+		plane_point	50 0 0
+		plane_normal	-1 0 0
+		bounce	1
+	}
+
+	affector DeflectorPlane
+	{
+		plane_point	-50 0 0
+		plane_normal	1 0 0
+		bounce	1
+	}
+
+	affector DeflectorPlane
+	{
+		plane_point	0 0 50
+		plane_normal	0 0 -1
+		bounce	1
+	}
+
+	affector DeflectorPlane
+	{
+		plane_point	0 0 -50
+		plane_normal	0 0 1
+		bounce	1
+	}
+
+	affector DirectionRandomiser
+	{
+		randomness	60
+	}
+}
+
+
+Examples/Snow
+{
+	quota	2000
+	material	Examples/Flare
+	particle_width	4
+	particle_height	4
+	cull_each	true
+	renderer	billboard
+	sorted	true
+	local_space	false
+	billboard_type	point
+
+	emitter Box
+	{
+		angle	0
+		colour	1 1 1 1
+		colour_range_start	1 1 1 1
+		colour_range_end	1 1 1 1
+		direction	0 -1 0
+		emission_rate	100
+		position	0 200 0
+		velocity	20
+		velocity_min	20
+		velocity_max	20
+		time_to_live	20
+		time_to_live_min	20
+		time_to_live_max	20
+		duration	0
+		duration_min	0
+		duration_max	0
+		repeat_delay	0
+		repeat_delay_min	0
+		repeat_delay_max	0
+		width	200
+		height	200
+		depth	1
+	}
+
+	affector DeflectorPlane
+	{
+		plane_point	0 0 0
+		plane_normal	0 1 0
+		bounce	0
+	}
+
+	affector DirectionRandomiser
+	{
+		randomness	10
+	}
+}
+
+
Index: code/trunk/Tutorial/Media/particle/emitted_emitter.particle
===================================================================
--- code/trunk/Tutorial/Media/particle/emitted_emitter.particle	(revision 44)
+++ code/trunk/Tutorial/Media/particle/emitted_emitter.particle	(revision 44)
@@ -0,0 +1,56 @@
+// Example emitted emitters
+Examples/Fireworks
+{
+    material Examples/Flare
+    point_rendering            false
+    particle_width             10
+    particle_height            10
+    cull_each                  false
+    quota                      1000
+    emit_emitter_quota         10
+    billboard_type             point
+    
+    // Emitter that emits multiple Point emitters with name 'explosion'
+    emitter Box
+    {
+        name                    mainEmitter
+        emit_emitter            explosion
+        angle                   30
+        emission_rate           1000
+        time_to_live            3
+        direction               0 1 0
+        velocity                200
+    }
+
+    // This Point emitter is emitted by the Box emitter and emits billboard particles itself
+    emitter Point
+    {
+        name                    explosion
+        angle                   360
+        emission_rate           1000
+        time_to_live            2
+        direction               0 1 0
+        velocity                80
+        duration                0.1
+        repeat_delay_min        2
+        repeat_delay_max        3
+    }
+
+    // Make em float downwards
+    affector LinearForce
+    {
+        force_vector            0 -100 0
+        force_application       add
+    }
+
+    // Give em some nice colours
+    affector ColourInterpolator
+    {
+        time0                   0
+        colour0                 1 1 0
+        time1                   0.5
+        colour1                 1 0 0
+        time2                   0.9
+        colour2                 0 0 1
+    }
+}
Index: code/trunk/Tutorial/Media/particle/smoke.particle
===================================================================
--- code/trunk/Tutorial/Media/particle/smoke.particle	(revision 44)
+++ code/trunk/Tutorial/Media/particle/smoke.particle	(revision 44)
@@ -0,0 +1,43 @@
+// Example particle systems
+
+// smoke
+Examples/Smoke
+{
+    	material        	Examples/Smoke
+    	particle_width  	55
+    	particle_height 	55
+    	cull_each       	true
+    	quota           	500
+    	billboard_type  	point
+		sorted				true
+    
+    	// Area emitter
+    	emitter Point
+    	{
+		angle               		11
+        	emission_rate       		15
+        	time_to_live        		4
+        	direction           		0 1 0
+        	velocity_min        		150
+        	velocity_max        		240    	
+	}
+
+	affector ColourImage
+	{
+		image		smokecolors.png
+	}
+
+   	affector Rotator
+   	{
+        	rotation_range_start  		0
+        	rotation_range_end   	 	360
+        	rotation_speed_range_start  	-60
+        	rotation_speed_range_end    	200
+   	}
+
+   	affector Scaler
+   	{
+       	rate 	100
+   	}
+
+}
Index: code/trunk/Tutorial/Media/terrain.cfg
===================================================================
--- code/trunk/Tutorial/Media/terrain.cfg	(revision 44)
+++ code/trunk/Tutorial/Media/terrain.cfg	(revision 44)
@@ -0,0 +1,71 @@
+# The main world texture (if you wish the terrain manager to create a material for you)
+WorldTexture=terrain_texture.jpg
+
+# The detail texture (if you wish the terrain manager to create a material for you)
+DetailTexture=terrain_detail.jpg
+
+#number of times the detail texture will tile in a terrain tile
+DetailTile=3
+
+# Heightmap source
+PageSource=Heightmap
+
+# Heightmap-source specific settings
+Heightmap.image=terrain.png
+
+# If you use RAW, fill in the below too
+# RAW-specific setting - size (horizontal/vertical)
+#Heightmap.raw.size=513
+# RAW-specific setting - bytes per pixel (1 = 8bit, 2=16bit)
+#Heightmap.raw.bpp=2
+
+# How large is a page of tiles (in vertices)? Must be (2^n)+1
+PageSize=513
+
+# How large is each tile? Must be (2^n)+1 and be smaller than PageSize
+TileSize=65
+
+# The maximum error allowed when determining which LOD to use
+MaxPixelError=3
+
+# The size of a terrain page, in world units
+PageWorldX=1500
+PageWorldZ=1500
+# Maximum height of the terrain 
+MaxHeight=100
+
+# Upper LOD limit
+MaxMipMapLevel=5
+
+#VertexNormals=yes
+#VertexColors=yes
+#UseTriStrips=yes
+
+# Use vertex program to morph LODs, if available
+VertexProgramMorph=yes
+
+# The proportional distance range at which the LOD morph starts to take effect
+# This is as a proportion of the distance between the current LODs effective range,
+# and the effective range of the next lower LOD
+LODMorphStart=0.2
+
+# This following section is for if you want to provide your own terrain shading routine
+# Note that since you define your textures within the material this makes the 
+# WorldTexture and DetailTexture settings redundant
+
+# The name of the vertex program parameter you wish to bind the morph LOD factor to
+# this is 0 when there is no adjustment (highest) to 1 when the morph takes it completely
+# to the same position as the next lower LOD
+# USE THIS IF YOU USE HIGH-LEVEL VERTEX PROGRAMS WITH LOD MORPHING
+#MorphLODFactorParamName=morphFactor
+
+# The index of the vertex program parameter you wish to bind the morph LOD factor to
+# this is 0 when there is no adjustment (highest) to 1 when the morph takes it completely
+# to the same position as the next lower LOD
+# USE THIS IF YOU USE ASSEMBLER VERTEX PROGRAMS WITH LOD MORPHING
+#MorphLODFactorParamIndex=4
+
+# The name of the material you will define to shade the terrain
+#CustomMaterialName=TestTerrainMaterial
+
+
Index: code/trunk/Tutorial/build-script-tardis
===================================================================
--- code/trunk/Tutorial/build-script-tardis	(revision 44)
+++ code/trunk/Tutorial/build-script-tardis	(revision 44)
@@ -0,0 +1,19 @@
+#!/bin/bash
+
+#if [ $1 == --with-tardis ] 
+	export PKG_CONFIG_PATH=/usr/pack/ogre-1.4.5-sd/i686-debian-linux3.1/lib/pkgconfig:/usr/pack/ois-1.0-sd/i686-debian-linux3.1/lib/pkgconfig/
+#fi
+
+COMPILER="gcc-3.4.3"
+SRC_FILES="src/main.cpp"
+HEADER_FILES="src/ExampleApplication.h  src/ExampleFrameListener.h  src/ExampleLoadingBar.h"
+EXECUTABLE="main"
+LIBS="OGRE OIS"
+LD_FLAGS="`pkg-config --libs ${LIBS}`"
+CXX_FLAGS="`pkg-config --cflags ${LIBS}`"
+INCLUDES="-Isrc"
+FLAGS="-O2 -march=pentium4 -pipe -g -ggdb"
+
+echo "${COMPILER} ${FLAGS} ${CXX_FLAGS} ${LD_FLAGS} ${INCLUDES} ${SRC_FILES} -o ${EXECUTABLE}"
+${COMPILER} ${FLAGS} ${CXX_FLAGS} ${LD_FLAGS} ${INCLUDES} ${SRC_FILES} -o ${EXECUTABLE}
+#g++-4.2.0 `pkg-config --libs /usr/pack/ogre-1.4.5-sd/i686-debian-linux3.1/lib/pkgconfig/OGRE.pc /usr/pack/ois-1.0-sd/i686-debian-linux3.1/lib/pkgconfig/OIS.pc` `pkg-config --cflags /usr/pack/ogre-1.4.5-sd/i686-debian-linux3.1/lib/pkgconfig/OGRE.pc /usr/pack/ois-1.0-sd/i686-debian-linux3.1/lib/pkgconfig/OIS.pc` main.cpp -I. -O2 -march=prescott -pipe -o main -g -ggdb
Index: code/trunk/Tutorial/build/media.cfg
===================================================================
--- code/trunk/Tutorial/build/media.cfg	(revision 44)
+++ code/trunk/Tutorial/build/media.cfg	(revision 44)
@@ -0,0 +1,16 @@
+Mesh=ogrehead.mesh
+Mesh=geosphere4500.mesh
+Mesh=razor.mesh
+Mesh=knot.mesh
+Mesh=RZR-002.mesh
+Mesh=geosphere8000.mesh
+Mesh=sphere.mesh
+
+CubeMap=cubescene.jpg
+CubeMap=early_morning.jpg
+CubeMap=cubemap.jpg
+CubeMap=morning.jpg
+CubeMap=cloudy_noon.jpg
+CubeMap=evening.jpg
+CubeMap=stormy.jpg
+CubeMap=stevecube.jpg
Index: code/trunk/Tutorial/build/ogre.cfg
===================================================================
--- code/trunk/Tutorial/build/ogre.cfg	(revision 44)
+++ code/trunk/Tutorial/build/ogre.cfg	(revision 44)
@@ -0,0 +1,7 @@
+Render System=OpenGL Rendering Subsystem
+
+[OpenGL Rendering Subsystem]
+FSAA=4
+Full Screen=No
+RTT Preferred Mode=PBuffer
+Video Mode=1280 x 1024
Index: code/trunk/Tutorial/build/plugins.cfg
===================================================================
--- code/trunk/Tutorial/build/plugins.cfg	(revision 44)
+++ code/trunk/Tutorial/build/plugins.cfg	(revision 44)
@@ -0,0 +1,15 @@
+# Defines plugins to load
+
+# Define plugin folder
+PluginFolder=/usr/pack/ogre-1.4.5-sd/i686-debian-linux3.1/lib/OGRE/
+# PluginsFolder=/usr/lib/OGRE
+
+# Define plugins
+#Plugin=RenderSystem_Direct3D9
+Plugin=RenderSystem_GL
+Plugin=Plugin_ParticleFX
+Plugin=Plugin_BSPSceneManager
+Plugin=Plugin_OctreeSceneManager
+Plugin=Plugin_CgProgramManager
+
+
Index: code/trunk/Tutorial/build/quake3settings.cfg
===================================================================
--- code/trunk/Tutorial/build/quake3settings.cfg	(revision 44)
+++ code/trunk/Tutorial/build/quake3settings.cfg	(revision 44)
@@ -0,0 +1,3 @@
+Pak0Location: f:\quake3levels\chiropteraDM.pk3
+Map: maps/chiropteradm.bsp
+
Index: code/trunk/Tutorial/build/resources.cfg
===================================================================
--- code/trunk/Tutorial/build/resources.cfg	(revision 44)
+++ code/trunk/Tutorial/build/resources.cfg	(revision 44)
@@ -0,0 +1,23 @@
+# Resource locations to be added to the 'boostrap' path
+# This also contains the minimum you need to use the Ogre example framework
+[Bootstrap]
+Zip=../Media/packs/OgreCore.zip
+
+# Resource locations to be added to the default path
+[General]
+FileSystem=../Media
+FileSystem=../Media/fonts
+FileSystem=../Media/materials/programs
+FileSystem=../Media/materials/scripts
+FileSystem=../Media/materials/textures
+FileSystem=../Media/models
+FileSystem=../Media/overlays
+FileSystem=../Media/particle
+FileSystem=../Media/gui
+FileSystem=../Media/DeferredShading../Media
+Zip=../Media/packs/cubemap.zip
+Zip=../Media/packs/cubemapsJS.zip
+Zip=../Media/packs/dragon.zip
+Zip=../Media/packs/fresneldemo.zip
+Zip=../Media/packs/ogretestmap.zip
+Zip=../Media/packs/skybox.zip
Index: code/trunk/Tutorial/cmake/FindOGRE.cmake
===================================================================
--- code/trunk/Tutorial/cmake/FindOGRE.cmake	(revision 44)
+++ code/trunk/Tutorial/cmake/FindOGRE.cmake	(revision 44)
@@ -0,0 +1,53 @@
+# Find OGRE includes and library
+#
+# This module defines
+#  OGRE_INCLUDE_DIR
+#  OGRE_LIBRARIES, the libraries to link against to use OGRE.
+#  OGRE_LIB_DIR, the location of the libraries
+#  OGRE_FOUND, If false, do not try to use OGRE
+#
+# Copyright © 2007, Matt Williams
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+
+IF (OGRE_LIBRARIES AND OGRE_INCLUDE_DIR)
+    SET(OGRE_FIND_QUIETLY TRUE) # Already in cache, be silent
+ENDIF (OGRE_LIBRARIES AND OGRE_INCLUDE_DIR)
+
+IF (WIN32) #Windows
+    MESSAGE(STATUS "Looking for OGRE")
+    SET(OGRESDK $ENV{OGRE_HOME})
+    STRING(REGEX REPLACE "[\\]" "/" OGRESDK "${OGRESDK}" )
+    SET(OGRE_INCLUDE_DIR ${OGRESDK}/include)
+    SET(OGRE_LIB_DIR ${OGRESDK}/lib)
+    SET(OGRE_LIBRARIES debug OgreMain_d optimized OgreMain)
+ELSE (WIN32) #Unix
+    FIND_PACKAGE(PkgConfig)
+    PKG_SEARCH_MODULE(OGRE OGRE /usr/pack/ogre-1.4.5-sd/i686-debian-linux3.1/lib/pkgconfig/OGRE.pc) # tardis specific hack
+    SET(OGRE_INCLUDE_DIR ${OGRE_INCLUDE_DIRS})
+    SET(OGRE_LIB_DIR ${OGRE_LIBDIR})
+    SET(OGRE_LIBRARIES ${OGRE_LIBRARIES} CACHE STRING "")
+ENDIF (WIN32)
+
+#Do some preparation
+SEPARATE_ARGUMENTS(OGRE_INCLUDE_DIR)
+SEPARATE_ARGUMENTS(OGRE_LIBRARIES)
+
+SET(OGRE_INCLUDE_DIR ${OGRE_INCLUDE_DIR} CACHE PATH "")
+SET(OGRE_LIBRARIES ${OGRE_LIBRARIES} CACHE STRING "")
+SET(OGRE_LIB_DIR ${OGRE_LIB_DIR} CACHE PATH "")
+
+IF (OGRE_INCLUDE_DIR AND OGRE_LIBRARIES)
+    SET(OGRE_FOUND TRUE)
+ENDIF (OGRE_INCLUDE_DIR AND OGRE_LIBRARIES)
+
+IF (OGRE_FOUND)
+    IF (NOT OGRE_FIND_QUIETLY)
+        MESSAGE(STATUS "  libraries : ${OGRE_LIBRARIES} from ${OGRE_LIB_DIR}")
+        MESSAGE(STATUS "  includes  : ${OGRE_INCLUDE_DIR}")
+    ENDIF (NOT OGRE_FIND_QUIETLY)
+ELSE (OGRE_FOUND)
+    IF (OGRE_FIND_REQUIRED)
+        MESSAGE(FATAL_ERROR "Could not find OGRE")
+    ENDIF (OGRE_FIND_REQUIRED)
+ENDIF (OGRE_FOUND)
Index: code/trunk/Tutorial/cmake/FindOIS.cmake
===================================================================
--- code/trunk/Tutorial/cmake/FindOIS.cmake	(revision 44)
+++ code/trunk/Tutorial/cmake/FindOIS.cmake	(revision 44)
@@ -0,0 +1,54 @@
+# Find OIS includes and library
+#
+# This module defines
+#  OIS_INCLUDE_DIR
+#  OIS_LIBRARIES, the libraries to link against to use OIS.
+#  OIS_LIB_DIR, the location of the libraries
+#  OIS_FOUND, If false, do not try to use OIS
+#
+# Copyright © 2007, Matt Williams
+# Modified by Nicolas Schlumber
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+
+IF (OIS_LIBRARIES AND OIS_INCLUDE_DIR)
+    SET(OIS_FIND_QUIETLY TRUE) # Already in cache, be silent
+ENDIF (OIS_LIBRARIES AND OIS_INCLUDE_DIR)
+
+IF (WIN32) #Windows
+    MESSAGE(STATUS "Looking for OIS")
+    SET(OISSDK $ENV{OIS_HOME})
+    STRING(REGEX REPLACE "[\\]" "/" OISSDK "${OISSDK}" )
+    SET(OIS_INCLUDE_DIR ${OISSDK}/include)
+    SET(OIS_LIB_DIR ${OISSDK}/lib)
+    SET(OIS_LIBRARIES debug OgreMain_d optimized OgreMain)
+ELSE (WIN32) #Unix
+    FIND_PACKAGE(PkgConfig)
+    PKG_SEARCH_MODULE(OIS OIS /usr/pack/ois-1.0-sd/i686-debian-linux3.1/lib/pkgconfig/OIS.pc) # tardis specific hack
+    SET(OIS_INCLUDE_DIR ${OIS_INCLUDE_DIRS})
+    SET(OIS_LIB_DIR ${OIS_LIBDIR})
+    SET(OIS_LIBRARIES ${OIS_LIBRARIES} CACHE STRING "")
+ENDIF (WIN32)
+
+#Do some preparation
+SEPARATE_ARGUMENTS(OIS_INCLUDE_DIR)
+SEPARATE_ARGUMENTS(OIS_LIBRARIES)
+
+SET(OIS_INCLUDE_DIR ${OIS_INCLUDE_DIR} CACHE PATH "")
+SET(OIS_LIBRARIES ${OIS_LIBRARIES} CACHE STRING "")
+SET(OIS_LIB_DIR ${OIS_LIB_DIR} CACHE PATH "")
+
+IF (OIS_INCLUDE_DIR AND OIS_LIBRARIES)
+    SET(OIS_FOUND TRUE)
+ENDIF (OIS_INCLUDE_DIR AND OIS_LIBRARIES)
+
+IF (OIS_FOUND)
+    IF (NOT OIS_FIND_QUIETLY)
+        MESSAGE(STATUS "  libraries : ${OIS_LIBRARIES} from ${OIS_LIB_DIR}")
+        MESSAGE(STATUS "  includes  : ${OIS_INCLUDE_DIR}")
+    ENDIF (NOT OIS_FIND_QUIETLY)
+ELSE (OIS_FOUND)
+    IF (OIS_FIND_REQUIRED)
+        MESSAGE(FATAL_ERROR "Could not find OIS")
+    ENDIF (OIS_FIND_REQUIRED)
+ENDIF (OIS_FOUND)
Index: code/trunk/Tutorial/cmake/FindPkgConfig.cmake
===================================================================
--- code/trunk/Tutorial/cmake/FindPkgConfig.cmake	(revision 44)
+++ code/trunk/Tutorial/cmake/FindPkgConfig.cmake	(revision 44)
@@ -0,0 +1,360 @@
+# - a pkg-config module for CMake
+#
+# Usage:
+#   pkg_check_modules(<PREFIX> [REQUIRED] <MODULE> [<MODULE>]*)
+#     checks for all the given modules
+#
+#   pkg_search_module(<PREFIX> [REQUIRED] <MODULE> [<MODULE>]*)
+#     checks for given modules and uses the first working one
+#
+# When the 'REQUIRED' argument was set, macros will fail with an error
+# when module(s) could not be found
+#
+# It sets the following variables:
+#   PKG_CONFIG_FOUND         ... true iff pkg-config works on the system
+#   PKG_CONFIG_EXECUTABLE    ... pathname of the pkg-config program
+#   <PREFIX>_FOUND           ... set to 1 iff module(s) exist
+#
+# For the following variables two sets of values exist; first one is the
+# common one and has the given PREFIX. The second set contains flags
+# which are given out when pkgconfig was called with the '--static'
+# option.
+#   <XPREFIX>_LIBRARIES      ... only the libraries (w/o the '-l')
+#   <XPREFIX>_LIBRARY_DIRS   ... the paths of the libraries (w/o the '-L')
+#   <XPREFIX>_LDFLAGS        ... all required linker flags
+#   <XPREFIX>_LDFLAGS_OTHERS ... all other linker flags
+#   <XPREFIX>_INCLUDE_DIRS   ... the '-I' preprocessor flags (w/o the '-I')
+#   <XPREFIX>_CFLAGS         ... all required cflags
+#   <XPREFIX>_CFLAGS_OTHERS  ... the other compiler flags
+#
+#   <XPREFIX> = <PREFIX>        for common case
+#   <XPREFIX> = <PREFIX>_STATIC for static linking
+#
+# There are some special variables whose prefix depends on the count
+# of given modules. When there is only one module, <PREFIX> stays
+# unchanged. When there are multiple modules, the prefix will be
+# changed to <PREFIX>_<MODNAME>:
+#   <XPREFIX>_VERSION    ... version of the module
+#   <XPREFIX>_PREFIX     ... prefix-directory of the module
+#   <XPREFIX>_INCLUDEDIR ... include-dir of the module
+#   <XPREFIX>_LIBDIR     ... lib-dir of the module
+#
+#   <XPREFIX> = <PREFIX>  when |MODULES| == 1, else
+#   <XPREFIX> = <PREFIX>_<MODNAME>
+#
+# A <MODULE> parameter can have the following formats:
+#   {MODNAME}            ... matches any version
+#   {MODNAME}>={VERSION} ... at least version <VERSION> is required
+#   {MODNAME}={VERSION}  ... exactly version <VERSION> is required
+#   {MODNAME}<={VERSION} ... modules must not be newer than <VERSION>
+#
+# Examples
+#   pkg_check_modules (GLIB2   glib-2.0)
+#
+#   pkg_check_modules (GLIB2   glib-2.0>=2.10)
+#     requires at least version 2.10 of glib2 and defines e.g.
+#       GLIB2_VERSION=2.10.3
+#
+#   pkg_check_modules (FOO     glib-2.0>=2.10 gtk+-2.0)
+#     requires both glib2 and gtk2, and defines e.g.
+#       FOO_glib-2.0_VERSION=2.10.3
+#       FOO_gtk+-2.0_VERSION=2.8.20
+#
+#   pkg_check_modules (XRENDER REQUIRED xrender)
+#     defines e.g.:
+#       XRENDER_LIBRARIES=Xrender;X11
+#       XRENDER_STATIC_LIBRARIES=Xrender;X11;pthread;Xau;Xdmcp
+#
+#   pkg_search_module (BAR     libxml-2.0 libxml2 libxml>=2)
+
+
+# Copyright (C) 2006 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
+#
+# Redistribution and use, with or without modification, are permitted
+# provided that the following conditions are met:
+# 
+#    1. Redistributions must retain the above copyright notice, this
+#       list of conditions and the following disclaimer.
+#    2. The name of the author may not be used to endorse or promote
+#       products derived from this software without specific prior
+#       written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+### Common stuff ####
+set(PKG_CONFIG_VERSION 1)
+set(PKG_CONFIG_FOUND   0)
+
+find_program(PKG_CONFIG_EXECUTABLE NAMES pkg-config DOC "pkg-config executable")
+mark_as_advanced(PKG_CONFIG_EXECUTABLE)
+
+if(PKG_CONFIG_EXECUTABLE)
+  set(PKG_CONFIG_FOUND 1)
+endif(PKG_CONFIG_EXECUTABLE)
+
+
+# Unsets the given variables
+macro(_pkgconfig_unset var)
+  set(${var} "" CACHE INTERNAL "")
+endmacro(_pkgconfig_unset)
+
+macro(_pkgconfig_set var value)
+  set(${var} ${value} CACHE INTERNAL "")
+endmacro(_pkgconfig_set)
+
+# Invokes pkgconfig, cleans up the result and sets variables
+macro(_pkgconfig_invoke _pkglist _prefix _varname _regexp)
+  set(_pkgconfig_invoke_result)
+
+  execute_process(
+    COMMAND ${PKG_CONFIG_EXECUTABLE} ${ARGN} ${_pkglist}
+    OUTPUT_VARIABLE _pkgconfig_invoke_result
+    RESULT_VARIABLE _pkgconfig_failed)
+
+  if (_pkgconfig_failed)
+    set(_pkgconfig_${_varname} "")
+    _pkgconfig_unset(${_prefix}_${_varname})
+  else(_pkgconfig_failed)
+    string(REGEX REPLACE "[\r\n]"                  " " _pkgconfig_invoke_result "${_pkgconfig_invoke_result}")
+    string(REGEX REPLACE " +$"                     ""  _pkgconfig_invoke_result "${_pkgconfig_invoke_result}")
+
+    if (NOT ${_regexp} STREQUAL "")
+      string(REGEX REPLACE "${_regexp}" " " _pkgconfig_invoke_result "${_pkgconfig_invoke_result}")
+    endif(NOT ${_regexp} STREQUAL "")
+
+    separate_arguments(_pkgconfig_invoke_result)
+
+    #message(STATUS "  ${_varname} ... ${_pkgconfig_invoke_result}")
+    set(_pkgconfig_${_varname} ${_pkgconfig_invoke_result})
+    _pkgconfig_set(${_prefix}_${_varname} "${_pkgconfig_invoke_result}")
+  endif(_pkgconfig_failed)
+endmacro(_pkgconfig_invoke)
+
+# Invokes pkgconfig two times; once without '--static' and once with
+# '--static'
+macro(_pkgconfig_invoke_dyn _pkglist _prefix _varname cleanup_regexp)
+  _pkgconfig_invoke("${_pkglist}" ${_prefix}        ${_varname} "${cleanup_regexp}" ${ARGN})
+  _pkgconfig_invoke("${_pkglist}" ${_prefix} STATIC_${_varname} "${cleanup_regexp}" --static  ${ARGN})
+endmacro(_pkgconfig_invoke_dyn)
+
+# Splits given arguments into options and a package list
+macro(_pkgconfig_parse_options _result _is_req)
+  set(${_is_req} 0)
+  
+  foreach(_pkg ${ARGN})
+    if (_pkg STREQUAL "REQUIRED")
+      set(${_is_req} 1)
+    endif (_pkg STREQUAL "REQUIRED")
+  endforeach(_pkg ${ARGN})
+
+  set(${_result} ${ARGN})
+  list(REMOVE_ITEM ${_result} "REQUIRED")
+endmacro(_pkgconfig_parse_options)
+
+###
+macro(_pkg_check_modules_internal _is_required _is_silent _prefix)
+  _pkgconfig_unset(${_prefix}_FOUND)
+  _pkgconfig_unset(${_prefix}_VERSION)
+  _pkgconfig_unset(${_prefix}_PREFIX)
+  _pkgconfig_unset(${_prefix}_INCLUDEDIR)
+  _pkgconfig_unset(${_prefix}_LIBDIR)
+  _pkgconfig_unset(${_prefix}_LIBS)
+  _pkgconfig_unset(${_prefix}_LIBS_L)
+  _pkgconfig_unset(${_prefix}_LIBS_PATHS)
+  _pkgconfig_unset(${_prefix}_LIBS_OTHER)
+  _pkgconfig_unset(${_prefix}_CFLAGS)
+  _pkgconfig_unset(${_prefix}_CFLAGS_I)
+  _pkgconfig_unset(${_prefix}_CFLAGS_OTHER)
+  _pkgconfig_unset(${_prefix}_STATIC_LIBDIR)
+  _pkgconfig_unset(${_prefix}_STATIC_LIBS)
+  _pkgconfig_unset(${_prefix}_STATIC_LIBS_L)
+  _pkgconfig_unset(${_prefix}_STATIC_LIBS_PATHS)
+  _pkgconfig_unset(${_prefix}_STATIC_LIBS_OTHER)
+  _pkgconfig_unset(${_prefix}_STATIC_CFLAGS)
+  _pkgconfig_unset(${_prefix}_STATIC_CFLAGS_I)
+  _pkgconfig_unset(${_prefix}_STATIC_CFLAGS_OTHER)
+
+  # create a better addressable variable of the modules and calculate its size
+  set(_pkg_check_modules_list ${ARGN})
+  list(LENGTH _pkg_check_modules_list _pkg_check_modules_cnt)
+
+  if(PKG_CONFIG_EXECUTABLE)
+    # give out status message telling checked module
+    if (NOT ${_is_silent})
+      if (_pkg_check_modules_cnt EQUAL 1)
+        message(STATUS "checking for module '${_pkg_check_modules_list}'")
+      else(_pkg_check_modules_cnt EQUAL 1)
+        message(STATUS "checking for modules '${_pkg_check_modules_list}'")
+      endif(_pkg_check_modules_cnt EQUAL 1)
+    endif(NOT ${_is_silent})
+    
+    set(_pkg_check_modules_packages)
+    set(_pkg_check_modules_failed)
+
+    # iterate through module list and check whether they exist and match the required version
+    foreach (_pkg_check_modules_pkg ${_pkg_check_modules_list})
+      set(_pkg_check_modules_exist_query)
+
+      # check whether version is given
+      if (_pkg_check_modules_pkg MATCHES ".*(>=|=|<=).*")
+        string(REGEX REPLACE "(.*[^><])(>=|=|<=)(.*)" "\\1" _pkg_check_modules_pkg_name "${_pkg_check_modules_pkg}")
+        string(REGEX REPLACE "(.*[^><])(>=|=|<=)(.*)" "\\2" _pkg_check_modules_pkg_op   "${_pkg_check_modules_pkg}")
+        string(REGEX REPLACE "(.*[^><])(>=|=|<=)(.*)" "\\3" _pkg_check_modules_pkg_ver  "${_pkg_check_modules_pkg}")
+      else(_pkg_check_modules_pkg MATCHES ".*(>=|=|<=).*")
+        set(_pkg_check_modules_pkg_name "${_pkg_check_modules_pkg}")
+        set(_pkg_check_modules_pkg_op)
+        set(_pkg_check_modules_pkg_ver)
+      endif(_pkg_check_modules_pkg MATCHES ".*(>=|=|<=).*")
+
+      # handle the operands
+      if (_pkg_check_modules_pkg_op STREQUAL ">=")
+        list(APPEND _pkg_check_modules_exist_query --atleast-version)
+      endif(_pkg_check_modules_pkg_op STREQUAL ">=")
+
+      if (_pkg_check_modules_pkg_op STREQUAL "=")
+        list(APPEND _pkg_check_modules_exist_query --exact-version)
+      endif(_pkg_check_modules_pkg_op STREQUAL "=")
+      
+      if (_pkg_check_modules_pkg_op STREQUAL "<=")
+        list(APPEND _pkg_check_modules_exist_query --max-version)
+      endif(_pkg_check_modules_pkg_op STREQUAL "<=")
+
+      # create the final query which is of the format:
+      # * --atleast-version <version> <pkg-name>
+      # * --exact-version <version> <pkg-name>      
+      # * --max-version <version> <pkg-name>
+      # * --exists <pkg-name>
+      if (_pkg_check_modules_pkg_op)
+        list(APPEND _pkg_check_modules_exist_query "${_pkg_check_modules_pkg_ver}")
+      else(_pkg_check_modules_pkg_op)
+        list(APPEND _pkg_check_modules_exist_query --exists)
+      endif(_pkg_check_modules_pkg_op)
+
+      _pkgconfig_unset(${_prefix}_${_pkg_check_modules_pkg_name}_VERSION)
+      _pkgconfig_unset(${_prefix}_${_pkg_check_modules_pkg_name}_PREFIX)
+      _pkgconfig_unset(${_prefix}_${_pkg_check_modules_pkg_name}_INCLUDEDIR)
+      _pkgconfig_unset(${_prefix}_${_pkg_check_modules_pkg_name}_LIBDIR)
+
+      list(APPEND _pkg_check_modules_exist_query "${_pkg_check_modules_pkg_name}")
+      list(APPEND _pkg_check_modules_packages    "${_pkg_check_modules_pkg_name}")
+
+      # execute the query
+      execute_process(
+        COMMAND ${PKG_CONFIG_EXECUTABLE} ${_pkg_check_modules_exist_query}
+        RESULT_VARIABLE _pkgconfig_retval)
+
+      # evaluate result and tell failures
+      if (_pkgconfig_retval)
+        if(NOT ${_is_silent})
+          message(STATUS "  package '${_pkg_check_modules_pkg}' not found")
+        endif(NOT ${_is_silent})
+
+        set(_pkg_check_modules_failed 1)
+      endif(_pkgconfig_retval)
+    endforeach(_pkg_check_modules_pkg)
+
+    if(_pkg_check_modules_failed)
+      # fail when requested
+      if (${_is_required})
+        message(SEND_ERROR "A required package was not found")
+      endif (${_is_required})
+    else(_pkg_check_modules_failed)
+      # when we are here, we checked whether requested modules
+      # exist. Now, go through them and set variables
+      
+      _pkgconfig_set(${_prefix}_FOUND 1)
+      list(LENGTH _pkg_check_modules_packages pkg_count)
+
+      # iterate through all modules again and set individual variables
+      foreach (_pkg_check_modules_pkg ${_pkg_check_modules_packages})
+        # handle case when there is only one package required
+        if (pkg_count EQUAL 1)
+          set(_pkg_check_prefix "${_prefix}")
+        else(pkg_count EQUAL 1)
+          set(_pkg_check_prefix "${_prefix}_${_pkg_check_modules_pkg}")
+        endif(pkg_count EQUAL 1)
+        
+        _pkgconfig_invoke(${_pkg_check_modules_pkg} "${_pkg_check_prefix}" VERSION    ""   --modversion )
+        _pkgconfig_invoke(${_pkg_check_modules_pkg} "${_pkg_check_prefix}" PREFIX     ""   --variable=prefix )
+        _pkgconfig_invoke(${_pkg_check_modules_pkg} "${_pkg_check_prefix}" INCLUDEDIR ""   --variable=includedir )
+        _pkgconfig_invoke(${_pkg_check_modules_pkg} "${_pkg_check_prefix}" LIBDIR     ""   --variable=libdir )
+
+        message(STATUS "  found ${_pkg_check_modules_pkg}, version ${_pkgconfig_VERSION}")
+      endforeach(_pkg_check_modules_pkg)
+
+      # set variables which are combined for multiple modules
+      _pkgconfig_invoke_dyn("${_pkg_check_modules_packages}" "${_prefix}" LIBRARIES           "(^| )-l" --libs-only-l )
+      _pkgconfig_invoke_dyn("${_pkg_check_modules_packages}" "${_prefix}" LIBRARY_DIRS        "(^| )-L" --libs-only-L )
+      _pkgconfig_invoke_dyn("${_pkg_check_modules_packages}" "${_prefix}" LDFLAGS             ""        --libs )
+      _pkgconfig_invoke_dyn("${_pkg_check_modules_packages}" "${_prefix}" LDFLAGS_OTHER       ""        --libs-only-other )
+
+      _pkgconfig_invoke_dyn("${_pkg_check_modules_packages}" "${_prefix}" INCLUDE_DIRS        "(^| )-I" --cflags-only-I )
+      _pkgconfig_invoke_dyn("${_pkg_check_modules_packages}" "${_prefix}" CFLAGS              ""        --cflags )
+      _pkgconfig_invoke_dyn("${_pkg_check_modules_packages}" "${_prefix}" CFLAGS_OTHER        ""        --cflags-only-other )
+    endif(_pkg_check_modules_failed)
+  else(PKG_CONFIG_EXECUTABLE)
+    if (${_is_required})
+      message(SEND_ERROR "pkg-config tool not found")
+    endif (${_is_required})
+  endif(PKG_CONFIG_EXECUTABLE)
+endmacro(_pkg_check_modules_internal)
+
+###
+### User visible macros start here
+###
+
+###
+macro(pkg_check_modules _prefix _module0)
+  # check cached value
+  if (NOT DEFINED __pkg_config_checked_${_prefix} OR __pkg_config_checked_${_prefix} LESS ${PKG_CONFIG_VERSION})
+    _pkgconfig_parse_options   (_pkg_modules _pkg_is_required "${_module0}" ${ARGN})
+    _pkg_check_modules_internal("${_pkg_is_required}" 0 "${_prefix}" ${_pkg_modules})
+
+    _pkgconfig_set(__pkg_config_checked_${_prefix} ${PKG_CONFIG_VERSION})
+  endif(NOT DEFINED __pkg_config_checked_${_prefix} OR __pkg_config_checked_${_prefix} LESS ${PKG_CONFIG_VERSION})
+endmacro(pkg_check_modules)
+
+###
+macro(pkg_search_module _prefix _module0)
+  # check cached value
+  if (NOT DEFINED __pkg_config_checked_${_prefix} OR __pkg_config_checked_${_prefix} LESS ${PKG_CONFIG_VERSION})
+    set(_pkg_modules_found 0)
+    _pkgconfig_parse_options(_pkg_modules_alt _pkg_is_required "${_module0}" ${ARGN})
+
+    message(STATUS "checking for one of the modules '${_pkg_modules_alt}'")
+
+    # iterate through all modules and stop at the first working one.
+    foreach(_pkg_alt ${_pkg_modules_alt})
+      if(NOT _pkg_modules_found)
+        _pkg_check_modules_internal(0 1 "${_prefix}" "${_pkg_alt}")
+      endif(NOT _pkg_modules_found)
+
+      if (${_prefix}_FOUND)
+        set(_pkg_modules_found 1)
+      endif(${_prefix}_FOUND)
+    endforeach(_pkg_alt)
+
+    if (NOT ${_prefix}_FOUND)
+      if(${_pkg_is_required})
+        message(SEND_ERROR "None of the required '${_pkg_modules_alt}' found")
+      endif(${_pkg_is_required})
+    endif(NOT ${_prefix}_FOUND)
+    
+    _pkgconfig_set(__pkg_config_checked_${_prefix} ${PKG_CONFIG_VERSION})
+  endif(NOT DEFINED __pkg_config_checked_${_prefix} OR __pkg_config_checked_${_prefix} LESS ${PKG_CONFIG_VERSION})  
+endmacro(pkg_search_module)
+
+### Local Variables:
+### mode: cmake
+### End:
Index: code/trunk/Tutorial/howto.build
===================================================================
--- code/trunk/Tutorial/howto.build	(revision 44)
+++ code/trunk/Tutorial/howto.build	(revision 44)
@@ -0,0 +1,5 @@
+Plain and simple:
+
+cd build
+cmake ..
+make
Index: code/trunk/Tutorial/main.cpp
===================================================================
--- code/trunk/Tutorial/main.cpp	(revision 43)
+++ 	(revision )
@@ -1,100 +1,0 @@
-#include "ExampleApplication.h"
-
-SceneNode *lightNode;
-
-class TutorialFrameListener : public ExampleFrameListener
-{
-public:
-    TutorialFrameListener(RenderWindow* win, Camera* cam, SceneManager *sceneMgr)
-        : ExampleFrameListener(win, cam, false, false)
-    {
-    }
-
-    bool frameStarted(const FrameEvent &evt)
-    {
-        lightNode->translate( Vector3(0, -10 * evt.timeSinceLastFrame, 0) );
-
-        return ExampleFrameListener::frameStarted(evt);
-    }
-private:
-};
-
-
-class TutorialApplication : public ExampleApplication
-{
-protected:
-public:
-    TutorialApplication()
-    {
-    }
-
-    ~TutorialApplication()
-    {
-    }
-protected:
-    void createCamera(void)
-    {
-        // create camera
-        mCamera = mSceneMgr->createCamera("PlayerCam");
-        mCamera->setNearClipDistance(5);
-        mCamera->setPosition(Vector3(0,10,500));
-        mCamera->lookAt(Vector3(0,0,0));
-    }
-
-    void createScene(void)
-    {
-        // add tutorial code here
-		mSceneMgr->setAmbientLight( ColourValue( 0.3, 0.3, 0.3 ) );
-		Entity* head = mSceneMgr->createEntity("head", "ogrehead.mesh");
-		SceneNode *node = mSceneMgr->getRootSceneNode()->createChildSceneNode( "OgreHeadNode", Vector3( 0, 0, 0 ) );
-		node->attachObject( head );
-		mSceneMgr->setSkyBox(true, "Examples/SpaceSkyBox");
-
-        Light *light = mSceneMgr->createLight("Light1");
-        light->setType(Light::LT_POINT);
-        light->setPosition(Vector3(0, -100, 0));
-        light->setDiffuseColour(1.0, 0.0, 0.0);
-        light->setSpecularColour(1.0, 0.0, 0.0);
-
-        BillboardSet *bbs = mSceneMgr->createBillboardSet("bb", 1);
-        bbs->createBillboard(Vector3::ZERO, ColourValue(1.0, 0.0, 0.0));
-        bbs->setMaterialName("Examples/Flare");
-        lightNode = mSceneMgr->getRootSceneNode()->createChildSceneNode( "LightNode", Vector3(0, 100, 0) );
-        lightNode->attachObject(bbs);
-		lightNode->attachObject(light);
-		light->setPosition(0.0, 0.0, 0.0);
-    }
-
-    void createFrameListener(void)
-    {
-        // create frame listener
-        mFrameListener = new TutorialFrameListener(mWindow, mCamera, mSceneMgr);
-        mRoot->addFrameListener(mFrameListener);
-    }
-};
-
-#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
-#define WIN32_LEAN_AND_MEAN
-#include "windows.h"
-
-INT WINAPI WinMain( HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT )
-#else
-int main(int argc, char **argv)
-#endif
-{
-    // Create application object
-    TutorialApplication app;
-
-    try {
-        app.go();
-    } catch( Exception& e ) {
-#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
-        MessageBox( NULL, e.getFullDescription().c_str(), "An exception has occurred!", MB_OK | MB_ICONERROR | MB_TASKMODAL);
-#else
-        fprintf(stderr, "An exception has occurred: %s\n",
-                e.getFullDescription().c_str());
-#endif
-    }
-
-    return 0;
-}
Index: code/trunk/Tutorial/name.txt
===================================================================
--- code/trunk/Tutorial/name.txt	(revision 44)
+++ code/trunk/Tutorial/name.txt	(revision 44)
@@ -0,0 +1,2 @@
+Enter your Name:
+
Index: code/trunk/Tutorial/src/ExampleApplication.h
===================================================================
--- code/trunk/Tutorial/src/ExampleApplication.h	(revision 44)
+++ code/trunk/Tutorial/src/ExampleApplication.h	(revision 44)
@@ -0,0 +1,257 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+You may use this sample code for anything you like, it is not covered by the
+LGPL like the rest of the engine.
+-----------------------------------------------------------------------------
+*/
+/*
+-----------------------------------------------------------------------------
+Filename:    ExampleApplication.h
+Description: Base class for all the OGRE examples
+-----------------------------------------------------------------------------
+*/
+
+#ifndef __ExampleApplication_H__
+#define __ExampleApplication_H__
+
+#include "Ogre.h"
+#include "OgreConfigFile.h"
+#include "ExampleFrameListener.h"
+
+#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
+#include <CoreFoundation/CoreFoundation.h>
+
+// This function will locate the path to our application on OS X,
+// unlike windows you can not rely on the curent working directory
+// for locating your configuration files and resources.
+std::string macBundlePath()
+{
+    char path[1024];
+    CFBundleRef mainBundle = CFBundleGetMainBundle();
+    assert(mainBundle);
+
+    CFURLRef mainBundleURL = CFBundleCopyBundleURL(mainBundle);
+    assert(mainBundleURL);
+
+    CFStringRef cfStringRef = CFURLCopyFileSystemPath( mainBundleURL, kCFURLPOSIXPathStyle);
+    assert(cfStringRef);
+
+    CFStringGetCString(cfStringRef, path, 1024, kCFStringEncodingASCII);
+
+    CFRelease(mainBundleURL);
+    CFRelease(cfStringRef);
+
+    return std::string(path);
+}
+#endif
+
+using namespace Ogre;
+
+/** Base class which manages the standard startup of an Ogre application.
+    Designed to be subclassed for specific examples if required.
+*/
+class ExampleApplication
+{
+public:
+    /// Standard constructor
+    ExampleApplication()
+    {
+        mFrameListener = 0;
+        mRoot = 0;
+		// Provide a nice cross platform solution for locating the configuration files
+		// On windows files are searched for in the current working directory, on OS X however
+		// you must provide the full path, the helper function macBundlePath does this for us.
+#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
+		mResourcePath = macBundlePath() + "/Contents/Resources/";
+#else
+		mResourcePath = "";
+#endif
+    }
+    /// Standard destructor
+    virtual ~ExampleApplication()
+    {
+        if (mFrameListener)
+            delete mFrameListener;
+        if (mRoot)
+            delete mRoot;
+    }
+
+    /// Start the example
+    virtual void go(void)
+    {
+        if (!setup())
+            return;
+
+        mRoot->startRendering();
+
+        // clean up
+        destroyScene();
+    }
+
+protected:
+    Root *mRoot;
+    Camera* mCamera;
+    SceneManager* mSceneMgr;
+    ExampleFrameListener* mFrameListener;
+    RenderWindow* mWindow;
+	Ogre::String mResourcePath;
+
+    // These internal methods package up the stages in the startup process
+    /** Sets up the application - returns false if the user chooses to abandon configuration. */
+    virtual bool setup(void)
+    {
+
+		String pluginsPath;
+		// only use plugins.cfg if not static
+#ifndef OGRE_STATIC_LIB
+		pluginsPath = mResourcePath + "plugins.cfg";
+#endif
+		
+        mRoot = new Root(pluginsPath, 
+            mResourcePath + "ogre.cfg", mResourcePath + "Ogre.log");
+
+        setupResources();
+
+        bool carryOn = configure();
+        if (!carryOn) return false;
+
+        chooseSceneManager();
+        createCamera();
+        createViewports();
+
+        // Set default mipmap level (NB some APIs ignore this)
+        TextureManager::getSingleton().setDefaultNumMipmaps(5);
+
+		// Create any resource listeners (for loading screens)
+		createResourceListener();
+		// Load resources
+		loadResources();
+
+		// Create the scene
+        createScene();
+
+        createFrameListener();
+
+        return true;
+
+    }
+    /** Configures the application - returns false if the user chooses to abandon configuration. */
+    virtual bool configure(void)
+    {
+        // Show the configuration dialog and initialise the system
+        // You can skip this and use root.restoreConfig() to load configuration
+        // settings if you were sure there are valid ones saved in ogre.cfg
+        if(mRoot->showConfigDialog())
+        {
+            // If returned true, user clicked OK so initialise
+            // Here we choose to let the system create a default rendering window by passing 'true'
+            mWindow = mRoot->initialise(true);
+            return true;
+        }
+        else
+        {
+            return false;
+        }
+    }
+
+    virtual void chooseSceneManager(void)
+    {
+        // Create the SceneManager, in this case a generic one
+        mSceneMgr = mRoot->createSceneManager(ST_GENERIC, "ExampleSMInstance");
+    }
+    virtual void createCamera(void)
+    {
+        // Create the camera
+        mCamera = mSceneMgr->createCamera("PlayerCam");
+
+        // Position it at 500 in Z direction
+        mCamera->setPosition(Vector3(0,0,500));
+        // Look back along -Z
+        mCamera->lookAt(Vector3(0,0,-300));
+        mCamera->setNearClipDistance(5);
+
+    }
+    virtual void createFrameListener(void)
+    {
+        mFrameListener= new ExampleFrameListener(mWindow, mCamera);
+        mFrameListener->showDebugOverlay(true);
+        mRoot->addFrameListener(mFrameListener);
+    }
+
+    virtual void createScene(void) = 0;    // pure virtual - this has to be overridden
+
+    virtual void destroyScene(void){}    // Optional to override this
+
+    virtual void createViewports(void)
+    {
+        // Create one viewport, entire window
+        Viewport* vp = mWindow->addViewport(mCamera);
+        vp->setBackgroundColour(ColourValue(0,0,0));
+
+        // Alter the camera aspect ratio to match the viewport
+        mCamera->setAspectRatio(
+            Real(vp->getActualWidth()) / Real(vp->getActualHeight()));
+    }
+
+    /// Method which will define the source of resources (other than current folder)
+    virtual void setupResources(void)
+    {
+        // Load resource paths from config file
+        ConfigFile cf;
+        cf.load(mResourcePath + "resources.cfg");
+
+        // Go through all sections & settings in the file
+        ConfigFile::SectionIterator seci = cf.getSectionIterator();
+
+        String secName, typeName, archName;
+        while (seci.hasMoreElements())
+        {
+            secName = seci.peekNextKey();
+            ConfigFile::SettingsMultiMap *settings = seci.getNext();
+            ConfigFile::SettingsMultiMap::iterator i;
+            for (i = settings->begin(); i != settings->end(); ++i)
+            {
+                typeName = i->first;
+                archName = i->second;
+#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
+                // OS X does not set the working directory relative to the app,
+                // In order to make things portable on OS X we need to provide
+                // the loading with it's own bundle path location
+                ResourceGroupManager::getSingleton().addResourceLocation(
+                    String(macBundlePath() + "/" + archName), typeName, secName);
+#else
+                ResourceGroupManager::getSingleton().addResourceLocation(
+                    archName, typeName, secName);
+#endif
+            }
+        }
+    }
+
+	/// Optional override method where you can create resource listeners (e.g. for loading screens)
+	virtual void createResourceListener(void)
+	{
+
+	}
+
+	/// Optional override method where you can perform resource group loading
+	/// Must at least do ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
+	virtual void loadResources(void)
+	{
+		// Initialise, parse scripts etc
+		ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
+
+	}
+
+
+
+};
+
+
+#endif
Index: code/trunk/Tutorial/src/ExampleFrameListener.h
===================================================================
--- code/trunk/Tutorial/src/ExampleFrameListener.h	(revision 44)
+++ code/trunk/Tutorial/src/ExampleFrameListener.h	(revision 44)
@@ -0,0 +1,401 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+You may use this sample code for anything you like, it is not covered by the
+LGPL like the rest of the engine.
+-----------------------------------------------------------------------------
+*/
+/*
+-----------------------------------------------------------------------------
+Filename:    ExampleFrameListener.h
+Description: Defines an example frame listener which responds to frame events.
+This frame listener just moves a specified camera around based on
+keyboard and mouse movements.
+Mouse:    Freelook
+W or Up:  Forward
+S or Down:Backward
+A:        Step left
+D:        Step right
+             PgUp:     Move upwards
+             PgDown:   Move downwards
+             F:        Toggle frame rate stats on/off
+			 R:        Render mode
+             T:        Cycle texture filtering
+                       Bilinear, Trilinear, Anisotropic(8)
+             P:        Toggle on/off display of camera position / orientation
+-----------------------------------------------------------------------------
+*/
+
+#ifndef __ExampleFrameListener_H__
+#define __ExampleFrameListener_H__
+
+#include "Ogre.h"
+#include "OgreStringConverter.h"
+#include "OgreException.h"
+
+//Use this define to signify OIS will be used as a DLL
+//(so that dll import/export macros are in effect)
+#define OIS_DYNAMIC_LIB
+#include <OIS/OIS.h>
+
+using namespace Ogre;
+
+class ExampleFrameListener: public FrameListener, public WindowEventListener
+{
+protected:
+	void updateStats(void)
+	{
+		static String currFps = "Current FPS: ";
+		static String avgFps = "Average FPS: ";
+		static String bestFps = "Best FPS: ";
+		static String worstFps = "Worst FPS: ";
+		static String tris = "Triangle Count: ";
+		static String batches = "Batch Count: ";
+
+		// update stats when necessary
+		try {
+			OverlayElement* guiAvg = OverlayManager::getSingleton().getOverlayElement("Core/AverageFps");
+			OverlayElement* guiCurr = OverlayManager::getSingleton().getOverlayElement("Core/CurrFps");
+			OverlayElement* guiBest = OverlayManager::getSingleton().getOverlayElement("Core/BestFps");
+			OverlayElement* guiWorst = OverlayManager::getSingleton().getOverlayElement("Core/WorstFps");
+
+			const RenderTarget::FrameStats& stats = mWindow->getStatistics();
+			guiAvg->setCaption(avgFps + StringConverter::toString(stats.avgFPS));
+			guiCurr->setCaption(currFps + StringConverter::toString(stats.lastFPS));
+			guiBest->setCaption(bestFps + StringConverter::toString(stats.bestFPS)
+				+" "+StringConverter::toString(stats.bestFrameTime)+" ms");
+			guiWorst->setCaption(worstFps + StringConverter::toString(stats.worstFPS)
+				+" "+StringConverter::toString(stats.worstFrameTime)+" ms");
+
+			OverlayElement* guiTris = OverlayManager::getSingleton().getOverlayElement("Core/NumTris");
+			guiTris->setCaption(tris + StringConverter::toString(stats.triangleCount));
+
+			OverlayElement* guiBatches = OverlayManager::getSingleton().getOverlayElement("Core/NumBatches");
+			guiBatches->setCaption(batches + StringConverter::toString(stats.batchCount));
+
+			OverlayElement* guiDbg = OverlayManager::getSingleton().getOverlayElement("Core/DebugText");
+			guiDbg->setCaption(mDebugText);
+		}
+		catch(...) { /* ignore */ }
+	}
+
+public:
+	// Constructor takes a RenderWindow because it uses that to determine input context
+	ExampleFrameListener(RenderWindow* win, Camera* cam, bool bufferedKeys = false, bool bufferedMouse = false,
+			     bool bufferedJoy = false ) :
+		mCamera(cam), mTranslateVector(Vector3::ZERO), mWindow(win), mStatsOn(true), mNumScreenShots(0),
+		mMoveScale(0.0f), mRotScale(0.0f), mTimeUntilNextToggle(0), mFiltering(TFO_BILINEAR),
+		mAniso(1), mSceneDetailIndex(0), mMoveSpeed(100), mRotateSpeed(36), mDebugOverlay(0),
+		mInputManager(0), mMouse(0), mKeyboard(0), mJoy(0)
+	{
+		using namespace OIS;
+
+		mDebugOverlay = OverlayManager::getSingleton().getByName("Core/DebugOverlay");
+
+		LogManager::getSingletonPtr()->logMessage("*** Initializing OIS ***");
+		ParamList pl;
+		size_t windowHnd = 0;
+		std::ostringstream windowHndStr;
+
+		win->getCustomAttribute("WINDOW", &windowHnd);
+		windowHndStr << windowHnd;
+		pl.insert(std::make_pair(std::string("WINDOW"), windowHndStr.str()));
+
+		mInputManager = InputManager::createInputSystem( pl );
+
+		//Create all devices (We only catch joystick exceptions here, as, most people have Key/Mouse)
+		mKeyboard = static_cast<Keyboard*>(mInputManager->createInputObject( OISKeyboard, bufferedKeys ));
+		mMouse = static_cast<Mouse*>(mInputManager->createInputObject( OISMouse, bufferedMouse ));
+		try {
+			mJoy = static_cast<JoyStick*>(mInputManager->createInputObject( OISJoyStick, bufferedJoy ));
+		}
+		catch(...) {
+			mJoy = 0;
+		}
+
+		//Set initial mouse clipping size
+		windowResized(mWindow);
+
+		showDebugOverlay(true);
+
+		//Register as a Window listener
+		WindowEventUtilities::addWindowEventListener(mWindow, this);
+	}
+
+	//Adjust mouse clipping area
+	virtual void windowResized(RenderWindow* rw)
+	{
+		unsigned int width, height, depth;
+		int left, top;
+		rw->getMetrics(width, height, depth, left, top);
+
+		const OIS::MouseState &ms = mMouse->getMouseState();
+		ms.width = width;
+		ms.height = height;
+	}
+
+	//Unattach OIS before window shutdown (very important under Linux)
+	virtual void windowClosed(RenderWindow* rw)
+	{
+		//Only close for window that created OIS (the main window in these demos)
+		if( rw == mWindow )
+		{
+			if( mInputManager )
+			{
+				mInputManager->destroyInputObject( mMouse );
+				mInputManager->destroyInputObject( mKeyboard );
+				mInputManager->destroyInputObject( mJoy );
+
+				OIS::InputManager::destroyInputSystem(mInputManager);
+				mInputManager = 0;
+			}
+		}
+	}
+
+	virtual ~ExampleFrameListener()
+	{
+		//Remove ourself as a Window listener
+		WindowEventUtilities::removeWindowEventListener(mWindow, this);
+		windowClosed(mWindow);
+	}
+
+	virtual bool processUnbufferedKeyInput(const FrameEvent& evt)
+	{
+		using namespace OIS;
+
+		if(mKeyboard->isKeyDown(KC_A))
+			mTranslateVector.x = -mMoveScale;	// Move camera left
+
+		if(mKeyboard->isKeyDown(KC_D))
+			mTranslateVector.x = mMoveScale;	// Move camera RIGHT
+
+		if(mKeyboard->isKeyDown(KC_UP) || mKeyboard->isKeyDown(KC_W) )
+			mTranslateVector.z = -mMoveScale;	// Move camera forward
+
+		if(mKeyboard->isKeyDown(KC_DOWN) || mKeyboard->isKeyDown(KC_S) )
+			mTranslateVector.z = mMoveScale;	// Move camera backward
+
+		if(mKeyboard->isKeyDown(KC_PGUP))
+			mTranslateVector.y = mMoveScale;	// Move camera up
+
+		if(mKeyboard->isKeyDown(KC_PGDOWN))
+			mTranslateVector.y = -mMoveScale;	// Move camera down
+
+		if(mKeyboard->isKeyDown(KC_RIGHT))
+			mCamera->yaw(-mRotScale);
+
+		if(mKeyboard->isKeyDown(KC_LEFT))
+			mCamera->yaw(mRotScale);
+
+		if( mKeyboard->isKeyDown(KC_ESCAPE) || mKeyboard->isKeyDown(KC_Q) )
+			return false;
+
+       	if( mKeyboard->isKeyDown(KC_F) && mTimeUntilNextToggle <= 0 )
+		{
+			mStatsOn = !mStatsOn;
+			showDebugOverlay(mStatsOn);
+			mTimeUntilNextToggle = 1;
+		}
+
+		if( mKeyboard->isKeyDown(KC_T) && mTimeUntilNextToggle <= 0 )
+		{
+			switch(mFiltering)
+			{
+			case TFO_BILINEAR:
+				mFiltering = TFO_TRILINEAR;
+				mAniso = 1;
+				break;
+			case TFO_TRILINEAR:
+				mFiltering = TFO_ANISOTROPIC;
+				mAniso = 8;
+				break;
+			case TFO_ANISOTROPIC:
+				mFiltering = TFO_BILINEAR;
+				mAniso = 1;
+				break;
+			default: break;
+			}
+			MaterialManager::getSingleton().setDefaultTextureFiltering(mFiltering);
+			MaterialManager::getSingleton().setDefaultAnisotropy(mAniso);
+
+			showDebugOverlay(mStatsOn);
+			mTimeUntilNextToggle = 1;
+		}
+
+		if(mKeyboard->isKeyDown(KC_SYSRQ) && mTimeUntilNextToggle <= 0)
+		{
+			std::ostringstream ss;
+			ss << "screenshot_" << ++mNumScreenShots << ".png";
+			mWindow->writeContentsToFile(ss.str());
+			mTimeUntilNextToggle = 0.5;
+			mDebugText = "Saved: " + ss.str();
+		}
+
+		if(mKeyboard->isKeyDown(KC_R) && mTimeUntilNextToggle <=0)
+		{
+			mSceneDetailIndex = (mSceneDetailIndex+1)%3 ;
+			switch(mSceneDetailIndex) {
+				case 0 : mCamera->setPolygonMode(PM_SOLID); break;
+				case 1 : mCamera->setPolygonMode(PM_WIREFRAME); break;
+				case 2 : mCamera->setPolygonMode(PM_POINTS); break;
+			}
+			mTimeUntilNextToggle = 0.5;
+		}
+
+		static bool displayCameraDetails = false;
+		if(mKeyboard->isKeyDown(KC_P) && mTimeUntilNextToggle <= 0)
+		{
+			displayCameraDetails = !displayCameraDetails;
+			mTimeUntilNextToggle = 0.5;
+			if (!displayCameraDetails)
+				mDebugText = "";
+		}
+
+		// Print camera details
+		if(displayCameraDetails)
+			mDebugText = "P: " + StringConverter::toString(mCamera->getDerivedPosition()) +
+						 " " + "O: " + StringConverter::toString(mCamera->getDerivedOrientation());
+
+		// Return true to continue rendering
+		return true;
+	}
+
+	bool processUnbufferedMouseInput(const FrameEvent& evt)
+	{
+		using namespace OIS;
+
+		// Rotation factors, may not be used if the second mouse button is pressed
+		// 2nd mouse button - slide, otherwise rotate
+		const MouseState &ms = mMouse->getMouseState();
+		if( ms.buttonDown( MB_Right ) )
+		{
+			mTranslateVector.x += ms.X.rel * 0.13;
+			mTranslateVector.y -= ms.Y.rel * 0.13;
+		}
+		else
+		{
+			mRotX = Degree(-ms.X.rel * 0.13);
+			mRotY = Degree(-ms.Y.rel * 0.13);
+		}
+
+		return true;
+	}
+
+	void moveCamera()
+	{
+		// Make all the changes to the camera
+		// Note that YAW direction is around a fixed axis (freelook style) rather than a natural YAW
+		//(e.g. airplane)
+		mCamera->yaw(mRotX);
+		mCamera->pitch(mRotY);
+		mCamera->moveRelative(mTranslateVector);
+	}
+
+	void showDebugOverlay(bool show)
+	{
+		if (mDebugOverlay)
+		{
+			if (show)
+				mDebugOverlay->show();
+			else
+				mDebugOverlay->hide();
+		}
+	}
+
+	// Override frameStarted event to process that (don't care about frameEnded)
+	bool frameStarted(const FrameEvent& evt)
+	{
+		using namespace OIS;
+
+		if(mWindow->isClosed())	return false;
+
+		//Need to capture/update each device
+		mKeyboard->capture();
+		mMouse->capture();
+		if( mJoy ) mJoy->capture();
+
+		bool buffJ = (mJoy) ? mJoy->buffered() : true;
+
+		//Check if one of the devices is not buffered
+		if( !mMouse->buffered() || !mKeyboard->buffered() || !buffJ )
+		{
+			// one of the input modes is immediate, so setup what is needed for immediate movement
+			if (mTimeUntilNextToggle >= 0)
+				mTimeUntilNextToggle -= evt.timeSinceLastFrame;
+
+			// If this is the first frame, pick a speed
+			if (evt.timeSinceLastFrame == 0)
+			{
+				mMoveScale = 1;
+				mRotScale = 0.1;
+			}
+			// Otherwise scale movement units by time passed since last frame
+			else
+			{
+				// Move about 100 units per second,
+				mMoveScale = mMoveSpeed * evt.timeSinceLastFrame;
+				// Take about 10 seconds for full rotation
+				mRotScale = mRotateSpeed * evt.timeSinceLastFrame;
+			}
+			mRotX = 0;
+			mRotY = 0;
+			mTranslateVector = Ogre::Vector3::ZERO;
+		}
+
+		//Check to see which device is not buffered, and handle it
+		if( !mKeyboard->buffered() )
+			if( processUnbufferedKeyInput(evt) == false )
+				return false;
+		if( !mMouse->buffered() )
+			if( processUnbufferedMouseInput(evt) == false )
+				return false;
+
+		if( !mMouse->buffered() || !mKeyboard->buffered() || !buffJ )
+			moveCamera();
+
+		return true;
+	}
+
+	bool frameEnded(const FrameEvent& evt)
+	{
+		updateStats();
+		return true;
+	}
+
+protected:
+	Camera* mCamera;
+
+	Vector3 mTranslateVector;
+	RenderWindow* mWindow;
+	bool mStatsOn;
+
+	std::string mDebugText;
+
+	unsigned int mNumScreenShots;
+	float mMoveScale;
+	Degree mRotScale;
+	// just to stop toggles flipping too fast
+	Real mTimeUntilNextToggle ;
+	Radian mRotX, mRotY;
+	TextureFilterOptions mFiltering;
+	int mAniso;
+
+	int mSceneDetailIndex ;
+	Real mMoveSpeed;
+	Degree mRotateSpeed;
+	Overlay* mDebugOverlay;
+
+	//OIS Input devices
+	OIS::InputManager* mInputManager;
+	OIS::Mouse*    mMouse;
+	OIS::Keyboard* mKeyboard;
+	OIS::JoyStick* mJoy;
+};
+
+#endif
Index: code/trunk/Tutorial/src/ExampleLoadingBar.h
===================================================================
--- code/trunk/Tutorial/src/ExampleLoadingBar.h	(revision 44)
+++ code/trunk/Tutorial/src/ExampleLoadingBar.h	(revision 44)
@@ -0,0 +1,182 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+(Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+You may use this sample code for anything you like, it is not covered by the
+LGPL like the rest of the engine.
+-----------------------------------------------------------------------------
+*/
+/*
+-----------------------------------------------------------------------------
+Filename:    ExampleLoadingBar.h
+Description: Defines an example loading progress bar which you can use during 
+startup, level changes etc to display loading progress. 
+IMPORTANT: Note that this progress bar relies on you having the OgreCore.zip 
+package already added to a resource group called 'Bootstrap' - this provides
+the basic resources required for the progress bar and will be loaded automatically.
+*/
+#include "OgreResourceGroupManager.h"
+#include "OgreException.h"
+#include "OgreOverlay.h"
+#include "OgreOverlayManager.h"
+#include "OgreRenderWindow.h"
+
+using namespace Ogre;
+
+/** Defines an example loading progress bar which you can use during 
+	startup, level changes etc to display loading progress. 
+@remarks
+	Basically you just need to create an instance of this class, call start()
+	before loading and finish() afterwards. You may also need to stop areas of
+	your scene rendering in between since this method will call 
+	RenderWindow::update() to update the display of the bar - we advise using
+	SceneManager's 'special case render queues' for this, see
+	SceneManager::addSpecialCaseRenderQueue for details.
+@note 
+	This progress bar relies on you having the OgreCore.zip package already 
+	added to a resource group called 'Bootstrap' - this provides the basic 
+	resources required for the progress bar and will be loaded automatically.
+*/
+class ExampleLoadingBar : public ResourceGroupListener
+{
+protected:
+	RenderWindow* mWindow;
+	Overlay* mLoadOverlay;
+	Real mInitProportion;
+	unsigned short mNumGroupsInit;
+	unsigned short mNumGroupsLoad;
+	Real mProgressBarMaxSize;
+	Real mProgressBarScriptSize;
+	Real mProgressBarInc;
+	OverlayElement* mLoadingBarElement;
+	OverlayElement* mLoadingDescriptionElement;
+	OverlayElement* mLoadingCommentElement;
+
+public:
+	ExampleLoadingBar() {}
+	virtual ~ExampleLoadingBar(){}
+
+	/** Show the loading bar and start listening.
+	@param window The window to update 
+	@param numGroupsInit The number of groups you're going to be initialising
+	@param numGroupsLoad The number of groups you're going to be loading
+	@param initProportion The proportion of the progress which will be taken
+		up by initialisation (ie script parsing etc). Defaults to 0.7 since
+		script parsing can often take the majority of the time.
+	*/
+	virtual void start(RenderWindow* window, 
+		unsigned short numGroupsInit = 1, 
+		unsigned short numGroupsLoad = 1, 
+		Real initProportion = 0.70f)
+	{
+		mWindow = window;
+		mNumGroupsInit = numGroupsInit;
+		mNumGroupsLoad = numGroupsLoad;
+		mInitProportion = initProportion;
+		// We need to pre-initialise the 'Bootstrap' group so we can use
+		// the basic contents in the loading screen
+		ResourceGroupManager::getSingleton().initialiseResourceGroup("Bootstrap");
+
+		OverlayManager& omgr = OverlayManager::getSingleton();
+		mLoadOverlay = (Overlay*)omgr.getByName("Core/LoadOverlay");
+		if (!mLoadOverlay)
+		{
+			OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, 
+				"Cannot find loading overlay", "ExampleLoadingBar::start");
+		}
+		mLoadOverlay->show();
+
+		// Save links to the bar and to the loading text, for updates as we go
+		mLoadingBarElement = omgr.getOverlayElement("Core/LoadPanel/Bar/Progress");
+		mLoadingCommentElement = omgr.getOverlayElement("Core/LoadPanel/Comment");
+		mLoadingDescriptionElement = omgr.getOverlayElement("Core/LoadPanel/Description");
+
+		OverlayElement* barContainer = omgr.getOverlayElement("Core/LoadPanel/Bar");
+		mProgressBarMaxSize = barContainer->getWidth();
+		mLoadingBarElement->setWidth(0);
+
+		// self is listener
+		ResourceGroupManager::getSingleton().addResourceGroupListener(this);
+
+
+
+	}
+
+	/** Hide the loading bar and stop listening. 
+	*/
+	virtual void finish(void)
+	{
+		// hide loading screen
+		mLoadOverlay->hide();
+
+		// Unregister listener
+		ResourceGroupManager::getSingleton().removeResourceGroupListener(this);
+
+	}
+
+
+	// ResourceGroupListener callbacks
+	void resourceGroupScriptingStarted(const String& groupName, size_t scriptCount)
+	{
+		assert(mNumGroupsInit > 0 && "You stated you were not going to init "
+			"any groups, but you did! Divide by zero would follow...");
+		// Lets assume script loading is 70%
+		mProgressBarInc = mProgressBarMaxSize * mInitProportion / (Real)scriptCount;
+		mProgressBarInc /= mNumGroupsInit;
+		mLoadingDescriptionElement->setCaption("Parsing scripts...");
+		mWindow->update();
+	}
+	void scriptParseStarted(const String& scriptName)
+	{
+		mLoadingCommentElement->setCaption(scriptName);
+		mWindow->update();
+	}
+	void scriptParseEnded(const String& scriptName)
+	{
+		mLoadingBarElement->setWidth(
+			mLoadingBarElement->getWidth() + mProgressBarInc);
+		mWindow->update();
+	}
+	void resourceGroupScriptingEnded(const String& groupName)
+	{
+	}
+	void resourceGroupLoadStarted(const String& groupName, size_t resourceCount)
+	{
+		assert(mNumGroupsLoad > 0 && "You stated you were not going to load "
+			"any groups, but you did! Divide by zero would follow...");
+		mProgressBarInc = mProgressBarMaxSize * (1-mInitProportion) / 
+			(Real)resourceCount;
+		mProgressBarInc /= mNumGroupsLoad;
+		mLoadingDescriptionElement->setCaption("Loading resources...");
+		mWindow->update();
+	}
+	void resourceLoadStarted(const ResourcePtr& resource)
+	{
+		mLoadingCommentElement->setCaption(resource->getName());
+		mWindow->update();
+	}
+	void resourceLoadEnded(void)
+	{
+	}
+	void worldGeometryStageStarted(const String& description)
+	{
+		mLoadingCommentElement->setCaption(description);
+		mWindow->update();
+	}
+	void worldGeometryStageEnded(void)
+	{
+		mLoadingBarElement->setWidth(
+			mLoadingBarElement->getWidth() + mProgressBarInc);
+		mWindow->update();
+	}
+	void resourceGroupLoadEnded(const String& groupName)
+	{
+	}
+
+};
+
Index: code/trunk/Tutorial/src/main.cpp
===================================================================
--- code/trunk/Tutorial/src/main.cpp	(revision 44)
+++ code/trunk/Tutorial/src/main.cpp	(revision 44)
@@ -0,0 +1,93 @@
+#include "ExampleApplication.h"
+
+SceneNode *lightNode;
+
+class TutorialFrameListener : public ExampleFrameListener
+{
+public:
+    TutorialFrameListener(RenderWindow* win, Camera* cam, SceneManager *sceneMgr)
+        : ExampleFrameListener(win, cam, false, false)
+    {
+    }
+
+    bool frameStarted(const FrameEvent &evt)
+    {
+        // add tutorial code here:
+        // ...
+
+        return ExampleFrameListener::frameStarted(evt);
+    }
+private:
+};
+
+
+class TutorialApplication : public ExampleApplication
+{
+protected:
+public:
+    TutorialApplication()
+    {
+    }
+
+    ~TutorialApplication()
+    {
+    }
+protected:
+    void createCamera(void)
+    {
+        // create camera
+        mCamera = mSceneMgr->createCamera("PlayerCam");
+        mCamera->setNearClipDistance(5);
+        mCamera->setPosition(Vector3(0,10,500));
+        mCamera->lookAt(Vector3(0,0,0));
+    }
+
+    void createScene(void)
+    {
+        // add tutorial code here:
+        // ...
+        mSceneMgr->setAmbientLight( ColourValue( 1, 1, 1 ) );
+        Entity *ent1 = mSceneMgr->createEntity( "Robot", "robot.mesh" );
+        SceneNode *node1 = mSceneMgr->getRootSceneNode()->createChildSceneNode( "RobotNode" );
+        node1->attachObject( ent1 );
+
+        Entity *ent2 = mSceneMgr->createEntity( "Robot2", "robot.mesh" );
+        SceneNode *node2 = mSceneMgr->getRootSceneNode()->createChildSceneNode( "RobotNode2", Vector3( 50, 0, 0 ) );
+        node2->attachObject( ent2 );
+
+
+    }
+
+    void createFrameListener(void)
+    {
+        // create frame listener
+        mFrameListener = new TutorialFrameListener(mWindow, mCamera, mSceneMgr);
+        mRoot->addFrameListener(mFrameListener);
+    }
+};
+
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+#define WIN32_LEAN_AND_MEAN
+#include "windows.h"
+
+INT WINAPI WinMain( HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT )
+#else
+int main(int argc, char **argv)
+#endif
+{
+    // Create application object
+    TutorialApplication app;
+
+    try {
+        app.go();
+    } catch( Exception& e ) {
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+        MessageBox( NULL, e.getFullDescription().c_str(), "An exception has occurred!", MB_OK | MB_ICONERROR | MB_TASKMODAL);
+#else
+        fprintf(stderr, "An exception has occurred: %s\n",
+                e.getFullDescription().c_str());
+#endif
+    }
+
+    return 0;
+}
Index: code/trunk/test2.txt
===================================================================
--- code/trunk/test2.txt	(revision 43)
+++ 	(revision )
@@ -1,1 +1,0 @@
-test
