diff -uwr ogremeshy_rev29.orig//CMakeLists.txt ogremeshy_rev29.new//CMakeLists.txt
--- ogremeshy_rev29.orig//CMakeLists.txt	2014-09-08 12:13:41 +0900
+++ ogremeshy_rev29.new//CMakeLists.txt	2014-09-08 11:35:56 +0900
@@ -103,47 +103,78 @@
 
 link_directories(${OGRE_LIBRARY_DIRS})
 ADD_EXECUTABLE(OgreMeshy WIN32 ${HEADER_FILES} ${SOURCE_FILES} )
+set_property(TARGET OgreMeshy PROPERTY DEBUG_POSTFIX _d)
 TARGET_LINK_LIBRARIES( OgreMeshy ${wxWidgets_LIBRARIES} )
-TARGET_LINK_LIBRARIES( OgreMeshy ${OGRE_LIBRARIES} )
-set(OGRE_Overlay_LIBRARIES OgreOverlay)
-set(OGRE_RTSS_LIBRARIES OgreRTShaderSystem)
-TARGET_LINK_LIBRARIES( OgreMeshy ${OGRE_Overlay_LIBRARIES} ${OGRE_RTSS_LIBRARIES} )
+TARGET_LINK_LIBRARIES( OgreMeshy
+  optimized ${OGRE_LIBRARY_REL} debug ${OGRE_LIBRARY_DBG}
+  optimized ${OGRE_Overlay_LIBRARY_REL} debug ${OGRE_Overlay_LIBRARY_DBG} 
+  optimized ${OGRE_RTShaderSystem_LIBRARY_REL} debug ${OGRE_RTShaderSystem_LIBRARY_DBG} )
 
 if(UNIX)
 	TARGET_LINK_LIBRARIES( OgreMeshy ${GTK2_LIBRARIES} )
 	TARGET_LINK_LIBRARIES( OgreMeshy ${OPENGL_LIBRARIES} )
 endif(UNIX)
 
-set(INST_DEST ".")
-install(TARGETS OgreMeshy RUNTIME DESTINATION ${INST_DEST})
+#set(INST_DEST ".")
+#install(TARGETS OgreMeshy RUNTIME DESTINATION ${INST_DEST})
 
-if(WIN32)
-	install(FILES ${OgreMeshy_SOURCE_DIR}/bin/Release/ChangeLog.txt DESTINATION ${INST_DEST})
-	install(FILES ${OgreMeshy_SOURCE_DIR}/bin/Release/FONTS_COPYRIGHT.txt DESTINATION ${INST_DEST})
-	install(FILES ${OgreMeshy_SOURCE_DIR}/bin/Release/LICENSE.txt DESTINATION ${INST_DEST})
-	install(FILES ${OgreMeshy_SOURCE_DIR}/bin/Release/Readme.txt DESTINATION ${INST_DEST})
+set(Cg_DIR Cg_DIR-NOTFOUND CACHE PATH "NVidia Cg Toolkit path.")
+if(${Cg_DIR} STREQUAL Cg_DIR-NOTFOUND)
+  message(FATAL_ERROR "Cg_DIR must be set.")
+endif()
 
-	# add 3rd party files: Ogre, etc
-	install(FILES ${OgreMeshy_SOURCE_DIR}/bin/Release/OgreMain.dll DESTINATION ${INST_DEST})
-	install(FILES ${OgreMeshy_SOURCE_DIR}/bin/Release/Plugins.cfg DESTINATION ${INST_DEST} )
-	install(FILES ${OgreMeshy_SOURCE_DIR}/bin/Release/Plugins/Plugin_CgProgramManager.dll DESTINATION ${INST_DEST}/Plugins )
-	install(FILES ${OgreMeshy_SOURCE_DIR}/bin/Release/Plugins/Plugin_OctreeSceneManager.dll DESTINATION ${INST_DEST}/Plugins )
-	install(FILES ${OgreMeshy_SOURCE_DIR}/bin/Release/Plugins/Plugin_ParticleFX.dll DESTINATION ${INST_DEST}/Plugins )
-	install(FILES ${OgreMeshy_SOURCE_DIR}/bin/Release/Plugins/RenderSystem_Direct3D9.dll DESTINATION ${INST_DEST}/Plugins )
-	install(FILES ${OgreMeshy_SOURCE_DIR}/bin/Release/Plugins/RenderSystem_GL.dll DESTINATION ${INST_DEST}/Plugins )
+if(EXISTS ${Cg_DIR})
+  if(CMAKE_SIZEOF_VOID_P EQUAL 8)
+    set(Cg_BINARY ${Cg_DIR}/bin.x64/cg.dll)
+  else()
+    set(Cg_BINARY ${Cg_DIR}/bin/cg.dll)
+  endif()
+endif()
 
