OGLES2 with hlsl2glslfork issue

Discussion of issues specific to mobile platforms such as iOS, Android, Symbian and Meego.
oiram
Halfling
Posts: 87
Joined: Sun Dec 13, 2009 5:06 am
x 6

OGLES2 with hlsl2glslfork issue

Post by oiram »

I've compiled ogre 1.8rc1 with ogles2 + hlsl2glslfork with no errors and run ogre samples on windows. but nothing drawing. I found some cg -> glsl translation errors in ogre.log.

Code: Select all

...
14:59:12: Parsing scripts for resource group RTShaderLib
14:59:12: Finished parsing scripts for resource group RTShaderLib
14:59:12: Creating resources for group RTShaderLib
14:59:12: All done
14:59:13: File: failed to convert from Cg to glsl with the following errors:
ERROR: 0:60: 'float2x4' : syntax error parse error
ERROR: 1 compilation errors.  No code generated.
...
with some digging I found there are two versions hlsl2glslfork.
1. https://github.com/aras-p/hlsl2glslfork
2. https://bitbucket.org/mawww/hlsl2glslfork

When I look into its code and I found some different at "hlslang.l".
In gitthub.com version, it's not define float2x4, float3x4 or others matrix type like.

Code: Select all

"discard"      {  pyylval->lex.line = lexlineno; return(DISCARD); }
"return"       {  pyylval->lex.line = lexlineno; return(RETURN); }

"float2x2"         {  pyylval->lex.line = lexlineno; parseContext.lexAfterType = true; return(MATRIX2); }
"float3x3"         {  pyylval->lex.line = lexlineno; parseContext.lexAfterType = true; return(MATRIX3); }
"float4x4"         {  pyylval->lex.line = lexlineno; parseContext.lexAfterType = true; return(MATRIX4); }
"half2x2"         {  pyylval->lex.line = lexlineno; parseContext.lexAfterType = true; return(HMATRIX2); }
"half3x3"         {  pyylval->lex.line = lexlineno; parseContext.lexAfterType = true; return(HMATRIX3); }
"half4x4"         {  pyylval->lex.line = lexlineno; parseContext.lexAfterType = true; return(HMATRIX4); }
"fixed2x2"        {  pyylval->lex.line = lexlineno; parseContext.lexAfterType = true; return(FMATRIX2); }
"fixed3x3"        {  pyylval->lex.line = lexlineno; parseContext.lexAfterType = true; return(FMATRIX3); }
"fixed4x4"        {  pyylval->lex.line = lexlineno; parseContext.lexAfterType = true; return(FMATRIX4); }
In bitbucked.org version, it's define them what we need.

Code: Select all

"discard"      {  pyylval->lex.line = lexlineno; return(DISCARD); }
"return"       {  pyylval->lex.line = lexlineno; return(RETURN); }

"float2x2"     {  pyylval->lex.line = lexlineno; parseContext.lexAfterType = true; return(MATRIX2x2); }
"float2x3"     {  pyylval->lex.line = lexlineno; parseContext.lexAfterType = true; return(MATRIX2x3); }
"float2x4"     {  pyylval->lex.line = lexlineno; parseContext.lexAfterType = true; return(MATRIX2x4); }

"float3x2"     {  pyylval->lex.line = lexlineno; parseContext.lexAfterType = true; return(MATRIX3x2); }
"float3x3"     {  pyylval->lex.line = lexlineno; parseContext.lexAfterType = true; return(MATRIX3x3); }
"float3x4"     {  pyylval->lex.line = lexlineno; parseContext.lexAfterType = true; return(MATRIX3x4); }

"float4x2"     {  pyylval->lex.line = lexlineno; parseContext.lexAfterType = true; return(MATRIX4x2); }
"float4x3"     {  pyylval->lex.line = lexlineno; parseContext.lexAfterType = true; return(MATRIX4x3); }
"float4x4"     {  pyylval->lex.line = lexlineno; parseContext.lexAfterType = true; return(MATRIX4x4); }
But it's too complex that I cannot fix. And I think the latest version is on "github.com" maintained by unity3d, but what's the other version and who write it?
Any advice?
:roll:
User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel
x 76

Re: OGLES2 with hlsl2glslfork issue

Post by Assaf Raman »

float2x4, float3x4 are not supported in opengl es 2
Watch out for my OGRE related tweets here.
oiram
Halfling
Posts: 87
Joined: Sun Dec 13, 2009 5:06 am
x 6

Re: OGLES2 with hlsl2glslfork issue

Post by oiram »

Then how about RTShaderSystem? It used float2x4 to transform in shader.
User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel
x 76

Re: OGLES2 with hlsl2glslfork issue

Post by Assaf Raman »

I don't know about 2X4 - but float3x4 doesn't exist in opengl es 2
Watch out for my OGRE related tweets here.
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: OGLES2 with hlsl2glslfork issue

Post by masterfalcon »

At the moment only square matrices are supported in GL ES 2. It's possible that the GL ES 2 Cg support could use some more work.