Releases: moderngl/moderngl
Releases · moderngl/moderngl
5.7.2
- Fixed a critical issue causing
Renderbuffer.release()
to crash due to missingInvalidObject
import. - Added a more sane error message when a scope is missing a framebuffer
Additional unit tests and code inspection were added to avoid similar issues in the future.
5.7.1
5.7.0
CHANGELOG
- Python 3.11 support
- Added support for configurable garbage collection mode.
Context.gc_mode
controls this.None
: (default) No garbage collection is performed. Objects needs to to be
manually released like in previous versions of moderngl."context_gc"
: Dead objects are collected inContext.objects
.
These can periodically be released usingContext.gc()
."auto"
: Dead objects are destroyed automatically like we would expect in python.
- Added support for
glPolygonOffset
. The factors and units can be set usingContext.polygon_offset
- Added support for normalized signed and unsigned integer textures.
ni1
,nu1
,ni2
andnu2
are the new dtypes for these. - Added
Context.external_texture
for creating textures from existing OpenGL textures. - Added
TextureCube.bind_to_image
so we can easily access cube textures in compute shaders - Added
Texture3D.bind_to_image
so we can easily access 3D textures in compute shaders - Added
TextureArray.bind_to_image
so we can easily access texture arrays in compute shaders - Added support for specifying a custom internalformat for cube maps. This can be used for sRGB and texture compression formats.
- Integer textures now use
NEAREST
interpolation by default. This was causing issues with some drivers. - Added support for writing to multiple buffers in transforms.
Context.program
now accepts a dictionary for mapping sampler names to specific texture units.- Added
Program.is_transform
exposing if the program has a fragment shader or not - Added
VertexArray.mode
and amode
argument inContext.vertex_array
. This is now the default rendering mode when no mode parameter is passed inrender()
ortransform()
- Added support for 1D sampler in
Uniform
- Added direct access to
glEnable
/glDisable
inContext.enable_direct
/Context.disable_direct
. This can be used to enabled capabilities not supported by ModernGL. Framebuffer.read()
now has aclamp
(bool) parameter. If enabled, floating point data will clamp to[0.0, 1.0]
. Clamping is disabled by default.- Fixed a bug causing
copy_framebuffer
to not work with multisampled framebuffers with multiple color attachments. - Fixed a bug in
copy_framebuffer
that caused the draw buffers to be permanently changed. - VertexArray: Removed "the first vertex attribute must not be a per instance attribute" limitation
- Fixed a crash when reading
ctx.provoking_vertex
- Added workaround for MacOS requiring a framebuffer to be bound in headless mode even for transform shaders. We simply create and bind a framebuffer internally.
- Added
GL_MAX_GEOMETRY_OUTPUT_VERTICES
toContext.info
- Docstring improvements
- Documentation improvements
5.6.4
- Transform feedback now supports all primitive modes both for vertex and geometry shaders
VertexArray.transform()
now raises sane errors when using the wrong primitive mode with geometry shadersVertexArray.transform()
now automatically detects output primitive based on the inputGL_TRIANGLES_ADJACENCY
enum incorrectly mapped (D0
instead of0D
)- Primitive modes are now accessible in the
Context
instance. For example:ctx.POINTS
andctx.TRIANGLES
- Texture filers are now also available in the
Context
instance. For example:ctx.NEAREST
andctx.LINEAR
- Docstring and documentation improvements
5.6.3
5.6.2
5.6.1
Improvements
- Added
Context.cull_face
. (glCullFace
). An alternative toContext.front_face
(glFrontFace
) - Added support for signed and unsigned integer sampler uniforms (
isampler*
,usampler*
) - Added support for multisampled texture array samplers
- Doc improvements
Bugs
- Transform feedback with geo shader should now property set the out primitive type.
It incorrectly assumedPOINTS
in some cases causing a gl error. - Moderngl will now propagate the default error messages from cpython when objects cannot
be read using the buffer protocol.
5.6.0
From ModernGL 5.6 context creation is done by the glcontext
package. This means we can keep improving context creation without releasing new
moderngl versions. The bar for contributing to context creation is also lower.
Backends can be written in C++ or by simply using ctypes.
This version also has a lot of improvements to docsstrings, api docs and documentation in general.
Still we have a lot more work to do in this area.
Added
- Standalone
Context
can now be destroyed on all platforms - Compute shaders can now write to textures using
Texture*.bind_to_image
VertexBuffer.transform
now as abuffer_offset
parameter
for setting the start byte offset of the output buffer.
This can be used in many creative ways in for example particle
emitting.Framebuffer
supports having only depth buffer. This makes things like shadow
mapping easier to work with.- Support for
PROGRAM_POINT_SIZE
context flag so point sizes can be set in
the vertex shader - Scissor test support.
Framebuffer.scissor
andContext.scissor
can now be used
to set and enable scissor testing per framebuffer. - The
Framebuffer.clear
have an optionalcolor
parameter to replace the
oldred, green, blue, alpha
parameters. - Samplers and Buffers have an
assign
method to simplify the scope creation. - Samplers have an optional
texture
parameter that will be used together with
the sampler when given. - The Scope's
enable_only
keyword argument is deprecated in favor of the
enable
keyword argument. - Buffers have a
bind
method that replaces the tuples in the VertexArray creation. - VertexArrays have an optional
scope
property that will be used when rendering. - The VertexArray's
vertices
property is now writeable. - VertexArrays have an
instances
property to control the default number of
instances when rendering. - The Context object contains the constants provided by the moderngl module.
The constants are: (TRIANGLE, LINES, DEPTH_TEST, ...)
Changed
- The
framebuffer
parameter is optional in Scopes. - The
ctx.simple_vertex_array
is deprecated in favor of usingctx.vertex_array
with the same parameters. - The
prog[uniform].value = value
is deprecated in favor of usingprog[uniform] = value
. - The
prog[uniform].write(bytes_value)
is deprecated in favor of using theprog[uniform] = bytes_value
.
Bugs
- Fixed an issue with attribute format detection causing integer and double types to fail
- Several minor bug fixes
5.5.4
This version was originally meant to only add python 3.8 support,
but a few additions and fixes where cherry-picked from the 5.6 branch.
- Python 3.8 support
Vertexarray
s can now be created without content.Context.blend_func
now supports separate blend functions for rgb and alpha.- Added
Context.blend_equation
supporting separate blend equations for rgb and alpha.
5.5.3
Fixed
- Scope object uniform buffer bindings.