Skip to content

v0.10.0 - OpenGL is Dead! Long Live WebGPU!

Compare
Choose a tag to compare
@LeHaine LeHaine released this 16 Jul 14:36
· 21 commits to master since this release
190991c

This is a huge release as it is nearly an entire rewrite of the framework from OpenGL to WebGPU. The reason for the rewrite was wanting to keep the framework modern by using modern graphic APIs. WebGPU fits that bill. The OpenGL version of the framework is archived in the opengl branch. This branch will no longer receive updates.

There is bad news as we lost a couple platform targets, Android and WASM. Android is still planned to be supported but the work needed to get a JNI bridge up to work with WGPU is pretty huge and I wanted to focus on getting desktop and browser via JS working.

There is good news for those who are apprehensive to moving on from OpenGL to WebGPU. The LittleKt API is mostly the same. We can still use our sprite batching, manipulate cameras, play with textures, and all that fun stuff. There is just a bit more extra work to setup the rendering process, which isn't much at all. There is an examples modules with loads of samples to test out and to reference. Some use the LittleKt APIs and others use just the low-level WebGPU APIs.

This release brings dozens upon dozens of fixes and minor optimizations that were found during the rewrite. I am pretty happy with where this is all at now and hope you all do too.

Release Info

Breaking

  • Replace all of OpenGL with WebGPU. The overall API is mostly the same, save for the specifics of having to use
    WebGPU. These changes are too large to fit in a changelog but can be checked out on the documentation and migrated.
    • Much of the API under graphics.* has changed but stayed relatively the same. E.g. SpriteBatch contains the
      same begin() -> draw() -> end() flow but requires WebGPU specific classes.
    • graphics.gl.* classes replaced with graphics.webgpu.*
  • Remove the Android target until a generator can be created for the WGPU natives for JNI (Future update).
  • The module group id, for defining in dependencies, has been changed from com.lehaine.littlekt to com.littlekt.
  • The scene-graph module has been extracted into its own package and will explicitly be defined in your
    dependencies: com.littlekt:scene-graph
  • Remove FrameBufferNode and related UI classes. Use CanvasLayerContainer and CanvasLayer for FBO related
    purposes.
  • Remove FrameBuffer class. WebGPUs RenderPass is essentially a Framebuffer / Render target.
  • Remove GlslGenerator and all related classes. Use WGSL for your shader needs, either by loading them from a file
    or directly in a string.
  • Remove vSync and backgroundColor configuration options.
  • Remove Game<T> and Scene<T> classes as they aren't in scope of the framework.
  • Rename Disposable to be Releasable as well as dispose() to release().
  • Remove FitViewport and FillViewport as they don't work with the current viewport limitations WebGPU imposes.
    WebGPU doesn't allow out-of-bounds viewports which causes a fatal error. There is no workaround without getting clever
    with shaders.
  • Update TextureSlice.originalWidth/Height & TextureSlice.packedWidth/Height to actualWidth/Height
    and trimmedWidth/Height, respecitively.

Changes

  • Add new wgpu-ffm module.
  • Add new wgpu-natives module.
  • Add new SpriteCache renderer.
  • Update Kotlin to 2.0.0
  • Update Kotlin.coroutines to 1.9.0-RC
  • Update Kotlin.atomicfu to 0.24.0
  • Update Kotlinx.serialization to 1.7.0
  • Update Kotlinx.html to 0.11.0
  • Add documentation to most of the framework.
  • Dozens of other minor misc. changes all across the framework.

Commit Details

What's Changed

  • graphics: update SpriteBatch and TextureArraySpriteBatch projection matrix to assume y-down by @LeHaine in #236
  • Make tiles public by @ValleyDragon888 in #242
  • Replace OpenGL with WebGPU by @LeHaine in #244
  • jvm: remove backgroundColor from JvmConfiguration by @LeHaine in #245
  • js: remove backgroundColor from JsConfiguration by @LeHaine in #246
  • core: update LwjglGraphics to support Linux X11 and Wayland backends by @LeHaine in #247
  • scene graph: fix setScissorRect miscalculation that resulted in an error by @LeHaine in #248
  • Add Features and Limits to Adapter and Device by @LeHaine in #249
  • Update gradle and build scripts to handle publishing new modules by @LeHaine in #250
  • core: update AssetProvider to handle preparing files again by @LeHaine in #251
  • scene-graph: update SceneGraph to only set sceneCanvas Node spriteShader to the Batch.defaultShader, if it owns the batch, otherwise it will create a new Shader by @LeHaine in #252
  • scene graph: rework how the root scene CanvasLayer is rendered into its own managed FBO via the SceneGraph and own batch by @LeHaine in #253
  • scene-graph: rework rendering & canvas coordinates calculations for CanvasLayer nodes by @LeHaine in #254
  • core: update Texture related classes to call WebGPUTexture.release() rather than destroy() to handle when the underyling buffers are destroyed by @LeHaine in #255
  • core: remove ContextExt and internal ownedContext as it's no longer needed by @LeHaine in #256
  • core: add dynamic uniform camera handling to SpriteShader, SpriteBatchShader, and SpriteBatch by @LeHaine in #257
  • update SpriteBatch to handle dynamic camera uniform offsets per shader and fix matrix tracking issue by @LeHaine in #258
  • ldtk: update calculation & parsing of ldtk y-coordiante to be flipped and to render via translating the map height or the level height by @LeHaine in #259
  • tiled: implement SpriteCaching for staggered & isometric maps by @LeHaine in #260
  • core: update SpriteBatch to ignore slice.offsetY by @LeHaine in #261
  • core: update TextureAtlas to flip the offsetY coord, when parsing, to be relative to the bottom of the image rather than the top by @LeHaine in #262
  • graph: update SceneGraph to set Node material shader & blend state by @LeHaine in #263

New Contributors

Full Changelog: v0.9.0...v0.10.0