Closed RGAA-Software closed 1 year ago
The screenshots you provided show that the shader code is embedded into your CPP code, and if that is the case, then that is most likely the problem. EDIT: Sorry, I misread, and just realised that it's the Live2D test that you're referring to. The issue is the same though, and it needs to be updated in order for it to work. You can do that yourself and submit a PR if you wish.
Axmol 2.0 requires that the shader source code is in separate files, as they are processed during build time to generate the correct shaders for different platforms.
Refer to #1279 for all the information you require in order to get it working. The information on that page should perhaps be placed somewhere that is more accessible, so that is something that should be addressed.
Note, the only issue I can see is this part of the shader:
#if defined(AX_USE_METAL)
" gl_Position = vec4(position.x, -position.y, position.z, 1.0);"
#else
" gl_Position = vec4(position, 1.0);"
#endif
I'm not sure if it is possible to add conditionals like that. @halx99 Is that possible with the axslc implementation? If not, is there a way to have 2 different source files and be selective about which one the axslc processes for a given platform? Nevermind, I just noticed that it can be done:
#if defined(METAL)
#endif
No need to do anything. A PR will be up soon with the updates to get Live2D working with Axmol 2.x.
It's working with Axmol 2.x now:
Thank you very much!
I known the reason of the crash is mismatched GLSL version.
After modified the glsl at here(the screenshot is origin code, I've modified ,such as: attribute -> in; gl_FragColor -> out fragColor...):
I still get the crash at here:
Any idea ? Thank you very much!