1. Angus Laurie-Pile
  2. RTSS Node based improvments

Commits

Riley Adams  committed b8f1cd9

Converted more playpen tests.

  • Participants
  • Parent commits c58e498
  • Branches default

Comments (0)

Files changed (17)

File Tests/VisualTests/Common/include/VisualTest.h

View file
         mCamera->setAspectRatio((Ogre::Real)mViewport->getActualWidth() / (Ogre::Real)mViewport->getActualHeight());
         mCamera->setNearClipDistance(0.5f);
         mCamera->setFarClipDistance(10000.f);
+		mCamera->setPosition(Ogre::Vector3::ZERO);
+		mCamera->setOrientation(Ogre::Quaternion::IDENTITY);
     }
 
     /** Unload all resources used by this sample */

File Tests/VisualTests/PlayPen/CMakeLists.txt

View file
     include/PlayPenTests.h)
 
 set(SOURCE_FILES
-    src/PlayPenTests.cpp
-    src/PlayPenStencilGlow.cpp
-    #src/PlayPenManualLoader.cpp
-    #src/PlayPenMRTCompositorScript.cpp
-    #src/PlayPenNormalMapMirroredUVs.cpp
-    #src/PlayPenMaterialSerializer.cpp
-    src/PlayPenTransparencyMipMaps.cpp
-    #src/PlayPenCthNewBlending.cpp
-    #src/PlayPenMatrices.cpp
+	src/PlayPenAttachObjectsToBones.cpp
+	src/PlayPenMultiSceneManagersSimple.cpp
+    src/PlayPen16Textures.cpp
+    src/PlayPen2Spotlights.cpp
+    src/PlayPenAlphaToCoverage.cpp
     src/PlayPenBasicPlane.cpp
-	##		src/PlayPenAlpha.cpp
-    ##		src/PlayPenBsp.cpp
-    #src/PlayPenAnimation.cpp
-    #src/PlayPenAnimationBlend.cpp
-    #src/PlayPenGpuPrograms.cpp
-    #src/PlayPenProjection.cpp
-    src/PlayPenMultiViewports.cpp
+    src/PlayPenBillboardAccurateFacing.cpp
+    src/PlayPenBillboardChain.cpp
+    src/PlayPenBillboardOrigins.cpp
+    src/PlayPenBillboardTextureCoords.cpp
+    src/PlayPenBlendDiffuseColour.cpp
+    src/PlayPenBlitSubTextures.cpp
+    src/PlayPenBuildTangentOnAnimatedMesh.cpp
+    src/PlayPenCubeDDS.cpp
+    src/PlayPenCustomProjectionMatrix.cpp
+    src/PlayPenDepthBias.cpp
     src/PlayPenDistortion.cpp
-    #src/PlayPenEdgeBuilderSingleIndexBufSingleVertexBuf.cpp
-    #src/PlayPenEdgeBuilderMultiIndexBufSingleVertexBuf.cpp
-    #src/PlayPenEdgeBuilderMultiIndexBufMultiVertexBuf.cpp
-    #src/PlayPenSkeletalAnimation.cpp
-    #src/PlayPenPrepareShadowVolume.cpp
-    #src/PlayPenWindowedViewportMode.cpp
-    #src/PlayPenSubEntityVisibility.cpp
-	src/PlayPenAttachObjectsToBones.cpp
-    src/PlayPenOrtho.cpp
-    #src/PlayPenFallbackResourceGroup.cpp
-    #src/PlayPenGeneratedLOD.cpp
-    #src/PlayPenClearScene.cpp
-    src/PlayPenStencilShadows.cpp
-    #src/PlayPenStencilShadowsMixedOpSubMeshes.cpp
-    src/PlayPen2Spotlights.cpp
-    #src/PlayPenTextureShadows.cpp
-    #src/PlayPenTextureShadowsCustomCasterMat.cpp
-    #src/PlayPenTextureShadowsCustomReceiverMat.cpp
-    #src/PlayPenCompositorTextureShadows.cpp
-    #src/PlayPenCompositorTechniqueSwitch.cpp
-    #src/PlayPenOverlayZOrder.cpp
-    #src/PlayPenIntersectionSceneQuery.cpp
-    #src/PlayPenRaySceneQuery.cpp
-    src/PlayPenLotsAndLotsOfEntities.cpp
-    #src/PlayPenSimpleMesh.cpp
-    #src/PlayPenGLSLTangent.cpp
-    #src/PlayPenInfiniteAAB.cpp
-    #src/PlayPen2Windows.cpp
-    src/PlayPenStaticGeometry.cpp
-    src/PlayPenStaticGeometryWithLOD.cpp
-    #src/PlayPenReloadResources.cpp
-    src/PlayPenBillboardTextureCoords.cpp
-    #src/PlayPenRadixSort.cpp  Not Visual!
-    #src/PlayPenPoseAnimation2.cpp
-    src/PlayPenReflectedBillboards.cpp
-    src/PlayPenManualObjectNonIndexed.cpp
-    src/PlayPenManualObjectNonIndexedUpdateSmaller.cpp
-    src/PlayPenManualObjectNonIndexedUpdateLarger.cpp
-    src/PlayPenManualObjectIndexed.cpp
-    src/PlayPenManualObjectIndexedUpdateSmaller.cpp
-    src/PlayPenManualObjectIndexedUpdateLarger.cpp
-    src/PlayPenBillboardChain.cpp
-    src/PlayPenCubeDDS.cpp
     src/PlayPenDxt1.cpp
+    src/PlayPenDxt1Alpha.cpp
     src/PlayPenDxt1FromMemory.cpp
-    src/PlayPenDxt1Alpha.cpp
     src/PlayPenDxt3.cpp
     src/PlayPenDxt3FromMemory.cpp
     src/PlayPenDxt5.cpp
-    #src/PlayPenFloat64DDS.cpp
+    src/PlayPenFarFromOrigin.cpp
+    src/PlayPenImageCombine.cpp
+    src/PlayPenLightClipPlanes.cpp
+    src/PlayPenLightClipPlanesMoreLights.cpp
+    src/PlayPenLightScissoring.cpp
+    src/PlayPenLotsAndLotsOfEntities.cpp
+    src/PlayPenManualObjectIndexed.cpp
+    src/PlayPenManualObjectIndexedUpdateLarger.cpp
+    src/PlayPenManualObjectIndexedUpdateSmaller.cpp
+    src/PlayPenManualObjectNonIndexed.cpp
+    src/PlayPenManualObjectNonIndexedUpdateLarger.cpp
+    src/PlayPenManualObjectNonIndexedUpdateSmaller.cpp
+    src/PlayPenMaterialSchemes.cpp
+    src/PlayPenMultiViewports.cpp
+    src/PlayPenNegativeScale.cpp
+    src/PlayPenOrtho.cpp
+    src/PlayPenPointSprites.cpp
+    src/PlayPenReflectedBillboards.cpp
+    src/PlayPenRibbonTrail.cpp
+    src/PlayPenSRGBtexture.cpp
+    src/PlayPenStaticGeometry.cpp
+    src/PlayPenStaticGeometryWithLOD.cpp
+    src/PlayPenStencilGlow.cpp
+    src/PlayPenStencilShadows.cpp
+    src/PlayPenTests.cpp
+    src/PlayPenTransparencyMipMaps.cpp
+    src/PlayPenWindowedViewportMode.cpp
+    src/PlayPenBsp.cpp
+    src/PlayPenSkeletalAnimation.cpp
+    src/PlayPenSkeletonAnimationOptimise.cpp
+    src/PlayPenManualObject2D.cpp
+    src/PlayPenSubEntityVisibility.cpp
+    src/PlayPenTextureShadows.cpp
+
+    #src/PlayPenMultiSceneManagersComplex.cpp
+
+    #src/PlayPenGeneratedLOD.cpp
+	#src/PlayPenAlpha.cpp
+    #src/PlayPen2Windows.cpp
+    #src/PlayPen2bppAlphaPVR.cpp
+    #src/PlayPen2bppPVR.cpp
+    #src/PlayPen4bppAlphaPVR.cpp
+    #src/PlayPen4bppPVR.cpp
+    #src/PlayPenAnimation.cpp
+    #src/PlayPenAnimationBlend.cpp
+    #src/PlayPenBackgroundLoadResourceGroup.cpp
+    #src/PlayPenBug.cpp
+    #src/PlayPenClearScene.cpp
+    #src/PlayPenCompositorTechniqueSwitch.cpp
+    #src/PlayPenCompositorTextureShadows.cpp
+    #src/PlayPenCthNewBlending.cpp
+    #src/PlayPenDepthShadowMap.cpp
+    #src/PlayPenEdgeBuilderMultiIndexBufMultiVertexBuf.cpp
+    #src/PlayPenEdgeBuilderMultiIndexBufSingleVertexBuf.cpp
+    #src/PlayPenEdgeBuilderSingleIndexBufSingleVertexBuf.cpp
+    #src/PlayPenExportPrecompiledAssemblerProgram.cpp
+    #src/PlayPenFallbackResourceGroup.cpp
     #src/PlayPenFloat128DDS.cpp
     #src/PlayPenFloat16DDS.cpp
     #src/PlayPenFloat32DDS.cpp
-    #src/PlayPen4bppPVR.cpp
-    #src/PlayPen4bppAlphaPVR.cpp
-    #src/PlayPen2bppPVR.cpp
-    #src/PlayPen2bppAlphaPVR.cpp
-    src/PlayPenRibbonTrail.cpp
-    #src/PlayPenExportPrecompiledAssemblerProgram.cpp
-#src/PlayPenMaterial.cpp
-    src/PlayPenBlendDiffuseColour.cpp
-    #src/PlayPenSplitPassesTooManyTexUnits.cpp
-    src/PlayPenCustomProjectionMatrix.cpp
-    src/PlayPenPointSprites.cpp
-    #src/PlayPenSuppressedShadows.cpp
-    #src/PlayPenViewportNoShadows.cpp
-    #src/PlayPenSerialisedColour.cpp
-    src/PlayPenBillboardAccurateFacing.cpp
-	src/PlayPenMultiSceneManagersSimple.cpp
-    #src/PlayPenMultiSceneManagersComplex.cpp
+    #src/PlayPenFloat64DDS.cpp
+    #src/PlayPenGLSLTangent.cpp
+    #src/PlayPenGeometryShaders.cpp
+    #src/PlayPenGpuPrograms.cpp
+    #src/PlayPenInfiniteAAB.cpp
+    #src/PlayPenIntersectionSceneQuery.cpp
+    #src/PlayPenLiSPSM.cpp
+    #src/PlayPenLod.cpp
+    #src/PlayPenMRT.cpp
+    #src/PlayPenMRTCompositorScript.cpp
     #src/PlayPenManualBoneMovement.cpp
-    src/PlayPenMaterialSchemes.cpp
+    #src/PlayPenManualIlluminationStage.cpp
+    #src/PlayPenManualLoader.cpp
     #src/PlayPenMaterialSchemesListener.cpp
     #src/PlayPenMaterialSchemesWithLOD.cpp
     #src/PlayPenMaterialSchemesWithMismatchedLOD.cpp
-    #src/PlayPenSkeletonAnimationOptimise.cpp
-    src/PlayPenBuildTangentOnAnimatedMesh.cpp
+    #src/PlayPenMaterialSerializer.cpp
+    #src/PlayPenMatrices.cpp
+    #src/PlayPenNewTerrain.cpp
+    #src/PlayPenNormalMapMirroredUVs.cpp
+    #src/PlayPenOverlayRelativeMode.cpp
+    #src/PlayPenOverlayZOrder.cpp
+    #src/PlayPenPoseAnimation2.cpp
+    #src/PlayPenPrepareShadowVolume.cpp
+    #src/PlayPenProjection.cpp
+    #src/PlayPenRadixSort.cpp  Not Visual!
+    #src/PlayPenRaySceneQuery.cpp
+    #src/PlayPenReinitialiseEntityAlteredMesh.cpp
+    #src/PlayPenReloadResources.cpp
+    #src/PlayPenSerialisedColour.cpp
+    #src/PlayPenShadowLod.cpp
+    #src/PlayPenSharedGpuParameters.cpp
+    #src/PlayPenSharedPtrBug.cpp
+    #src/PlayPenSimpleMesh.cpp
+    #src/PlayPenSplitPassesTooManyTexUnits.cpp
+    #src/PlayPenSpotlightViewProj.cpp
+    #src/PlayPenStencilShadowsMixedOpSubMeshes.cpp
+    #src/PlayPenStringTokenising.cpp
+    #src/PlayPenSuppressedShadows.cpp
+    src/PlayPenTextureShadowsCustomCasterMat.cpp
+    src/PlayPenTextureShadowsCustomReceiverMat.cpp
+    src/PlayPenTextureShadowsIntegrated.cpp
+    #src/PlayPenTextureShadowsIntegratedPSSM.cpp
+    #src/PlayPenTextureShadowsTransparentCaster.cpp
+    #src/PlayPenTimeCreateDestroyObject.cpp
+    #src/PlayPenTwoNewTerrains.cpp
     #src/PlayPenVertexTexture.cpp
-    #src/PlayPenBackgroundLoadResourceGroup.cpp
-    #src/PlayPenOverlayRelativeMode.cpp
-    src/PlayPenBillboardOrigins.cpp
-    src/PlayPenDepthBias.cpp
-    #src/PlayPenStringTokenising.cpp
-    #src/PlayPenTextureShadowsTransparentCaster.cpp
-    #src/PlayPenTextureShadowsIntegrated.cpp
-    #src/PlayPenTextureShadowsIntegratedPSSM.cpp
-    #src/PlayPenTimeCreateDestroyObject.cpp
-    src/PlayPenLightScissoring.cpp
-    src/PlayPenLightClipPlanes.cpp
-    src/PlayPenLightClipPlanesMoreLights.cpp
-    #src/PlayPenMRT.cpp
-    src/PlayPen16Textures.cpp
-    #src/PlayPenSharedPtrBug.cpp
-    #src/PlayPenSpotlightViewProj.cpp
-    #src/PlayPenManualIlluminationStage.cpp
-    #src/PlayPenReinitialiseEntityAlteredMesh.cpp
-    src/PlayPenSRGBtexture.cpp
-    src/PlayPenNegativeScale.cpp
-    #src/PlayPenLod.cpp
-    #src/PlayPenBug.cpp
-    #src/PlayPenManualObject2D.cpp
-    #src/PlayPenShadowLod.cpp
-    src/PlayPenFarFromOrigin.cpp
-    #src/PlayPenGeometryShaders.cpp
-    src/PlayPenAlphaToCoverage.cpp
-    #src/PlayPenLiSPSM.cpp
-    src/PlayPenBlitSubTextures.cpp
-    #src/PlayPenDepthShadowMap.cpp
-    #src/PlayPenSharedGpuParameters.cpp
-    src/PlayPenImageCombine.cpp
-    #src/PlayPenNewTerrain.cpp
-    #src/PlayPenTwoNewTerrains.cpp
+    #src/PlayPenViewportNoShadows.cpp
+	#src/PlayPenMaterial.cpp
     src/PlayPenTestPlugin.cpp)
 
 include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)

