Releases: blueburncz/BBMOD
3.16.6
This release fixes SSAO when using orthographic projection and adds more options to control SSAO quality with.
Changelog:
- Added new property
SSAOSelfOcclusionBias
toBBMOD_DefaultRenderer
, which defaults to 0.01. Increase to fix self-occlusion. - Added new property
SSAOBlurDepthRange
toBBMOD_DefaultRenderer
, which is the maximum depth difference over which can be SSAO samples blurred. Defaults to 2. - Added new optional arguments
_selfOcclusionBias
and_blurDepthRange
to functionbbmod_ssao_draw
, using which you can configure self-occlusion bias and blur depth range respectively. - Fixed SSAO when using orthographic projection.
3.16.5
This release mainly fixes specular reflections and the size of the gizmo when using an orthographic projection. Additionally, resources can now be marked as persistent and a new clear
method was added to the resource manager, which frees all non-persistent resources.
Changelog:
- Added new property
Height
toBBMOD_BaseCamera
, which is the height of the orthographic projection. Ifundefined
, then it is computed fromWidth
usingAspectRatio
. Defaults toundefined
. - Property
Width
ofBBMOD_BaseCamera
can now beundefined
. It is then computed fromHeight
usingAspectRatio
. - Fixed gizmo changing size based on its distance from the camera when using an orthographic projection.
- Fixed specular reflections when using an orthographic projection.
- Added new property
Persistent
toBBMOD_Resource
. If it istrue
, then the resource is persistent and it is not destroyed when methodfree
is used. Default value isfalse
. - Added new method
clear
toBBMOD_ResourceManager
, which destroys all non-persistent resources. - Added new macro
BBMOD_RESOURCE_MANAGER
, which is the default resource manager.
3.16.4
This release fixes animation serialization to buffers.
Scripting API changes
- Fixed method
to_buffer
ofBBMOD_Animation
, which previously caused a crash.
3.16.3
This release fixes rendering of particles and SSAO on macOS (and possibly other OpenGL platforms). No changes were made to the Scripting API.
3.16.2
This is a tiny release that fixes BBMOD_BaseCamera
and model serialization to buffers.
Scripting API changes
- Fixed method
update_matrices
ofBBMOD_BaseCamera
. - Added missing method
ToBuffer
toBBMOD_Quaternion
. - Fixed method
to_buffer
ofBBMOD_Model
. - Fixed method
to_buffer
ofBBMOD_Mesh
.
3.16.1
This release adds more of unlit variations of the default shaders and materials.
Scripting API changes
- Added new macro
BBMOD_SHADER_DEFAULT_UNLIT
, which is the default shader for unlit objects. - Added new macro
BBMOD_MATERIAL_DEFAULT_UNLIT
, which is the default material for unlit objects. - Added new macro
BBMOD_SHADER_TERRAIN_UNLIT
, which is an unlit terrain shader. - Added new macro
BBMOD_MATERIAL_TERRAIN_UNLIT
, which is an unlit terrain material.
3.16.0
This release is a preface to bigger new features to come that require some modifications to the library. It is being released earlier to give you more time to accommodate to the changes and to give us time to fix potential issues while we also work on the new features. Please make sure to read this changelog thoroughly before updating to this release!
Feature highlights
Modules reorganized
To simplify the structure of the library and to allow certain planned features to be implemented, modules had to be reorganized, with a lot of the API being put into the Core module. The Core module now contains all the basics and the rest are modules that add features on top of that.
BBMOD DLL in the core
BBMOD DLL is now also a part of the Core module and its path in the included files can be controlled only through a new macro BBMOD_DLL_PATH
! This is because it could be utilized throughout other parts of the library when possible (e.g. to speed things up or enable features otherwise unsupported on certain platforms).
Vertex texture fetching support
GameMaker supports vertex texture fetching (VTF) on most platforms, known exceptions being PS4, PS5, Xbox and Windows. We would like to utilize VTF on desktop platforms in one of the future updates, so we are adding support for VTF on Windows through the BBMOD DLL. You can now use bbmod_vtf_is_supported
to check if VTF is supported on the current platform and bbmod_texture_set_stage_vs
to pass a texture to a vertex shader.
Shader variants
Before it was not possible to share a single material between static, animated and dynamically batched models. Instead you had to create a separate copy of the material with a special shader. This issue has been resolved by adding shader variants. Each BBMOD_Shader
can now consist of multiple GameMaker shader resources, where each is used with a different vertex format. This means that you can now use BBMOD_MATERIAL_DEFAULT
for all three model kinds, without the _ANIMATED
or _BATCHED
suffix.
Default renderer
To enable us to develop multiple rendering pipelines, BBMOD_Renderer
had to be split into BBMOD_BaseRenderer
and BBMOD_DefaultRenderer
. The former is a new base struct for all renderers and the latter is a replacement for the old renderer. Aditionally, everything regarding the default materials and the default renderer was put into a single folder, so it is easier to find all resources used in the default rendering pipeline.
Scripting API changes
- Added missing method
Reset
toBBMOD_RaycastResult
, which resets its properties to their default values. - Prefixed all private API with
__
(two underscores) to "hide" it from autocomplete. - Structs
BBMOD_Collider
,BBMOD_Node
,BBMOD_Vertex
,BBMOD_VertexFormat
,BBMOD_ParticleModule
,BBMOD_Property
andBBMOD_Shader
now inherit fromBBMOD_Class
. - Added new macro
BBMOD_MAX_BONES
, which is the maximum number of bones a single model can have. Equals to 128. - Added new method
set_node_rotation_post
toBBMOD_AnimationPlayer
, which sets a post-rotation of a node. - Added new macro
BBMOD_MAX_BATCH_VEC4S
, which is the maximum number of vec4 uniforms for dynamic batch data available in the default shaders. - Added new function
bbmod_vtf_is_supported
, which checks if vertex texture fetching is supported on the current platform. - Added new function
bbmod_texture_set_stage_vs
, which passes a texture to a vertex shader. - Added new member
DepthOnly
to enumBBMOD_ERenderPass
, which is a render pass where opaque objects are rendered into an off-screen depth buffer. - Member
Deferred
of enumBBMOD_ERenderPass
is now deprecated! Please use the newDepthOnly
instead. - Added new member
GBuffer
to enumBBMOD_ERenderPass
, which is a render pass where opaque objects are rendered into a G-Buffer. - Added new method
add_variant
toBBMOD_Shader
, which adds a shader variant to be used with a specific vertex format. - Added new method
has_variant
toBBMOD_Shader
, which checks whether the shader has a variant for given vertex format. - Property
VertexFormat
ofBBMOD_Shader
is now obsolete! Please use the new methodhas_variant
instead. - Arguments
_shader
and_vertexFormat
ofBBMOD_Shader
's constructor are now optional. If specified, then they are added to the shader with the new methodadd_variant
. - Added new method
get_variant
toBBMOD_Shader
, which retrieves a shader variant for given vertex format. - Property
Raw
ofBBMOD_Shader
is now obsolete! Please use the new methodget_variant
instead. - Method
get_name
ofBBMOD_Shader
is now obsolete and will always returnundefined
! - Method
is_compiled
ofBBMOD_Shader
now checks if all its variants are compiled! - Removed deprecated methods,
set_uniform_f
,set_uniform_f2
,set_uniform_f3
,set_uniform_f4
,set_uniform_f_array
,set_uniform_i
,set_uniform_i2
,set_uniform_i3
,set_uniform_i4
,set_uniform_i_array
,set_uniform_matrix
,set_uniform_matrix_array
andset_sampler
ofBBMOD_Shader
! - Methods
get_uniform
andget_sampler_index
ofBBMOD_Shader
are now obsolete and will always return-1
! - Method
set
ofBBMOD_Shader
now expects argument_vertexFormat
, which is used to set a specific shader variant! - Changed signature of
BBMOD_RenderQueue.draw_mesh
todraw_mesh(_vertexBuffer, _vertexFormat, _primitiveType, _materialIndex, _material, _matrix)
! - Changed signature of
BBMOD_RenderQueue.draw_mesh_animated
todraw_mesh_animated(_vertexBuffer, _vertexFormat, _primitiveType, _materialIndex, _material, _matrix, _boneTransform)
! - Changed signature of
BBMOD_RenderQueue.draw_mesh_batched
todraw_mesh_batched(_vertexBuffer, _vertexFormat, _primitiveType, _materialIndex, _material, _matrix, _batchData)
! - Added new optional argument
_matrix
toBBMOD_Model.render
, which is the world matrix to use when rendering the model. It defaults tomatrix_get(matrix_world)
when not specified. - Renamed sprite
BBMOD_SprCheckerboard
toBBMOD_SprDefaultBaseOpacity
! - Moved macros
BBMOD_SHADER_DEPTH
,BBMOD_SHADER_DEPTH_ANIMATED
andBBMOD_SHADER_DEPTH_BATCHED
to the Core module! - Added new macro
BBMOD_SHADER_DEFAULT_DEPTH
, which is a substitution for the oldBBMOD_SHADER_DEPTH
. It contains shader variants for vertex formatsBBMOD_VFORMAT_DEFAULT_ANIMATED
,BBMOD_VFORMAT_DEFAULT_BATCHED
andBBMOD_VFORMAT_DEFAULT_LIGHTMAP
. - Macros
BBMOD_SHADER_DEPTH
,BBMOD_SHADER_DEPTH_ANIMATED
andBBMOD_SHADER_DEPTH_BATCHED
are now deprecated! Please use the newBBMOD_SHADER_DEFAULT_DEPTH
instead. - Renamed shaders
BBMOD_ShDepth
,BBMOD_ShDepthAnimated
andBBMOD_ShDepthBatched
toBBMOD_ShDefaultDepth
,BBMOD_ShDefaultDepthAnimated
andBBMOD_ShDefaultDepthBatched
respectively! - Removed the Rendering/Depth buffer submodule, since it became empty!
- Moved structs
BBMOD_LightmapMaterial
andBBMOD_LightmapShader
to the Core module! - Added new structs
BBMOD_DefaultLightmapMaterial
andBBMOD_DefaultLightmapShader
, which are substitutions forBBMOD_LightmapMaterial
andBBMOD_LightmapShader
respectively. - Struct
BBMOD_LightmapMaterial
now inherits from the newBBMOD_DefaultLightmapMaterial
and is marked as deprecated! Please useBBMOD_DefaultLightmapMaterial
instead. - Struct
BBMOD_LightmapShader
now inherits from the newBBMOD_DefaultLightmapShader
and is marked as deprecated! Please useBBMOD_DefaultLightmapShader
instead. - Moved macros
BBMOD_VFORMAT_LIGHTMAP
,BBMOD_SHADER_LIGHTMAP
,BBMOD_SHADER_LIGHTMAP_DEPTH
andBBMOD_MATERIAL_LIGHTMAP
to the Core module! - Added new macro
BBMOD_VFORMAT_DEFAULT_LIGHTMAP
, which is a vertex format of lightmapped models with two UV channels. - Macro
BBMOD_VFORMAT_LIGHTMAP
is now deprecated! Please use the newBBMOD_VFORMAT_DEFAULT_LIGHTMAP
instead. - Added new macro
BBMOD_SHADER_DEFAULT_LIGHTMAP
, which is a shader for rendering lightmapped models with two UV channels. - Macro
BBMOD_SHADER_LIGHTMAP
is now deprecated! Please use the newBBMOD_SHADER_DEFAULT_LIGHTMAP
instead. - Macro
BBMOD_SHADER_LIGHTMAP_DEPTH
is now deprecated! Please use the newBBMOD_SHADER_DEFAULT_DEPTH
instead. - Moved functions
bbmod_lightmap_get
andbbmod_lightmap_set
to the Core module! - Renamed shader
BBMOD_ShLightmap
toBBMOD_ShDefaultLightmap
! - Renamed shader
BBMOD_ShLightmapDepth
toBBMOD_ShDefaultDepthLightmap
! - Moved macros
BBMOD_VFORMAT_SPRITE
,BBMOD_SHADER_SPRITE
andBBMOD_MATERIAL_SPRITE
to the Core module! - Added new macro
BBMOD_VFORMAT_DEFAULT_SPRITE
, which is a vertex format of 2D sprites. - Macro
BBMOD_VFORMAT_SPRITE
is now deprecated! Please use the newBBMOD_VFORMAT_DEFAULT_SPRITE
instead. - Added new macro
BBMOD_SHADER_DEFAULT_SPRITE
, which is a shader for 2D sprites. - Macro
BBMOD_SHADER_SPRITE
is now deprecated! Please use the newBBMOD_SHADER_DEFAULT_SPRITE
instead. - Added new macro
BBMOD_MATERIAL_DEFAULT_SPRITE
, which is a material for 2D sprites. - Macro
BBMOD_MATERIAL_SPRITE
is now deprecated! Please use the newBBMOD_MATERIAL_DEFAULT_SPRITE
instead. - Renamed shader
BBMOD_ShSprite
toBBMOD_ShDefaultSprite
! - Removed the 2D module, since it became empty!
- Moved struct
BBMOD_Renderer
from to the Core module! - Added new struct
BBMOD_BaseRenderer
, which is a base struct for renderers. - Added new struct
BBMOD_DefaultRenderer
, which inherits fromBBMOD_BaseRenderer
and implements the same functionality asBBMOD_Renderer
did. - Struct
BBMOD_Renderer
now inherits from the newBBMOD_DefaultRenderer
and is marked as deprecated! Please useBBMOD_DefaultRenderer
instead. - Removed the Rendering/Renderer submodule, since it became empty!
- Removed ...
3.15.1
This is a tiny release that adds more mipmapping configuration options to materials.
Changelog:
Core module:
- Added new property
MipBias
toBBMOD_Material
, which defines a bias for which mip level is used. Default value is 0. - Added new property
MipFilter
toBBMOD_Material
, which is the mip filter mode used for the material. Default value istf_anisotropic
. - Added new property
MipMin
toBBMOD_Material
, which is the minimum mip level used. Default value is 0. - Added new property
MipMax
toBBMOD_Material
, which is the maximum mip level used. Default value is 16. - Added new property
Anisotropy
toBBMOD_Material
, which is the maximum level of anisotropy whenBBMOD_Material.MipFilter
is set totf_anisotropic
. Default value is 16.
3.15.0
This release brings many improvements to various parts of the library, like improved gizmo, possibility to select instances rendered in dynamic batches, debug draw for colliders, fixed rendering of terrain when using non-uniform scaling, configurable chromatic aberration post-processing effect and also support for shadow-casting spot lights among others. Please read the changelog thoroughly before upgrading to this version, as changes done to add support for selecting instances from dynamic batches could be breaking (depending on your project)!
Changelog:
General:
- Default animated shaders now accept max 128 bones instead of 64.
- Default batched shaders now expect data in form of
[(x, y, z, uniformScale), (qX, qY, qZ, qW), (idX, idY, idZ, idW), ...]
, where(idX, idY, idZ, idW)
is instance ID encoded as color! - Shadows from directional lights now smoothly transition out at shadowmap borders instead of being cut off right away.
Core module:
- Added new function
bbmod_matrix_build_normalmatrix
, which creates a matrix using which you can safely transform normal vectors in shaders. - Struct
BBMOD_StaticBatch
is now deprecated. We recommend using aBBMOD_DynamicBatch
instead. - Added new property
ShadowmapResolution
toBBMOD_Light
, which is the shadowmap resolution. - Added new property
ShadowmapArea
toBBMOD_DirectionalLight
, which is the area captured by the shadowmap. - Argument
_slotsPerInstance
ofBBMOD_DynamicBatch
's constructor now defaults to 12 instead of 8. - Method
default_fn
ofBBMOD_DynamicBatch
, which is the default data writer, now also writes instanceid
encoded as color (12 places in total instead of 8)! - Added new optional argument
_ids
to methodrender
ofBBMOD_DynamicBatch
, which are IDs of instances in the_batchData
array(s). Defaults to IDs of instances added to the batch using itsadd_instance
method. - Added new macro
BBMOD_VFORMAT_DEBUG
, which is a vertex format useful for debugging purposes, like drawing previews of colliders.
Gizmo module:
- Added new property
EnableGridSnap
toBBMOD_Gizmo
, which enables snapping to grid when moving objects. - Added new property
GridSize
toBBMOD_Gizmo
, which is the size of the grid. - Added new property
EnableAngleSnap
toBBMOD_Gizmo
, which enables angle snapping when rotating objects. - Added new property
AngleSnap
toBBMOD_Gizmo
, which is the angle snapping size. - Added new property
KeyCancel
toBBMOD_Gizmo
, which is the virtual key used to cancel editing and revert changes. Default isvk_escape
. - Added new property
KeyIgnoreSnap
toBBMOD_Gizmo
, which is the virtual key used to ignore grid and angle snapping when they are enabled. Default isvk_alt
. - Added new method
GetInstanceGlobalMatrix
toBBMOD_Gizmo
, which is a function that the gizmo uses to retrieve an instance's global matrix. Normally this is an identity matrix. If the instance is attached to another instance for example, then this will be that instance's transformation matrix. - Fixed the gizmo to work independently on from which direction is the camera looking at it and whether it's moving or not.
- Added new macro
BBMOD_SHADER_INSTANCE_ID_BATCHED
, which is a shader used when rendering instance IDs.
Raycasting module:
- Added new method
GetCorners
toBBMOD_FrustumCollider
, which retrieves an array of its corners. - Added new method
DrawDebug
toBBMOD_Ray
, which draws a debug preview of the ray. - Added new method
DrawDebug
toBBMOD_Collider
, which draws a debug preview of the collider. By default this method is not implemented and it will throwBBMOD_NotImplementedException
if used! - Implemented method
DrawDebug
for collidersBBMOD_AABBCollider
,BBMOD_FrustumCollider
andBBMOD_SphereCollider
.
Rendering module:
Post-processing submodule:
- Added new property
ChromaticAberrationOffset
toBBMOD_PostProcessor
, which are chromatic aberration offsets for RGB channels.
Renderer submodule:
- Property
ShadowmapResolution
ofBBMOD_Renderer
is now obsolete. Please useBBMOD_Light.ShadowmapResolution
instead. - Property
ShadowmapArea
ofBBMOD_Renderer
is now obsolete. Please useBBMOD_DirectionalLight.ShadowmapArea
instead.
Sky submodule:
- Fixed shader
BBMOD_ShSky
ignoring matrix rotation.
Terrain module:
- Fixed terrain normals when using non-uniform scaling.
3.14.1
This release is a hotfix of a bug where the screen turned all black when gizmo had instances selected. No changes were made to the GML API.