v0.10.0 - OpenGL is Dead! Long Live WebGPU!
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.SpriteBatchcontains the samebegin() -> draw() -> end()flow but requires WebGPU specific classes. graphics.gl.*classes replaced withgraphics.webgpu.*
- Much of the API under
- 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.littlekttocom.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
FrameBufferNodeand related UI classes. UseCanvasLayerContainerandCanvasLayerfor FBO related purposes. - Remove
FrameBufferclass. WebGPUsRenderPassis essentially a Framebuffer / Render target. - Remove
GlslGeneratorand all related classes. UseWGSLfor your shader needs, either by loading them from a file or directly in a string. - Remove
vSyncandbackgroundColorconfiguration options. - Remove
Game<T>andScene<T>classes as they aren't in scope of the framework. - Rename
Disposableto beReleasableas well asdispose()torelease(). - Remove
FitViewportandFillViewportas 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/HeighttoactualWidth/HeightandtrimmedWidth/Height, respecitively.
Changes
- Add new
wgpu-ffmmodule. - Add new
wgpu-nativesmodule. - Add new
SpriteCacherenderer. - Update Kotlin to
2.0.0 - Update
Kotlin.coroutinesto1.9.0-RC - Update
Kotlin.atomicfuto0.24.0 - Update
Kotlinx.serializationto1.7.0 - Update
Kotlinx.htmlto0.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 https://github.com/littlektframework/littlekt/pull/236
- Make tiles public by @ValleyDragon888 in https://github.com/littlektframework/littlekt/pull/242
- Replace OpenGL with WebGPU by @LeHaine in https://github.com/littlektframework/littlekt/pull/244
- jvm: remove backgroundColor from JvmConfiguration by @LeHaine in https://github.com/littlektframework/littlekt/pull/245
- js: remove backgroundColor from JsConfiguration by @LeHaine in https://github.com/littlektframework/littlekt/pull/246
- core: update LwjglGraphics to support Linux X11 and Wayland backends by @LeHaine in https://github.com/littlektframework/littlekt/pull/247
- scene graph: fix setScissorRect miscalculation that resulted in an error by @LeHaine in https://github.com/littlektframework/littlekt/pull/248
- Add Features and Limits to Adapter and Device by @LeHaine in https://github.com/littlektframework/littlekt/pull/249
- Update gradle and build scripts to handle publishing new modules by @LeHaine in https://github.com/littlektframework/littlekt/pull/250
- core: update AssetProvider to handle preparing files again by @LeHaine in https://github.com/littlektframework/littlekt/pull/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 https://github.com/littlektframework/littlekt/pull/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 https://github.com/littlektframework/littlekt/pull/253
- scene-graph: rework rendering & canvas coordinates calculations for CanvasLayer nodes by @LeHaine in https://github.com/littlektframework/littlekt/pull/254
- core: update Texture related classes to call WebGPUTexture.release() rather than destroy() to handle when the underyling buffers are destroyed by @LeHaine in https://github.com/littlektframework/littlekt/pull/255
- core: remove ContextExt and internal ownedContext as it's no longer needed by @LeHaine in https://github.com/littlektframework/littlekt/pull/256
- core: add dynamic uniform camera handling to SpriteShader, SpriteBatchShader, and SpriteBatch by @LeHaine in https://github.com/littlektframework/littlekt/pull/257
- update SpriteBatch to handle dynamic camera uniform offsets per shader and fix matrix tracking issue by @LeHaine in https://github.com/littlektframework/littlekt/pull/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 https://github.com/littlektframework/littlekt/pull/259
- tiled: implement SpriteCaching for staggered & isometric maps by @LeHaine in https://github.com/littlektframework/littlekt/pull/260
- core: update SpriteBatch to ignore slice.offsetY by @LeHaine in https://github.com/littlektframework/littlekt/pull/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 https://github.com/littlektframework/littlekt/pull/262
- graph: update SceneGraph to set Node material shader & blend state by @LeHaine in https://github.com/littlektframework/littlekt/pull/263
New Contributors
- @ValleyDragon888 made their first contribution in https://github.com/littlektframework/littlekt/pull/242
Full Changelog: https://github.com/littlektframework/littlekt/compare/v0.9.0...v0.10.0