Skip to content

Releases: blueburncz/BBMOD

3.14.0

19 Oct 19:25
Compare
Choose a tag to compare

This release brings various improvements to different parts of the library. Post-processing was separated from renderer into a dedicated struct. A new type of punctual light was added - a spot light. A frustum collider and frustum-sphere intersection test was added, using which you can make simple frustum culling. Lastly, a new basic camera with full control over from, to and up vectors was added, so it is easier to create BBMOD cameras matching regular GameMaker cameras.

Changelog:

GML API:

Core module:

  • Method BBMOD_RenderQueue.set_sampler now also accepts a specific index instead of just a uniform name. This is useful for HLSL11, which does not have the uniform keyword.
  • Added new struct BBMOD_PunctualLight, which is a base struct for punctual lights.
  • Struct BBMOD_PointLight now inherits from BBMOD_PunctualLight.
  • Added new struct BBMOD_SpotLight, which is a new punctual light - a spot light.
  • Added new function bbmod_light_punctual_add, which adds a punctual light to be sent to shaders.
  • Added new function bbmod_light_punctual_count, which retrieves number of punctual lights added to be sent to shaders.
  • Added new function bbmod_light_punctual_get, which retrieves a punctual light at given index.
  • Added new function bbmod_light_punctual_remove, which removes a punctual light so it is not sent to shaders anymore.
  • Added new function bbmod_light_punctual_remove_index, which removes a punctual light so it is not sent to shaders anymore.
  • Added new function bbmod_light_punctual_clear, which removes all punctual lights sent to shaders.
  • Functions bbmod_light_point_add, bbmod_light_point_count, bbmod_light_point_get, bbmod_light_point_remove, bbmod_light_point_remove_index and bbmod_light_point_clear are now deprecated. Please use the new bbmod_light_punctual_* functions instead.
  • Added new property MaxPunctualLights to BBMOD_BaseShader, which is the maximum number of punctual lights in the shader. This must match with value defined in the raw GameMaker shader!
  • Property MaxPointLights of BBMOD_BaseShader is now obsolete. Please use the new MaxPunctualLights instead.
  • Added new method set_punctual_lights to BBMOD_BaseShader, which sets uniform bbmod_LightPunctualDataA.
  • Method set_point_lights of BBMOD_BaseShader is now deprecated, please use the new set_punctual_lights instead.

Camera module:

  • Added new property Up to BBMOD_Camera, which is the camera's up vector.
  • Changed BBMOD_Camera.AspectRatio's default value to window_get_width() / window_get_height(). Previously it was set to 16 / 9.
  • Added new struct BBMOD_BaseCamera, which inherits from BBMOD_Class and it is now the base struct for cameras. It has a destroy method that destroys the raw GameMaker camera!
  • Struct BBMOD_Camera now inherits from BBMOD_BaseCamera.

Raycasting module:

  • Added new struct BBMOD_FrustumCollider, which is a frustum collider that can be initialized from any view-projection matrix or a BBMOD_Camera.
  • Added new method TestFrustum to BBMOD_Collider, which tests whether a collider intersects with a frustum collider. This method is by default not implemented and it will throw a BBMOD_NotImplementedException!
  • Implemented method TestFrustum for BBMOD_SphereCollider.

Rendering module:

Post-processing submodule:

  • Added new struct BBMOD_PostProcessor, which handles post-processing effects.

Renderer submodule:

  • Moved enum BBMOD_EAntialiasing from the Renderer submodule to the Post-processing submodule.
  • Moved properties ColorGradingLUT, ChromaticAberration, Grayscale, Vignette, VignetteColor and Antialiasing from BBMOD_Renderer to BBMOD_PostProcessor.
  • Added new property PostProcessor to BBMOD_Renderer, which is an instance of post-processor. Default is undefined.
  • Property EnablePostProcessing of BBMOD_Renderer is now obsolete.

3.13.1

12 Oct 13:13
Compare
Choose a tag to compare

