Skip to content

Releases: littlektframework/littlekt

v0.10.1

21 Jul 15:40
2f3916b
Compare
Choose a tag to compare

Some minor fixes:

Release Info

Fixes

  • Fix miscalculation for scene-graph Cotnrol.anchor() for TOP_* related layouts.
  • Fix AssetProvider to asset preparation logic not preparing additional assets after the initial preparation.

Commit Details

What's Changed

  • graph: fix miscalculation for Control anchor TOP_* related anchors by @LeHaine in #265
  • core: update AssetProvider to allow for prepared to be invoked multiple times by @LeHaine in #266

Full Changelog: v0.10.0...v0.10.1

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

16 Jul 14:36
190991c
Compare
Choose a tag to compare

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

v0.9.0

23 Mar 23:47
b66d97b
Compare
Choose a tag to compare

Release Info

Breaking

  • ShaderProgram.getAttrib() can now return a -1 instead of throwing an IllegalStateException if the attribute name doesn't exist.
  • ShaderProgram.getUniformLocation can now return a null instead of the UniformLocation if the uniform name doesn't exist.
  • Update JVM target to 17 from 11.

Changes

  • Add WASM as an official platform target.
  • Update FrameBuffer to allow for multiple texture attachments to be used.
  • Remove nest-ability from FrameBuffer due to poor performance with multiple calls to get currently bound frame buffer.
    • FrameBuffer.end() will now bind to the default frame buffer instead with optional viewport position and size parameters.
  • Update GLSlGenerator to support gl_FragData[].
  • Update GL with new drawBuffer and clearBuffer[fuiv] functions.
  • Update GL with new getActiveAttrib and getActiveUniform related functions.
  • Optimize WebGL to prevent creating a new array on certain GL calls.
  • Update ShaderProgram to handle finding and setting active uniforms and attributes instead relying on
    the ShaderParameter to do so.
  • Update AGP to 8.2.0.
  • Update Kotlin to 1.9.23.
  • Update kotlinx-coroutines to 1.8.0.
  • Update Dokka gradle plugin to 1.9.20.

Commit Details

  • Update InputQueueProcessor to clear events pool even if no InputProcessor exists by @LeHaine in #225
  • Update ShaderProgram to handle fetching all active uniforms and attribs and remove the create(ShaderProgram) function from ShaderParameter by @LeHaine in #226
  • Update FrameBuffer to handle multiple color attachments by @LeHaine in #227
  • Add ability to reuse GlFrameBuffer and optimize FrameBuffer to not create a GlFrameBuffer object per begin() & end() call by @LeHaine in #228
  • Rename FrameBuffer.ColorAttachment to TextureAttachment and add depth & stencil support by @LeHaine in #229
  • Remove FrameBuffer nestability due to poor performance. by @LeHaine in #230
  • Remove ShaderProgram getAttrib() and getUniform() from throwing an IllegalStateException by @LeHaine in #231
  • sprite batch: update default size to 1000 instead of 8191 by @LeHaine in #232
  • gradle: update to kotlin 1.9.23 and dokka to 1.9.20 by @LeHaine in #234
  • Add WASM Platform by @LeHaine in #216

Full Changelog: v0.8.1...v0.9.0

v0.8.1 - Better Late Than Never

22 Jan 15:44
b419195
Compare
Choose a tag to compare

Changes

  • Remove remaining 3D spatial graphic classes that were accidentally left over from 0.8.0.
  • Update LDtk to handle changes up to LDtk 1.5.3.
  • Update Kotlin to 1.9.21.
  • Update Kotlinx.coroutines to 1.8.0-RC2.
  • Update Kotlinx.atomicfu to 0.23.1.
  • Update Kotlinx.serialization to 1.6.2.
  • Update Dokka gradle plugin to 1.9.10.

Fixes

  • Fix NoSuchElementException being thrown when testing touch input in browsers simulated device-mode.

v0.8.0

27 Oct 12:02
7ea971a
Compare
Choose a tag to compare

A small release.

Breaking

  • Removed all experimental GLTF and 3D rendering graphics.

