Author Topic: write shader  (Read 2115 times)

Offline nima.sh23

  • byte
  • *
  • Posts: 40
    • View Profile
write shader
« on: October 07, 2015, 11:07:52 am »
I try to use texture splatting, I create a 3d file on blender, set textures and materials on object, export 3d object and shader( by GLSL ), for each material I have shader.
Is it wrong way for use shader on jpct?
How can I write shader for my 3d object?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: write shader
« Reply #1 on: October 07, 2015, 01:24:13 pm »
So Blender exports a GLSL shader for you?

Offline nima.sh23

  • byte
  • *
  • Posts: 40
    • View Profile
Re: write shader
« Reply #2 on: October 07, 2015, 02:02:47 pm »
Yes, It export for me, but I for each material, I mean, I have 3 materials and 3 vertex and fragment5 files.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: write shader
« Reply #3 on: October 07, 2015, 03:09:08 pm »
Well, I gave you an example shader for texture splatting in the other thread. I've no idea what exactly Blender exports there, but I'm pretty sure that it won't work on Android anyway and even if it would, it doesn't follow the naming conventions that jPCT-AE uses for shaders (have a look at the GLSLShader documentation for more details). So I would just ignore these shaders and use the one from the example that I gave you. That requires of course that your texture setup matches the shader's requirements.

Offline nima.sh23

  • byte
  • *
  • Posts: 40
    • View Profile
Re: write shader
« Reply #4 on: October 07, 2015, 04:30:31 pm »
Thanks man.