This release hotfixes flickering models - a visual bug that appeared in 3.13.0.

3.13.0

12 Oct 09:22
Compare
Choose a tag to compare

This update adds support for dynamic batching of models with multiple materials.

Changelog:

CLI:

  • Rebuilt BBMOD DLL and BBMOD CLI in Release mode.

GML API:

Core module:

  • Fixed BBMOD_Material.Mipmapping not working for externally loaded textures.
  • Fixed BBMOD_Material.apply always resetting shader, even when it wasn't necessary. This should slightly increase rendering performance.
  • Data for dynamic batching passed to methods submit, render of BBMOD_Model and BBMOD_DynamicBatch and method BBMOD_RenderQueue.draw_mesh_batched can now also be array of arrays of data. This has the same effect like if you called these methods multiple times with the individual arrays, but it has better performance.
  • Added new function bbmod_array_clone, which creates a shallow clone of an array.
  • Added new function bbmod_array_to_buffer, which writes an array into a buffer.
  • Added new function bbmod_array_from_buffer, which creates an array with values from a buffer.
  • Added new read-only property Frozen to BBMOD_Model, which is set to true when the model is frozen.
  • Added new read-only property Frozen to BBMOD_Mesh, which is set to true when the mesh is frozen.
  • Added new method copy to BBMOD_Model, which deeply copies model's data into another model.
  • Added new method clone to BBMOD_Model, which creates a deep clone of the model.
  • Added new method copy to BBMOD_Node, which deeply copies node's data into another node.
  • Added new method clone to BBMOD_Node, which creates a deep clone of the node.
  • Added new method copy to BBMOD_Mesh, which deeply copies mesh's data into another mesh.
  • Added new method clone to BBMOD_Mesh, which creates a deep clone of the mesh.
  • Added support for models with multiple materials to BBMOD_DynamicBatch.
  • Arguments _model and _size of constructor of BBMOD_DynamicBatch are now optional.
  • Added new method from_model to BBMOD_DynamicBatch, using which you can create the model batch later when _model is not passed to the constructor.
  • Added optional argument _slotsPerInstance to constructor of BBMOD_DynamicBatch, which is the number of slots that each instance takes in the data array.
  • Added new read-only property SlotsPerInstance to BBMOD_DynamicBatch, which is the number of slots that each instance takes in the data array.
  • Added new read-only property BatchLength to BBMOD_DynamicBatch, which is the total length of batch data array for a single draw call.
  • Added new read-only property Batch to BBMOD_DynamicBatch, which is the batched version of the model.
  • Added new read-only property InstanceCount to BBMOD_DynamicBatch, which is the number of instances currently added to the dynamic batch.
  • Added new property DataWriter to BBMOD_DynamicBatch, which is a function that writes instance data into the batch data array. It defaults to BBMOD_DynamicBatch.default_fn.
  • Added new method add_instance to BBMOD_DynamicBatch, which adds an instance to the dynamic batch.
  • Added new method update_instance to BBMOD_DynamicBatch, which updates batch data for given instance.
  • Added new method remove_instance to BBMOD_DynamicBatch, which removes an instance from the dynamic batch.
  • Arguments _materials of method submit and render of BBMOD_DynamicBatch is now optional.
  • Added new optional argument _batchData to methods submit and render of BBMOD_Model, which is data for dynamic batching.
  • Arguments _materials and _fn of method submit_object and render_object of BBMOD_DynamicBatch are now optional.

Particles module:

  • Added optional argument _position to method spawn_particle of BBMOD_ParticleEmitter, which is the position to spawn the particle at. If not specified, it defaults to the particle emitter's position.

Resource manager module:

  • Fixed BBMOD_ResourceManager not remembering loaded materials.

3.12.0

19 Sep 17:34
Compare
Choose a tag to compare

This update mainly adds support for loading materials from *.bbmat files. BBMAT is a simple JSON file containing material definition. It can be either created by hand or exported from BBMOD GUI.

Changelog:

