RTSS and multi-technique materials

Problems building or running the engine, queries about how to use features etc.
Post Reply
shenjoku
Gremlin
Posts: 193
Joined: Sat Aug 06, 2011 11:02 pm
x 6

RTSS and multi-technique materials

Post by shenjoku »

Can someone tell me how the RTSS works with a material that has multiple techniques? I'm trying to convert the terrain system to use RTSS so it will work with the lighting system I have in place, but I don't know how to deal with the material having multiple techniques for high and low LOD. This has to all be done in code btw, so that makes it a bit more tricky I think.

As far as I can tell you can only add a SRS (sub-render state) to the material directly and not to a specific technique. So how does the RTSS know which one to use? If you defined the material in script in would look something like this:

Code: Select all

material TestMaterial
{
	lod_values 3000

	// First technique for high LOD.
	technique
	{
		pass
		{
			// Texture units and stuff here.

			rtshader_system
			{
				// Parameters to RTSS.
			}
		}
	}

	// Second technique for low LOD.
	technique
	{
		lod_index 1

		pass
		{
			// Texture units and stuff here.

			rtshader_system
			{
				// Parameters to RTSS.
			}
		}
	}
}
I've noticed that createShaderBasedTechnique() has parameters for specifying a source and destination technique scheme name, which so far I've only ever been passing Ogre::MaterialManager::DEFAULT_SCHEME_NAME. Can this somehow specify which technique the RTSS is creating the information for? I'm not really sure how to use those parameters and the documentation is not very helpful either.
shenjoku
Gremlin
Posts: 193
Joined: Sat Aug 06, 2011 11:02 pm
x 6

Re: RTSS and multi-technique materials

Post by shenjoku »

After a bit of testing I've found out that whatever technique is last in the material is the one that will end up being used. I'm not entirely sure what causes this but it's obviously not the behavior I want. Any idea on how to make this work correctly? I can't really find anything.
Post Reply