Change language evaluation order in RTSS?

Minor issues with the Ogre API that can be trivial to fix
d000hg
Goblin
Posts: 257
Joined: Tue Sep 02, 2008 9:41 pm
x 1

Change language evaluation order in RTSS?

Post by d000hg »

http://www.ogre3d.org/forums/viewtopic. ... 28#p457014

I think trying to choose native languages first is generally better; it also means the RTSS works on iOS with Cg support enabled...

Code: Select all

	if (hmgr.isLanguageSupported("cg"))
	{
		mShaderLanguage	= "cg";
	}
	else if (hmgr.isLanguageSupported("glsl"))
	{
		mShaderLanguage	= "glsl";
	}
	else if (hmgr.isLanguageSupported("glsles"))
	{
		mShaderLanguage	= "glsles";
	}
	else if (hmgr.isLanguageSupported("hlsl"))
	{
		mShaderLanguage	= "hlsl";
	}
	else
	{...
The fact Cg is pretty much not working at all with HLSL2GLSL on iOS is another bug but regardless, using RTSS to build shaders which then have to be converted into a native format just seems ugly!
d000hg
Goblin
Posts: 257
Joined: Tue Sep 02, 2008 9:41 pm
x 1

Re: Change language evaluation order in RTSS?

Post by d000hg »

There's a bug-issue for this now: http://www.ogre3d.org/mantis/view.php?id=555

In my tests, even in Ogre 1.8.2 RTSS is broken with iOS/GLES2 using the standard iOSDependencies download.
User avatar
masterfalcon
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 4270
Joined: Sun Feb 25, 2007 4:56 am
Location: Bloomington, MN
x 126

Re: Change language evaluation order in RTSS?

Post by masterfalcon »

Do keep in mind that Cg support for GLES2 is experimental in 1.8 and not guaranteed to work.
d000hg
Goblin
Posts: 257
Joined: Tue Sep 02, 2008 9:41 pm
x 1

Re: Change language evaluation order in RTSS?

Post by d000hg »

Unless I have things backwards (very possible) that's kind of my point... if it chooses glsles in preference to Cg, it doesn't rely on Cg support for RTSS. As it is now, RTSS generates Cg which then gets converted using hlsl2glsl, right? Whereas in my tweak, it would generate glsles directly.

Obviously for actual Cg shaders that's a different story, but it's quite possible I'd write proper glsles shaders and still want to use RTSS for simple materials.
User avatar
masterfalcon
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 4270
Joined: Sun Feb 25, 2007 4:56 am
Location: Bloomington, MN
x 126

Re: Change language evaluation order in RTSS?

Post by masterfalcon »

Yeah I suppose so. I guess then it would basically never use Cg for GLES2. Cg would only really be supported for non-RTSS generated programs. I see that logic better now.