General:

  • Disabled color grading on GLSL ES platforms, as it did not work consistently across various devices! This may be addressed in future versions.
  • Fixed terrain not casting shadows.
  • BBANIM files can now contain animation events.

CLI:

  • Updated Assimp from v5.2.4 to v5.2.5. This release for example fixes vertex weight issues, which in some cases lead into model deformations. You can find the full changelog here.

GML API:

Core module:

  • Added function bbmod_string_starts_with, which checks whether a string starts with a substring.
  • Added function bbmod_string_split_on_first, which splits the string in two at the first occurrence of the delimiter.
  • Added function bbmod_string_explode, which splits given string on every occurrence of given character and puts created parts into an array.
  • Added function bbmod_string_join_array, which joins an array into a string, putting separator in between each entry.
  • Added function bbmod_path_normalize, which normalizes path for the current platform.
  • Added function bbmod_path_is_relative, which checks if a path is relative.
  • Added function bbmod_path_is_absolute, which checks if a path is absolute.
  • Added function bbmod_path_get_relative, which retrieves a relative version of a path.
  • Added function bbmod_path_get_absolute, which retrieves an absolute version of a path.
  • Added function bbmod_json_load using which you can load a JSON file.
  • Added function bbmod_render_queues_get, using which you can retrieve a read-only array of existing render queues.
  • Variable global.bbmod_render_queues is now obsolete. Please use the new bbmod_render_queues_get instead.
  • Added function bbmod_render_pass_to_string, which retrieves a name of a render pass.
  • Added function bbmod_render_pass_from_string, which retrieves a render pass from its name.
  • Added function bbmod_shader_register, using which you can register a shader under a name.
  • Added function bbmod_shader_exists, using which you can check if there is a shader registered under given name.
  • Added function bbmod_shader_get, using which you can retrieve registered shaders.
  • Added function bbmod_material_register, using which you can register a material under a name.
  • Added function bbmod_material_exists, using which you can check if there is a material registered under given name.
  • Added function bbmod_material_get, using which you can retrieve registered materials.
  • Added method to_buffer to BBMOD_Resource, using which you can write a resource into a buffer.
  • Implemented method to_buffer for resources BBMOD_Model, BBMOD_Animation and BBMOD_Sprite.
  • Added method to_file to BBMOD_Resource, using which you can write a resource into a file.
  • Added method to_json to BBMOD_Material, using which you can save material properties to a JSON object.
  • Added method from_json to BBMOD_Material, using which you can load material properties from a JSON object.
  • Implemented methods to_file, from_file and from_file_async for BBMOD_Material.

Resource Manager module:

  • Method load of BBMOD_ResourceManager can now load materials from *.bbmat files.

3.11.0

08 Sep 15:03
Compare
Choose a tag to compare

This release adds macOS support to BBMOD CLI (command line tool) and BBMOD DLL (dynamic library).

Changelog:

CLI:

  • BBMOD CLI is now also available on macOS. Previously only Windows was supported.

GML API:

Core module:

  • Added method set_material_index to BBMOD_BaseShader, using which you can set the bbmod_MaterialIndex uniform.
  • Added optional argument _materialIndex to methods draw_mesh and draw_mesh_animated of BBMOD_RenderQueue, which is the index of the current material.

DLL module:

  • DLL module now works also on macOS. Previously only Windows was supported.
  • Default value of _path argument in BBMOD_DLL's constructor now changes based on the platform.

3.10.0

03 Sep 14:19
Compare
Choose a tag to compare

This release adds a new Save module, using which you can easily define serializable properties of objects and save and load instances to and from buffers.

Changelog:

GML API:

Core module:

  • Added new enum BBMOD_EPropertyType, which is an enumeration of all types of serializable properties.
  • Added new struct BBMOD_Property, which is a descriptor of a serializable property.

Gizmo module:

  • Properties KeyNextEditType and KeyNextEditSpace of BBMOD_Gizmo can now be undefined.

