{
  "$type": "site.standard.document",
  "bskyPostRef": {
    "cid": "bafyreig7rr672tldde7tln5qei7lojd26qb3ztermuf2x3lhg2u2svujb4",
    "uri": "at://did:plc:dxjzgxe7cvirxkwfjr2tjspt/app.bsky.feed.post/3migmmluvjbb2"
  },
  "path": "/t/an-attempt-at-vulkan/49433?page=3#post_46",
  "publishedAt": "2026-04-01T10:17:32.000Z",
  "site": "https://hub.jmonkeyengine.org",
  "tags": [
    "icyboxs/jmonkeyengine-vulkan",
    "@Override"
  ],
  "textContent": "icyboxs/jmonkeyengine-vulkan\n\n\n    package com.example.JmeTest;\n\n    import com.jme3.app.FlyCamAppState;\n    import com.jme3.app.SimpleApplication;\n    import com.jme3.app.StatsAppState;\n    import com.jme3.asset.TextureKey;\n    import com.jme3.audio.AudioListenerState;\n    import com.jme3.material.Material;\n    import com.jme3.math.ColorRGBA;\n    import com.jme3.math.FastMath;\n    import com.jme3.renderer.vulkan.context.LwjglVulkanContext;\n    import com.jme3.scene.Geometry;\n    import com.jme3.scene.shape.Box;\n    import com.jme3.shader.BufferObject;\n    import com.jme3.system.AppSettings;\n    import com.jme3.texture.Image;\n    import com.jme3.texture.Image.Format;\n    import com.jme3.texture.Texture;\n    import com.jme3.texture.Texture2D;\n    import com.jme3.texture.image.ColorSpace;\n    import com.jme3.util.BufferUtils;\n    import java.awt.image.BufferedImage;\n    import java.io.File;\n    import java.nio.ByteBuffer;\n    import javax.imageio.ImageIO;\n\n    public class HelloVulkan extends SimpleApplication {\n\n        public static void main(String[] args) {\n            HelloVulkan app = new HelloVulkan();\n\n            AppSettings settings = new AppSettings(true);\n            settings.setTitle(\"JME Vulkan\");\n            settings.setWidth(1280);\n            settings.setHeight(720);\n            settings.setRenderer(AppSettings.LWJGL_VULKAN);\n            settings.setVSync(true);\n            settings.setCustomRenderer(LwjglVulkanContext.class);\n            app.setShowSettings(false);\n            app.setSettings(settings);\n            app.start();\n        }\n\n        public HelloVulkan() {\n            //new StatsAppState(),\n            super(new AudioListenerState(), new FlyCamAppState());\n        }\n\n        @Override\n        public void simpleInitApp() {\n            Box box = new Box(2f, 2f, 2f);\n            Geometry geom = new Geometry(\"MultiSetBox\", box);\n\n            Material mat = new Material(assetManager, \"Common/MatDefs/Misc/VKUnshaded.j3md\");\n\n            geom.setMaterial(mat);\n\n\n\n            Texture tex = assetManager.loadTexture(\"sky.png\");\n\n\n            mat.setTexture(\"ColorMap\", tex);\n            rootNode.attachChild(geom);\n            viewPort.setBackgroundColor(ColorRGBA.Green);\n        }\n\n\n\n    }\n\n\n\nThis is my test class.\nCurrently, only VKUnshaded.j3md can be used.\nOf course, you can try to write the GLSL for Vulkan by yourself for a test.\nThis week seems to have very little time left.\n\nI might convert all my current OpenGL GLSL shaders to Vulkan GLSL this weekend, placing them in separately named files. For example, renaming Unshaded to VKUnshaded, so that the Vulkan shaders are listed separately to reduce mixing with OpenGL code. Initially, I wanted to write the Vulkan shaders into the current OpenGL shaders and use macros to differentiate them, but that seemed too messy. For now, let’s do it this way and gradually transition to find a way to make the shader code compatible with both.\n\nEverything runs smoothly on Windows 10. However, I cannot guarantee that it will work properly on other systems. Of course, if there are any issues, you can leave a message here.",
  "title": "An attempt at Vulkan"
}