Releases: littlektframework/littlekt
v0.10.1
Some minor fixes:
Release Info
Fixes
- Fix miscalculation for scene-graph
Cotnrol.anchor()
forTOP_*
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!
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
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.littlekt
tocom.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. UseCanvasLayerContainer
andCanvasLayer
for FBO related
purposes. - Remove
FrameBuffer
class. WebGPUsRenderPass
is essentially a Framebuffer / Render target. - Remove
GlslGenerator
and all related classes. UseWGSL
for your shader needs, either by loading them from a file
or directly in a string. - Remove
vSync
andbackgroundColor
configuration options. - Remove
Game<T>
andScene<T>
classes as they aren't in scope of the framework. - Rename
Disposable
to beReleasable
as well asdispose()
torelease()
. - Remove
FitViewport
andFillViewport
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
toactualWidth/Height
andtrimmedWidth/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
to1.9.0-RC
- Update
Kotlin.atomicfu
to0.24.0
- Update
Kotlinx.serialization
to1.7.0
- Update
Kotlinx.html
to0.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
- @ValleyDragon888 made their first contribution in #242
Full Changelog: v0.9.0...v0.10.0
v0.9.0
Release Info
Breaking
ShaderProgram.getAttrib()
can now return a-1
instead of throwing anIllegalStateException
if the attribute name doesn't exist.ShaderProgram.getUniformLocation
can now return anull
instead of theUniformLocation
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 supportgl_FragData[]
. - Update
GL
with newdrawBuffer
andclearBuffer[fuiv]
functions. - Update
GL
with newgetActiveAttrib
andgetActiveUniform
related functions. - Optimize
WebGL
to prevent creating a new array on certainGL
calls. - Update
ShaderProgram
to handle finding and setting active uniforms and attributes instead relying on
theShaderParameter
to do so. - Update
AGP
to8.2.0
. - Update Kotlin to
1.9.23
. - Update
kotlinx-coroutines
to1.8.0
. - Update Dokka gradle plugin to
1.9.20
.
Commit Details
- Update
InputQueueProcessor
to clear events pool even if noInputProcessor
exists by @LeHaine in #225 - Update
ShaderProgram
to handle fetching all active uniforms and attribs and remove thecreate(ShaderProgram)
function fromShaderParameter
by @LeHaine in #226 - Update
FrameBuffer
to handle multiple color attachments by @LeHaine in #227 - Add ability to reuse
GlFrameBuffer
and optimizeFrameBuffer
to not create aGlFrameBuffer
object perbegin()
&end()
call by @LeHaine in #228 - Rename
FrameBuffer.ColorAttachment
toTextureAttachment
and add depth & stencil support by @LeHaine in #229 - Remove
FrameBuffer
nestability due to poor performance. by @LeHaine in #230 - Remove
ShaderProgram
getAttrib()
andgetUniform()
from throwing anIllegalStateException
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
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
to1.8.0-RC2
. - Update
Kotlinx.atomicfu
to0.23.1
. - Update
Kotlinx.serialization
to1.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
A small release.
Breaking
- Removed all experimental GLTF and 3D rendering graphics.
Changes
- Update Kotlin to
1.9.10
. - Update
Kotlinx.coroutines
to1.7.3
. - Update
Kotlinx.atomicfu
to0.22.0
. - Update
Kotlinx.serialization
to1.6.0
. - Update
LWJGL
to3.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
Changes
- Update Kotlin to
1.8.20
. - Update
FrameBuffer
class is nowopen
. - Add new
forEachTileInView
toLdtkLayer
to iterate over tiles current in the view bounds without rendering. - Breaking: Move
BlendMode
andDepthStencilMode
out of thegraph
package and into thegraphics.utils
. - Add new
setBlendFunction(blendMode)
toBatch
. - Breaking: update
createShader
to return the type of vertex and fragment shaders instead of the super class. - Add
FrameBuffer.use
extension similar toBatch.use
. - Breaking:
Shader.parameters
are now to be used with aLinkedHashSet
instead of aMutableList()
.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
, andGlslGenerator.texture
now returns a constructor delegate instead of a literal.val color = texture2D(...) -> val color by texture2D(...)
Fixes
- Fix
TextureArraySpriteBatch.draw(spriteVertices)
to manually increaseMesh.geometry.numVertices
to prevent data
from being overwritten withgeometry.addVertex
. - Fix
TextureArraySpriteBatch
to use the correctVertexAttribute
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 materialBlendMode
. - 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 usingGLInt
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 fordown()
,pressed()
, andreleased()
functions
v0.6.3
v0.6.2
This contains only a single change that was preventing a SceneGraph
from being rendered on WebGL.
- Update
GLSLGenerator
uniform delegates to only add to theShader.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 theparamters
list.
When creating aShaderProgram
with WebGL, it would throw shader compilation error due to not finding in the glsl
source. This was preventing aSceneGraph
from being rendered on the Web due to the default 3D model shader.
v0.6.1
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
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
, andCamera3D
.
- Extremely basic lighting (this will improve in the future).
- Skeletal animation.
- glTF loading and basic material rendering:
resourceVfs["myModel.glb"].readGltfModel()
. - New
PerspectiveCamera
class.
- Adds a few new nodes to the
- New
MeshGeometry
class. Replaces the oldMeshBatcher
but doesn't require to make a newMesh
instance to create
the vertices. An instance can be passed into aMesh
for it to use. - New
MeshBuilder
class that uses the newMeshGeometry
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 anattribute
orvarying
for conditional shaders.
Vec4
updates to handleQuaternion
related math
Breaking
-
Update
BaseButton.buttonGroup
to be private and added a newsetButtonGroup(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 separateMeshGeometry
. - If you are using a
Mesh
instance that was using the batcher and making use ofMesh.addVertex
do the following:- Previously:
mesh.addVertex { ... }
. New:mesh.geometry.addVertex { ... }
- Previously:
- Removed
useBatcher
in favor of usingMeshGeometry
to create aMesh
without binding it.
- Removed
-
SceneGraph.showDebugInfo
is no longer able to be changed. To request debug rendering use the
newSceneGraph.requestShowDebugInfo
. The reason for this change was theshowDebugInfo
was taking effect
immediately and throwing exceptions due to the internalBatch
not being ready to render withShapeRenderer
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 handleNode.updateInterval
values less than1
. Anything less than1
will now not update
itself or its children. - Add
useOriginalSize
option toTextureRect
node to allow positioning theTextureSlice
based off the original size
before packing and trimming. - Fix
SceneGraph
touch focuses not being cleared after aTOUCH_UP
event being fired resulting in thousands of
elements in the list. - Fix
SceneGraph
to fire the correctMOUSE_EXIT
input event with pointers last over an input control. - Update
Control.hasPoint
to handle rotated control nodes - Fix
CanvasItem.toLocal
andCanvasItem.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 of360
degrees to satisfy the condition. - Fix
TOUCH_UP
event not being sent toinput
&unhandledInput
functions when not clicking on aControl
node. - Fix multiple calls to
debugRender
in theSceneGraph
when using any nestedCanvasLayer
. - Fix
FrameBufferNode
not propagating debug render calls to its children. - Add new
InputEvent.canvasX
andInputEvent.canvasY
to get coordinates of the event in theCanvasItem.canvas
coordinates. This is useful when nestingCanvas
nodes. - Update existing
Control
nodes that useuiInput
to check against newInputEvent.canvasX
andInputEvent.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 ofArrayList
data structure.
Libraries
- Update
kotlin
to1.8.10
. - Update
kotlinx.serialization
to1.5.0-RC
. - Update
kotlinx.atomicfu
to0.19.0
.