Save module:

  • Added new module - Save.
  • Added new function bbmod_object_add_property, using which you can add a serializable property to an object.
  • Added functions bbmod_object_add_bool, bbmod_object_add_color, bbmod_object_add_gmfont, bbmod_object_add_gmobject, bbmod_object_add_gmpath, bbmod_object_add_gmroom, bbmod_object_add_gmscript, bbmod_object_add_gmshader, bbmod_object_add_gmsound, bbmod_object_add_gmsprite, bbmod_object_add_gmtileset, bbmod_object_add_gmtimeline, bbmod_object_add_matrix, bbmod_object_add_path, bbmod_object_add_quaternion, bbmod_object_add_real, bbmod_object_add_real_array, bbmod_object_add_string, bbmod_object_add_vec2, bbmod_object_add_vec3 and bbmod_object_add_vec4, which are shorthands for bbmod_object_add_property.
  • Added function bbmod_object_get_property_map, using which you can retrieve a map of all serializable properties of an object.
  • Added function bbmod_object_get_property_array, using which you can retrieve an array of all serializable properties of an object.
  • Added function bbmod_instance_to_buffer, using which you can serialize an instance into a buffer.
  • Added function bbmod_instance_from_buffer, using which you can deserialize an instance from a buffer.
  • Added function bbmod_save_instances_to_buffer, using which you can save all instances of an object into a buffer.
  • Added function bbmod_load_instances_from_buffer, using which you can load saved instances from a buffer.

3.9.0

23 Jul 15:28
Compare
Choose a tag to compare

This release adds support for rendering models with baked lightmaps using secondary UV channel. Additionally fix of specular highlights intensity when using specular color textures is also included in this release.

Changelog:

BBMOD CLI:

  • Added new option --disable-uv2 (-duv2), using which you can disable export of second UV channel (if defined). This option is true by default (second UV channel is disabled).
  • The _log.txt file created during model conversion now describes vertex format of each mesh.

GML API:

Core module:

  • The first argument of BBMOD_VertexFormat's constructor can now be a struct with keys called after properties of BBMOD_VertexFormat and values true or false, depending on whether the vertex format should or should not have the property.
  • Added new property TextureCoords2 to struct BBMOD_VertexFormat, which tells whether the vertex format has a second UV channel.
  • Added optional argument _versionMinor to bbmod_vertex_format_load, which is the minor version of a BBMOD file that the vertex format is being loaded from.
  • Added new functions bbmod_light_ambient_get_affect_lightmaps and bbmod_light_ambient_set_affect_lightmaps, using which you can get/set whether the ambient light affects materials that use baked lightmaps. By default this is enabled.
  • Added new property AffectLightmaps to struct BBMOD_Light, using which you can enable/disable the light for materials that use baked lightmaps. By default this is enabled.

DLL module:

  • Added new method get_disable_uv2 to struct BBMOD_DLL, using which you can check whether second UV channel is disabled.
  • Added new method set_disable_uv2 to struct BBMOD_DLL, using which you can enable/disable second UV channel.

Lightmap module:

  • Added new module - Lightmap.
  • Added new struct BBMOD_LightmapShader, which is a wrapper for shaders used by lightmapped materials.
  • Added new struct BBMOD_LightmapMaterial, which is a material that can be used when rendering models with two UV channels, the second one being used for lightmaps.
  • Added new macro BBMOD_VFORMAT_LIGHTMAP, which is a vertex format of models with two UV channels, the second one being used for lightmaps.
  • Added new macro BBMOD_SHADER_LIGHTMAP, which is a shader for rendering models with two UV channels, the second one being used for lightmaps.
  • Added new macro BBMOD_SHADER_LIGHTMAP_DEPTH, which is a depth shader for lightmapped models with two UV channels.
  • Added new macro BBMOD_SHADER_LIGHTMAP_INSTANCE_ID, which is a shader used when rendering instance IDs for lightmapped models.
  • Added new macro BBMOD_MATERIAL_LIGHTMAP, which is a material for models with two UV channels, the second one being used for lightmaps.
  • Added new functions bbmod_lightmap_get and bbmod_lightmap_set, using which you can get/set the default lightmap texture used by all lightmapped materials (unless they override it).