File Tests/VisualTests/PlayPen/include/PlayPenTests.h

View file
 
 	PlayPen_Bsp();
 
+	StringVector getRequiredPlugins()
+	{
+		StringVector names;
+		names.push_back("BSP Scene Manager");
+		return names;
+	}
+
+	void createSceneManager()
+	{
+		mSceneMgr = mRoot->createSceneManager("BspSceneManager");
+	}
+
 protected:
 
 	void setupContent();
 protected:
 
 	void setupContent();
+	void cleanupContent();
 
 };
 
 //------------------------------------------------------------------------------
 /** Tests */
-class _OgreSampleClassExport PlayPen_TextureShadowsCustomCasterMat : public VisualTest
+class _OgreSampleClassExport PlayPen_TextureShadowsCustomCasterMat : public PlayPen_TextureShadows
 {
 public:
 
 
 //------------------------------------------------------------------------------
 /** Tests */
-class _OgreSampleClassExport PlayPen_TextureShadowsCustomReceiverMat : public VisualTest
+class _OgreSampleClassExport PlayPen_TextureShadowsCustomReceiverMat : public PlayPen_TextureShadows
 {
 public:
 
 protected:
 
 	void setupContent();
+	void cleanupContent();
 
 };
 
 protected:
 
 	void setupContent();
+	void cleanupContent();
 
 };
 
 void addTextureDebugOverlay(Ogre::TexturePtr tex, size_t i);
 void addTextureShadowDebugOverlay(size_t num, Ogre::SceneManager* mgr);
 void clearDebugTextureOverlays();
+void createRandomEntityClones(Entity* ent, size_t cloneCount, 
+	const Vector3& min, const Vector3& max, SceneManager* mgr);
 
 #endif

File Tests/VisualTests/PlayPen/src/PlayPenBsp.cpp

