{
  "$type": "site.standard.document",
  "bskyPostRef": {
    "cid": "bafyreig2tv4hbeifzd6efypcvzrzluey4aiuo433mw7ftdlmxakziomv64",
    "uri": "at://did:plc:dxjzgxe7cvirxkwfjr2tjspt/app.bsky.feed.post/3mhe7e2tsab22"
  },
  "path": "/t/an-attempt-at-vulkan/49433?page=2#post_21",
  "publishedAt": "2026-03-17T17:58:27.000Z",
  "site": "https://hub.jmonkeyengine.org",
  "tags": [
    "https://docs.vulkan.org/guide/latest/push_constan",
    "(https://docs.vulkan.org/guide/latest/storage_image_and_texel_buffers.html)"
  ],
  "textContent": "zzuegg:\n\n> 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.\n>\n> 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.\n>\n> https://docs.vulkan.org/guide/latest/push_constan\n\n(https://docs.vulkan.org/guide/latest/storage_image_and_texel_buffers.html)\n\nThank 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.\n\n\n\nI can now display it correctly, though I still can’t directly use jMonkeyEngine’s built-in shaders.\n\n\n     private static final String MAT_DEF = \"Common/MatDefs/Aurora/Aurora.j3md\";\n\n\nCurrently, I’m using a custom shader.\nI apologize for not responding to everyone for a while—I’ve been focused on tracking down the issue.",
  "title": "An attempt at Vulkan"
}