3.8.0

12 Jul 15:17
Compare
Choose a tag to compare

This release mainly unifies default and PBR shaders and materials by merging them into one and supporting features from both. This means you can now use the default shaders and materials with both specular color & smoothness and metallic & roughness workflows. The default shaders and materials now also support emissive and subsurface textures. All contents of the PBR submodule are now obsolete and they will be removed in a future release. Please use the default ones instead. Shaders used for rendering gizmos were accidentally changed in the last release, so these have been fixed. Further fixes of model rendering on some Android devices are also included in this release.

Changelog:

GML API:

Core module:

  • Moved properties NormalRoughness, MetallicAO, Subsurface and Emissive and methods set_normal_roughness, set_metallic_ao, set_subsurface and set_emissive from struct BBMOD_PBRMaterial to struct BBMOD_DefaultMaterial.
  • Moved methods set_normal_roughness, set_metallic_ao, set_subsurface and set_emissive from struct BBMOD_PBRShader to struct BBMOD_DefaultShader.

Rendering module:

PBR submodule:

  • Struct BBMOD_PBRMaterial now inherits from BBMOD_DefaultMaterial.
  • Struct BBMOD_PBRMaterial is now obsolete, please use BBMOD_DefaultMaterial instead.
  • Struct BBMOD_PBRShader now inherits from BBMOD_DefaultShader.
  • Struct BBMOD_PBRShader is now obsolete, please use BBMOD_DefaultShader instead.
  • Macro BBMOD_SHADER_PBR is now obsolete, please use BBMOD_SHADER_DEFAULT instead.
  • Macro BBMOD_SHADER_PBR_ANIMATED is now obsolete, please use BBMOD_SHADER_DEFAULT_ANIMATED instead.
  • Macro BBMOD_SHADER_PBR_BATCHED is now obsolete, please use BBMOD_SHADER_DEFAULT_BATCHED instead.
  • Macro BBMOD_MATERIAL_PBR is now obsolete, please use BBMOD_MATERIAL_DEFAULT instead.
  • Macro BBMOD_MATERIAL_PBR_ANIMATED is now obsolete, please use BBMOD_MATERIAL_DEFAULT_ANIMATED instead.
  • Macro BBMOD_MATERIAL_PBR_BATCHED is now obsolete, please use BBMOD_MATERIAL_DEFAULT_BATCHED instead.
  • Added new macros BBMOD_ShPBR, BBMOD_ShPBRAnimated and BBMOD_ShPBRBatched for backwards compatibility purposes. These evaluate to BBMOD_ShDefault, BBMOD_ShDefaultAnimated and BBMOD_ShDefaultBatched respectively.

Sky submodule:

  • Moved macro BBMOD_MATERIAL_SKY from the PBR submodule into a new Sky submodule, since the PBR submodule is going to be removed in a future release.

3.7.2

05 Jul 08:37
Compare
Choose a tag to compare

This release mainly fixes shader compilation issues on some Android devices, which were caused by #pragma include lines in shaders. Names of files output by BBMOD CLI were also fixed, as previously it could merge multiple animations onto one BBANIM filename, even though the animations were called differently.

3.7.1

03 Jul 13:02
Compare
Choose a tag to compare

This release mostly focuses on compatibility issues with Feather and errors in code and documentation that were discovered thanks to Feather. New style for documentation comments of functions was also adopted to make them easier to read.

Changelog:

GML API:

Core module:

  • Fixed methods MulComponentwise, AddComponentwise, SubComponentwise and ScaleComponentwise of BBMOD_Matrix.

Camera module:

  • Fixed crash that would occur if mouselook was enabled in browsers that do not support it (HTML5 exports).

Gizmo module:

  • Fixed gizmo model for moving objects, which was rotated wrongly after release 3.6.1.