C++ debug material with vertex color Topic is solved

Problems building or running the engine, queries about how to use features etc.
slapin
Bronze Sponsor
Bronze Sponsor
Posts: 339
Joined: Fri May 23, 2025 5:04 pm
x 24

C++ debug material with vertex color

Post by slapin »

Hi, all!
I need to produce various debug geometry using ManualObject. For that I need vertex-color only material generated in C++,
which should be seen on top of everything ignoring depth and render ordering. How can I do this? Or maybe there is existing embedded one?
My last attempt is not quite adequate...

Code: Select all

Ogre::MaterialPtr
createVertexColorNoDepthMaterial(const std::string &materialName)
{
	Ogre::MaterialPtr material =
		Ogre::MaterialManager::getSingleton().create(
			materialName,
			Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);

Ogre::Pass *pass = material->getTechnique(0)->getPass(0);
pass->setLightingEnabled(false);
pass->setCullingMode(Ogre::CULL_NONE);
pass->setVertexColourTracking(Ogre::TVC_DIFFUSE | Ogre::TVC_AMBIENT |
			      Ogre::TVC_SPECULAR);
// pass->setDepthCheckEnabled(true);
 pass->setDepthCheckEnabled(false);
// pass->setDepthWriteEnabled(false);
pass->setDepthWriteEnabled(false);
material->load();
return material;
}

The problem it is both occluded by everything and still affected by other objects :(
The color works but it is not the color I thought it would be... would be nice to make it finally work...
@paroj sorry to bother but I struggle with this one for a long time :(

paroj
OGRE Team Member
OGRE Team Member
Posts: 2274
Joined: Sun Mar 30, 2014 2:51 pm
x 1239

Re: C++ debug material with vertex color

Post by paroj »

follow the DebugDrawer and put it on RENDER_QUEUE_OVERLAY for good measure.
https://github.com/OGRECave/ogre/blob/a ... er.cpp#L50

slapin
Bronze Sponsor
Bronze Sponsor
Posts: 339
Joined: Fri May 23, 2025 5:04 pm
x 24

Re: C++ debug material with vertex color

Post by slapin »

Could you please elaborate about RENDER_QUEUE_OVERLAY?

paroj
OGRE Team Member
OGRE Team Member
Posts: 2274
Joined: Sun Mar 30, 2014 2:51 pm
x 1239

Re: C++ debug material with vertex color

Post by paroj »

slapin
Bronze Sponsor
Bronze Sponsor
Posts: 339
Joined: Fri May 23, 2025 5:04 pm
x 24

Re: C++ debug material with vertex color

Post by slapin »

Thanks a lot!