An attempt at Vulkan
zzuegg:
Tbh i am not sure i get the issues. Yes, spir-v does not support preprocessors style functions. Nor does opengl. You are already forced to recompile the shader in case a define changes. Jme already has its own preprocessor in place that does the loop unroll, so why not extent that part.
For uniform style variables you have push constants in vulcan. If its a good idea to use it is a different topic, but you can.
(https://docs.vulkan.org/guide/latest/storage_image_and_texel_buffers.html)
Thank you for the tip. I think I finally understand why the mesh always renders incorrectly. The article you shared provided a detailed explanation of UBOs. I had previously assumed that the problem was due to macros affecting the final shader, as my meshes kept displaying incorrectly. However, I now realize that the issue was the misalignment between the UBO memory and the layout in the shader. I know what to do next.
I can now display it correctly, though I still can’t directly use jMonkeyEngine’s built-in shaders.
private static final String MAT_DEF = "Common/MatDefs/Aurora/Aurora.j3md";
Currently, I’m using a custom shader. I apologize for not responding to everyone for a while—I’ve been focused on tracking down the issue.
Discussion in the ATmosphere