Skip to content

Commit

Permalink
Samples: add category for shader samples & add mesh shader sample
Browse files Browse the repository at this point in the history
  • Loading branch information
paroj committed Sep 22, 2024
1 parent d066d1f commit 78d77a9
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 4 deletions.
2 changes: 2 additions & 0 deletions Samples/Common/src/DefaultSamplesPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion Samples/Simple/include/AtomicCounters.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
50 changes: 50 additions & 0 deletions Samples/Simple/include/MeshShaders.h
Original file line number Diff line number Diff line change
@@ -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);
}
};
2 changes: 1 addition & 1 deletion Samples/Simple/include/Tessellation.h
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}

Expand Down
2 changes: 1 addition & 1 deletion Samples/Simple/include/TextureArray.h
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}

Expand Down
2 changes: 1 addition & 1 deletion Samples/Simple/src/Compute.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 78d77a9

Please sign in to comment.