GLSLShader usage same between jpct and jpct-ae?

Started by kkl, December 14, 2014, 10:22:52 AM

Previous topic - Next topic

kkl

Hi egon,

R they the same? I tried using the same method from jpct-ae and it does nt work in jpct. Plus, it shows warning like Matrix construction from matrix is not allowed in implicit GLSL version number 110

EgonOlsen

The class itself is basically the same, but GLSL isn't. In addition, the desktop version relies on the predefined uniforms from GL, which don't exist on mobile.
So in short: You have to rewrite your shaders for desktop, but that's not caused by the GLSLShader class.

kkl

Do you mean we have to use the fixed uniform like gl_ModelViewProjectionMatrix? We don't have to calculate the MVP matrix and pass it shader like android version anymore?

EgonOlsen

Yes, those gl_ uniforms are available in desktop GLSL, which is why jPCT doesn't bother with defining its own ones like jPCT-AE has to. You just have to watch the GLSL version that your shader defines, because higher versions don't support these magic uniforms anymore because...reasons...

kkl

Thanks egon. Seems like it's alot of work to rebuild the desktop version in order to make it compatible to android version. I was thinking making an desktop version editor, so it would be easy to edit the object while looking at the result.