-	install(FILES ${OgreMeshy_SOURCE_DIR}/bin/Release/Plugins/cg.dll DESTINATION ${INST_DEST}/Plugins )
+if(NOT EXISTS ${Cg_BINARY})
+  message(FATAL_ERROR "cg.dll is not found(${Cg_BINARY}).")
+endif()
 	
-	# and the resources
-	FILE(GLOB files "${OgreMeshy_SOURCE_DIR}/bin/Release/Resources/Fonts/*.*")
-	INSTALL(FILES ${files} DESTINATION ${INST_DEST}/Resources/Fonts)
 
-	FILE(GLOB files "${OgreMeshy_SOURCE_DIR}/bin/Release/Resources/Icons/32x32/*.*")
-	INSTALL(FILES ${files} DESTINATION ${INST_DEST}/Resources/Icons/32x32)
+if(WIN32)
+	foreach(cfg Release Debug)
+	  if(${cfg} STREQUAL Debug)	    
+	    set(SUF DBG)
+	  else()
+	    set(SUF REL)
+	  endif()
+	  
+	  set(INST_DEST ${CMAKE_INSTALL_PREFIX}/${cfg})
+	  install(TARGETS OgreMeshy RUNTIME DESTINATION ${INST_DEST} CONFIGURATIONS ${cfg})
+
+	  install(FILES ${OgreMeshy_SOURCE_DIR}/bin/Release/ChangeLog.txt DESTINATION ${INST_DEST} CONFIGURATIONS ${cfg})
+	  install(FILES ${OgreMeshy_SOURCE_DIR}/bin/Release/FONTS_COPYRIGHT.txt DESTINATION ${INST_DEST} CONFIGURATIONS ${cfg})
+	  install(FILES ${OgreMeshy_SOURCE_DIR}/bin/Release/LICENSE.txt DESTINATION ${INST_DEST} CONFIGURATIONS ${cfg})
+	  install(FILES ${OgreMeshy_SOURCE_DIR}/bin/Release/Readme.txt DESTINATION ${INST_DEST} CONFIGURATIONS ${cfg})
 
-	FILE(GLOB files "${OgreMeshy_SOURCE_DIR}/bin/Release/Resources/Models/*.*")
-	INSTALL(FILES ${files} DESTINATION ${INST_DEST}/Resources/Models)
+	  # add 3rd party files: Ogre, etc
+	  install(FILES ${OGRE_BINARY_${SUF}}
+	                ${OGRE_Overlay_BINARY_${SUF}}
+	                ${OGRE_RTShaderSystem_BINARY_${SUF}}
+	                ${OgreMeshy_SOURCE_DIR}/bin/${cfg}/Plugins.cfg
+		  DESTINATION ${INST_DEST}
+		  CONFIGURATIONS ${cfg})
+	  install(FILES ${OGRE_Plugin_CgProgramManager_${SUF}}
+	                ${OGRE_Plugin_OctreeSceneManager_${SUF}}
+	                ${OGRE_Plugin_ParticleFX_${SUF}} 
+	                ${OGRE_RenderSystem_Direct3D9_${SUF}}
+	                ${OGRE_RenderSystem_Direct3D11_${SUF}} 
+	                ${OGRE_RenderSystem_GL_${SUF}}			
+	                ${Cg_BINARY}
+		  DESTINATION ${INST_DEST}/Plugins
+		  CONFIGURATIONS ${cfg})
+
+	  # and the resources
+	  install(DIRECTORY ${OgreMeshy_SOURCE_DIR}/bin/Release/Resources
+	          DESTINATION ${INST_DEST}
+		  CONFIGURATIONS ${cfg})
 	
