Janet rendering playground with Vulkan
Stub out anim.c
More work on sampling 3d textures for global illumination.
Basic support for 3d textures.


browse  log 



You can also use your local clone with git send-email.

#JVK - Vulkan Renderer

A simple Vulkan Renderer. This is a self learning project, don't use it for anything. It reimplements many things like Vulkan memory allocation and window creation that can be more robustly handled by existing libraries. Also the Janet (scripting language) binding is neat but entirely unnecessary - the demos could be written in C against the public facing header jvk.h. Also we don't use C++ so as to be as close as possible to the Vulkan API (it is more convenient to create struct literals in C99 than C++, although since starting this, the vulkan headers now have a standardized C++ wrapper that is equally convenient from C++). And I like (tolerate) C, sue me.



  • GLTF model loading.
  • Metallic Roughness shading
  • Spot lighting
  • Spherical harmonics global illumination (single light probe for now, very very basic).
  • Simple shadow-mapping with PCF.
  • Dynamic texture, mesh, light and instance loading and unloading.
  • Skybox for simple reflection mapping
  • Debug view modes
  • No runtime dependencies besides Vulkan, C runtime, and OS libraries (and xcb on linux).
  • Text rendering and very basic HUD.
  • Terrible Perlin noise "terrain" generation (really just for tests).

#Implementation Characteristics

  • Bindless shader design - uses (mostly) one large descriptor set.
  • Simple but efficient bitmap-based Vulkan memory allocator in alloc.c
  • Abstracted Graphics and Compute pipelines and pipeline creation utilities
  • Shaders compiled offline to SPIR-V - ro runtime shader compiler. Shader variants are implemented with specialization constants.
  • Shadow mapping done in realtime (despite limited movement in demos).
  • Support for vertex skinning
  • Partial GLTF support - normal mapping, ambient occlusion, metallic roughness, albedo.
  • Simple mesh batching


  • Flesh out a global illumination solution
  • Animation of skinned meshes
  • Improve shadow mapping
  • Better GLTF material support.
  • Post Processing
  • Raytracing and Mesh pipelines (RT ambient occlusion? RT reflections? Option for fully raytraced scene?)
  • LOD support
  • Do something interesting with compute shaders (particles, hair, etc.)
  • Volumetric lighting
  • Better font rendering (using Bezier curves rather than bitmaps).
  • GUI improvements - simple interactive components (buttons and stuff) for demos rather than HUD.

#Editing Shaders

  • Download and install shaderc
  • Remove spirv directory
  • Use jpm build to rebuild shaders.


  • Linux with X11 or Windows
  • Vulkan 1.2 or greater
  • MSVC on Windows or GCC/Clang on Linux
  • Google's Shaderc if you want to recompile/edit shaders
  • Janet lang and jpm to build.


$ jpm build

To build the Janet module (this a DLL that the Janet runtime can load).

  • To run some of the demos, use
$ jpm run [demoname]

For example,

jpm run spheres