View file
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+Copyright (c) 2000-2009 Torus Knot Software Ltd
+
+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.
+-----------------------------------------------------------------------------
+*/
+#include "PlayPenTests.h"
+
+PlayPen_Bsp::PlayPen_Bsp()
+{
+	mInfo["Title"] = "PlayPen_Bsp";
+	mInfo["Description"] = "Tests.";
+	addScreenshotFrame(250);
+}
+//----------------------------------------------------------------------------
+
+void PlayPen_Bsp::setupContent()
+{
+	// Load Quake3 locations from a file
+	ConfigFile cf;
+	
+	cf.load("quakemap.cfg");
+	
+	String quakePk3 = cf.getSetting("Archive");
+	String quakeLevel = cf.getSetting("Map");
+	
+	ResourceGroupManager::getSingleton().addResourceLocation(quakePk3, "Zip");
+	
+	
+	// Load world geometry
+	mSceneMgr->setWorldGeometry(quakeLevel);
+	
+	// modify camera for close work
+	mCamera->setNearClipDistance(4);
+	mCamera->setFarClipDistance(4000);
+	
+	// Also change position, and set Quake-type orientation
+	// Get random player start point
+	ViewPoint vp = mSceneMgr->getSuggestedViewpoint(true);
+	mCamera->setPosition(vp.position);
+	mCamera->pitch(Degree(90)); // Quake uses X/Y horizon, Z up
+	mCamera->rotate(vp.orientation);
+	// Don't yaw along variable axis, causes leaning
+	mCamera->setFixedYawAxis(true, Vector3::UNIT_Z);
+
+	mCamera->yaw(Ogre::Degree(-90.f));
+	
+}

File Tests/VisualTests/PlayPen/src/PlayPenFarFromOrigin.cpp

View file
 
 void PlayPen_FarFromOrigin::cleanupContent()
 {
-	clearDebugTextureOverlays();
+	//clearDebugTextureOverlays();
 }
 
 void PlayPen_FarFromOrigin::setupContent()
 	SceneNode* mTestNode[5];
 	mSceneMgr->setShadowTechnique(SHADOWTYPE_TEXTURE_MODULATIVE);
 	mSceneMgr->setShadowTextureSettings(1024, 2);
-	addTextureShadowDebugOverlay(2, mSceneMgr);
 	
 	Vector3 offset(100000, 0, 100000);
 	//Vector3 offset(0, 0, 0);
 	
 	FocusedShadowCameraSetup* camSetup = new FocusedShadowCameraSetup();
 	mSceneMgr->setShadowCameraSetup(ShadowCameraSetupPtr(camSetup));
+	//addTextureShadowDebugOverlay(1, mSceneMgr);
 	
 }

File Tests/VisualTests/PlayPen/src/PlayPenManualObject2D.cpp

View file
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+Copyright (c) 2000-2009 Torus Knot Software Ltd
+
+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.
+-----------------------------------------------------------------------------
+*/
+#include "PlayPenTests.h"
+
+PlayPen_ManualObject2D::PlayPen_ManualObject2D()
+{
+	mInfo["Title"] = "PlayPen_ManualObject2D";
+	mInfo["Description"] = "Tests.";
+	addScreenshotFrame(250);
+}
+//----------------------------------------------------------------------------
+
+void PlayPen_ManualObject2D::setupContent()
+{
+	ManualObject* man = mSceneMgr->createManualObject("1");
+	man->begin("Examples/OgreLogo");
+	man->position( 0.0, 0.0, 0.0);  man->textureCoord( 0, 1 );
+	man->position( 0.1, 0.0, 0.0);  man->textureCoord( 1, 1 );
+	man->position( 0.1, 0.1, 0.0);  man->textureCoord( 1, 0 );
+	man->position( 0.0, 0.1, 0.0);  man->textureCoord( 0, 0 );
+	
+	man->triangle( 0, 1, 2 );
+	man->triangle( 0, 2, 3 );
+	
+	man->setRenderQueueGroup(Ogre::RENDER_QUEUE_OVERLAY -1); 
+	man->end();
+	man->setUseIdentityProjection(true);
+	man->setUseIdentityView(true);
+	AxisAlignedBox aabb;
+	aabb.setInfinite();
+	man->setBoundingBox(aabb);
+	
+	SceneNode* sn = mSceneMgr->getRootSceneNode()->createChildSceneNode();
+	sn->setScale(5,5,1);
+	sn->attachObject(man);
+}

File Tests/VisualTests/PlayPen/src/PlayPenSkeletalAnimation.cpp

View file
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+Copyright (c) 2000-2009 Torus Knot Software Ltd
+
+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.
+-----------------------------------------------------------------------------
+*/
+#include "PlayPenTests.h"
+
+PlayPen_SkeletalAnimation::PlayPen_SkeletalAnimation()
+{
+	mInfo["Title"] = "PlayPen_SkeletalAnimation";
+	mInfo["Description"] = "Tests.";
+	addScreenshotFrame(250);
+}
+//----------------------------------------------------------------------------
+
+void PlayPen_SkeletalAnimation::setupContent()
+{
+	// Set ambient light
+	mSceneMgr->setAmbientLight(ColourValue(0.5, 0.5, 0.5));
+	//mWindow->getViewport(0)->setBackgroundColour(ColourValue::White);
+	
+	
+	
+	Entity *ent = mSceneMgr->createEntity("robot", "robot.mesh");
+	//ent->setDisplaySkeleton(true);
+	// Uncomment the below to test software skinning
+	ent->setMaterialName("Examples/Rocky");
+	// Add entity to the scene node
+	mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(ent);
+	Ogre::AnimationState* mAnimState = ent->getAnimationState("Walk");
+	mAnimState->setEnabled(true);
+	
+	// Give it a little ambience with lights
+	Light* l;
+	l = mSceneMgr->createLight("BlueLight");
+	l->setPosition(-200,-80,-100);
+	l->setDiffuseColour(0.5, 0.5, 1.0);
+	
+	l = mSceneMgr->createLight("GreenLight");
+	l->setPosition(0,0,-100);
+	l->setDiffuseColour(0.5, 1.0, 0.5);
+	
+	// Position the camera
+	mCamera->setPosition(200,50,0);
+	mCamera->lookAt(0,50,0);
+	
+	// Report whether hardware skinning is enabled or not
+	/*Technique* t = ent->getSubEntity(0)->getTechnique();
+	Pass* p = t->getPass(0);
+	OverlayElement* guiDbg = OverlayManager::getSingleton().getOverlayElement("Core/DebugText");
+	if (p->hasVertexProgram() && 
+	p->getVertexProgram()->isSkeletalAnimationIncluded())
+	{
+		guiDbg->setCaption("Hardware skinning is enabled");
+	}
+	else
+	{
+		guiDbg->setCaption("Software skinning is enabled");
+	}*/
+	
+	mAnimStateList.push_back(mAnimState);
+}

File Tests/VisualTests/PlayPen/src/PlayPenSkeletonAnimationOptimise.cpp

View file
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+Copyright (c) 2000-2009 Torus Knot Software Ltd
+
+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.
+-----------------------------------------------------------------------------
+*/
+#include "PlayPenTests.h"
+
+PlayPen_SkeletonAnimationOptimise::PlayPen_SkeletonAnimationOptimise()
+{
+	mInfo["Title"] = "PlayPen_SkeletonAnimationOptimise";
+	mInfo["Description"] = "Tests.";
+	addScreenshotFrame(250);
+}
+//----------------------------------------------------------------------------
+
+void PlayPen_SkeletonAnimationOptimise::setupContent()
+{
+	SceneNode* mTestNode[5];
+	mSceneMgr->setShadowTextureSize(512);
+	mSceneMgr->setShadowTechnique(SHADOWTYPE_STENCIL_ADDITIVE);
+	mSceneMgr->setShadowFarDistance(1500);
+	mSceneMgr->setShadowColour(ColourValue(0.35, 0.35, 0.35));
+	//mSceneMgr->setShadowFarDistance(800);
+	// Set ambient light
+	mSceneMgr->setAmbientLight(ColourValue(0.3, 0.3, 0.3));
+	
+	Light* mLight = mSceneMgr->createLight("MainLight");
+	
+	/*/
+	// Directional test
+	mLight->setType(Light::LT_DIRECTIONAL);
+	Vector3 vec(-1,-1,0);
+	vec.normalise();
+	mLight->setDirection(vec);
+	/*/
+	// Point test
+	mLight->setType(Light::LT_POINT);
+	mLight->setPosition(0, 200, 0);
+	//*/
+	
+	Entity* pEnt;
+	
+	// Hardware animation
+	pEnt = mSceneMgr->createEntity( "1", "robot.mesh" );
+	AnimationState* a = pEnt->getAnimationState("Walk");
+	a->setEnabled(true);
+	mAnimStateList.push_back(a);
+	mTestNode[0] = mSceneMgr->getRootSceneNode()->createChildSceneNode();
+	mTestNode[0]->attachObject( pEnt );
+	mTestNode[0]->translate(+100,-100,0);
+	
+	// Software animation
+	pEnt = mSceneMgr->createEntity( "2", "robot.mesh" );
+	pEnt->setMaterialName("BaseWhite");
+	a = pEnt->getAnimationState("Walk");
+	a->setEnabled(true);
+	mAnimStateList.push_back(a);
+	
+	mTestNode[1] = mSceneMgr->getRootSceneNode()->createChildSceneNode();
+	mTestNode[1]->attachObject( pEnt );
+	mTestNode[1]->translate(-100,-100,0);
+	
+	
+	Plane plane;
+	plane.normal = Vector3::UNIT_Y;
+	plane.d = 100;
+	MeshManager::getSingleton().createPlane("Myplane",
+	ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, plane,
+	1500,1500,10,10,true,1,5,5,Vector3::UNIT_Z);
+	Entity* pPlaneEnt;
+	pPlaneEnt = mSceneMgr->createEntity( "plane", "Myplane" );
+	pPlaneEnt->setMaterialName("2 - Default");
+	pPlaneEnt->setCastShadows(false);
+	mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(pPlaneEnt);
+
+	mCamera->setPosition(0,0,300);
+}

