Author Topic: GLSLShader usage same between jpct and jpct-ae?  (Read 2715 times)

Offline kkl

  • float
  • ****
  • Posts: 291
    • View Profile
GLSLShader usage same between jpct and jpct-ae?
« on: December 14, 2014, 10:22:52 am »
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
Code: [Select]
Matrix construction from matrix is not allowed in implicit GLSL version number 110

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: GLSLShader usage same between jpct and jpct-ae?
« Reply #1 on: December 14, 2014, 03:56:36 pm »
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.

Offline kkl

  • float
  • ****
  • Posts: 291
    • View Profile
Re: GLSLShader usage same between jpct and jpct-ae?
« Reply #2 on: December 15, 2014, 02:18:53 am »
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?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: GLSLShader usage same between jpct and jpct-ae?
« Reply #3 on: December 15, 2014, 07:51:51 am »
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...

Offline kkl

  • float
  • ****
  • Posts: 291
    • View Profile
Re: GLSLShader usage same between jpct and jpct-ae?
« Reply #4 on: December 15, 2014, 08:57:02 am »
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.