I've been using orxDisplay_DrawMesh in order to draw my soft-bodies for a while. It works quite well, but now I've started investigating how much I can utilize shaders with it. In particular, I'm wondering if there's any way of passing custom vertex attributes to my fragment shaders? As far as I could see in the orx source code, the vertex shaders are hard-coded. They don't seem to support such customization.
The only workaround I could come up with is to abuse the vertex colors. Since I'm writing the fragment shader, I simply override the default behavior that multiplies the vertex colors with the object texture and that gives me 4 floats to transfer useful information to my shaders. Is there any problem with this workaround? Also, can you think of any way to transfer more that 4 numbers (on a vertex-by-vertex basis)?
Another problem I'm trying to solve is handling self occlusions gracefully. The best way of doing that would be to set the z-position in the fragment shader, but as far as I could find, the OpenGL ES fragment shaders don't support that. So, the next best would be the ability to define the z-position with the vertex positions, but the orxDisplay_DrawMesh API only accepts x and y coordinates, the z coordinate is inherited from the object. My last resort could be to sort the triangles manually to handle self-occlusions reasonably, but I'd rather avoid that unless necessary.
All of that said, I'm really amazed at how much service I'm getting from Orx and how little I need to fight it, even though I'm using it for something that it wasn't designed for. I guess that speaks for how well it was designed