Releases: blueburncz/BBMOD
3.1.3
This release mainly adds per-vertex ambient (split into upper and lower hemisphere), directional and point lights and per-pixel fog into the default shaders, imitating the classic GameMaker 3D look.
Changelog:
GML API:
Core module:
- Added new functions
bbmod_light_ambient_set
,bbmod_light_ambient_get_up
,bbmod_light_ambient_set_up
,bbmod_light_ambient_get_down
andbbmod_light_ambient_set_down
using which you can configure color of the ambient light sent to shaders. - Added new struct
BBMOD_Light
, which is a base class for dynamic. - Added new struct
BBMOD_PointLight
, which is a dynamic point light. - Added new 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
using which you can configure point lights sent to shaders. - Added new struct
BBMOD_DirectionalLight
, which is a dynamic directional light. - Added new functions
bbmod_light_directional_get
andbbmod_light_directional_set
using which you can configure directional light sent to shaders. - Added new struct
BBMOD_ImageBasedLight
, which casts light from RGBM-encoded prefiltered octahedrons onto the scene. - Added new functions
bbmod_fog_set
,bbmod_fog_set_color
,bbmod_fog_get_intensity
,bbmod_fog_set_intensity
,bbmod_fog_get_start
,bbmod_fog_set_start
,bbmod_fog_get_end
andbbmod_fog_set_end
using which you can configure fog properties passed to shaders. - Added a new functions
bbmod_ibl_get
andbbmod_ibl_set
using which you can configure image based light sent to shaders. - Added new methods
on_set
andon_reset
toBBMOD_BaseShader
, which are executed when the shader is set/reset. These are now used in derived shaders to set global shader uniforms instead of misusing methodset_material
. - Added new methods
set_ambient_light
,set_directional_light
,set_point_lights
andset_fog
toBBMOD_Shader
, which are called automatically inon_set
to pass defined lights and fog to the shader. - Added new functions
bbmod_camera_get_position
andbbmod_camera_set_position
using which you can configure the camera position sent to shaders. - Deprecated variable
global.bbmod_camera_position
, please use the new functions instead. - Added new functions
bbmod_camera_get_exposure
andbbmod_camera_set_exposure
using which you can configure the camera exposure value sent to shaders. - Deprecated variable
global.bbmod_camera_exposure
, please use the new functions instead. - Added new functions
bbmod_render_pass_get
andbbmod_render_pass_set
using which you can configure the current render pass. - Deprecated variable
global.bbmod_render_pass
, please use the new functions instead. - Added new macros
BBMOD_C_AQUA
,BBMOD_C_BLACK
,BBMOD_C_BLUE
,BBMOD_C_DKGRAY
,BBMOD_C_FUCHSIA
,BBMOD_C_GRAY
,BBMOD_C_GREEN
,BBMOD_C_LIME
,BBMOD_C_LTGRAY
,BBMOD_C_MAROON
,BBMOD_C_NAVY
,BBMOD_C_OLIVE
,BBMOD_C_ORANGE
,BBMOD_C_PURPLE
,BBMOD_C_RED
,BBMOD_C_SILVER
,BBMOD_C_TEAL
,BBMOD_C_WHITE
andBBMOD_C_YELLOW
, which are shorthands fornew BBMOD_Color().FromConstant(c_aqua)
etc. - Added new method
BBMOD_Color.FromHex
using which you can initialize a color usingRRGGBB
hexadecimal format.
Rendering module:
PBR submodule:
- Using material
BBMOD_MATERIAL_SKY
does no longer implicitly load sky and IBL sprites from the included files! You will need to do that yourself if you want to use the PBR shaders! - Moved methods
set_cam_pos
andset_exposure
fromBBMOD_PBRShader
toBBMOD_Shader
. These are also called in theon_set
method. - Method
BBMOD_PBRShader.set_ibl
now optionally takes aBBMOD_ImageBasedLight
to pass to the shader. When not specified, it defaults to the one defined usingbbmod_ibl_set
. Call of this method was also moved toon_set
. - Deprecated functions
bbmod_set_ibl_sprite
andbbmod_set_ibl_texture
. Please use the new structBBMOD_ImageBasedLight
and functionbbmod_ibl_set
instead.
3.1.2
This release mainly adds possibility to define shaders used by a material in individual render passes, which in combination with render queues enables creating advanced rendering pipelines.
Changelog:
GML API:
Core module:
- Added new macro
BBMOD_RGBM_VALUE_MAX
, which defines the maximum value which a single color channel can have before it is converted to RGBM. - Added new struct
BBMOD_Color
, which supports HDR colors. - Added new struct
BBMOD_BaseShader
, which does not define any uniforms specific to BBMOD and it is now the base class for shader resource wrappers. - Struct
BBMOD_Shader
now inherits fromBBMOD_BaseShader
. - Added new enum of render passes
BBMOD_ERenderPass
. - Deprecated macros
BBMOD_RENDER_DEFERRED
,BBMOD_RENDER_FORWARD
andBBMOD_RENDER_SHADOWS
. Use appropriate members ofBBMOD_ERenderPass
instead, as these macros will be removed in a future release. - Removed property
Shader
ofBBMOD_Material
. - Added new methods
set_shader
,has_shader
,get_shader
andremove_shader
toBBMOD_Material
, using which you can define shaders used by the material in specific render passes. - Method
BBMOD_Material.apply
now returnstrue
orfalse
based on whether the material was applied (instead of always returningself
). - Method
BBMOD_Material.submit_queue
does no longer automatically clear the queue. - Added new method
BBMOD_Material.clear_queue
, which clears the material's render queue. - New
BBMOD_Material
s no longer use the checkerboard texture as the default. The texture is still used byBBMOD_MATERIAL_DEFAULT*
materials. - Function
bbmod_get_materials
now accepts an optional render pass argument, using which you can retrieve only materials that have a shader for a specific render pass. - Added new interface
BBMOD_IRenderTarget
, which is an interface for structs that can be set as a render target. - Added new methods
Set
andSetIndex
toBBMOD_Vec2
,BBMOD_Vec3
andBBMOD_Vec4
using which you can change the vector components in-place. - Moved
bbmod_set_camera_position
,global.bbmod_camera_exposure
,global.bbmod_camera_position
from the PBR module to the Core module to resolve dependency issues. - Added new function
bbmod_get_calling_function_name
, using which you can retrieve the name of the function that calls it. - Added new function
bbmod_class_get_name
, using which you can retrieve class names of structs inheriting fromBBMOD_Class
. - Added new macro
BBMOD_CLASS_GENERATED_BODY
, which now must always be the first line in structs inheriting fromBBMOD_Class
. - Added new method
BBMOD_Class.is_instance
, using which you can test if an instance ofBBMOD_Class
inherits from a specific class.
Importer module:
- Fixed import of OBJ model that included empty lines.
Rendering module:
- Added new module - Rendering.
Cubemap submodule:
- Added new submodule - Cubemap.
- Added new struct
BBMOD_Cubemap
, using which you can easily render scenes into a cubemap.
PBR submodule:
- PBR is now a submodule of the Rendering module.
- Parameter
_shader
in the constructor ofBBMOD_PBRMaterial
is now optional. - Method
BBMOD_PBRMaterial.set_emissive
now acceptsBBMOD_Color
as an argument. The variant with 3 arguments (one for each color channel) is kept for backwards compatibility, but it should not be used anymore, as it will be removed in a future release!
Renderer submodule:
- Renderer is now a submodule of the Rendering module.
3.1.1
This release patches few errors in the BBMOD GML library.
Changelog:
GML API:
Core module:
- Moved interface
BBMOD_IRenderable
from the Renderer module to the Core module. - Fixed return value of
BBMOD_Material.submit_queue
, which should have beenself
, but the method did not return anything. - Fixed methods
Reflect
ofBBMOD_Vec2
,BBMOD_Vec3
andBBMOD_Vec4
, which returned incorrect results.
3.1.0
This release of BBMOD adds a new module "State machine", which includes an implementation of a general-purpose state machine, as well as a state machine for animation playback control.
Changelog:
GML API:
Core module:
- Added new struct
BBMOD_Class
which is a base struct for BBMOD structs that require more OOP functionality. - Moved methods
on_event
,off_event
andtrigger_event
ofBBMOD_AnimationPlayer
into a new interfaceBBMOD_IEventListener
. - Struct
BBMOD_AnimationPlayer
now implements interfaceBBMOD_IEventListener
. - Listeners passed to method
BBMOD_IEventListener.on_event
can now take the event name as the second argument. - The event name argument of method
BBMOD_IEventListener.on_event
is now optional. If it is not specified, then the listener is executed on every event. - Fixed material
BBMOD_VFORMAT_DEFAULT_BATCHED
, which by accident used shaderBBMOD_ShDefaultAnimated
. - Added method
BBMOD_Quaternion.FromEuler
, which initializes a quaternion using euler angles.
State machine module:
- Added a new module - State machine.
- Added new structs
BBMOD_StateMachine
andBBMOD_State
, which implement a state machine. - Added new structs
BBMOD_AnimationStateMachine
andBBMOD_AnimationState
, which implement a state machine that controls animation playback.
3.0.0
This major release of BBMOD focuses on modularity of the GML library, increased animation playback performance and support for advanced rendering pipelines.
Changelog:
General:
- Done a full switch from matrices to dual quaternions for node transforms and animation data.
- Interpolated animation frames are now precomputed offline during model conversion. Animation sampling rate is fully configurable.
- Added three levels of animation optimization. Higher optimization levels increase the animation playback performance but disable additional features like transforming nodes through code, node attachments or animation transitions.
- Done changes to the model and animation file format and increased their version from
2
to3
.
BBMOD CLI:
- Added new option
--optimize-animations
(-oa
) using which you can configure the animation optimization level. - Added new option
--sampling-rate
(-sr
) using which you can configure the animation sampling rate (fps).
GML API:
General:
- Moved included files from
./BBMOD
to./Data/BBMOD
. - Increased macro
BBMOD_VERSION
from2
to3
. It is not possible to load*.bbmod
and*.bbanim
files from previous versions. - Removed all obsolete and deprecated functions etc.
- Split the library into multiple folders - modules. Each one of this module adds extra functionality, but the only module you need to import to be able to use BBMOD is the Core module.
- PBR is now its own module and it is no longer the default shader/material - you do not have to include it if you are going to use your own shaders.
- Renamed sprite
BBMOD_SprDefaultMaterial
toBBMOD_SprCheckerboard
and removed its subimages except for the first one, which is the checkerboard texture.
DLL:
- Added new methods
get_optimize_animations
andset_optimize_animations
toBBMOD_DLL
using which you can configure the animation optimization level. - Added new methods
get_sampling_rate
andset_sampling_rate
toBBMOD_DLL
using which you can configure the animation sampling rate (fps).
Vertex format:
- Added a new method
BBMOD_VertexFormat.get_byte_size
, which retrieves a size of a single vertex using the vertex format in bytes. - Added new macros for
BBMOD_VFORMAT_DEFAULT
,BBMOD_VFORMAT_DEFAULT_ANIMATED
andBBMOD_VFORMAT_DEFAULT_BATCHED
, which are the default vertex formats for static, animated and dynamically batched models respectively.
Mesh:
- Converted legacy struct
BBMOD_EMesh
into a GMS2.3+ structBBMOD_Mesh
. - Added a new property
VertexFormat
toBBMOD_Mesh
. This is aBBMOD_VertexFormat
that the mesh uses.
Node:
- Converted legacy struct
BBMOD_ENode
into a GMS2.3+ structBBMOD_Node
. - Added a new property
Parent
toBBMOD_Node
, which is the parent of the node orundefined
if it is the root node. - Added a new read-only property
IsBone
toBBMOD_Node
, which tells whether the node or any node down the chain is a part of a skeleton. This is used to increase performance of animation playback. - Added a new method
BBMOD_Node.set_skeleton
using which you can mark a node as a part of a skeleton node chain. - Added a new read-only property
IsRenderable
toBBMOD_Node
, which tells whether the node or any node down the chain has a mesh. This is used to increase performance of model rendering. - Added a new method
BBMOD_Node.set_renderable
using which you can mark a node as renderable.
Shaders and materials:
- Renamed shaders
BBMOD_ShDefault
,BBMOD_ShDefaultBatched
andBBMOD_ShDefaultAnimated
toBBMOD_ShPBR
,BBMOD_ShPBRBatched
andBBMOD_ShPBRAnimated
respectively. - Added a new set of default shaders (with the same names as the original ones). These are basic pass-through shaders, much easier to customize than the PBR ones.
- Added a new struct
BBMOD_Shader
, which wraps regular GM shader resources. BBMOD_Material
now accepts aBBMOD_Shader
instead of a regular GM shader resource.- Added a new struct
BBMOD_PBRMaterial
which inherits fromBBMOD_Material
. Moved PBR-only properties ofBBMOD_Material
toBBMOD_PBRMaterial
. - Renamed
BBMOD_Material
'sRenderPath
property toRenderPass
. - Added a new function
bbmod_get_materials
which returns an array of all existing materials. - Added a new read-only property
Priority
toBBMOD_Material
. This property determines the order of materials in the array returned bybbmod_get_materials
. - Added a new property
Repeat
toBBMOD_Material
using which you can configure texture repeat for the material. - Added a new method
BBMOD_Material.set_priority
, using which you can change thePriority
property of aBBMOD_Material
. - Added new properties
TextureOffset
andTextureScale
toBBMOD_Material
, using which you can control its texture coordinates within a texture page. - Method
BBMOD_Material.apply
now returns theself
(BBMOD_Material
) instead of a boolean. - Added a new method
BBMOD_Material.copy
which copies the material's properties into another material. - Added a new method
BBMOD_Material.set_base_opacity
using which you can change the material's base color and opacity using floats. - Changed the default value of the
BBMOD_Material.OnApply
property frombbmod_material_on_apply_default
toundefined
. - Removed function
bbmod_material_on_apply_default
. Setting shader uniforms and textures is now taken care of by theBBMOD_Shader
struct. - Added new macros
BBMOD_SHADER_DEFAULT
,BBMOD_SHADER_DEFAULT_ANIMATED
andBBMOD_SHADER_DEFAULT_BATCHED
, which are the default shaders for static, animated and dynamically batched models respectively. - Added new macros
BBMOD_SHADER_PBR
,BBMOD_SHADER_PBR_ANIMATED
andBBMOD_SHADER_PBR_BATCHED
, which are PBR shaders for static, animated and dynamically batched models respectively. - Added new macros
BBMOD_MATERIAL_PBR
,BBMOD_MATERIAL_PBR_ANIMATED
andBBMOD_MATERIAL_PBR_BATCHED
, which are PBR materials for static, animated and dynamically batched models respectively.
Rendering:
- Added a new struct
BBMOD_RenderCommand
. - Added a new property
RenderCommands
toBBMOD_Material
. This property is a list ofBBMOD_RenderCommand
structs that use the material. - Renamed method
render
ofBBMOD_Model
,BBMOD_DynamicBatch
andBBMOD_StaticBatch
tosubmit
. This method still immediately draws the model. - Added a new method
render
toBBMOD_Model
,BBMOD_DynamicBatch
andBBMOD_StaticBatch
, which enqueues the model for rendering. - Renamed method
render_object
ofBBMOD_DynamicBatch
tosubmit_object
. This method still immediately draws the dynamic batch. - Added a new method
render_object
toBBMOD_DynamicBatch
, which enqueues the dynamic batch for rendering. - Added new methods
render([_materials])
andsubmit([_materials])
toBBMOD_AnimationPlayer
. These are shorthands formodel.render(materials, animationPlayer.get_transform())
andmodel.submit(materials, animationPlayer.get_transform())
respectively. - Added a new method
BBMOD_Material.submit_queue
using which you can submit all its render commands. - Added a new macro
BBMOD_RENDER_SHADOWS
, which is a flag used to tell that a material is rendered in a shadow pass.
Animations:
- Removed legacy structs
BBMOD_EAnimationNode
,BBMOD_EAnimationKey
,BBMOD_EPositionKey
,BBMOD_ERotationKey
andBBMOD_EBone
. Animation data is now stored in a more optimal way. - Removed property
InterpolateFrames
ofBBMOD_AnimationPlayer
. All frames are now precomputed. - Removed property
AnimationStart
ofBBMOD_AnimationInstance
. - Added methods
supports_attachments
,supports_bone_transform
andsupports_transitions
toBBMOD_Animation
using which you can check if the animation supports node attachments, bone transformations through code and transitions respectively. This is determined by the optimization level of the animation. - Added new method
get_node_transform_from_frame
toBBMOD_AnimationPlayer
using which you can retrieve a node's transform from the last played animation frame. - Replaced property
OnEvent
ofBBMOD_AnimationPlayer
with methodson_event
andoff_event
. - Added new properties
Animation
andAnimationLoops
toBBMOD_AnimationPlayer
which is the last played animation and whether it loops respectively. - Added new method
change
toBBMOD_AnimationPlayer
. The animation player now remembers the last played animation and if a different one is passed it automatically transitions into it. This also triggers a new animation eventBBMOD_EV_ANIMATION_CHANGE
. - Added a new macro
BBMOD_EV_ANIMATION_LOOP
, which is an event triggered by an animation player when the animation played loops and continues from the start. - Added a new method
add_event
toBBMOD_Animation
using which you can add a custom animation event triggered at a specific frame.
Camera and renderer:
- Added a new struct
BBMOD_Camera
which implements both first-person and third-person camera. - Added a new struct
BBMOD_IRenderable
which defines an abstract interface of renderable objects. These can be rendered in theBBMOD_Renderer
struct. - Added a new struct
BBMOD_Renderer
which implements a basic render pipeline. This struct can be inherited from to define custom render pipelines.
Mesh builder and model importer:
- Added a new struct
BBMOD_Vertex
. - Added a new struct
BBMOD_MeshBuilder
, using which you can create BBMOD meshes through code. - Added a new struct
BBMOD_Importer
, which is a base struct for model importers. - Added a new struct
BBMOD_OBJImporter
, which is an importer of*.obj
models.
Math library:
- Removed CE dependency.
- Added new structs
BBMOD_Vec2
,BBMOD_Vec3
,BBMOD_Vec4
,BBMOD_Quaternion
andBBMOD_DualQuaternion
.
Exceptions:
- Renamed struct
BBMOD_Error
toBBMOD_Exception
. - Added a new struct `BBMOD_NotImplemented...
2.5.0
Changelog:
GUI:
- Released first early access version! For non-commercial purposes, you can obtain a free copy from our website (requires a registered account). For commercial purposes please purchase BBMOD from the Marketplace.
GML:
- Added rendering to a cubemap.
2.4.2
Changelog:
CLI:
- Added new option
--optimize-materials
(-oma
) using which you can enable/disable material optimization. When enabled, redundant materials are joined into one and unused materials are removed. This is by default enabled to match behavior of previous versions. - Added new option
--optimize-meshes
(-ome
) using which you can enable/disable mesh optimization. When enabled, multiple meshes with the same material are joined into one. This is by default enabled to match behavior of previous versions. - Added new option
--optimize-nodes
(-on
) using which you can enable/disable node optimization. When enabled, multiple nodes (without animations, bones, ...) are joined into one. This is by default enabled to match behavior of previous versions.
GML:
- Added method
BBMOD_Model.find_node
using which you can retrieve aBBMOD_ENode
legacy struct by its name or id. - Added new methods
get_optimize_materials
,set_optimize_materials
,get_optimize_meshes
,set_optimize_meshes
,get_optimize_nodes
andset_optimize_nodes
toBBMOD_DLL
using which you can configure the new optimizations. - Added property
BBMOD_ENode.Visible
using which you can disable rendering of a node and its child nodes. - All
BBMOD_DLL
setters now returnself
, as they should have since the last update. - Fixed links in
BBMOD_DLL
documentation. - Renamed property
BBMOD_DLL.path
toBBMOD_DLL.Path
(uppercaseP
) to comply with the coding style used in the rest of the project. - Renamed property
BBMOD_Error.msg
toBBMOD_Error.Message
to comply with the coding style used in the rest of the project.
2.4.1
Changelog:
- Added a new default sky texture.
- Added methods
get_material
andset_material
toBBMOD_Model
using which you can get/set a material slot by its name. - Added property
Filtering
toBBMOD_Material
using which you can disable texture filtering for given material. - Added property
Materials
intoBBMOD_Model
, which is an array of default materials used when none are passed to therender
method. - All struct method that previously didn't have a return value now return
self
, which means they can be chained together.like().so()
. - Fixed method
BBMOD_Animation.get_animation_time
. - Fixed support for dynamic batching and animations on Android.
- Method
BBMOD_AnimationPlayer.update
now requiresdelta_time
as its first argument! This is because usingdelta_time
directly in struct methods did not work in YYC. - Optimized
BBMOD_DynamicBatch.render_object
usingwith
instead ofinstance_find
. - Updated project structure - all BBMOD resources are now under a BBMOD folder.
2.4.0
Changelog:
- Fixed major issues with loading animated models. This required a new model format - please reconvert all your models and check the latest documentation for changes in API!
- Added new properties
TransitionIn
andTransitionOut
toBBMOD_Animation
using which you can control duration of transition in and out of an animation. - Added new property
AlphaTest
toBBMOD_Material
using which you can discard transparent pixels of materials. - Added new property
Mipmapping
toBBMOD_Material
using which you can disable mipmapping for given material. - BBMOD CLI now automatically removes strings "_Armature" and "_mixamo" from *.bbanim files.
- BBMOD CLI now shows a warning when a model has more than 64 bones, since that is the default upper limit defined in shader
BBMOD_ShDefaultAnimated
. - Removed scripting API that was marked as obsolete in the previous release.
2.3.0
Changelog:
- Upgraded to GMS2.3
- Rewrote some parts of the API using the new GML OOP features
- Improved animation player
- Added a new PBR material system (metallic workflow)
- Added static and dynamic batching
- Added new options to BBMOD CLI - flip uvs horizontally and/or vertically, flip normals, generate flat/smooth/no normals
- Included DLL for converting models from GML