File Tests/VisualTests/PlayPen/src/PlayPenSubEntityVisibility.cpp

View file
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+Copyright (c) 2000-2009 Torus Knot Software Ltd
+
+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.
+-----------------------------------------------------------------------------
+*/
+#include "PlayPenTests.h"
+
+PlayPen_SubEntityVisibility::PlayPen_SubEntityVisibility()
+{
+	mInfo["Title"] = "PlayPen_SubEntityVisibility";
+	mInfo["Description"] = "Tests.";
+	addScreenshotFrame(250);
+}
+//----------------------------------------------------------------------------
+
+void PlayPen_SubEntityVisibility::setupContent()
+{
+	SceneNode* mTestNode[5];
+	// Set ambient light
+	mSceneMgr->setAmbientLight(ColourValue(0.5, 0.5, 0.5));
+	
+	// Create a point light
+	Light* l = mSceneMgr->createLight("MainLight");
+	l->setType(Light::LT_DIRECTIONAL);
+	l->setDirection(-Vector3::UNIT_Y);
+	
+	mTestNode[0] = (SceneNode*)mSceneMgr->getRootSceneNode()->createChild();
+	
+	Entity* pEnt = mSceneMgr->createEntity( "1", "ogrehead.mesh" );
+	mTestNode[0]->attachObject( pEnt );
+	
+	pEnt->getSubEntity(1)->setVisible(false);
+	
+	mCamera->setPosition(0,0,125);
+}

File Tests/VisualTests/PlayPen/src/PlayPenTestPlugin.cpp

View file
     addSample(new PlayPen_MorphAnimationWithoutNormals());
     addSample(new PlayPen_PoseAnimationWithNormals());
     addSample(new PlayPen_PoseAnimationWithoutNormals());
+
+	// new tests as of July 18
     addSample(new PlayPen_SceneNodeTracking());
     addSample(new PlayPen_StencilGlow());
-    //addSample(new PlayPen_ManualLoader());
-    //addSample(new PlayPen_MRTCompositorScript());
-    //addSample(new PlayPen_NormalMapMirroredUVs());
-    //addSample(new PlayPen_MaterialSerializer());
     addSample(new PlayPen_TransparencyMipMaps());
-    //addSample(new PlayPen_CthNewBlending());
-    //addSample(new PlayPen_Matrices());
     addSample(new PlayPen_BasicPlane());
-    //		addSample(new PlayPen_Alpha());
-    //		addSample(new PlayPen_Bsp());
-    //addSample(new PlayPen_Animation());
-    //addSample(new PlayPen_AnimationBlend());
-    //addSample(new PlayPen_GpuPrograms());
-    //addSample(new PlayPen_Projection());
     addSample(new PlayPen_MultiViewports());
     addSample(new PlayPen_Distortion());
-    //addSample(new PlayPen_EdgeBuilderSingleIndexBufSingleVertexBuf());
-    //addSample(new PlayPen_EdgeBuilderMultiIndexBufSingleVertexBuf());
-    //addSample(new PlayPen_EdgeBuilderMultiIndexBufMultiVertexBuf());
-    //addSample(new PlayPen_SkeletalAnimation());
-    //addSample(new PlayPen_PrepareShadowVolume());
-    //addSample(new PlayPen_WindowedViewportMode());
-    //addSample(new PlayPen_SubEntityVisibility());
     addSample(new PlayPen_AttachObjectsToBones());
     addSample(new PlayPen_Ortho());
-    //addSample(new PlayPen_ManualLOD());
-    //addSample(new PlayPen_FallbackResourceGroup());
-    //addSample(new PlayPen_GeneratedLOD());
-    //addSample(new PlayPen_ClearScene());
     addSample(new PlayPen_StencilShadows());
-    //addSample(new PlayPen_StencilShadowsMixedOpSubMeshes());
     addSample(new PlayPen_2Spotlights());
-    //addSample(new PlayPen_TextureShadows());
-    //addSample(new PlayPen_TextureShadowsCustomCasterMat());
-    //addSample(new PlayPen_TextureShadowsCustomReceiverMat());
-    //addSample(new PlayPen_CompositorTextureShadows());
-    //addSample(new PlayPen_CompositorTechniqueSwitch());
-    //addSample(new PlayPen_OverlayZOrder());
-    //addSample(new PlayPen_IntersectionSceneQuery());
-    //addSample(new PlayPen_RaySceneQuery());
     addSample(new PlayPen_LotsAndLotsOfEntities());
-    //addSample(new PlayPen_SimpleMesh());
-    //addSample(new PlayPen_GLSLTangent());
-    //addSample(new PlayPen_InfiniteAAB());
-    //addSample(new PlayPen_2Windows());
     addSample(new PlayPen_StaticGeometry());
     addSample(new PlayPen_StaticGeometryWithLOD());
-    //addSample(new PlayPen_ReloadResources());
     addSample(new PlayPen_BillboardTextureCoords());
-    //addSample(new PlayPen_RadixSort()); /** Not Visual */
-    //addSample(new PlayPen_PoseAnimation2());
     addSample(new PlayPen_ReflectedBillboards());
     addSample(new PlayPen_ManualObjectNonIndexed());
     addSample(new PlayPen_ManualObjectNonIndexedUpdateSmaller());
     addSample(new PlayPen_Dxt3());
     addSample(new PlayPen_Dxt3FromMemory());
     addSample(new PlayPen_Dxt5());
+    addSample(new PlayPen_RibbonTrail());
+    addSample(new PlayPen_BlendDiffuseColour());
+    addSample(new PlayPen_CustomProjectionMatrix());
+    addSample(new PlayPen_PointSprites());
+    addSample(new PlayPen_BillboardAccurateFacing());
+    addSample(new PlayPen_MultiSceneManagersSimple());
+    addSample(new PlayPen_NegativeScale());
+    addSample(new PlayPen_SRGBtexture());
+    addSample(new PlayPen_LightScissoring());
+    addSample(new PlayPen_LightClipPlanes());
+    addSample(new PlayPen_LightClipPlanesMoreLights());
+    addSample(new PlayPen_MaterialSchemes());
+    addSample(new PlayPen_BuildTangentOnAnimatedMesh());
+    addSample(new PlayPen_BillboardOrigins());
+    addSample(new PlayPen_DepthBias());
+    addSample(new PlayPen_16Textures());
+    addSample(new PlayPen_FarFromOrigin());
+    addSample(new PlayPen_AlphaToCoverage());
+    addSample(new PlayPen_BlitSubTextures());
+    addSample(new PlayPen_ImageCombine());
+
+	// NEW
+    addSample(new PlayPen_WindowedViewportMode());
+    addSample(new PlayPen_Bsp());
+    addSample(new PlayPen_SkeletalAnimation());
+    addSample(new PlayPen_SubEntityVisibility());
+    addSample(new PlayPen_SkeletonAnimationOptimise());
+    addSample(new PlayPen_TextureShadows());
+    addSample(new PlayPen_TextureShadowsIntegrated());
+    //addSample(new PlayPen_TextureShadowsIntegratedPSSM());
+
+	// ??
+    //addSample(new PlayPen_MultiSceneManagersComplex());
+
+
+	// The below is a temporary summary of the conversion process
+	// I made a script that parsed the playpen and automatically set
+	// up the basics for all the tests, so now I'm working through
+	// one-by-one fixing specific issues, and eliminating some tests
+	// (namely those that aren't actually visual).
+
+	// INCOMPLETE?
+	//addSample(new PlayPen_Material());
+	
+	// UNSUPPORTED?
+	//addSample(new PlayPen_GeneratedLOD()); generateLodLevels is no longer a member of Mesh
+	
+	// NEEDS PLUGIN
+    //addSample(new PlayPen_NewTerrain());
+    //addSample(new PlayPen_TwoNewTerrains());
+    //addSample(new PlayPen_InfiniteAAB());
+
+	// UNSUPPORTED/NEEDS CAPABILITY CHECK
+    //addSample(new PlayPen_NormalMapMirroredUVs());
     //addSample(new PlayPen_Float64DDS());
     //addSample(new PlayPen_Float128DDS());
     //addSample(new PlayPen_Float16DDS());
     //addSample(new PlayPen_4bppAlphaPVR());
     //addSample(new PlayPen_2bppPVR());
     //addSample(new PlayPen_2bppAlphaPVR());
