Skip to content

Releases: moderngl/moderngl

5.7.2

07 Nov 06:21
Compare
Choose a tag to compare
  • Fixed a critical issue causing Renderbuffer.release() to crash due to missing InvalidObject 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

06 Nov 15:55
67b37c0
Compare
Choose a tag to compare

This version mainly addresses code maintainability and stability.

5.7.0

28 Oct 02:55
ff12176
Compare
Choose a tag to compare

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 in Context.objects.
      These can periodically be released using Context.gc().
    • "auto": Dead objects are destroyed automatically like we would expect in python.
  • Added support for glPolygonOffset. The factors and units can be set using Context.polygon_offset
  • Added support for normalized signed and unsigned integer textures. ni1, nu1, ni2 and nu2
    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 a mode argument in Context.vertex_array. This is now the default rendering mode when no mode parameter is passed in render() or transform()
  • Added support for 1D sampler in Uniform
  • Added direct access to glEnable / glDisable in Context.enable_direct / Context.disable_direct. This can be used to enabled capabilities not supported by ModernGL.
  • Framebuffer.read() now has a clamp (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 to Context.info
  • Docstring improvements
  • Documentation improvements

5.6.4

19 Feb 00:57
Compare
Choose a tag to compare
  • 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 shaders
  • VertexArray.transform() now automatically detects output primitive based on the input
  • GL_TRIANGLES_ADJACENCY enum incorrectly mapped (D0 instead of 0D)
  • Primitive modes are now accessible in the Context instance. For example: ctx.POINTS and ctx.TRIANGLES
  • Texture filers are now also available in the Context instance. For example: ctx.NEAREST and ctx.LINEAR
  • Docstring and documentation improvements

5.6.3

31 Jan 21:28
Compare
Choose a tag to compare
  • Added Context.extensions. This is a set containing the OpenGL extensions supported by the context.
  • Added support for overridable internal_format for Texture. This opens up for sRGB and compressed formats if needed.
  • Docstring and documentation improvements

5.6.2

08 Sep 23:50
Compare
Choose a tag to compare
  • TextureArray.build_mimpmaps() used the wrong target when building mipmaps.
    This caused the texture to corrupt with some drivers. Thanks to Nir Aides
    for discovering this bug.
  • Docstring improvements

5.6.1

09 Jun 21:10
Compare
Choose a tag to compare

Improvements

  • Added Context.cull_face. (glCullFace). An alternative to Context.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 assumed POINTS 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

01 Feb 12:17
Compare
Choose a tag to compare

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 a buffer_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 and Context.scissor can now be used
    to set and enable scissor testing per framebuffer.
  • The Framebuffer.clear have an optional color parameter to replace the
    old red, 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 using ctx.vertex_array with the same parameters.
  • The prog[uniform].value = value is deprecated in favor of using prog[uniform] = value.
  • The prog[uniform].write(bytes_value) is deprecated in favor of using the prog[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

10 Nov 01:40
Compare
Choose a tag to compare

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
  • Vertexarrays 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

16 Aug 19:10
Compare
Choose a tag to compare

Fixed

  • Scope object uniform buffer bindings.