Changes

  • Update Kotlin to 1.9.10.
  • Update Kotlinx.coroutines to 1.7.3.
  • Update Kotlinx.atomicfu to 0.22.0.
  • Update Kotlinx.serialization to 1.6.0.
  • Update LWJGL to 3.3.3.
  • Update Android Gradle plugin to 7.3.1.
  • Update Gradle version plugin to 0.48.0.
  • Update Dokka gradle plugin to 1.9.0.

v0.7.0

22 Apr 13:17
763dfe3
Compare
Choose a tag to compare

Changes

  • Update Kotlin to 1.8.20.
  • Update FrameBuffer class is now open.
  • Add new forEachTileInView to LdtkLayer to iterate over tiles current in the view bounds without rendering.
  • Breaking: Move BlendMode and DepthStencilMode out of the graph package and into the graphics.utils.
  • Add new setBlendFunction(blendMode) to Batch.
  • Breaking: update createShader to return the type of vertex and fragment shaders instead of the super class.
  • Add FrameBuffer.use extension similar to Batch.use.
  • Breaking: Shader.parameters are now to be used with a LinkedHashSet instead of a MutableList(). mutableListOf(param1, param2) -> linkedSetOf(param1, param2).
  • Breaking: Update Shader.parameters to grab parameters by variable name instead of index. parameters[0] -> parameters["u_texture"]
  • Breaking: GlslGenerator.texture2D, GlslGenerator.shadow2D, and GlslGenerator.texture now returns a constructor delegate instead of a literal. val color = texture2D(...) -> val color by texture2D(...)

Fixes

  • Fix TextureArraySpriteBatch.draw(spriteVertices) to manually increase Mesh.geometry.numVertices to prevent data
    from being overwritten with geometry.addVertex.
  • Fix TextureArraySpriteBatch to use the correct VertexAttribute for 2D positions.
  • Fix TextureArraySpriteBatch.maxVertices calculation.
  • Fix LDtkLayer rendering to calculate the correct maximum cells in both x & y axes.
  • Fix SceneGraph to set the correct blend equation off a material BlendMode.
  • Fix GlslGenerator not removing unused definitions from functions.
  • Fix Tiled row & column calculations & iso transform to use correct view bound points.
  • Fix GlslGenerator.For not using GLInt value directly
  • Fix GlslGenerator.atan to use correct parameters (was only allowing one parameter to be passed in)
  • Fix InputMapController.addBinding to check for key modifiers for down(), pressed(), and released() functions

v0.6.3

08 Feb 18:39
01ad6d1
Compare
Choose a tag to compare
  • Fix an issue with Button not calculating label sizing when added after scene creation.

v0.6.2

08 Feb 15:35
96106dc
Compare
Choose a tag to compare

This contains only a single change that was preventing a SceneGraph from being rendered on WebGL.

  • Update GLSLGenerator uniform delegates to only add to the Shader.paremeters only when has its value used in the
    source. Due to some static conditions some uniforms may not be used while still being defined in the paramters list.
    When creating a ShaderProgram with WebGL, it would throw shader compilation error due to not finding in the glsl
    source. This was preventing a SceneGraph from being rendered on the Web due to the default 3D model shader.

v0.6.1

08 Feb 13:21
e8992c9
Compare
Choose a tag to compare

v0.6.1

This contains fixes for JVM Mac support. Major thanks to @jsm174 for helping out with all the Mac support.

Fixes

  • Add new HdpiMode for JVM platforms. Setting to HdpiMode.PIXELS will allow correct display on Macs with retina displays.
  • Update GlVersion to handle comparisons of versions correctly. This fixes issues in the GlslGenerator.
  • Update LjwglGL to only use the extension framebuffer and renderbuffer calls if the OpenGL version is < 3.
  • Fix shader compilation errors on Macs.

v0.6.0

07 Feb 00:34
7110621
Compare
Choose a tag to compare

v0.6.0

This version is full of breaking changes, mainly to mesh creation and handling, to make way for adding some basic 3d
related graphics and handling.