-    addSample(new PlayPen_RibbonTrail());
+    //addSample(new PlayPen_VertexTexture()); // dX
+	
+	// NEEDS RESOURCES
+    //addSample(new PlayPen_CthNewBlending());
+    //addSample(new PlayPen_GpuPrograms());
+    //addSample(new PlayPen_Animation());
+    //addSample(new PlayPen_AnimationBlend());
+    //addSample(new PlayPen_Alpha());
+    //addSample(new PlayPen_OverlayRelativeMode());
+    //addSample(new PlayPen_SimpleMesh());
+    //addSample(new PlayPen_OverlayZOrder());
+
+	// PROBLEMATIC - INSPECT CLOSER
+    //addSample(new PlayPen_Projection());
+
+	// NOT VISUAL (or not readily tested in a visual manner)
+    //addSample(new PlayPen_ManualLoader());
+    //addSample(new PlayPen_EdgeBuilderSingleIndexBufSingleVertexBuf());
+    //addSample(new PlayPen_EdgeBuilderMultiIndexBufSingleVertexBuf());
+    //addSample(new PlayPen_EdgeBuilderMultiIndexBufMultiVertexBuf());
+    //addSample(new PlayPen_MaterialSerializer());
+    //addSample(new PlayPen_Matrices());
+    //addSample(new PlayPen_2Windows());
+    //addSample(new PlayPen_RadixSort());
+    //addSample(new PlayPen_StringTokenising());
+    //addSample(new PlayPen_SplitPassesTooManyTexUnits());
+	
+	// RESOURCE LOCATION ISSUES
+    //addSample(new PlayPen_FallbackResourceGroup());
+
+	// ?
+    //addSample(new PlayPen_PrepareShadowVolume());
+
+	// ALREADY PRESENT
+    //addSample(new PlayPen_ManualLOD());
+    //addSample(new PlayPen_PoseAnimation2());
+	
+	// ADDIIONAL DEPENDENCIES
+    //addSample(new PlayPen_MaterialSchemesListener());
+
+	// NEEDS TESTS/MEDIA
+    //addSample(new PlayPen_SerialisedColour());
+
+	// NEEDS EXTRA CLEANUP
+    //addSample(new PlayPen_MRTCompositorScript());
+
+	// TO CONVERT
+    //addSample(new PlayPen_ClearScene());
+    //addSample(new PlayPen_StencilShadowsMixedOpSubMeshes());
+    addSample(new PlayPen_TextureShadowsCustomCasterMat());
+    addSample(new PlayPen_TextureShadowsCustomReceiverMat());
+    //addSample(new PlayPen_CompositorTextureShadows());
+    //addSample(new PlayPen_CompositorTechniqueSwitch());
+    //addSample(new PlayPen_MaterialSchemesWithLOD());
+    //addSample(new PlayPen_MaterialSchemesWithMismatchedLOD());
+    //addSample(new PlayPen_LiSPSM());
+    //addSample(new PlayPen_GLSLTangent());
+    //addSample(new PlayPen_ReinitialiseEntityAlteredMesh());
+    //addSample(new PlayPen_MRT());
+	
+	// MAYBE
+    //addSample(new PlayPen_Bug());
+    //addSample(new PlayPen_IntersectionSceneQuery());
+
+    //addSample(new PlayPen_RaySceneQuery());
+    //addSample(new PlayPen_ReloadResources());
     //addSample(new PlayPen_ExportPrecompiledAssemblerProgram());
-// INCOMPLETE? //addSample(new PlayPen_Material());
-    addSample(new PlayPen_BlendDiffuseColour());
-    //addSample(new PlayPen_SplitPassesTooManyTexUnits());
-    addSample(new PlayPen_CustomProjectionMatrix());
-    addSample(new PlayPen_PointSprites());
     //addSample(new PlayPen_SuppressedShadows());
     //addSample(new PlayPen_ViewportNoShadows());
-    //addSample(new PlayPen_SerialisedColour());
-    addSample(new PlayPen_BillboardAccurateFacing());
-    addSample(new PlayPen_MultiSceneManagersSimple());
-    //addSample(new PlayPen_MultiSceneManagersComplex());
     //addSample(new PlayPen_ManualBoneMovement());
-    addSample(new PlayPen_MaterialSchemes());
-    //addSample(new PlayPen_MaterialSchemesListener());
-    //addSample(new PlayPen_MaterialSchemesWithLOD());
-    //addSample(new PlayPen_MaterialSchemesWithMismatchedLOD());
-    //addSample(new PlayPen_SkeletonAnimationOptimise());
-    addSample(new PlayPen_BuildTangentOnAnimatedMesh());
-    //addSample(new PlayPen_VertexTexture());
     //addSample(new PlayPen_BackgroundLoadResourceGroup());
-    //addSample(new PlayPen_OverlayRelativeMode());
-    addSample(new PlayPen_BillboardOrigins());
-    addSample(new PlayPen_DepthBias());
-    //addSample(new PlayPen_StringTokenising());
     //addSample(new PlayPen_TextureShadowsTransparentCaster());
-    //addSample(new PlayPen_TextureShadowsIntegrated());
-    //addSample(new PlayPen_TextureShadowsIntegratedPSSM());
     //addSample(new PlayPen_TimeCreateDestroyObject());
-    addSample(new PlayPen_LightScissoring());
-    addSample(new PlayPen_LightClipPlanes());
-    addSample(new PlayPen_LightClipPlanesMoreLights());
-    //addSample(new PlayPen_MRT());
-    addSample(new PlayPen_16Textures());
     //addSample(new PlayPen_SharedPtrBug());
     //addSample(new PlayPen_SpotlightViewProj());
     //addSample(new PlayPen_ManualIlluminationStage());
-    //addSample(new PlayPen_ReinitialiseEntityAlteredMesh());
-    addSample(new PlayPen_SRGBtexture());
-    addSample(new PlayPen_NegativeScale());
     //addSample(new PlayPen_Lod());
-    //addSample(new PlayPen_Bug());
-    //addSample(new PlayPen_ManualObject2D());
+    addSample(new PlayPen_ManualObject2D());
     //addSample(new PlayPen_ShadowLod());
-    addSample(new PlayPen_FarFromOrigin());
     //addSample(new PlayPen_GeometryShaders());
-    addSample(new PlayPen_AlphaToCoverage());
-    //addSample(new PlayPen_LiSPSM());
-    addSample(new PlayPen_BlitSubTextures());
     //addSample(new PlayPen_DepthShadowMap());
-//	addSample(new PlayPen_SharedGpuParameters());
-    addSample(new PlayPen_ImageCombine());
-    //addSample(new PlayPen_NewTerrain());
-    //addSample(new PlayPen_TwoNewTerrains());
+	//addSample(new PlayPen_SharedGpuParameters());
 }
 //---------------------------------------------------------------------
 

File Tests/VisualTests/PlayPen/src/PlayPenTests.cpp

View file
 	Ogre::Overlay* debugOverlay = Ogre::OverlayManager::getSingleton().getByName("Core/DebugOverlay");
 
 	if(debugOverlay)
-		debugOverlay->hide();
+		Ogre::OverlayManager::getSingleton().destroy("Core/DebugOverlay");
+		//debugOverlay->hide();
 
-	for(int i = 0; Ogre::OverlayManager::getSingleton().hasOverlayElement( 
-		"Ogre/DebugTexPanel" + Ogre::StringConverter::toString(i)); ++i)
+	for(int i = 0; i < 10; ++i)
 	{
-		OverlayManager::getSingleton().destroyOverlayElement(
-			"Ogre/DebugTexPanel" + Ogre::StringConverter::toString(i));
+		if(Ogre::OverlayManager::getSingleton().hasOverlayElement( 
+		"Ogre/DebugTexPanel" + Ogre::StringConverter::toString(i)))
+		{
+			OverlayManager::getSingleton().destroyOverlayElement(
+				"Ogre/DebugTexPanel" + Ogre::StringConverter::toString(i));
+			Ogre::MaterialManager::getSingleton().remove("Ogre/DebugTexture" + Ogre::StringConverter::toString(i));
+		}
 	}
 }
 