+	endforeach()	
 endif()
 
 # and CPack
diff -uwr ogremeshy_rev29.orig//bin/Debug/Plugins.cfg ogremeshy_rev29.new//bin/Debug/Plugins.cfg
--- ogremeshy_rev29.orig//bin/Debug/Plugins.cfg	2014-09-08 12:13:41 +0900
+++ ogremeshy_rev29.new//bin/Debug/Plugins.cfg	2014-09-08 11:35:56 +0900
@@ -5,7 +5,7 @@
 
 # Define plugins
  Plugin=RenderSystem_Direct3D9_d
-# Plugin=RenderSystem_Direct3D11_d
+ Plugin=RenderSystem_Direct3D11_d
  Plugin=RenderSystem_GL_d
 # Plugin=RenderSystem_GLES_d
 # Plugin=RenderSystem_GLES2_d
diff -uwr ogremeshy_rev29.orig//bin/Release/Plugins.cfg ogremeshy_rev29.new//bin/Release/Plugins.cfg
--- ogremeshy_rev29.orig//bin/Release/Plugins.cfg	2014-09-08 12:13:41 +0900
+++ ogremeshy_rev29.new//bin/Release/Plugins.cfg	2014-09-08 11:35:56 +0900
@@ -5,7 +5,7 @@
 
 # Define plugins
  Plugin=RenderSystem_Direct3D9
-# Plugin=RenderSystem_Direct3D11
+ Plugin=RenderSystem_Direct3D11
  Plugin=RenderSystem_GL
 # Plugin=RenderSystem_GLES
 # Plugin=RenderSystem_GLES2
diff -uwr ogremeshy_rev29.orig//include/Core/ShaderGeneratorTechniqueResolverListener.h ogremeshy_rev29.new//include/Core/ShaderGeneratorTechniqueResolverListener.h
--- ogremeshy_rev29.orig//include/Core/ShaderGeneratorTechniqueResolverListener.h	2014-09-08 12:13:41 +0900
+++ ogremeshy_rev29.new//include/Core/ShaderGeneratorTechniqueResolverListener.h	2014-09-03 10:20:03 +0900
@@ -4,6 +4,7 @@
 #include "OgreStringVector.h"
 #include "OgreRTShaderSystem.h"
 #include "OgreShaderGenerator.h"
+#include <OgreMaterialManager.h>
 #define _RTSS_WRITE_SHADERS_TO_DISK 0
 class ShaderGeneratorTechniqueResolverListener : public Ogre::MaterialManager::Listener
 {
diff -uwr ogremeshy_rev29.orig//include/Core/wxOgreMeshViewerMainFrameImpl.h ogremeshy_rev29.new//include/Core/wxOgreMeshViewerMainFrameImpl.h
--- ogremeshy_rev29.orig//include/Core/wxOgreMeshViewerMainFrameImpl.h	2014-09-08 12:13:41 +0900
+++ ogremeshy_rev29.new//include/Core/wxOgreMeshViewerMainFrameImpl.h	2014-09-03 15:44:48 +0900
@@ -23,6 +23,10 @@
 #include "OgreFrameListener.h"
 #include "OgreLog.h"
 
+#include <queue>
+#include <map>
+#include <wx/thread.h>
+
 class wxOgreRenderWindow;
 class wxAuiManager;
 class wxAuiNotebook;
@@ -50,6 +54,15 @@
 	NumCoordinateConvention
 };
 
