Release notes version 0.2.4

tristan edited this page Oct 22, 2018 · 17 revisions


New Features

Improved frustum culling

Frustum culling is parallelized per chunk and the bounding box update process is simplified. It gives about 2x times faster scenegraph stage for scene with thousands of objects.

See also: 20e9ff0.

Optimized mesh memory model

Mesh memory model is changed into SoA (Structure of Array) which improve the ability for the user to change one type of data (like position, color, uv) without paying the reupdate of all the vertices data, but only the pay for one category. It speedups by 2x the mesh update due to armature update and by 4x the update of vertices through python.

See also: b6123cc.

Bullet multithreading

Bullet library is update to its latest release version (2.87) which provides a multithreading support over 4 units used for collisions and constraints. The user point of view doesn't change excepted for KX_CharacterWrapper which use a vector for member gravity instead of a float before. The multithreading is automatically enabled and decreases physics time by about 2.

See also: 96148a6.

Dynamic object lighting layer

Before if the object layer was changed the lighting was impacted, this is not anymore the case as the object layer is now dynamic in the material and mutable as before through KX_GameObject.layer. This layer mimic the same viewport behaviour concerning lights with This Layer Only option checked.

See also: c024480.

Light inverse square cutoff falloff

A new lamp attenuation method was implemented for point and spot lamps. This "Inverse Square Cutoff" method gives you the possibility to define the radius and the cutoff threshold increasing the realism of the images.

  • With the parameter Radius we can establish the real radius of the lamps.
  • With the parameter Cutoff we can ignore all the illumination that falls below some cutoff threshold.

More technical info can be found here


See also: b87fe29.

Color management

The user have the ability to select the color management applied after the rendering. Before sRGB was always enabled and applied before filters, now selecting sRGB will apply color space conversion only after filters leaving linear values for filters input.

The UI is as follow:


This panel exists in Render tab and Texture tab, the first is the color space of the image on screen, the second the color space of the textures used by materials or worlds.

Linear space:


sRGB space:


See also: 552bf8e.

Mesh duplication in python

LibNew can be used to duplicate a mesh, but it does the duplication in a deeper level which can make the process slow. An other duplication method is proposed:


This function returns a new KX_Mesh with same vertices and materials that lives as long as the scene. The user can replace material and move vertices in this mesh independently of the original mesh.

To use this mesh, it must be replaced in a object:

mesh = orig_mesh.copy()

# Do some modification of mesh


See also: 1df87c0.

Mesh BVH in python

BVH can be constructed from a mesh with a transformation where indices are mesh polygons indices. The following function aim it:

bvh = mesh.constructBvh(transform=mat)

Were transform is a 4x4 matrix, defaulted to identity. BVH are used for fast intersection and ray tests.

See also: 59d33db, b7105d0.

Batch group reference object

Merged meshes created by a btach group are used by multiple objects but are rendered with a single set of settings. Previously the setting passed to material in case of batch group wasn't properly managed, this is now done by using a reference object form the list of objects merged. From this reference object the color and lighting layer are taken from an updated to the shader.

For default batching group the default reference if the first object in the merged list, updated when removing an object. Else the user can explicitly specify the reference object using attribute:


See also: 263b6a8.

Scene on remove callback

The new callback KX_Scene.onRemove is called when a scene is removed or replaced. KX_Scene.onRemove hold a list of functions with one optional argument for scene. Example:

