Releases: blueburncz/BBMOD
3.14.0
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 theuniform
keyword. - Added new struct
BBMOD_PunctualLight
, which is a base struct for punctual lights. - Struct
BBMOD_PointLight
now inherits fromBBMOD_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
andbbmod_light_point_clear
are now deprecated. Please use the newbbmod_light_punctual_*
functions instead. - Added new property
MaxPunctualLights
toBBMOD_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
ofBBMOD_BaseShader
is now obsolete. Please use the newMaxPunctualLights
instead. - Added new method
set_punctual_lights
toBBMOD_BaseShader
, which sets uniformbbmod_LightPunctualDataA
. - Method
set_point_lights
ofBBMOD_BaseShader
is now deprecated, please use the newset_punctual_lights
instead.
Camera module:
- Added new property
Up
toBBMOD_Camera
, which is the camera's up vector. - Changed
BBMOD_Camera.AspectRatio
's default value towindow_get_width() / window_get_height()
. Previously it was set to16 / 9
. - Added new struct
BBMOD_BaseCamera
, which inherits fromBBMOD_Class
and it is now the base struct for cameras. It has adestroy
method that destroys the raw GameMaker camera! - Struct
BBMOD_Camera
now inherits fromBBMOD_BaseCamera
.
Raycasting module:
- Added new struct
BBMOD_FrustumCollider
, which is a frustum collider that can be initialized from any view-projection matrix or aBBMOD_Camera
. - Added new method
TestFrustum
toBBMOD_Collider
, which tests whether a collider intersects with a frustum collider. This method is by default not implemented and it will throw aBBMOD_NotImplementedException
! - Implemented method
TestFrustum
forBBMOD_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
andAntialiasing
fromBBMOD_Renderer
toBBMOD_PostProcessor
. - Added new property
PostProcessor
toBBMOD_Renderer
, which is an instance of post-processor. Default isundefined
. - Property
EnablePostProcessing
ofBBMOD_Renderer
is now obsolete.
3.13.1
This release hotfixes flickering models - a visual bug that appeared in 3.13.0.
3.13.0
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
ofBBMOD_Model
andBBMOD_DynamicBatch
and methodBBMOD_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
toBBMOD_Model
, which is set totrue
when the model is frozen. - Added new read-only property
Frozen
toBBMOD_Mesh
, which is set totrue
when the mesh is frozen. - Added new method
copy
toBBMOD_Model
, which deeply copies model's data into another model. - Added new method
clone
toBBMOD_Model
, which creates a deep clone of the model. - Added new method
copy
toBBMOD_Node
, which deeply copies node's data into another node. - Added new method
clone
toBBMOD_Node
, which creates a deep clone of the node. - Added new method
copy
toBBMOD_Mesh
, which deeply copies mesh's data into another mesh. - Added new method
clone
toBBMOD_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 ofBBMOD_DynamicBatch
are now optional. - Added new method
from_model
toBBMOD_DynamicBatch
, using which you can create the model batch later when_model
is not passed to the constructor. - Added optional argument
_slotsPerInstance
to constructor ofBBMOD_DynamicBatch
, which is the number of slots that each instance takes in the data array. - Added new read-only property
SlotsPerInstance
toBBMOD_DynamicBatch
, which is the number of slots that each instance takes in the data array. - Added new read-only property
BatchLength
toBBMOD_DynamicBatch
, which is the total length of batch data array for a single draw call. - Added new read-only property
Batch
toBBMOD_DynamicBatch
, which is the batched version of the model. - Added new read-only property
InstanceCount
toBBMOD_DynamicBatch
, which is the number of instances currently added to the dynamic batch. - Added new property
DataWriter
toBBMOD_DynamicBatch
, which is a function that writes instance data into the batch data array. It defaults toBBMOD_DynamicBatch.default_fn
. - Added new method
add_instance
toBBMOD_DynamicBatch
, which adds an instance to the dynamic batch. - Added new method
update_instance
toBBMOD_DynamicBatch
, which updates batch data for given instance. - Added new method
remove_instance
toBBMOD_DynamicBatch
, which removes an instance from the dynamic batch. - Arguments
_materials
of methodsubmit
andrender
ofBBMOD_DynamicBatch
is now optional. - Added new optional argument
_batchData
to methodssubmit
andrender
ofBBMOD_Model
, which is data for dynamic batching. - Arguments
_materials
and_fn
of methodsubmit_object
andrender_object
ofBBMOD_DynamicBatch
are now optional.
Particles module:
- Added optional argument
_position
to methodspawn_particle
ofBBMOD_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
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 newbbmod_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
toBBMOD_Resource
, using which you can write a resource into a buffer. - Implemented method
to_buffer
for resourcesBBMOD_Model
,BBMOD_Animation
andBBMOD_Sprite
. - Added method
to_file
toBBMOD_Resource
, using which you can write a resource into a file. - Added method
to_json
toBBMOD_Material
, using which you can save material properties to a JSON object. - Added method
from_json
toBBMOD_Material
, using which you can load material properties from a JSON object. - Implemented methods
to_file
,from_file
andfrom_file_async
forBBMOD_Material
.
Resource Manager module:
- Method
load
ofBBMOD_ResourceManager
can now load materials from*.bbmat
files.
3.11.0
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
toBBMOD_BaseShader
, using which you can set thebbmod_MaterialIndex
uniform. - Added optional argument
_materialIndex
to methodsdraw_mesh
anddraw_mesh_animated
ofBBMOD_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 inBBMOD_DLL
's constructor now changes based on the platform.
3.10.0
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
andKeyNextEditSpace
ofBBMOD_Gizmo
can now beundefined
.
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
andbbmod_object_add_vec4
, which are shorthands forbbmod_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
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 istrue
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 ofBBMOD_VertexFormat
and valuestrue
orfalse
, depending on whether the vertex format should or should not have the property. - Added new property
TextureCoords2
to structBBMOD_VertexFormat
, which tells whether the vertex format has a second UV channel. - Added optional argument
_versionMinor
tobbmod_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
andbbmod_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 structBBMOD_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 structBBMOD_DLL
, using which you can check whether second UV channel is disabled. - Added new method
set_disable_uv2
to structBBMOD_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
andbbmod_lightmap_set
, using which you can get/set the default lightmap texture used by all lightmapped materials (unless they override it).
3.8.0
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
andEmissive
and methodsset_normal_roughness
,set_metallic_ao
,set_subsurface
andset_emissive
from structBBMOD_PBRMaterial
to structBBMOD_DefaultMaterial
. - Moved methods
set_normal_roughness
,set_metallic_ao
,set_subsurface
andset_emissive
from structBBMOD_PBRShader
to structBBMOD_DefaultShader
.
Rendering module:
PBR submodule:
- Struct
BBMOD_PBRMaterial
now inherits fromBBMOD_DefaultMaterial
. - Struct
BBMOD_PBRMaterial
is now obsolete, please useBBMOD_DefaultMaterial
instead. - Struct
BBMOD_PBRShader
now inherits fromBBMOD_DefaultShader
. - Struct
BBMOD_PBRShader
is now obsolete, please useBBMOD_DefaultShader
instead. - Macro
BBMOD_SHADER_PBR
is now obsolete, please useBBMOD_SHADER_DEFAULT
instead. - Macro
BBMOD_SHADER_PBR_ANIMATED
is now obsolete, please useBBMOD_SHADER_DEFAULT_ANIMATED
instead. - Macro
BBMOD_SHADER_PBR_BATCHED
is now obsolete, please useBBMOD_SHADER_DEFAULT_BATCHED
instead. - Macro
BBMOD_MATERIAL_PBR
is now obsolete, please useBBMOD_MATERIAL_DEFAULT
instead. - Macro
BBMOD_MATERIAL_PBR_ANIMATED
is now obsolete, please useBBMOD_MATERIAL_DEFAULT_ANIMATED
instead. - Macro
BBMOD_MATERIAL_PBR_BATCHED
is now obsolete, please useBBMOD_MATERIAL_DEFAULT_BATCHED
instead. - Added new macros
BBMOD_ShPBR
,BBMOD_ShPBRAnimated
andBBMOD_ShPBRBatched
for backwards compatibility purposes. These evaluate toBBMOD_ShDefault
,BBMOD_ShDefaultAnimated
andBBMOD_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
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
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
andScaleComponentwise
ofBBMOD_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.