+struct LogMessageEntry
+{
+	int threadSN;
+	Ogre::String message;
+	Ogre::LogMessageLevel lml;
+	bool maskDebug;
+};
+
+
 /** Implementing MainFrame */
 class MeshyMainFrameImpl : public MainFrame, public wxOgreRenderWindowListener,
 										public Ogre::FrameListener, public Ogre::LogListener
@@ -105,6 +118,13 @@
 	// Shader generator material manager listener.	
 	ShaderGeneratorTechniqueResolverListener*	mMaterialMgrListener;		
 
+	std::queue<LogMessageEntry> mLogMessageQueue;
+	void _messageLogged(int threadSN, const Ogre::String& message, Ogre::LogMessageLevel lml, bool maskDebug);
+	wxMutex mMutex;
+	std::map<wxThreadIdType, int> mTid2SN;
+	int mCurrentSN;
+	const int NUM_MAX_LOG_POP = 32;
+
 	void saveSettings();
 	void loadSettings();
 
@@ -163,6 +183,8 @@
 
 	virtual void messageLogged( const Ogre::String& message, Ogre::LogMessageLevel lml,
 						bool maskDebug, const Ogre::String &logName, bool& skipThisMessage );
+
+	virtual void OnInternalIdle()/*override*/;
 };
 
 #endif // __MeshyMainFrameImpl__
diff -uwr ogremeshy_rev29.orig//src/Core/Panels/AnimPosePanel.cpp ogremeshy_rev29.new//src/Core/Panels/AnimPosePanel.cpp
--- ogremeshy_rev29.orig//src/Core/Panels/AnimPosePanel.cpp	2014-09-08 12:13:41 +0900
+++ ogremeshy_rev29.new//src/Core/Panels/AnimPosePanel.cpp	2014-09-03 10:20:03 +0900
@@ -23,6 +23,7 @@
 #include <OgreEntity.h>
 #include <OgreAnimation.h>
 #include <OgreKeyFrame.h>
+#include <OgreMesh.h>
 
 //Avoid accidentally loading a mesh which matches an animation with this name. (Seriously? that name?)
 const Ogre::String c_manualPoseAnimationName = "PoseManual#!@@!_  Q";
diff -uwr ogremeshy_rev29.orig//src/Core/ShaderGeneratorTechniqueResolverListener.cpp ogremeshy_rev29.new//src/Core/ShaderGeneratorTechniqueResolverListener.cpp
--- ogremeshy_rev29.orig//src/Core/ShaderGeneratorTechniqueResolverListener.cpp	2014-09-08 12:13:41 +0900
+++ ogremeshy_rev29.new//src/Core/ShaderGeneratorTechniqueResolverListener.cpp	2014-09-03 10:20:03 +0900
@@ -1,4 +1,5 @@
 #include "Core/ShaderGeneratorTechniqueResolverListener.h"