def example(controller):
	scene = controller.owner.scene

	def callback(scene):
		print('removing scene "%s"' %

See also: f62dca6.

Soft body UI settings

Almost all soft body settings are now exposed in the physics panel:


All these settings came from bullet and are partially documented by this file:

Bullet name Bullet brief name description Description
aeromodel Aerodynamic model Define what kind of feature is used to compute aerodynamic forces (specifies orientation of vertex or face normals for aeurodynamics).
kVCF Velocities correction factor (Baumgarte) Define the amount of correction per time step for drift solver (sometimes referred to as ERP in rigid bodies solvers).
kDP Damping coefficient (Velocity?) damping.
kDG Drag coefficient For aerodynamics computations. See wikipedia “Drag coefficient”. 0 = no drag.
kLF Lift coefficient For aerodynamics computations. See wikipedia “Lift (force)”. 0 = no lift.
kPR Pressure coefficient Affects aerodynamics computations. Also, when setPose(true, ...)*** has been called, defines pressure used to conserve volume. (?)
kVC Volume conservation coefficient Volume conservation. Also, when setPose(true, ...)*** has been called, defines magnitude of the force used to conserve volume. (?)
kDF Dynamic friction coefficient Same as rigid body friction. 0 = slides, 1 = sticks.
kMT Pose matching coefficient When setPose(..., true)*** has been called, defines the factor used for pose matching. (enforcing relative vertex positions)
kCHR Rigid contacts hardness Defines how “soft” contact with rigid bodies are. 0 = no penetration correction, 1 = full correction.
kKHR Kinetic contacts hardness Defines how “soft” contact with kinetic/static bodies are. 0 = no penetration correction, 1 = full correction.
kSHR Soft contacts hardness Defines how “soft” contact with other soft bodies are. 0 = no penetration correction, 1 = full correction.
kAHR Anchors hardness Defines how “soft” anchor constraints (joints) are. 0 = no drift correction, 1 = full correction.
kSRHR_CL Soft vs rigid hardness Used with clusters only. Presumably similar function as kCHR.
kSKHR_CL Soft vs kinetic hardness Used with clusters only. Presumably similar function as kKHR.
kSSHR_CL Soft vs soft hardness Used with clusters only. Presumably similar function as kSHR.
kSR_SPLT_CL Soft vs rigid impulse split Used with clusters only. What proportion to split impulse with a rigid body after collision.
kSK_SPLT_CL Soft vs kinetic impulse split Used with clusters only. What proportion to split impulse with a kinetic/static body after collision.
kSS_SPLT_CL Soft vs soft impulse split Used with clusters only. What proportion to split impulse with another soft body after collision.
maxvolume Maximum volume ratio for pose ?
timescale Time scale Factor of time step. Can be used to speed up or slow down simulation of a specific soft body
viterations Velocities solver iterations Number of iterations for velocities solvers (if any).
piterations Positions solver iterations Number of iterations for position solvers (if any).
diterations Drift solver iterations Number of iterations for drift solvers (if any).
citerations Cluster solver iterations Number of iterations for cluster solvers (if any).
collisions Collisions flags See btSoftBody::fCollision
m_vsequence Velocity solvers sequence Defines order and type of solvers to apply for velocities. See btSoftBody::eVSolver.
m_psequence Position solvers sequence Defines order and type of solvers to apply for positions. See btSoftBody::ePSolver.
m_dsequence Drift solvers sequence Defines order and type of solvers to apply for drift. See btSoftBody::ePSolver.
m_kLST Linear stiffness coefficient
m_kAST Angular stiffness coefficient
m_kVST Volume stiffness coefficient

See also: 491ed27, ef6c5b4, b4b0e4c, 65ab238, 2bb2675, 45f9385.

Curve objects

Curve objects are now converted as empty objects KX_EmptyObject.

See also: cd9fa2b.

Invisible occluders

Invisible objects are now the ability to occlude other objects if they are configured as occluders.

See also: fa68fed.

UI cleanups

The UI concerning the game engine is simplified to hide settings not effective in game. These settings are scene keying set, speaker and fore field object in add object menu, and audio settings other than Distance Model, Speed and Doppler, are removed.

The sound panel is now:


Game Engine from rendering engine mode (at the top bar) is renamed to UPBGE to explicitly tell the user the application is with UPBGE.

See also: 6065fbd.

Default theme and startup file

Since its beginning UPBGE startup was the one pulled from blender, but this application target game engine more than rendering with other blender engines. In consideration the startup is reworked to ease new user creating contents.

It looks like:


First of all the engine UPBGE is selected by default, next the logic and script editors are set in window and the default scene is now compound of a cube upon a plane with one sun light with shadow and two hemi for global lighting. Environment lighting is enabled and the cube object hold a component similar to the template the user can generate with button Create Component. Concerning rendering, the shadow is PCF, MSAA is defaulted to 4x and framerate and profiler is exposed. In the same time the theme is changed to a darker theme.

See also: 08b0874.

Application directory

Configuration directory for UPBGE is changed to not conflict with blender directory. For linux the path is now .config/upbge and for windows AppData\Roaming\UPBGE.

See also: 155b83a.

Application logo

As is indicated in the Blender web (, the logo and the brand name Blender are not part of the GNU GPL, and can only be used commercially by the Blender Foundation on products, websites, and publications. Due to this the blender logo in applications is replaced by UPBGE logo.

See also: 1e5c590.

Bpy upbge version module exposes values upbge_version and upbge_version_string which return the same values as module

See also 1450832.

Python component script template generation

The bottom Create Component in component tab, will ask a name like module.Component and create a file named with a template class Component.


import bge
from collections import OrderedDict

if not hasattr(bge, "__component__"):
    # Put shared definitions here executed only in game engine.
    # e.g:
    # scene = bge.logic.getCurrentScene()

class Component(bge.types.KX_PythonComponent):
    # Put your arguments here of the format ("key", default_value).
    # These values are exposed to the UI.
    args = OrderedDict([

    def start(self, args):
        # Put your initialization code here, args stores the values from the UI.
        # self.object is the owner object of this component.

    def update(self):
        # Put your code executed every logic step here.
        # self.object is the owner object of this component.

See also: fba7bd3.

Python component UI improvements

A component can be expanded or reduce with a similar button than logic bricks:


PythonComponent bpy type has member module to retrieve the module name and so the full name of the component. This can be used by addons.

See also: af46b84.

Python component security

User pref option Auto Run Python Scripts is renamed Auto Run Python Scripts and Component and can disable the execution of components when trying to reload a component.


See also: a98a2bd, b0e3a39, c80501f.

Python component templates

Thanks to Guilherme Teres, a list of component is available for users helping to create top down games, character controller, setting minimap of playing sound. They are the following:

Each of these repository has a directory Source containing the python script of the components and example blend files, the documentation of each component is contained in the repository README.

Blender addons

Default addons is targeting a fork repository including new addons such as parallax bake, character creator.

You can find tutorial of the parallax addon here.

The repository is

See also: 7188624.

GLSL versions

Custom shaders now use automatically the higher compatible shader version capable, from #version 120 to #version 450 compatibility. The user still have to not put #version directive in any shader script.

See also: bf69125.

Libload fixes

Many issues related to libloading were fixed including management of lighthing. Currently when a light is added to a scene after a libload, all materials in the scene are regenerate to take in consideration this new ligth. The same happen when removing a light.

See also: 1acbbf7, 8765a15, 7f35889.

Compatibility issues

  • Rename async parameter from LibLoad as is a reserved word in Python 3.7. Now is named asynchronous. For example, you can use it this way now:
bge.logic.LibLoad(path, 'Scene', asynchronous=True)
  • KX_CharacterWrapper.gravity is now vector instead of a float.
  • Color management moved the conversion after filters, some filters could be influenced by this modification and updated to use linear values.

See also: 1959ed2.

Refactor and Clean ups

  • Cleanup KX_NavMeshObject.[h/cpp]. (see b2293e9)
  • Cleanup KX_SteeringActuator.[h/cpp]. (see 615cdb0)
  • Use std::vector for path instead of float array for nav mesh. (see 86cf416)
  • Use slot to store information around display arrays in RAS_Deformer. (see 404070c)
  • Cleanup mesh layers info. (see 39ae7f9)
  • Replace display array modification flag by update client/server. (see 87a7e65)
  • Cleanup KX_Scene.[h/cpp]. (see 1973f22)
  • Remove Hungarian notation. (see 555e650)
  • Remove unused m_rootnode member in KX_Scene. (see a82e220)
  • Remove m_blenderGroupObject in KX_GameObject. (see 71dcfe6)
  • Use RAS_VertexFormatType to specify format in RAS_VertexData template. (see 091804c)
  • Implement template intantiation switch utility. (see f47a2dc)
  • Use BL_ConvertObjectInfo to store object conversion data. (see fe801b4)
  • Move ReplicateConstrains function in KX_GameObject. (see 4b4259c)
  • Replace SetProg by BindProg and UnbindProg in shaders. (see ec62b3e)
  • Don't allocate on heap KX_LodLevel. (see 45f9b46)
  • Encapsulate light update in KX_LightObject. (see e8a9322)
  • Rename KX_Light.[h/cpp] to KX_LightObject.[h/cpp]. (see ab265f6)
  • Cleanup python initialization. (see c83d50e)
  • Use vertex array object for RAS_OpenGLRasterizer::ScreenPlane. (see 3aa9b76)
  • Rename RAS_MeshObject to RAS_Mesh. (see a3957d7)
  • Renaming KX_MeshProxy to KX_Mesh and make it permanent. (see 92af8d6)
  • Rename BL_Blender* to BL_*. (see 271407c)
  • Rename BL_BlenderScalarInterpolator.[h/cpp] to BL_ScalarInterpolator.[h/cpp]. (see 95774a1)
  • Cleanup BL_ScalarInterpolator.[h/cpp]. (see a972f04)
  • Cleanup SG_Controller and subclasses. (see ad70ea4)
  • Move interpolator into SG_Controller. (see 7dfc5e2)
  • Factorize code in KX_IpoSGController::Update(). (see a8d9f40)
  • Unify SG_COntroller subclasses replication. (see 0ba4f91)
  • Use mat3 constructor from euler in KX_OrientationInterpolator. (see 6d876f1)
  • Remove unused KX_[Scaling/Position/Orientation]Interpolator. (see 3c8e4c4)
  • Remove redundant check in KX_IpoController::Update. (see 6141fa3)
  • Unify replication of interpolator in SG_Controller. (see cf48458)
  • Use std::unique_ptr in KX_GameObject. (see 5a546f6)
  • Use VBO and VAO for debug drawing. (see a23e65c)
  • Remove duplication of sg controllers. (see 863d1ce)
  • Don't allocate SG_Interpolator on heap. (see c0d24cf)
  • Pass show boundingbox/armature flags to KX_Scene::DebugDraw. (see b4324ae)
  • Use CM_ListRemoveIfFound in SCA_IObject. (see 48e2862)
  • Use std::unique_ptr for event managers in SCA_LogicManager. (see 0414529)
  • Rework the way of load the game controller database (see 03e07a5)
  • Various cleanup in syntax. (see c960fe0)
  • Remove SG word in SG_Node function. (see 06e8f2a)
  • Simplify SG_Controller interaction with SG_Node. (see 96567f2)
  • Use template function for PyObjectFrom. (see 8b68754)
  • Use member function in EXP_ListWrapper. (see 99455b2)
  • Don't use heap for BL_ScalarInterpolator in BL_InterpolatorList. (see 096e566)
  • Move camera zoom setting in BL_Converter and RAS_CameraData. (see 3257be1)
  • Don't directly allocate on heap RAS_MeshSlot. (see 822bd35)
  • Use debug draw directly in KX_Scene and KX_KetsjiEngine. (see e613636)
  • Simplify RAS_Rasterizer::SetViewMatrix. (see 11be475)
  • Move RAS_Deformer in RAS_MeshUser. (see d2e0374)
  • Avoid unneeded dynamic_cast. (see 06e4dd9)
  • Move SG_Controller entirely in BL_Action. (#708) (see 8df1a72)
  • Avoid updating polygon offset if the previous state is same. (see 462e36b)
  • Replace LA_System by a simple clock. (see 3ed74ca)
  • Avoid calling glGetUniformLocation while setting a uniform through BL_Shader. (#733) (see 18e5a96)
  • Cleanup KX_Camera constructor. (see 8f3ae99)
  • Add upbge version info to stats (#767) (see 727c1fb)
  • Use mathfu types (see #844d9, 11e3f98, 44186f7, 179edd8, 1e658ce, 3e11751, 3f0e7b8, ca264cb)
  • Replace float tuple by mathutils.Vector in python documentation. (see 432ec8f)
  • Remove unused variable in obstacle simulation. (see b53c8bf)
  • Avoid explicit allocation on heap of physics debug drawer. (see 99feb54)
  • Refactor exit code managment. (see 2413cd4)
  • Avoid redundant state call to GL_CULL_FACE. (see 9fb0a3b)
  • Simplify texture blurring. (see f1e625c)
  • Rename RAS_IPoly[gon]Material to RAS_IMaterial. (see fcbde82)
  • Clarify globalDict setting. (see 3ce5565)

Bug Fixes

  • Fix channel update of duplicated armatures. (see eb0374a)
  • Fix uninitialized bounding box. (see cafd183)
  • Fix softbody cluster collision: set mass before creating cluster. (see 4a45419)
  • Fix reference counting of module items. (see 77464fb)
  • Use aligned allocator for RAS_BoundingBox::DisplayArraySlot. (see a99d456)
  • Fix sys.path/meta_path/modules not restored at game end. (see 6a5f431)
  • Fix conversion of color layers. (see 48ad207)
  • Use ARB OpenGL for functions higher than 3.0. (see ae062f8)
  • Reset mouse look actuator position on negative event. (see c36bc67)
  • Re-enable 8th UV and color layer in ConstructArray. (see 351f778)
  • Fix ray cast with xray and property filtering. (see 2c93233)
  • Fix early bail for object activity culling. (see 69d9d10)
  • Fix deletion of mathutils types in blenderplayer python. (see 646ae9d)
  • Restore and move IsNegativeScaling in SG_Node. (see ed78298)
  • Fix KX_GameObject::NodeSetGlobalOrientation. (see aef8773)
  • Fix group replication. (see af34951)
  • Fix UV and color update for deformer display array. (see f17538d)
  • Fix object auto bounds update. (see ba30dbb)
  • Fix FuzzyZero for very small vectors. (#664) (see aac6b53)
  • Fix for bug #746 Navmesh related (#752) (see 8c94a3f)
  • Fix some OSX compilation errors related to mathfu. (see 7a791c9)
  • Fix mathutils callbacks registration. (see f30d10d)
  • Fix gl_Color. (see 26c128f)
  • Set audiorate to 48000Hz by default (see 6e8870b)
  • Fix orthographic camera getScreenRay. (see 229ff4e)
  • Fix navmesh rebuild after mesh replacement. (#778) (see 5b8cb1e)
  • Fix bge.render.[get/set]Vsync. (#834) (see dbff6df)
  • Fix geometry instancing ligthing. (#847) (see e2fde22)
  • Fix capsule shape dimensions. (see 607351f)
  • Fix conversion of realtime maps. (#857) (see eebb46f)
  • Fix character collision detection. (#866) (see 8d97bab)
  • Fix "value in inputs[x].[queue/values/status]" (see 0513b96)
  • Fix for #797 (#869) (see 683c104, f169853)
  • Fix property and file name string size for components. (see 086255e)
  • Fix bullet ghost constraint solver. (see 3366966)
  • Fix object render settings for batching groups. (#861) (see 263b6a8)
  • Fix mesh polygon count. (see 8c8b8db)
  • Fix color space of ImageRender textures. (#891) (see 0d30856, 5ac1856)
  • Fix batching uvs and colors. (see ea1ffff)
  • Fix modifier deformer normal recalculation. (see 9f54aab)
Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.