Ebitengine 2.9 Release Notes
These release notes are a draft. v2.9.0 has not been released yet.
v2.9.0
This release mainly adds minor features, bug fixes, and performance improvements.
Starting from Ebitengine 2.9, Go 1.24 or later is required.
Improved Rendering Quality for Vector Graphics
Previously, the vector
package used functions such as AppendVerticesAndIndicesForFilling
and AppendVerticesAndIndicesForStroke
to decompose vector shapes into triangles, which were then rendered. This approach had the following issues:
- Edges did not look clean. Ebitengine adopted a method of rendering vector graphics onto a large offscreen buffer and then scaling it down, but both efficiency and quality were unsatisfactory.
- It was not possible to render semi-transparent colors.
- The
Blend
option did not behave as expected.
The new approach uses a special shader to create a custom stencil buffer, which is then used to fill with colors. This increases the number of samples per pixel while consuming the same or fewer textures, improving rendering quality. Additionally, instead of drawing multiple overlapping triangles, the finished stencil buffer is filled at once, allowing correct rendering of semi-transparent colors and proper handling of the Blend
option. The implementation was inspired by Evan Wallace’s blog post, “Easy Scalable Text Rendering on the GPU”.
The functions added for the new rendering method are mainly vector.FillPath()
and vector.StrokePath()
. To use the new rendering method, calls to the old AppendVerticesAndIndicesFor…
functions need to be replaced with the new ones. The rendering results of the existing AppendVerticesAndIndicesFor…
functions remain unchanged. These functions are now deprecated. The deprecated functions will continue to work as long as Ebitengine remains in the same major version, but they may be removed in future major versions.
Bug Fixes
In addition to the fixes listed below, this release also includes all bug fixes from version 2.8.
- Fixed a crash that could occur when moving a window between monitors (#3121).
- Fixed incorrect results with
ebiten.IsMouseButtonPressed
andinpututil.IsMouseButtonJustPressed
when using a touchpad (#3137, #3249). - Fixed
(*audio.Player).Position()
not returning the correct value when the window was in the background (#3154). - Fixed a crash in the Kage shading language when specifying a bool type for a uniform variable (#3165).
- Fixed a crash when providing a source that did not properly implement
io.Seeker
to a decoder (e.g., in theaudio/vorbis
package) (#3192, #3193). - Fixed
ebiten.SetWindowMousePassThrough
not working properly when called before startup (#3222). - Fixed occasional screen flickering on macOS (#3278).
- Fixed an issue where music could start playing automatically after waking from sleep (#3297).
- Other minor fixes
New APIs
ebiten.DefaultDrawFinalScreen
(#3139)ebiten.FilterPixelated
(#2826)ebiten.Tick()
(#3213)(*ebiten.Image).DrawTriangles32
(#3201)(*ebiten.Image).DrawTrianglesShader32
(#3201)ebiten.RunGameOptions.ApplePressAndHoldEnabled
(#3233)audio.ResampleReader
(#3194)audio.ResampleReaderF32
(#3194)colorm.DrawImageOptions.ColorScale
(#3188)vector.DrawPathOptions
(#3287)vector.FillOptions
(#3287)vector.FillCircle()
(#3150)vector.FillPath()
(#3153, #3278)vector.FillRect()
(#3150)vector.StrokePath()
(#3153, #3278)(*vector.Path).AddPath()
(#3153, #3266)(*vector.Path).AddStroke()
(#3153, #3266)(*vector.Path).Bounds()
(#3271)(*vector.Path).Reset()
(#3123)
Deprecated APIs
Up to 2.8 | Since 2.9 | Issue |
---|---|---|
ebiten.FillRule |
#3153 | |
ebiten.DrawTrianglesOptions.AntiAlias |
vector.FillPath() |
#3153 |
ebiten.DrawTrianglesOptions.FillRule |
vector.FillPath() |
#3153 |
ebiten.DrawTrianglesShaderOptions.AntiAlias |
vector.FillPath() |
#3153 |
ebiten.DrawTrianglesShaderOptions.FillRule |
vector.FillPath() |
#3153 |
audio.Resample() |
audio.ResampleReader() |
#3194 |
audio.ResampleF32() |
audio.ResampleReaderF32() |
#3194 |
colorm.DrawTrianglesOptions.AntiAlias |
#3153 | |
colorm.DrawTrianglesOptions.FillRule |
#3153 | |
text/v2.GoTextFace.Script |
text/v2.GoTextFace.Language |
#3175 |
vector.Path.AppendVerticesAndIndicesForFilling() |
vector.FillPath() |
#3153 |
vector.Path.AppendVerticesAndIndicesForStroke() |
vector.FillPath() and vector.Path.AddStroke() |
#3153 |
vector.DrawFilledCircle() |
vector.FillCircle() |
#3150 |
vector.DrawFilledRect() |
vector.FillRect() |
#3150 |