+#include <OgreTechnique.h>
 
 	ShaderGeneratorTechniqueResolverListener::ShaderGeneratorTechniqueResolverListener(Ogre::RTShader::ShaderGenerator* pShaderGenerator)
 	{
diff -uwr ogremeshy_rev29.orig//src/Core/wxOgreMeshViewerMainFrameImpl.cpp ogremeshy_rev29.new//src/Core/wxOgreMeshViewerMainFrameImpl.cpp
--- ogremeshy_rev29.orig//src/Core/wxOgreMeshViewerMainFrameImpl.cpp	2014-09-08 12:13:41 +0900
+++ ogremeshy_rev29.new//src/Core/wxOgreMeshViewerMainFrameImpl.cpp	2014-09-08 12:04:53 +0900
@@ -85,7 +85,9 @@
 			m_wasRightPressed( false ),
 			m_mouseX( 0 ),
 			m_mouseY( 0 ),
-			m_coordinateConvention( COORD_Y_UP )
+			m_coordinateConvention( COORD_Y_UP ),
+			mCurrentSN(0),
+			mMaterialMgrListener(nullptr)
 {
 #ifndef __WXMSW__
 	//Set config directory to user home directory
@@ -123,13 +125,13 @@
 	{
 		//Need to convert to OEM codepage so that fstream can
 		//use it properly on international systems.
-		TCHAR oemPath[MAX_PATH];
+		CCHAR oemPath[MAX_PATH];
 		CharToOem( path, oemPath );
 		m_configDirectory = oemPath;
 		m_configDirectory += "\\OgreMeshy\\";
 
 		//Attempt to create directory where config files go
-		if( !CreateDirectory( m_configDirectory.c_str(), NULL ) &&
+		if( !CreateDirectoryA( m_configDirectory.c_str(), NULL ) &&
 			GetLastError() != ERROR_ALREADY_EXISTS )
 		{
 			//Couldn't create directory (no write access?),
@@ -259,6 +261,8 @@
 {
 	saveSettings();
 
+	finalizeRTShaderSystem();
+
 	if( m_wxOgreRenderWindow )
 	{
 		m_wxOgreRenderWindow->Destroy();
@@ -498,7 +502,7 @@
 	//m_camera->setPosition( Ogre::Vector3( 0, 10.0f, 10.0f) );
 	m_camera->lookAt( Ogre::Vector3( 0.0f, 0.0f, 0.0f ) );
 	m_camera->setNearClipDistance( 0.1f );
-	m_camera->setFarClipDistance( 100.0f );
+	m_camera->setFarClipDistance( 1000.0f );
 
 	Ogre::Viewport* vp = m_wxOgreRenderWindow->GetRenderWindow()->addViewport( m_camera );
 	//vp->setClearEveryFrame( true, Ogre::FBT_COLOUR | Ogre::FBT_DEPTH );
@@ -531,6 +535,9 @@
 	{
 		m_ogreLog = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 500, 150 ),
 									wxNO_BORDER | wxTE_MULTILINE | wxTE_DONTWRAP | wxTE_RICH | wxTE_RICH2 );
+		wxTextAttr style = m_ogreLog->GetDefaultStyle();
+		style.SetFontFamily(wxFontFamily::wxFONTFAMILY_TELETYPE);
+		m_ogreLog->SetDefaultStyle(style);
 		m_ogreLog->SetEditable( false );
 
 		m_wxAuiManager->AddPane( m_ogreLog, wxAuiPaneInfo().Name(wxT("LogWindow")).
@@ -1515,8 +1522,8 @@
 													getStatistics();
 
 	m_statusBar1->SetStatusText( wxString::Format( wxT("%0.2f FPS"), stats.avgFPS ),		1 );
-	m_statusBar1->SetStatusText( wxString::Format( wxT("polys: %d"), stats.triangleCount ),	2 );
-	m_statusBar1->SetStatusText( wxString::Format( wxT("batches: %d"), stats.batchCount ),	3 );
+	m_statusBar1->SetStatusText( wxString::Format( wxT("polys: %I64d"), stats.triangleCount ),	2 );
+	m_statusBar1->SetStatusText( wxString::Format( wxT("batches: %I64d"), stats.batchCount ),	3 );
 
 	if(m_meshEntity)
 	{
@@ -1718,14 +1725,14 @@
 	messageLogged( message, lml, maskDebug, logName, skipThisMessage );
 }
 
-void MeshyMainFrameImpl::messageLogged( const Ogre::String& message, Ogre::LogMessageLevel lml,
-													bool maskDebug, const Ogre::String &logName, bool& skipThisMessage )
+void MeshyMainFrameImpl::_messageLogged(int threadSN, const Ogre::String& message, Ogre::LogMessageLevel lml, bool maskDebug)
 {
 	static const wxColour c_darkYellow( 130, 127, 0 );
 	static const wxColour c_darkGreen ( 0, 127, 0 );
 
 	// now if we got an error, show the log!
 	wxString msg = wxString( (message + "\n").c_str(), wxConvUTF8 );
+	msg = wxString::Format("%d> %s", threadSN, msg);
 	
 	// black is the default
 	m_ogreLog->SetDefaultStyle( wxTextAttr( *wxBLACK ) );
@@ -1797,6 +1804,44 @@
 		//HACK: Seems only way to smoothly move update it (may be wxWidgets bug?)
 		m_ogreLog->SetFocus();
 	}
+
+}
+
+void MeshyMainFrameImpl::messageLogged( const Ogre::String& message, Ogre::LogMessageLevel lml,
+													bool maskDebug, const Ogre::String &logName, bool& skipThisMessage )
+{
+	wxMutexLocker lock(mMutex);
+
+	auto tid = wxThread::GetCurrentId();
+	int sn;
+	if (mTid2SN.find(tid) == mTid2SN.end())
+		mTid2SN[tid] = sn = mCurrentSN++;
+	else
+		sn = mTid2SN[tid];		
+
+	LogMessageEntry lme;
+	lme.threadSN = sn;
+	lme.message = message;
+	lme.lml = lml;
+	lme.maskDebug = maskDebug;
+
+	mLogMessageQueue.push(lme);
+}
+
+void MeshyMainFrameImpl::OnInternalIdle()
+{
+	for (int i = 0; i < NUM_MAX_LOG_POP && !mLogMessageQueue.empty(); ++i)
+	{
+		const LogMessageEntry &lme = mLogMessageQueue.front();
+		int threadSN = lme.threadSN;
+		const Ogre::String message = lme.message;
+		Ogre::LogMessageLevel lml = lme.lml;
+		bool maskDebug = lme.maskDebug;
+
+		_messageLogged(threadSN, message, lml, maskDebug);
+
+		mLogMessageQueue.pop();
+	}
 }
 
 bool MeshyMainFrameImpl::initializeRTShaderSystem(Ogre::SceneManager* sceneMgr)
diff -uwr ogremeshy_rev29.orig//src/main.cpp ogremeshy_rev29.new//src/main.cpp
--- ogremeshy_rev29.orig//src/main.cpp	2014-09-08 12:13:41 +0900
+++ ogremeshy_rev29.new//src/main.cpp	2014-09-03 10:20:03 +0900
@@ -74,21 +74,21 @@
     cmdLineDesc[0].kind			= wxCMD_LINE_PARAM;
     cmdLineDesc[0].shortName	= NULL;
     cmdLineDesc[0].longName		= NULL;
-    cmdLineDesc[0].description	= wxT("Input mesh file");
+    cmdLineDesc[0].description	= "Input mesh file";
     cmdLineDesc[0].type			= wxCMD_LINE_VAL_STRING;
     cmdLineDesc[0].flags		= wxCMD_LINE_PARAM_OPTIONAL;
 
 	cmdLineDesc[1].kind			= wxCMD_LINE_SWITCH;
-    cmdLineDesc[1].shortName	= wxT("setup");
+    cmdLineDesc[1].shortName	= "setup";
     cmdLineDesc[1].longName		= NULL;
-    cmdLineDesc[1].description	= wxT("Configure OGRE's RenderSystem (D3D & OGL)");
+    cmdLineDesc[1].description	= "Configure OGRE's RenderSystem (D3D & OGL)";
     cmdLineDesc[1].type			= wxCMD_LINE_VAL_STRING;
     cmdLineDesc[1].flags		= wxCMD_LINE_PARAM_OPTIONAL;
 
 	cmdLineDesc[2].kind			= wxCMD_LINE_OPTION;
-    cmdLineDesc[2].shortName	= wxT("r");
-    cmdLineDesc[2].longName		= wxT("resources");
-    cmdLineDesc[2].description	= wxT("Specify resources.cfg to load on startup");
+    cmdLineDesc[2].shortName	= "r";
+    cmdLineDesc[2].longName		= "resources";
+    cmdLineDesc[2].description	= "Specify resources.cfg to load on startup";
     cmdLineDesc[2].type			= wxCMD_LINE_VAL_STRING;
     cmdLineDesc[2].flags		= wxCMD_LINE_PARAM_OPTIONAL;
 
