diff --git a/Samples/Common/src/DefaultSamplesPlugin.cpp b/Samples/Common/src/DefaultSamplesPlugin.cpp index 0603969260c..6cb7d84032c 100644 --- a/Samples/Common/src/DefaultSamplesPlugin.cpp +++ b/Samples/Common/src/DefaultSamplesPlugin.cpp @@ -63,6 +63,7 @@ #ifdef OGRE_BUILD_COMPONENT_MESHLODGENERATOR # include "MeshLod.h" #endif +#include "MeshShaders.h" #include "NewInstancing.h" #include "OceanDemo.h" #include "ParticleFX.h" @@ -134,6 +135,7 @@ DefaultSamplesPlugin::DefaultSamplesPlugin() : SamplePlugin("DefaultSamplesPlugi #ifdef OGRE_BUILD_COMPONENT_MESHLODGENERATOR addSample(new Sample_MeshLod); #endif + addSample(new Sample_MeshShaders); addSample(new Sample_ParticleFX); #ifdef HAVE_PCZ_PLUGIN addSample(new Sample_PCZTest); diff --git a/Samples/Simple/include/AtomicCounters.h b/Samples/Simple/include/AtomicCounters.h index c5e8f604c07..49a8fa45cc9 100644 --- a/Samples/Simple/include/AtomicCounters.h +++ b/Samples/Simple/include/AtomicCounters.h @@ -26,7 +26,7 @@ class _OgreSampleClassExport Sample_AtomicCounters : public SdkSample mInfo["Title"] = "Atomic Counters"; mInfo["Description"] = "An example of using atomic counters to visualise GPU rasterization order"; mInfo["Thumbnail"] = "thumb_atomicc.png"; - mInfo["Category"] = "Unsorted"; + mInfo["Category"] = "ShaderFeatures"; } void testCapabilities(const RenderSystemCapabilities* caps) override diff --git a/Samples/Simple/include/MeshShaders.h b/Samples/Simple/include/MeshShaders.h new file mode 100644 index 00000000000..3f943003fdb --- /dev/null +++ b/Samples/Simple/include/MeshShaders.h @@ -0,0 +1,50 @@ +/* +----------------------------------------------------------------------------- +This source file is part of OGRE +(Object-oriented Graphics Rendering Engine) +For the latest info, see http://www.ogre3d.org/ + +Copyright (c) 2000-2014 Torus Knot Software Ltd +Also see acknowledgements in Readme.html + +You may use this sample code for anything you like, it is not covered by the +same license as the rest of the engine. +----------------------------------------------------------------------------- +*/ +#include "SdkSample.h" +#include "SamplePlugin.h" + +using namespace Ogre; +using namespace OgreBites; + +class _OgreSampleClassExport Sample_MeshShaders : public SdkSample +{ + public: + Sample_MeshShaders() + { + mInfo["Title"] = "Mesh Shaders"; + mInfo["Description"] = "An example of using mesh shaders"; + mInfo["Thumbnail"] = "thumb_atomicc.png"; + mInfo["Category"] = "ShaderFeatures"; + } + + void testCapabilities(const RenderSystemCapabilities* caps) override + { + requireMaterial("Example/MeshShader"); + } + + void setupContent() override + { + mViewport->setBackgroundColour(ColourValue(0.3, 0.3, 0.3)); + + mCameraMan->setStyle(CS_ORBIT); + mCameraMan->setYawPitchDist(Degree(0), Degree(0), 1000); + + auto rect = mSceneMgr->createEntity(SceneManager::PT_PLANE); + rect->getMesh()->_setBounds(AxisAlignedBox::BOX_INFINITE); + + MaterialPtr mat = MaterialManager::getSingleton().getByName("Example/MeshShader"); + rect->setMaterial(mat); + mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(rect); + } +}; diff --git a/Samples/Simple/include/Tessellation.h b/Samples/Simple/include/Tessellation.h index 846365746aa..03ea772fa4f 100644 --- a/Samples/Simple/include/Tessellation.h +++ b/Samples/Simple/include/Tessellation.h @@ -16,7 +16,7 @@ class _OgreSampleClassExport Sample_Tessellation : public SdkSample mInfo["Title"] = "Tessellation"; mInfo["Description"] = "Sample for tessellation support (Hull, Domain shaders)"; mInfo["Thumbnail"] = "thumb_tessellation.png"; - mInfo["Category"] = "Unsorted"; + mInfo["Category"] = "ShaderFeatures"; mInfo["Help"] = "Top Left: Multi-frame\nTop Right: Scrolling\nBottom Left: Rotation\nBottom Right: Scaling"; } diff --git a/Samples/Simple/include/TextureArray.h b/Samples/Simple/include/TextureArray.h index a8ee2c5659e..4a23ad0f33d 100644 --- a/Samples/Simple/include/TextureArray.h +++ b/Samples/Simple/include/TextureArray.h @@ -16,7 +16,7 @@ class _OgreSampleClassExport Sample_TextureArray : public SdkSample mInfo["Title"] = "Texture Array"; mInfo["Description"] = "Demonstrates texture array support."; mInfo["Thumbnail"] = "thumb_texarray.png"; - mInfo["Category"] = "Unsorted"; + mInfo["Category"] = "ShaderFeatures"; mInfo["Help"] = "Top Left: Multi-frame\nTop Right: Scrolling\nBottom Left: Rotation\nBottom Right: Scaling"; } diff --git a/Samples/Simple/src/Compute.cpp b/Samples/Simple/src/Compute.cpp index b57a5880863..a23b71c7f8c 100644 --- a/Samples/Simple/src/Compute.cpp +++ b/Samples/Simple/src/Compute.cpp @@ -19,7 +19,7 @@ namespace OgreBites { mInfo["Title"] = "Compute"; mInfo["Description"] = "A basic example of the compute shader."; mInfo["Thumbnail"] = "thumb_compute.png"; - mInfo["Category"] = "Tests"; + mInfo["Category"] = "ShaderFeatures"; mInfo["Help"] = "The shader is executed in groups of 16x16 workers\n" "in total there are 16x16 groups forming a grid of 256x256\n" "each worker writes the color based on the local id\n"