Index: experimental/TerrainTest/TerrainTest.sln
===================================================================
--- experimental/TerrainTest/TerrainTest.sln	(revision 162)
+++ experimental/TerrainTest/TerrainTest.sln	(revision 162)
@@ -0,0 +1,26 @@
+﻿
+Microsoft Visual Studio Solution File, Format Version 10.00
+# Visual Studio 2008
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TerrainTest", "TerrainTest.vcproj", "{31EA52E8-FAAA-4B5E-BC40-4E4E7050E5F1}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|Win32 = Debug|Win32
+		Debug|x64 = Debug|x64
+		Release|Win32 = Release|Win32
+		Release|x64 = Release|x64
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{31EA52E8-FAAA-4B5E-BC40-4E4E7050E5F1}.Debug|Win32.ActiveCfg = Debug|Win32
+		{31EA52E8-FAAA-4B5E-BC40-4E4E7050E5F1}.Debug|Win32.Build.0 = Debug|Win32
+		{31EA52E8-FAAA-4B5E-BC40-4E4E7050E5F1}.Debug|x64.ActiveCfg = Debug|x64
+		{31EA52E8-FAAA-4B5E-BC40-4E4E7050E5F1}.Debug|x64.Build.0 = Debug|x64
+		{31EA52E8-FAAA-4B5E-BC40-4E4E7050E5F1}.Release|Win32.ActiveCfg = Release|Win32
+		{31EA52E8-FAAA-4B5E-BC40-4E4E7050E5F1}.Release|Win32.Build.0 = Release|Win32
+		{31EA52E8-FAAA-4B5E-BC40-4E4E7050E5F1}.Release|x64.ActiveCfg = Release|x64
+		{31EA52E8-FAAA-4B5E-BC40-4E4E7050E5F1}.Release|x64.Build.0 = Release|x64
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal
Index: experimental/TerrainTest/TerrainTest.vcproj
===================================================================
--- experimental/TerrainTest/TerrainTest.vcproj	(revision 162)
+++ experimental/TerrainTest/TerrainTest.vcproj	(revision 162)
@@ -0,0 +1,371 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="9,00"
+	Name="TerrainTest"
+	ProjectGUID="{31EA52E8-FAAA-4B5E-BC40-4E4E7050E5F1}"
+	RootNamespace="TerrainTest"
+	Keyword="Win32Proj"
+	TargetFrameworkVersion="131072"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+		<Platform
+			Name="x64"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="D:\OpenSceneGraph\OpenSceneGraph-2.9.10_x86\include;"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				DebugInformationFormat="4"
+				DisableSpecificWarnings="4706;4127;4100"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OpenThreadsd.lib osgd.lib osgDBd.lib osgUtild.lib osgGAd.lib osgViewerd.lib osgTextd.lib osgTerraind.lib opengl32.lib D:\OpenSceneGraph\3rdParty_x86_x64\x64\lib\zlibD.lib $(NOINHERIT)"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories="&quot;D:\OpenSceneGraph\OpenSceneGraph-2.9.10_x86\lib\&quot;"
+				GenerateDebugInformation="true"
+				SubSystem="1"
+				ImportLibrary=""
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Debug|x64"
+			OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				TargetEnvironment="3"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="D:\OpenSceneGraph\OpenSceneGraph-2.9.10_x64\include;"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				DebugInformationFormat="3"
+				DisableSpecificWarnings="4706;4127;4100"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="D:\OpenSceneGraph\OpenSceneGraph-2.9.10_x64\lib\OpenThreadsd.lib D:\OpenSceneGraph\OpenSceneGraph-2.9.10_x64\lib\osgd.lib D:\OpenSceneGraph\OpenSceneGraph-2.9.10_x64\lib\osgDBd.lib D:\OpenSceneGraph\OpenSceneGraph-2.9.10_x64\lib\osgUtild.lib D:\OpenSceneGraph\OpenSceneGraph-2.9.10_x64\lib\osgGAd.lib D:\OpenSceneGraph\OpenSceneGraph-2.9.10_x64\lib\osgViewerd.lib D:\OpenSceneGraph\OpenSceneGraph-2.9.10_x64\lib\osgTextd.lib D:\OpenSceneGraph\OpenSceneGraph-2.9.10_x64\lib\osgTerraind.lib opengl32.lib D:\OpenSceneGraph\3rdParty_x86_x64\x64\lib\zlibD.lib $(NOINHERIT)"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories="&quot;D:\OpenSceneGraph\OpenSceneGraph-2.9.10_x64\lib\&quot;"
+				GenerateDebugInformation="true"
+				SubSystem="1"
+				ImportLibrary=""
+				TargetMachine="17"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="1"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				EnableIntrinsicFunctions="true"
+				AdditionalIncludeDirectories="D:\OpenSceneGraph\OpenSceneGraph-2.9.10_x86\include;"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+				RuntimeLibrary="2"
+				EnableFunctionLevelLinking="true"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				DebugInformationFormat="3"
+				DisableSpecificWarnings="4706;4127;4100"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OpenThreads.lib osg.lib osgDB.lib osgUtil.lib osgGA.lib osgViewer.lib osgText.lib osgTerrain.lib opengl32.lib D:\OpenSceneGraph\3rdParty_x86_x64\x64\lib\zlib.lib $(NOINHERIT)"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="&quot;D:\OpenSceneGraph\OpenSceneGraph-2.9.10_x86\lib\&quot;"
+				GenerateDebugInformation="true"
+				SubSystem="1"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				ImportLibrary=""
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|x64"
+			OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="1"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				TargetEnvironment="3"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				EnableIntrinsicFunctions="true"
+				AdditionalIncludeDirectories="D:\OpenSceneGraph\OpenSceneGraph-2.9.10_x64\include;"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+				RuntimeLibrary="2"
+				EnableFunctionLevelLinking="true"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				DebugInformationFormat="3"
+				DisableSpecificWarnings="4706;4127;4100"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="OpenThreads.lib osg.lib osgDB.lib osgUtil.lib osgGA.lib osgViewer.lib osgText.lib osgTerrain.lib opengl32.lib D:\OpenSceneGraph\3rdParty_x86_x64\x64\lib\zlib.lib $(NOINHERIT)"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="&quot;D:\OpenSceneGraph\OpenSceneGraph-2.9.10_x64\lib\&quot;"
+				GenerateDebugInformation="true"
+				SubSystem="1"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				ImportLibrary=""
+				TargetMachine="17"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Quelldateien"
+			Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+			>
+			<File
+				RelativePath=".\myTerrainTechnique.cpp"
+				>
+			</File>
+			<File
+				RelativePath=".\osgterrain.cpp"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Headerdateien"
+			Filter="h;hpp;hxx;hm;inl;inc;xsd"
+			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+			>
+			<File
+				RelativePath=".\myTerrainTechnique.h"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Ressourcendateien"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
+			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+			>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Index: experimental/TerrainTest/myTerrainTechnique.cpp
===================================================================
--- experimental/TerrainTest/myTerrainTechnique.cpp	(revision 162)
+++ experimental/TerrainTest/myTerrainTechnique.cpp	(revision 162)
@@ -0,0 +1,21 @@
+#include "myTerrainTechnique.h"
+#include <osgTerrain/TerrainTile>
+
+myTerrainTechnique::myTerrainTechnique(void)
+{
+}
+
+myTerrainTechnique::~myTerrainTechnique(void)
+{
+}
+
+void myTerrainTechnique::update(osgUtil::UpdateVisitor* uv)
+{
+    OSG_ALWAYS<<className()<<"::update(..) not implementated yet"<<std::endl;
+
+	if (_terrainTile)
+	{
+		//_terrainTile->getElevationLayer()->set
+		_terrainTile->osg::Group::traverse(*uv);
+	}
+}
Index: experimental/TerrainTest/myTerrainTechnique.h
===================================================================
--- experimental/TerrainTest/myTerrainTechnique.h	(revision 162)
+++ experimental/TerrainTest/myTerrainTechnique.h	(revision 162)
@@ -0,0 +1,12 @@
+#pragma once
+
+#include <osgTerrain/TerrainTechnique>
+
+class myTerrainTechnique : public osgTerrain::TerrainTechnique
+{
+public:
+	myTerrainTechnique(void);
+	~myTerrainTechnique(void);
+
+	virtual void update(osgUtil::UpdateVisitor* nv);
+};
Index: experimental/TerrainTest/osgterrain.cpp
===================================================================
--- experimental/TerrainTest/osgterrain.cpp	(revision 162)
+++ experimental/TerrainTest/osgterrain.cpp	(revision 162)
@@ -0,0 +1,234 @@
+/* OpenSceneGraph example, osgterrain.
+*
+*  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 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.
+*/
+
+#include <osg/ArgumentParser>
+#include <osgDB/ReadFile>
+
+#include <osgViewer/Viewer>
+#include <osgViewer/ViewerEventHandlers>
+
+#include <osgGA/TrackballManipulator>
+#include <osgGA/FlightManipulator>
+#include <osgGA/DriveManipulator>
+#include <osgGA/KeySwitchMatrixManipulator>
+#include <osgGA/StateSetManipulator>
+#include <osgGA/AnimationPathManipulator>
+#include <osgGA/TerrainManipulator>
+
+#include <osgTerrain/Terrain>
+#include <osgTerrain/TerrainTile>
+#include <osgTerrain/GeometryTechnique>
+#include <osgTerrain/Layer>
+
+#include "myTerrainTechnique.h"
+
+#include <iostream>
+
+template<class T>
+class FindTopMostNodeOfTypeVisitor : public osg::NodeVisitor
+{
+public:
+    FindTopMostNodeOfTypeVisitor():
+        osg::NodeVisitor(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN),
+        _foundNode(0)
+    {}
+
+    void apply(osg::Node& node)
+    {
+        T* result = dynamic_cast<T*>(&node);
+        if (result)
+        {
+            _foundNode = result;
+        }
+        else
+        {
+            traverse(node);
+        }
+    }
+
+    T* _foundNode;
+};
+
+template<class T>
+T* findTopMostNodeOfType(osg::Node* node)
+{
+    if (!node) return 0;
+
+    FindTopMostNodeOfTypeVisitor<T> fnotv;
+    node->accept(fnotv);
+
+    return fnotv._foundNode;
+}
+
+// class to handle events with a pick
+class TerrainHandler : public osgGA::GUIEventHandler {
+public:
+
+    TerrainHandler(osgTerrain::Terrain* terrain):
+        _terrain(terrain) {}
+
+    bool handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionAdapter& aa)
+    {
+        switch(ea.getEventType())
+        {
+            case(osgGA::GUIEventAdapter::KEYDOWN):
+            {
+                if (ea.getKey()=='r')
+                {
+                    _terrain->setSampleRatio(_terrain->getSampleRatio()*0.5);
+                    osg::notify(osg::NOTICE)<<"Sample ratio "<<_terrain->getSampleRatio()<<std::endl;
+                    return true;
+                }
+                else if (ea.getKey()=='R')
+                {
+                    _terrain->setSampleRatio(_terrain->getSampleRatio()/0.5);
+                    osg::notify(osg::NOTICE)<<"Sample ratio "<<_terrain->getSampleRatio()<<std::endl;
+                    return true;
+                }
+                else if (ea.getKey()=='v')
+                {
+                    _terrain->setVerticalScale(_terrain->getVerticalScale()*1.25);
+                    osg::notify(osg::NOTICE)<<"Vertical scale "<<_terrain->getVerticalScale()<<std::endl;
+                    return true;
+                }
+                else if (ea.getKey()=='V')
+                {
+                    _terrain->setVerticalScale(_terrain->getVerticalScale()/1.25);
+                    osg::notify(osg::NOTICE)<<"Vertical scale "<<_terrain->getVerticalScale()<<std::endl;
+                    return true;
+                }
+
+                return false;
+            }
+            default:
+                return false;
+        }
+    }
+
+protected:
+
+    ~TerrainHandler() {}
+
+    osg::ref_ptr<osgTerrain::Terrain>  _terrain;
+};
+
+int main(int argc, char** argv)
+{
+    osg::ArgumentParser arguments(&argc, argv);
+
+    // construct the viewer.
+    osgViewer::Viewer viewer(arguments);
+
+    // set up the camera manipulators.
+    {
+        osg::ref_ptr<osgGA::KeySwitchMatrixManipulator> keyswitchManipulator = new osgGA::KeySwitchMatrixManipulator;
+
+        keyswitchManipulator->addMatrixManipulator( '1', "Trackball", new osgGA::TrackballManipulator() );
+        keyswitchManipulator->addMatrixManipulator( '2', "Flight", new osgGA::FlightManipulator() );
+        keyswitchManipulator->addMatrixManipulator( '3', "Drive", new osgGA::DriveManipulator() );
+        keyswitchManipulator->addMatrixManipulator( '4', "Terrain", new osgGA::TerrainManipulator() );
+
+        std::string pathfile;
+        char keyForAnimationPath = '5';
+        while (arguments.read("-p",pathfile))
+        {
+            osgGA::AnimationPathManipulator* apm = new osgGA::AnimationPathManipulator(pathfile);
+            if (apm || !apm->valid()) 
+            {
+                unsigned int num = keyswitchManipulator->getNumMatrixManipulators();
+                keyswitchManipulator->addMatrixManipulator( keyForAnimationPath, "Path", apm );
+                keyswitchManipulator->selectMatrixManipulator(num);
+                ++keyForAnimationPath;
+            }
+        }
+
+        viewer.setCameraManipulator( keyswitchManipulator.get() );
+    }
+
+
+    // add the state manipulator
+    viewer.addEventHandler( new osgGA::StateSetManipulator(viewer.getCamera()->getOrCreateStateSet()) );
+
+    // add the stats handler
+    viewer.addEventHandler(new osgViewer::StatsHandler);
+
+    // add the record camera path handler
+    viewer.addEventHandler(new osgViewer::RecordCameraPathHandler);
+
+    // add the window size toggle handler
+    viewer.addEventHandler(new osgViewer::WindowSizeHandler);
+
+    // obtain the vertical scale
+    float verticalScale = 1.0f;
+    while(arguments.read("-v",verticalScale)) {}
+
+    // obtain the sample ratio
+    float sampleRatio = 1.0f;
+    while(arguments.read("-r",sampleRatio)) {}
+
+    osgTerrain::TerrainTile::BlendingPolicy blendingPolicy = osgTerrain::TerrainTile::INHERIT;
+    std::string strBlendingPolicy;
+    while(arguments.read("--blending-policy", strBlendingPolicy))
+    {
+        if (strBlendingPolicy == "INHERIT") blendingPolicy = osgTerrain::TerrainTile::INHERIT;
+        else if (strBlendingPolicy == "DO_NOT_SET_BLENDING") blendingPolicy = osgTerrain::TerrainTile::DO_NOT_SET_BLENDING;
+        else if (strBlendingPolicy == "ENABLE_BLENDING") blendingPolicy = osgTerrain::TerrainTile::ENABLE_BLENDING;
+        else if (strBlendingPolicy == "ENABLE_BLENDING_WHEN_ALPHA_PRESENT") blendingPolicy = osgTerrain::TerrainTile::ENABLE_BLENDING_WHEN_ALPHA_PRESENT;
+    }
+
+    // load the nodes from the commandline arguments.
+    osg::Node* rootnode = osgDB::readNodeFiles(arguments);
+
+    if (!rootnode)
+    {
+        osg::notify(osg::NOTICE)<<"Warning: no valid data loaded, please specify a database on the command line."<<std::endl;
+        return 1;
+    }
+
+    osgTerrain::Terrain* terrain = findTopMostNodeOfType<osgTerrain::Terrain>(rootnode);
+    if (!terrain)
+    {
+        terrain = new osgTerrain::Terrain;
+        terrain->addChild(rootnode);
+
+        rootnode = terrain;
+    }
+
+    terrain->setSampleRatio(sampleRatio);
+    terrain->setVerticalScale(verticalScale);
+    terrain->setBlendingPolicy(blendingPolicy);
+	osg::ref_ptr<myTerrainTechnique> myT = new myTerrainTechnique();
+	//terrain->setTerrainTechniquePrototype( myT );
+
+	osgTerrain::TerrainTile* tile = findTopMostNodeOfType<osgTerrain::TerrainTile>(rootnode);
+	if(tile)
+	{
+		tile->setTerrainTechnique( myT );
+	}
+
+    // register our custom handler for adjust Terrain settings
+    viewer.addEventHandler(new TerrainHandler(terrain));
+
+    // add a viewport to the viewer and attach the scene graph.
+    viewer.setSceneData( rootnode );
+
+
+    // run the viewers main loop
+    return viewer.run();
+
+}
