Fix for RTShader GLSLES Writer

Discussion of issues specific to mobile platforms such as iOS, Android, Symbian and Meego.
KelevrA
Gnoblar
Posts: 3
Joined: Tue Jan 10, 2012 5:15 am

Fix for RTShader GLSLES Writer

Post by KelevrA »

Hi to all.
When i start test OGRE 1.8 with GLES2 on android, i found bug on device with PowerVR graphic card (LG Optimus Black SGX530, Nexus Prime SGX 540, Galaxy Tab P1000 SGX530 and other sgx, as i think), models was black (on some device) or filled by random color =( But on SGS2 with Mali-400 all works fine.

Bug was in (FFP_Add(gl_FragColor.xyz, lLocalParam_0.xyz, gl_FragColor.xyz)) and other func wich take gl_FragColor as out parma.

This is the fixed class of OgreShaderGLSLESProgramWriter
OgreShaderGLSLESProgramWriter.cpp
I surround my code with // ***************************************** lines.

Good luck.
You do not have the required permissions to view the files attached to this post.
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: Fix for RTShader GLSLES Writer

Post by masterfalcon »

Thanks! I don't have any android devices but I'll commit this on good faith.
KelevrA
Gnoblar
Posts: 3
Joined: Tue Jan 10, 2012 5:15 am

Re: Fix for RTShader GLSLES Writer

Post by KelevrA »

If some one test this it will be good =) I tested this on 4 PowerVR devices.

It's just replace gl_FragColor passed in func, and at end of fragment shader write line "gl_FragColor = tmpFragColor;"
Shamun
Gnoblar
Posts: 19
Joined: Sun Aug 01, 2010 12:45 am
Location: Israel
x 5

Re: Fix for RTShader GLSLES Writer

Post by Shamun »

I've got another update to the glsleswriter.
The sgs2 can't handle gl_Position as out parameter so I changed it. (same fix as gl_FragColor)
So now I can see my models but black for some reason, only when using sgs2. (I've tested the code on the Tegra 2 and it works great)
You do not have the required permissions to view the files attached to this post.
Shamun
Gnoblar
Posts: 19
Joined: Sun Aug 01, 2010 12:45 am
Location: Israel
x 5

Re: Fix for RTShader GLSLES Writer

Post by Shamun »

Apparently the Mali-400 can't handle any varying as out parameter so I changed the glsles writer and now it looks great.
I'll upload a patch soon.

Here is the patch https://sourceforge.net/tracker/?func=d ... tid=302997