File Tests/VisualTests/PlayPen/src/PlayPenTextureShadows.cpp

View file
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+Copyright (c) 2000-2009 Torus Knot Software Ltd
+
+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.
+-----------------------------------------------------------------------------
+*/
+#include "PlayPenTests.h"
+
+
+PlayPen_TextureShadows::PlayPen_TextureShadows()
+{
+	mInfo["Title"] = "PlayPen_TextureShadows";
+	mInfo["Description"] = "Tests.";
+	addScreenshotFrame(250);
+}
+//----------------------------------------------------------------------------
+
+void PlayPen_TextureShadows::cleanupContent()
+{
+	clearDebugTextureOverlays();
+}
+//----------------------------------------------------------------------------
+
+void PlayPen_TextureShadows::setupContent()
+{
+	SceneNode* mTestNode[10];
+
+	mSceneMgr->setShadowTextureSize(1024);
+	mSceneMgr->setShadowTextureCount(1);
+	//mSceneMgr->setShadowTechnique(tech);
+	mSceneMgr->setShadowTechnique(SHADOWTYPE_TEXTURE_ADDITIVE);
+	
+	//FocusedShadowCameraSetup* lispsmSetup = new FocusedShadowCameraSetup();
+	//LiSPSMShadowCameraSetup* lispsmSetup = new LiSPSMShadowCameraSetup();
+	//lispsmSetup->setOptimalAdjustFactor(1.5);
+	//mSceneMgr->setShadowCameraSetup(ShadowCameraSetupPtr(lispsmSetup));
+	
+	mSceneMgr->setShadowFarDistance(1000);
+	mSceneMgr->setShadowColour(ColourValue(0.35, 0.35, 0.35));
+	//mSceneMgr->setShadowFarDistance(800);
+	// Set ambient light
+	mSceneMgr->setAmbientLight(ColourValue(0.3, 0.3, 0.3));
+	
+	Light* mLight = mSceneMgr->createLight("MainLight");
+	
+	
+	// Directional test
+	//if (directional)
+	//{
+		mLight->setType(Light::LT_DIRECTIONAL);
+		Vector3 vec(-1,-1,0);
+		vec.normalise();
+		mLight->setDirection(vec);
+	//}
+	// Spotlight test
+	/*else
+	{
+		mLight->setType(Light::LT_SPOTLIGHT);
+		mLight->setAttenuation(1500, 1, 0, 0);
+		mLight->setDiffuseColour(1.0, 1.0, 0.8);
+		mTestNode[0] = mSceneMgr->getRootSceneNode()->createChildSceneNode();
+		mTestNode[0]->setPosition(800,600,0);
+		mTestNode[0]->lookAt(Vector3(0,0,0), Node::TS_WORLD, Vector3::UNIT_Z);
+		mTestNode[0]->attachObject(mLight);
+	}*/
+	
+	mTestNode[1] = mSceneMgr->getRootSceneNode()->createChildSceneNode();
+	
+	
+	Entity* pEnt;
+	pEnt = mSceneMgr->createEntity( "1", "robot.mesh" );
+	//pEnt->setRenderingDistance(100);
+	AnimationState* mAnimState = pEnt->getAnimationState("Walk");
+	mAnimState->setEnabled(true);
+	mAnimStateList.push_back(mAnimState);
+	//pEnt->setMaterialName("2 - Default");
+	mTestNode[1]->attachObject( pEnt );
+	mTestNode[1]->translate(0,-100,0);
+	
+	Quaternion quat1 = Quaternion::IDENTITY;
+	Quaternion quat2;
+	quat2.FromAngleAxis(Degree(360), Vector3::UNIT_Y);
+	
+	pEnt = mSceneMgr->createEntity( "3", "knot.mesh" );
+	mTestNode[2] = mSceneMgr->getRootSceneNode()->createChildSceneNode(Vector3(-200, 0, -200));
+	mTestNode[2]->attachObject( pEnt );
+	
+	createRandomEntityClones(pEnt, 20, Vector3(-1000,0,-1000), Vector3(1000,0,1000), mSceneMgr);
+	
+	
+	// Transparent object (can force cast shadows)
+	pEnt = mSceneMgr->createEntity( "3.5", "knot.mesh" );
+	MaterialPtr tmat = MaterialManager::getSingleton().create("TestAlphaTransparency", 
+	ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
+	tmat->setTransparencyCastsShadows(true);
+	Pass* tpass = tmat->getTechnique(0)->getPass(0);
+	tpass->setAlphaRejectSettings(CMPF_GREATER, 150);
+	tpass->setSceneBlending(SBT_TRANSPARENT_ALPHA);
+	tpass->createTextureUnitState("gras_02.png");
+	tpass->setCullingMode(CULL_NONE);
+	
+	pEnt->setMaterialName("TestAlphaTransparency");
+	mTestNode[3] = mSceneMgr->getRootSceneNode()->createChildSceneNode(Vector3(350, 0, -200));
+	mTestNode[3]->attachObject( pEnt );
+	
+	MeshPtr msh = MeshManager::getSingleton().load("knot.mesh",
+	ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
+	msh->buildTangentVectors(VES_TANGENT, 0, 0);
+	pEnt = mSceneMgr->createEntity( "4", "knot.mesh" );
+	//pEnt->setMaterialName("Examples/BumpMapping/MultiLightSpecular");
+	mTestNode[2] = mSceneMgr->getRootSceneNode()->createChildSceneNode(Vector3(100, 0, 200));
+	mTestNode[2]->attachObject( pEnt );
+	
+	mSceneMgr->setSkyBox(true, "Examples/CloudyNoonSkyBox");
+	
+	
+	MovablePlane movablePlane(Vector3::UNIT_Y, 100);
+	MeshManager::getSingleton().createPlane("Myplane",
+	ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, movablePlane,
+	2500,2500,10,10,true,1,5,5,Vector3::UNIT_Z);
+	Entity* pPlaneEnt;
+	pPlaneEnt = mSceneMgr->createEntity( "plane", "Myplane" );
+	if (SHADOWTYPE_TEXTURE_ADDITIVE & SHADOWDETAILTYPE_INTEGRATED)
+	{
+	  pPlaneEnt->setMaterialName("Examples/Plane/IntegratedShadows");
+	}
+	else
+	{
+		pPlaneEnt->setMaterialName("2 - Default");
+	}
+	pPlaneEnt->setCastShadows(false);
+	mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(pPlaneEnt);
+	
+	addTextureShadowDebugOverlay(1,mSceneMgr);
+	
+	
+	/*
+	ParticleSystem* pSys2 = mSceneMgr->createParticleSystem("smoke", 
+	"Examples/Smoke");
+	mTestNode[4] = mSceneMgr->getRootSceneNode()->createChildSceneNode(Vector3(-300, -100, 200));
+	mTestNode[4]->attachObject(pSys2);
+	*/
+	
+	mCamera->setPosition(0, 1000, 500);
+	mCamera->lookAt(0,0,0);
+	mCamera->setFarClipDistance(10000);
+	
+	
+}

File Tests/VisualTests/PlayPen/src/PlayPenTextureShadowsCustomCasterMat.cpp

View file
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+Copyright (c) 2000-2009 Torus Knot Software Ltd
+
+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.
+-----------------------------------------------------------------------------
+*/
+#include "PlayPenTests.h"
+
+PlayPen_TextureShadowsCustomCasterMat::PlayPen_TextureShadowsCustomCasterMat()
+{
+	mInfo["Title"] = "PlayPen_TextureShadowsCustomCasterMat";
+	mInfo["Description"] = "Tests.";
+	addScreenshotFrame(250);
+}
+//----------------------------------------------------------------------------
+
+void PlayPen_TextureShadowsCustomCasterMat::setupContent()
+{
+	PlayPen_TextureShadows::setupContent();
+	
+	String customCasterMatVp = 
+	"void customCasterVp(float4 position : POSITION,\n"
+	"out float4 oPosition : POSITION,\n"
+	"uniform float4x4 worldViewProj)\n"
+	"{\n"
+	"	oPosition = mul(worldViewProj, position);\n"
+	"}\n";
+	String customCasterMatFp = 
+	"void customCasterFp(\n"
+	"out float4 oColor : COLOR)\n"
+	"{\n"
+	"	oColor = float4(1,1,0,1); // just a test\n"
+	"}\n";
+	
+	HighLevelGpuProgramPtr vp = HighLevelGpuProgramManager::getSingleton()
+	.createProgram("CustomShadowCasterVp", 
+	ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, 
+	"cg", GPT_VERTEX_PROGRAM);
+	vp->setSource(customCasterMatVp);
+	vp->setParameter("profiles", "vs_1_1 arbvp1");
+	vp->setParameter("entry_point", "customCasterVp");
+	vp->load();
+	
+	HighLevelGpuProgramPtr fp = HighLevelGpuProgramManager::getSingleton()
+	.createProgram("CustomShadowCasterFp", 
+	ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, 
+	"cg", GPT_FRAGMENT_PROGRAM);
+	fp->setSource(customCasterMatFp);
+	fp->setParameter("profiles", "ps_1_1 arbfp1");
+	fp->setParameter("entry_point", "customCasterFp");
+	fp->load();
+	
+	MaterialPtr mat = MaterialManager::getSingleton().create("CustomShadowCaster", 
+	ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
+	Pass* p = mat->getTechnique(0)->getPass(0);
+	p->setVertexProgram("CustomShadowCasterVp");
+	p->getVertexProgramParameters()->setNamedAutoConstant(
+	"worldViewProj", GpuProgramParameters::ACT_WORLDVIEWPROJ_MATRIX);
+	p->setFragmentProgram("CustomShadowCasterFp");
+	
+	mSceneMgr->setShadowTextureCasterMaterial("CustomShadowCaster");
+	
+	
+	
+	
+	
+}

File Tests/VisualTests/PlayPen/src/PlayPenTextureShadowsCustomReceiverMat.cpp

View file
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+Copyright (c) 2000-2009 Torus Knot Software Ltd
+
+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.
+-----------------------------------------------------------------------------
+*/
+#include "PlayPenTests.h"
+
+PlayPen_TextureShadowsCustomReceiverMat::PlayPen_TextureShadowsCustomReceiverMat()
+{
+	mInfo["Title"] = "PlayPen_TextureShadowsCustomReceiverMat";
+	mInfo["Description"] = "Tests.";
+	addScreenshotFrame(250);
+}
+//----------------------------------------------------------------------------
+
+void PlayPen_TextureShadowsCustomReceiverMat::setupContent()
+{
+	PlayPen_TextureShadows::setupContent();
+	
+	String customReceiverMatVp = 
+	"void customReceiverVp(float4 position : POSITION,\n"
+	"out float4 oPosition : POSITION,\n"
+	"out float2 oUV : TEXCOORD0,\n"
+	"uniform float4x4 texViewProj,\n"
+	"uniform float4x4 worldViewProj)\n"
+	"{\n"
+	"	oPosition = mul(worldViewProj, position);\n"
+	"	float4 suv = mul(texViewProj, position);\n"
+	"	oUV = suv.xy / suv.w;\n"
+	"}\n";
+	String customReceiverMatFp = 
+	"void customReceiverFp(\n"
+	"float2 uv : TEXCOORD0,\n"
+	"uniform sampler2D shadowTex : register(s0),\n"
+	"out float4 oColor : COLOR)\n"
+	"{\n"
+	"	float4 shadow = tex2D(shadowTex, uv);\n"
+	"	oColor = shadow * float4(1,0,1,1); // just a test\n"
+	"}\n";
+	
+	HighLevelGpuProgramPtr vp = HighLevelGpuProgramManager::getSingleton()
+	.createProgram("CustomShadowReceiverVp", 
+	ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, 
+	"cg", GPT_VERTEX_PROGRAM);
+	vp->setSource(customReceiverMatVp);
+	vp->setParameter("profiles", "vs_1_1 arbvp1");
+	vp->setParameter("entry_point", "customReceiverVp");
+	vp->load();
+	
+	HighLevelGpuProgramPtr fp = HighLevelGpuProgramManager::getSingleton()
+	.createProgram("CustomShadowReceiverFp", 
+	ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, 
+	"cg", GPT_FRAGMENT_PROGRAM);
+	fp->setSource(customReceiverMatFp);
+	fp->setParameter("profiles", "ps_1_1 arbfp1");
+	fp->setParameter("entry_point", "customReceiverFp");
+	fp->load();
+	
+	MaterialPtr mat = MaterialManager::getSingleton().create("CustomShadowReceiver", 
+	ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
+	Pass* p = mat->getTechnique(0)->getPass(0);
+	p->setVertexProgram("CustomShadowReceiverVp");
+	p->getVertexProgramParameters()->setNamedAutoConstant(
+	"worldViewProj", GpuProgramParameters::ACT_WORLDVIEWPROJ_MATRIX);
+	p->getVertexProgramParameters()->setNamedAutoConstant(
+	"texViewProj", GpuProgramParameters::ACT_TEXTURE_VIEWPROJ_MATRIX);
+	p->setFragmentProgram("CustomShadowReceiverFp");
+	p->createTextureUnitState(); // shadow texture will populate
+	
+	mSceneMgr->setShadowTextureReceiverMaterial("CustomShadowReceiver");
+	
+	
+	
+}

File Tests/VisualTests/PlayPen/src/PlayPenTextureShadowsIntegrated.cpp

View file
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+Copyright (c) 2000-2009 Torus Knot Software Ltd
+
+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.
+-----------------------------------------------------------------------------
+*/
+#include "PlayPenTests.h"
+
+PlayPen_TextureShadowsIntegrated::PlayPen_TextureShadowsIntegrated()
+{
+	mInfo["Title"] = "PlayPen_TextureShadowsIntegrated";
+	mInfo["Description"] = "Tests.";
+	addScreenshotFrame(250);
+}
+//----------------------------------------------------------------------------
+
+void PlayPen_TextureShadowsIntegrated::cleanupContent()
+{
+	clearDebugTextureOverlays();
+}
+//----------------------------------------------------------------------------
+
+void PlayPen_TextureShadowsIntegrated::setupContent()
+{
+	mSceneMgr->setShadowTechnique(SHADOWTYPE_TEXTURE_ADDITIVE_INTEGRATED);
+	//mSceneMgr->setShadowTechnique(SHADOWTYPE_TEXTURE_MODULATIVE);
+	MaterialManager::getSingleton().setDefaultTextureFiltering(TFO_ANISOTROPIC);
+	MaterialManager::getSingleton().setDefaultAnisotropy(5);
+	
+	mSceneMgr->setShadowTextureSettings(1024, 2);
+	
+	mSceneMgr->setAmbientLight(ColourValue::Black);
+	Light* l = mSceneMgr->createLight("Spot1");
+	l->setType(Light::LT_SPOTLIGHT);
+	l->setAttenuation(5000,1,0,0);
+	l->setSpotlightRange(Degree(30),Degree(45),1.0f);
+	SceneNode* lightNode1 = mSceneMgr->getRootSceneNode()->createChildSceneNode();
+	lightNode1->attachObject(l);
+	lightNode1->setPosition(400, 250, 500);
+	lightNode1->lookAt(Vector3(0,-200,0), Node::TS_WORLD);
+	l->setDirection(Vector3::NEGATIVE_UNIT_Z);
+	l->setDiffuseColour(0.7, 0.7, 0.5);
+	
+	l = mSceneMgr->createLight("Spot2");
+	l->setAttenuation(5000,1,0,0);
+	/* // spotlight */
+	l->setType(Light::LT_SPOTLIGHT);
+	l->setSpotlightRange(Degree(30),Degree(45),1.0f);
+	/**/
+	// point
+	SceneNode* lightNode2 = mSceneMgr->getRootSceneNode()->createChildSceneNode();
+	lightNode2->attachObject(l);
+	lightNode2->setPosition(-500, 200, 500);
+	lightNode2->lookAt(Vector3(0,-200,0), Node::TS_WORLD);
+	l->setDirection(Vector3::NEGATIVE_UNIT_Z);
+	/* // directional
+	l->setType(Light::LT_DIRECTIONAL);
+	Vector3 dir(0.5, -1, 0.5);
+	dir.normalise();
+	l->setDirection(dir);
+	*/
+	l->setDiffuseColour(1, 0.2, 0.2);
+	
+	/*
+	// Test spot 3
+	l = mSceneMgr->createLight("Spot3");
+	l->setType(Light::LT_SPOTLIGHT);
+	l->setAttenuation(5000,1,0,0);
+	l->setSpotlightRange(Degree(30),Degree(45),1.0f);
+	SceneNode* lightNode3 = mSceneMgr->getRootSceneNode()->createChildSceneNode();
+	lightNode3->attachObject(l);
+	lightNode3->setPosition(700, 250, 500);
+	lightNode3->lookAt(Vector3(0,-200,0), Node::TS_WORLD);
+	l->setDirection(Vector3::NEGATIVE_UNIT_Z);
+	l->setDiffuseColour(0.0, 0.7, 1.0);
+	*/
+	
+	// Create a basic plane to have something in the scene to look at
+	Plane plane;
+	plane.normal = Vector3::UNIT_Y;
+	plane.d = 100;
+	MeshPtr msh = MeshManager::getSingleton().createPlane("Myplane",
+	ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, plane,
+	4500,4500,100,100,true,1,40,40,Vector3::UNIT_Z);
+	msh->buildTangentVectors(VES_TANGENT);
+	Entity* pPlaneEnt;
+	pPlaneEnt = mSceneMgr->createEntity( "plane", "Myplane" );
+	//pPlaneEnt->setMaterialName("Examples/OffsetMapping/Specular");
+	pPlaneEnt->setMaterialName("Examples/OffsetMapping/IntegratedShadows");
+	pPlaneEnt->setCastShadows(false);
+	mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(pPlaneEnt);
+	
+	pPlaneEnt = mSceneMgr->createEntity( "plane2", "Myplane" );
+	//pPlaneEnt->setMaterialName("Examples/OffsetMapping/Specular");
+	pPlaneEnt->setMaterialName("Examples/OffsetMapping/IntegratedShadows");
+	pPlaneEnt->setCastShadows(false);
+	SceneNode* n = mSceneMgr->getRootSceneNode()->createChildSceneNode();
+	n->roll(Degree(90));
+	n->translate(100,0,0);
+	//n->attachObject(pPlaneEnt);
+	
+	pPlaneEnt = mSceneMgr->createEntity( "plane3", "Myplane" );
+	//pPlaneEnt->setMaterialName("Examples/OffsetMapping/Specular");
+	pPlaneEnt->setMaterialName("Examples/OffsetMapping/IntegratedShadows");
+	pPlaneEnt->setCastShadows(false);
+	n = mSceneMgr->getRootSceneNode()->createChildSceneNode();
+	n->pitch(Degree(90));
+	n->yaw(Degree(-90));
+	n->translate(0,0,-100);
+	n->attachObject(pPlaneEnt);
+	
+	mCamera->setPosition(-50, 500, 1000);
+	mCamera->lookAt(Vector3(-50,-100,0));
+	
+	Entity* ent = mSceneMgr->createEntity("athene", "athene.mesh");
+	ent->setMaterialName("Examples/Athene/NormalMapped");
+	mSceneMgr->getRootSceneNode()->createChildSceneNode(Vector3(0,-20,0))->attachObject(ent);
+	
+	addTextureShadowDebugOverlay(2, mSceneMgr);
+	
+	
+	
+}

File Tests/VisualTests/PlayPen/src/PlayPenTextureShadowsIntegratedPSSM.cpp

View file
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+Copyright (c) 2000-2009 Torus Knot Software Ltd
+
+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.
+-----------------------------------------------------------------------------
+*/
+#include "PlayPenTests.h"
+
+PlayPen_TextureShadowsIntegratedPSSM::PlayPen_TextureShadowsIntegratedPSSM()
+{
+	mInfo["Title"] = "PlayPen_TextureShadowsIntegratedPSSM";
+	mInfo["Description"] = "Tests.";
+	addScreenshotFrame(250);
+}
+//----------------------------------------------------------------------------
+
+void PlayPen_TextureShadowsIntegratedPSSM::cleanupContent()
+{
+	clearDebugTextureOverlays();
+}
+//----------------------------------------------------------------------------
+
+void PlayPen_TextureShadowsIntegratedPSSM::setupContent()
+{
+	mSceneMgr->setShadowTechnique(SHADOWTYPE_TEXTURE_ADDITIVE_INTEGRATED);
+	
+	// 3 textures per directional light
+	mSceneMgr->setShadowTextureCountPerLightType(Ogre::Light::LT_DIRECTIONAL, 3);
+	mSceneMgr->setShadowTextureSettings(512, 3, PF_FLOAT32_R);
+	mSceneMgr->setShadowTextureSelfShadow(true);
+	// Set up caster material - this is just a standard depth/shadow map caster
+	mSceneMgr->setShadowTextureCasterMaterial("PSSM/shadow_caster");
+	
+	// shadow camera setup
+	PSSMShadowCameraSetup* pssmSetup = new PSSMShadowCameraSetup();
+	pssmSetup->calculateSplitPoints(3, mCamera->getNearClipDistance(), mCamera->getFarClipDistance());
+	pssmSetup->setSplitPadding(10);
+	pssmSetup->setOptimalAdjustFactor(0, 2);
+	pssmSetup->setOptimalAdjustFactor(1, 1);
+	pssmSetup->setOptimalAdjustFactor(2, 0.5);
+	
+	mSceneMgr->setShadowCameraSetup(ShadowCameraSetupPtr(pssmSetup));
+	
+	
+	mSceneMgr->setAmbientLight(ColourValue(0.3, 0.3, 0.3));
+	Light* l = mSceneMgr->createLight("Dir");
+	l->setType(Light::LT_DIRECTIONAL);
+	Vector3 dir(0.3, -1, 0.2);
+	dir.normalise();
+	l->setDirection(dir);
+	
+	
+	// Create a basic plane to have something in the scene to look at
+	Plane plane;
+	plane.normal = Vector3::UNIT_Y;
+	plane.d = 100;
+	MeshPtr msh = MeshManager::getSingleton().createPlane("Myplane",
+	ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, plane,
+	4500,4500,100,100,true,1,40,40,Vector3::UNIT_Z);
+	msh->buildTangentVectors(VES_TANGENT);
+	Entity* pPlaneEnt;
+	pPlaneEnt = mSceneMgr->createEntity( "plane", "Myplane" );
+	pPlaneEnt->setMaterialName("PSSM/Plane");
+	mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(pPlaneEnt);
+	
+	mCamera->setPosition(-50, 500, 1000);
+	mCamera->lookAt(Vector3(-50,-100,0));
+	
+	Entity* ent = mSceneMgr->createEntity("knot", "knot.mesh");
+	ent->setMaterialName("PSSM/Knot");
+	mSceneMgr->getRootSceneNode()->createChildSceneNode(Vector3(0,0,0))->attachObject(ent);
+	createRandomEntityClones(ent, 20, Vector3(-1000,0,-1000), Vector3(1000,0,1000), mSceneMgr);
+	
+	
+	Vector4 splitPoints;
+	const PSSMShadowCameraSetup::SplitPointList& splitPointList = pssmSetup->getSplitPoints();
+	for (int i = 0; i < 3; ++i)
+	{
+		splitPoints[i] = splitPointList[i];
+	}
+	MaterialPtr mat = MaterialManager::getSingleton().getByName("PSSM/Plane");
+	mat->getTechnique(0)->getPass(0)->getFragmentProgramParameters()->setNamedConstant("pssmSplitPoints", splitPoints);
+	mat = MaterialManager::getSingleton().getByName("PSSM/Knot");
+	mat->getTechnique(0)->getPass(0)->getFragmentProgramParameters()->setNamedConstant("pssmSplitPoints", splitPoints);
+	
+	addTextureShadowDebugOverlay(3, mSceneMgr);
+	
+	
+	
+}

File Tests/VisualTests/PlayPen/src/PlayPenWindowedViewportMode.cpp

View file
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+Copyright (c) 2000-2009 Torus Knot Software Ltd
+
+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.
+-----------------------------------------------------------------------------
+*/
+#include "PlayPenTests.h"
+
+PlayPen_WindowedViewportMode::PlayPen_WindowedViewportMode()
+{
+	mInfo["Title"] = "PlayPen_WindowedViewportMode";
+	mInfo["Description"] = "Tests.";
+	addScreenshotFrame(250);
+}
+//----------------------------------------------------------------------------
+
+void PlayPen_WindowedViewportMode::setupContent()
+{
+	Ogre::SceneNode* mTestNode[5];
+
+	// Set ambient light
+	mSceneMgr->setAmbientLight(ColourValue(0.5, 0.5, 0.5));
+	
+	// Create a point light
+	Light* l = mSceneMgr->createLight("MainLight");
+	l->setType(Light::LT_DIRECTIONAL);
+	l->setDirection(-Vector3::UNIT_Y);
+	
+	mTestNode[0] = (SceneNode*)mSceneMgr->getRootSceneNode()->createChild();
+	
+	Entity* pEnt = mSceneMgr->createEntity( "1", "ogrehead.mesh" );
+	mTestNode[0]->attachObject( pEnt );
+	
+	mCamera->setWindow(0,0,0.5,0.5);
+	
+
+	mCamera->setPosition(0,0,125);
+}