write shader

Started by nima.sh23, October 07, 2015, 11:07:52 AM

Previous topic - Next topic

nima.sh23

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?

EgonOlsen

So Blender exports a GLSL shader for you?

nima.sh23

Yes, It export for me, but I for each material, I mean, I have 3 materials and 3 vertex and fragment5 files.

EgonOlsen

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.

nima.sh23