nKast

pixel perf-ect

19. October 2025 08:16
by nKast
0 Comments

What's new in KNI v4.02

19. October 2025 08:16 by nKast | 0 Comments

  The new version of KNI 4.2.9001 brings advances in the graphics backends, bug fixes,  and implementation of missing features. A more detailed list of the changes is available on the changelog.


Download KNI v4.2 today.
See migrate to v4.2 on how to upgrade your current projects.


Android.GL

Android.GL has been upgraded to support 16K page-aligned OpenAL binaries to comply with Google's new requirement for Android 15+ devices starting November 1, 2025. This ensures full compatibility with upcoming hardware and Android OS versions.

The OpenAL build now includes OBOE integration for improved audio latency and performance. This modern audio path benefits both low-level streaming audio and high-fidelity sound playback.

Additionally, Android.GL now implements Mouse input, including support for SetCursor() with standard pointer shapes.

 

WinForms.DX11

This release updates the SharpDX backend to version 4.2.0 from 4.0.1.

DirectX keyboard input is now enabled by default when running without a GameWindow or Game instance, making it easier to integrate KNI rendering surfaces into WinForms or UWP-based editors.


SDL2.GL

  MediaPlayer playback has been improved. Looped songs now repeat seamlessly without silent gaps. This resolves one of the most frequently reported issues, which previously led developers to rely on external solutions.


Blazor.GL

 The Blazor.GL backend continues to mature, adding new rendering and audio capabilities.

It now implements DrawInstancedPrimitives(...) was implemented by @squarebananas, allowing efficient instanced rendering in WebGL.
Below you can see the Instanced-Model sample, running on the browser, with 40K Instances @60fps!

(Live Web Demo)

Two more changes by the same contributor, GameWindow.OnTextInput is implemented for text-based UI and editor support, and Mouse.SetCursor() is implemented for stock cursors.

WebAudio Pan support has been added, along with support for loading float32 (IEEE) audio in SoundEffect.

DynamicSoundEffectInstance is implemented for streaming real-time audio, and Microphone input is now supported for live audio capture.
See the Microphone-Echo sample for usage of both Microphone and DynamicSoundEffectInstance.

(Live Web Demo)

 

Pipeline Editor

  The Pipeline Editor introduces several workflow improvements.

A new modal window is shown while NuGet packages are being resolved, improving feedback during slow operations.

Newly added items in .mgcb files are now sorted by path, keeping the file structure clean and consistent.

The editor now only writes processor parameters that have been changed or explicitly defined, making the .mgcb file shorter and easier to read.

Media

 Songs are now transcoded to .WMA for Windows, and to .MP3 for all other platforms since it is a royalty-free format with broad hardware support.

  Video support has been enhanced with VideoImporter to handle transcoding from source formats. Videos are transcoded to .WMV for Windows and .WebM for all other platforms, providing modern, royalty-free formats with wide platform compatibility, high resolution, and efficient compression.

  

Shaders 

  The new KNIFX shader format has been introduced to support future features and fix structural limitations of the old format. Loading previous MGFX v10 shaders is still supported to provide an easy path to migration, while support for legacy MGFX v09 format has been dropped.

The effect processor will generate different .XNBs for OpenGL and GL-ES (Mobile/WebGL) platforms.

A shader that is not supported by the GraphicsProfile, will throw an exception with a better message, instead of an esoteric DirectX/GL error.

Setting Matrix parameter now preserves optimized the Matrix4x4 type as defined in the shader, and will not convert it to Matrix4x3.

Setting Matrix array parameters now respects optimized arrays without buffer overrides or exceptions.

Shader samplers no longer override textures when a Sampler is defined without a texture. This resolves an outstanding XNA compatibility issue that affected porting XNA samples.

GL-ES shaders now maintain full precision in fragment operations, making GLES platforms behave similarly to other platforms, without floating error artifacts.

The effect preprocessor has two new defines, __GL__ and __GLES____OPENGL__ from now on is defined only when targeting the SDL2.GL platform.
The following defines were removed from the effect preoprocessor: MGFX, DEBUGSM4HLSLGLSL, OPENGL. Here is the full list of defines in the KNI effect preprocessor: __KNIFX____DEBUG____DIRECTX____GL____OPENGL____GLES__.

 

Apos.Shapes and & FontStashSharp 

  Apos.Shapes is a rendering library that enables efficient 2D shape rendering using Signed Distance Fields (SDFs). It can render high-quality, resolution-independent graphics, making it ideal for UI elements, procedural graphics, and debugging visuals. The library offers a range of shapes, including lines, circles, rectangles, and more, with support for filled and bordered styles, and anti-aliasing. The library now supports KNI for integration into KNI-based projects. Get Apos.Shapes.KNI on NuGet.

  FontStashSharp is a flexible text‑rendering library designed to load fonts at runtime and render glyphs on demand. It supports dynamic glyph rendering without requiring predefined character ranges. The new FontStashSharp.KNI NuGet package brings KNI integration, allowing developers to easily add scalable and efficient text rendering to their projects.

   

Sponsors

We’re grateful to our contributors and sponsors for their continued support. By becoming a sponsor, you help ensure the growth and sustainability of the KNI framework. Together, we’re shaping the future of open-source game development.

Add comment