Highlights

  • Basic 3D support This is experimental and not really meant to be used in a real game yet:
    • Adds a few new nodes to the SceneGraph to handle rendering 3D meshes and models:
      • Node3D, VisualInstance, Model, and Camera3D.
    • Extremely basic lighting (this will improve in the future).
    • Skeletal animation.
    • glTF loading and basic material rendering: resourceVfs["myModel.glb"].readGltfModel().
    • New PerspectiveCamera class.
  • New MeshGeometry class. Replaces the old MeshBatcher but doesn't require to make a new Mesh instance to create
    the vertices. An instance can be passed into a Mesh for it to use.
  • New MeshBuilder class that uses the new MeshGeometry class to help facilitate generating meshes and vertices.
  • Various GLSL generator improvements and optimizations
    • Declare and set value of variable in line.
    • 3.3 layout locations support.
    • Add new predicate option when declaring an attribute or varying for conditional shaders.
  • Vec4 updates to handle Quaternion related math

Breaking

  • Update BaseButton.buttonGroup to be private and added a new setButtonGroup(group) function to handle setting
    button groups.

    Migration:

    Previous:

    val myButtonGroup = ButtonGroup()
    button {
        buttonGroup = myButtonGroup
        buttonGroup.buttons += this
    }

    New:

    val myButtonGroup = ButtonGroup()
    button {
        setButtonGroup(myButtonGroup)
    }
  • Move all 2D graphic related items to new subpackage call g2d. To migrate: append .g2d to all imports using any 2D
    related class.

  • Mesh changes:

    • Removed MeshBatcher and replaced with separate MeshGeometry.
    • If you are using a Mesh instance that was using the batcher and making use of Mesh.addVertex do the following:
      • Previously: mesh.addVertex { ... }. New: mesh.geometry.addVertex { ... }
    • Removed useBatcher in favor of using MeshGeometry to create a Mesh without binding it.
  • SceneGraph.showDebugInfo is no longer able to be changed. To request debug rendering use the
    new SceneGraph.requestShowDebugInfo. The reason for this change was the showDebugInfo was taking effect
    immediately and throwing exceptions due to the internal Batch not being ready to render with ShapeRenderer and
    such. The request will take into effect after the current frame finishes rendering. SceneGraph.showDebugInfo will
    contain the true value of debug rendering.

Changes

  • Fix BaseButton pressed & disabled properties incorrectly comparing new value with a wrong value affecting toggle
    buttons.
  • Update NodeList to handle Node.updateInterval values less than 1. Anything less than 1 will now not update
    itself or its children.
  • Add useOriginalSize option to TextureRect node to allow positioning the TextureSlice based off the original size
    before packing and trimming.
  • Fix SceneGraph touch focuses not being cleared after a TOUCH_UP event being fired resulting in thousands of
    elements in the list.
  • Fix SceneGraph to fire the correct MOUSE_EXIT input event with pointers last over an input control.
  • Update Control.hasPoint to handle rotated control nodes
  • Fix CanvasItem.toLocal and CanvasItem.toGlobal to use its respective matrices for calculation of the coordinates.
  • Fix Control.hit not handling rotated nodes in its calculation
  • Update all checks of rotation == Angle.ZERO to use a normalized angle and fuzzy zero checking. This results in
    angles of 360 degrees to satisfy the condition.
  • Fix TOUCH_UP event not being sent to input & unhandledInput functions when not clicking on a Control node.
  • Fix multiple calls to debugRender in the SceneGraph when using any nested CanvasLayer.
  • Fix FrameBufferNode not propagating debug render calls to its children.
  • Add new InputEvent.canvasX and InputEvent.canvasY to get coordinates of the event in the CanvasItem.canvas
    coordinates. This is useful when nesting Canvas nodes.
  • Update existing Control nodes that use uiInput to check against new InputEvent.canvasX and InputEvent.canvasY
    coordinates.
  • Fix GlyphLayout not calculating glyph advances properly resulting in incorrect wrapping calculations
  • Fix when a Control node should calculate its minimum size. This fixes issues with labels not using the correct
    layout height.
  • Add getOrNull(Int) to all variants of ArrayList data structure.

Libraries

  • Update kotlin to 1.8.10.
  • Update kotlinx.serialization to 1.5.0-RC.
  • Update kotlinx.atomicfu to 0.19.0.