Index: GTP/trunk/App/Demos/Illum/Ogre/src/GameToolsToneMapDemo/include/GameToolsToneMapDemo.h
===================================================================
--- GTP/trunk/App/Demos/Illum/Ogre/src/GameToolsToneMapDemo/include/GameToolsToneMapDemo.h	(revision 1568)
+++ GTP/trunk/App/Demos/Illum/Ogre/src/GameToolsToneMapDemo/include/GameToolsToneMapDemo.h	(revision 1568)
@@ -0,0 +1,145 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2005 The OGRE Team
+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.
+-----------------------------------------------------------------------------
+*/
+
+/**
+    \file 
+        Lighting.h
+    \brief
+        Shows lighting support in OGRE. Also demonstrates the use of billboards
+        and controllers for automatic time-relative behaviour.
+*/
+
+
+#include "ExampleApplication.h"
+#include "OgreIlluminationManager.h"
+#include "SpriteParticleRenderer.h"
+
+
+// Listener class for frame updates
+class ParticleDemoFrameListener : public ExampleFrameListener
+{
+protected:
+	
+	unsigned long framecount;
+	
+public:
+    ParticleDemoFrameListener(RenderWindow* window, Camera* maincam)
+        :ExampleFrameListener(window, maincam) 
+				 
+    {
+		framecount = 0;		
+    }
+
+    bool frameStarted(const FrameEvent& evt)
+    {		
+		bool result = ExampleFrameListener::frameStarted(evt);
+       framecount++;
+        return result;     
+    }
+
+	
+
+};
+
+/** Application class */
+class ParticleDemoApplication : public ExampleApplication
+{
+
+public:
+
+protected:
+	SceneNode* kupolaNode;
+	SceneNode* mainLightNode;
+
+
+	void createPostproc()
+	{
+		/*CompositorManager::getSingleton().addCompositor(mWindow->getViewport(0),
+														"GameTools/Glow");
+		CompositorManager::getSingleton().setCompositorEnabled(mWindow->getViewport(0),
+														"GameTools/Glow", true);*/
+		CompositorManager::getSingleton().addCompositor(mWindow->getViewport(0),
+														"GameTools/ToneMap");
+		CompositorManager::getSingleton().setCompositorEnabled(mWindow->getViewport(0),
+														"GameTools/ToneMap", true);
+	}
+    
+
+	void createScene(void)
+    {
+		createPostproc();
+
+		OgreIlluminationManager::getSingleton().setMainCamera(mCamera);
+		OgreIlluminationManager::getSingleton().setMainViewport(mWindow->getViewport(0));
+				
+		Root::getSingleton()._setCurrentSceneManager(mSceneMgr);
+		mCamera->setPosition(0,100,240);
+		mCamera->setFOVy(Radian(Degree(80)));
+		//mCamera->setFarClipDistance(1000);
+		// Set ambient light
+        mSceneMgr->setAmbientLight(ColourValue(0.2, 0.2, 0.2));
+
+		// Skybox
+        mSceneMgr->setSkyBox(true, "Examples/MorningSkyBox");
+		SceneNode* rootNode = mSceneMgr->getRootSceneNode();	
+			
+      
+		//init objects
+		Entity* kupola = mSceneMgr->createEntity("kupola", "kupola.mesh");
+		kupola->getSubEntity(0)->setMaterialName("kupolafal_low");
+		kupola->getSubEntity(1)->setMaterialName("kupolatalaj_low");
+		Entity* head = mSceneMgr->createEntity("head", "ogrehead.mesh");
+				
+		//init nodes
+		kupolaNode = rootNode->createChildSceneNode( "kupola" );
+		kupolaNode->rotate(Vector3(0,1,0),Radian(Degree(90)));
+		kupolaNode->attachObject( kupola );
+		kupolaNode->scale(25,21,25);		
+		kupolaNode->_updateBounds();
+		MeshPtr kmesh = kupola->getMesh();
+		kmesh->buildTangentVectors(0,1);
+		
+		SceneNode* headNode = rootNode->createChildSceneNode("head");
+		headNode->attachObject(head);
+		headNode->setScale(2,2,2);
+		AxisAlignedBox bbox = head->getBoundingBox();
+		headNode->setPosition(0, 100,0);		
+		headNode->_updateBounds();
+		
+
+		//Init lights
+	/*	Light* mainLight = mSceneMgr->createLight("MainLight");
+		mainLight->setType(Light::LT_POINT);
+		mainLight->setDiffuseColour(ColourValue(0.9,0.9,0.9,1));
+		mainLight->setSpecularColour(ColourValue(0.9, 0.9,0.9,1));
+		mainLight->setAttenuation(400, 1.0, 1, 1);
+		mainLightNode = rootNode->createChildSceneNode();
+		mainLightNode->setPosition(0,150,0);
+		mainLight->setPosition(mainLightNode->getWorldPosition());
+		mainLightNode->attachObject(mainLight); 	*/
+	
+		
+   }
+
+	void createFrameListener(void)
+    {
+		// This is where we instantiate our own frame listener
+		mFrameListener= new ParticleDemoFrameListener(mWindow,
+											mCamera	);
+    mRoot->addFrameListener(mFrameListener);
+	mRoot->addFrameListener(&OgreIlluminationManager::getSingleton());
+   }
+
+};
+
Index: GTP/trunk/App/Demos/Illum/Ogre/src/GameToolsToneMapDemo/scripts/GameToolsToneMapDemo.vcproj
===================================================================
--- GTP/trunk/App/Demos/Illum/Ogre/src/GameToolsToneMapDemo/scripts/GameToolsToneMapDemo.vcproj	(revision 1568)
+++ GTP/trunk/App/Demos/Illum/Ogre/src/GameToolsToneMapDemo/scripts/GameToolsToneMapDemo.vcproj	(revision 1568)
@@ -0,0 +1,163 @@
+<?xml version="1.0" encoding="windows-1250"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="ToneMapDemo"
+	ProjectGUID="{09F9E809-02CF-4926-8203-2B9C02FBD916}"
+	Keyword="Win32Proj">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				ImproveFloatingPointConsistency="TRUE"
+				AdditionalIncludeDirectories="..\include;&quot;$(OGRE_PATH)\Samples\Common\include&quot;;&quot;$(OGRE_PATH)\OgreMain\include&quot;;..\..\..\..\..\..\..\Lib\Illum\IllumModule\OgreIllumModule\include;..\..\..\..\..\..\..\Lib\Illum\IllumModule\OgreIllumModule\include\RenderTechniques;..\..\..\..\..\..\..\Lib\Illum\IllumModule\OgreIllumModule\include\RenderingRuns;..\..\..\..\..\..\..\Lib\Illum\IllumModule\IllumModule\include\RenderTechniques;..\..\..\..\..\..\..\Lib\Illum\IllumModule\IllumModule\include;..\..\..\..\..\..\..\Lib\Illum\IllumModule\IllumModule\include\RenderingRuns"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;GAMETOOLS_ILLUMINATION_MODULE"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="4"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain_d.lib IllumModule_Ogre.lib IllumModule.lib"
+				OutputFile="$(OutDir)/GameToolsToneMapDemo.exe"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories="..\..\..\..\..\..\..\Lib\Illum\IllumModule\OgreIllumModule\bin\Debug;&quot;$(OGRE_PATH)\OgreMain\lib\$(ConfigurationName)&quot;;..\..\..\..\..\..\..\Lib\Illum\IllumModule\IllumModule\bin\Debug"
+				IgnoreDefaultLibraryNames=""
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile="$(OutDir)/proba.pdb"
+				SubSystem="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\..\bin\$(ConfigurationName)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="..\bin\$(ConfigurationName)"
+			IntermediateDirectory="..\obj\$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="2"
+			WholeProgramOptimization="TRUE">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				GlobalOptimizations="TRUE"
+				InlineFunctionExpansion="1"
+				EnableIntrinsicFunctions="TRUE"
+				ImproveFloatingPointConsistency="TRUE"
+				FavorSizeOrSpeed="1"
+				OmitFramePointers="TRUE"
+				EnableFiberSafeOptimizations="FALSE"
+				OptimizeForProcessor="2"
+				OptimizeForWindowsApplication="TRUE"
+				AdditionalIncludeDirectories="..\include;&quot;$(OGRE_PATH)\Samples\Common\include&quot;;&quot;$(OGRE_PATH)\OgreMain\include&quot;;..\..\..\..\..\..\..\Lib\Illum\IllumModule\OgreIllumModule\include;..\..\..\..\..\..\..\Lib\Illum\IllumModule\OgreIllumModule\include\RenderTechniques;..\..\..\..\..\..\..\Lib\Illum\IllumModule\OgreIllumModule\include\RenderingRuns;..\..\..\..\..\..\..\Lib\Illum\IllumModule\IllumModule\include\RenderTechniques;..\..\..\..\..\..\..\Lib\Illum\IllumModule\IllumModule\include;..\..\..\..\..\..\..\Lib\Illum\IllumModule\IllumModule\include\RenderingRuns"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;GAMETOOLS_ILLUMINATION_MODULE"
+				StringPooling="TRUE"
+				MinimalRebuild="TRUE"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="FALSE"
+				EnableFunctionLevelLinking="TRUE"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OgreMain.lib IllumModule_Ogre.lib IllumModule.lib"
+				OutputFile="$(OutDir)/GameToolsToneMapDemo.exe"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="..\..\..\..\..\..\..\Lib\Illum\IllumModule\OgreIllumModule\bin\Release;&quot;$(OGRE_PATH)\OgreMain\lib\$(ConfigurationName)&quot;;..\..\..\..\..\..\..\Lib\Illum\IllumModule\IllumModule\bin\Release"
+				GenerateDebugInformation="FALSE"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				OptimizeForWindows98="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\..\bin\$(ConfigurationName)"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm">
+			<File
+				RelativePath="..\src\GameToolsToneMapDemo.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc">
+			<File
+				RelativePath="..\include\GameToolsToneMapDemo.h">
+			</File>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
+			<File
+				RelativePath="..\..\..\Media\materials\scripts\kupola.material">
+			</File>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Index: GTP/trunk/App/Demos/Illum/Ogre/src/GameToolsToneMapDemo/scripts/GameToolsToneMapDemo.dsp
===================================================================
--- GTP/trunk/App/Demos/Illum/Ogre/src/GameToolsToneMapDemo/scripts/GameToolsToneMapDemo.dsp	(revision 1568)
+++ GTP/trunk/App/Demos/Illum/Ogre/src/GameToolsToneMapDemo/scripts/GameToolsToneMapDemo.dsp	(revision 1568)
@@ -0,0 +1,114 @@
+# Microsoft Developer Studio Project File - Name="Demo_Lighting" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Application" 0x0101
+
+CFG=Demo_Lighting - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "Demo_Lighting.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "Demo_Lighting.mak" CFG="Demo_Lighting - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "Demo_Lighting - Win32 Release" (based on "Win32 (x86) Application")
+!MESSAGE "Demo_Lighting - Win32 Debug" (based on "Win32 (x86) Application")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+MTL=midl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "Demo_Lighting - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "..\bin\Release"
+# PROP BASE Intermediate_Dir "..\obj\Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "..\bin\Release"
+# PROP Intermediate_Dir "..\obj\Release"
+# PROP Ignore_Export_Lib 1
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\include" /I "..\..\Common\include" /I "..\..\..\OgreMain\include" /D "NDEBUG" /D "_MBCS" /D "_WINDOWS" /D "WIN32" /YX /FD /c
+# SUBTRACT CPP /Fr
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x809 /d "NDEBUG"
+# ADD RSC /l 0x809 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib OgreMain.lib /nologo /subsystem:windows /machine:I386 /out:"../../Common/Bin/Release/Demo_Lighting.exe" /libpath:"..\..\..\OgreMain\lib\release"
+# SUBTRACT LINK32 /profile /debug
+
+!ELSEIF  "$(CFG)" == "Demo_Lighting - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "..\bin\Debug"
+# PROP BASE Intermediate_Dir "..\obj\Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "..\bin\Debug"
+# PROP Intermediate_Dir "..\obj\Debug"
+# PROP Ignore_Export_Lib 1
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\include" /I "..\..\Common\include" /I "..\..\..\OgreMain\include" /D "_MBCS" /D "_WINDOWS" /D "_DEBUG" /D "WIN32" /FD /GZ /Zm500 /c
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x809 /d "_DEBUG"
+# ADD RSC /l 0x809 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib OgreMain_d.lib /nologo /subsystem:windows /debug /machine:I386 /nodefaultlib:"LIBCMT" /out:"../../Common/Bin/Debug/Demo_Lighting.exe" /pdbtype:sept /libpath:"..\..\..\OgreMain\lib\debug"
+# SUBTRACT LINK32 /verbose
+
+!ENDIF 
+
+# Begin Target
+
+# Name "Demo_Lighting - Win32 Release"
+# Name "Demo_Lighting - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\src\Lighting.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=..\include\Lighting.h
+# End Source File
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
Index: GTP/trunk/App/Demos/Illum/Ogre/src/GameToolsToneMapDemo/src/GameToolsToneMapDemo.cpp
===================================================================
--- GTP/trunk/App/Demos/Illum/Ogre/src/GameToolsToneMapDemo/src/GameToolsToneMapDemo.cpp	(revision 1568)
+++ GTP/trunk/App/Demos/Illum/Ogre/src/GameToolsToneMapDemo/src/GameToolsToneMapDemo.cpp	(revision 1568)
@@ -0,0 +1,62 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2005 The OGRE Team
+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.
+-----------------------------------------------------------------------------
+*/
+
+/**
+    \file 
+        Lighting.cpp
+    \brief
+        Shows lighting support in OGRE.
+*/
+
+
+
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+#define WIN32_LEAN_AND_MEAN
+#include "windows.h"
+#endif
+
+#include "GameToolsToneMapDemo.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+INT WINAPI WinMain( HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT )
+#else
+int main(int argc, char **argv)
+#endif
+{
+	
+    // Create application object
+    ParticleDemoApplication app;
+
+    try {
+        app.go();
+    } catch( Ogre::Exception& e ) {
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+        MessageBox( NULL, e.getFullDescription().c_str(), "An exception has occured!", MB_OK | MB_ICONERROR | MB_TASKMODAL);
+#else
+        std::cerr << "An exception has occured: " << e.getFullDescription();
+#endif
+    }
+
+    return 0;
+}
+
+#ifdef __cplusplus
+}
+#endif
