Fix for RTShader GLSLES Writer

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

Fix for RTShader GLSLES Writer

Post by KelevrA » Tue Jan 10, 2012 5:43 am

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
(44.55 KiB) Downloaded 167 times
I surround my code with // ***************************************** lines.

Good luck.
0 x

User avatar
masterfalcon
OGRE Team Member
OGRE Team Member
Posts: 4270
Joined: Sun Feb 25, 2007 4:56 am
Location: Bloomington, MN
Contact:

Re: Fix for RTShader GLSLES Writer

Post by masterfalcon » Tue Jan 10, 2012 8:20 am

Thanks! I don't have any android devices but I'll commit this on good faith.
0 x

KelevrA
Gnoblar
Posts: 3
Joined: Tue Jan 10, 2012 5:15 am

Re: Fix for RTShader GLSLES Writer

Post by KelevrA » Tue Jan 10, 2012 9:50 am

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;"
0 x

Shamun
Gnoblar
Posts: 19
Joined: Sun Aug 01, 2010 12:45 am
Location: Israel

Re: Fix for RTShader GLSLES Writer

Post by Shamun » Mon Jan 23, 2012 12:58 am

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)
Attachments
OgreShaderGLSLESProgramWriter.cpp
(43.14 KiB) Downloaded 144 times
0 x

Shamun
Gnoblar
Posts: 19
Joined: Sun Aug 01, 2010 12:45 am
Location: Israel

Re: Fix for RTShader GLSLES Writer

Post by Shamun » Wed Jan 25, 2012 1:48 pm

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
0 x

Post Reply