Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement mesh creation in python. #659

Open
wants to merge 486 commits into
base: master
Choose a base branch
from
Open

Implement mesh creation in python. #659

wants to merge 486 commits into from
This pull request is big! We’re only showing the most recent 250 commits.

Commits on Dec 9, 2017

  1. Configuration menu
    Copy the full SHA
    e3bc77d View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    6696957 View commit details
    Browse the repository at this point in the history

Commits on Dec 10, 2017

  1. UPBGE: Cleanup KX_Scene.[h/cpp].

    This cleanup includes:
    - uncrustify pass
    - move function definition
    - remove extra class keyword
    - add const
    - use static_cast
    - reword comments
    panzergame committed Dec 10, 2017
    Configuration menu
    Copy the full SHA
    1973f22 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    555e650 View commit details
    Browse the repository at this point in the history
  3. UPBGE: Remove unused m_rootnode member in KX_Scene.

    This member was used only locally in a function, its visibility
    is restricted then.
    panzergame committed Dec 10, 2017
    Configuration menu
    Copy the full SHA
    a82e220 View commit details
    Browse the repository at this point in the history
  4. UPBGE: Remove blender group object in KX_GameObject.

    The blender group object member in KX_GameObject (m_blenderGroupObject)
    was a redundant information has it is similar to
    m_dupliGroupObject->GetBlenderObject().
    
    This member is removed and its usage is replaced by calling function
    GetBlenderObject of the dupli game object.
    panzergame committed Dec 10, 2017
    Configuration menu
    Copy the full SHA
    71dcfe6 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    cafd183 View commit details
    Browse the repository at this point in the history

Commits on Dec 11, 2017

  1. UPBGE: Fix free of collision data.

    Previously when calling python function obj.collide(...)
    the collision data PHY_ICollData was owned by noone and
    so leaked in memory.
    
    To fix this issue the owner ship if transfered to
    KX_CollisionContactPointList.
    
    Also a function KX_GameObject::HasCollisionCallbacks is
    implemented to not create contact point list for nothing.
    panzergame committed Dec 11, 2017
    Configuration menu
    Copy the full SHA
    2cc0d9e View commit details
    Browse the repository at this point in the history

Commits on Dec 14, 2017

  1. UPBGE: Use RAS_VertexFormatType to specify format in RAS_VertexData t…

    …emplate.
    
    Instead using two parameters to intanciate the RAS_VertexData template
    class, one struct is used: RAS_VertexFormatType, this struct also include
    the enum for the uv and color size.
    panzergame committed Dec 14, 2017
    Configuration menu
    Copy the full SHA
    091804c View commit details
    Browse the repository at this point in the history

Commits on Dec 15, 2017

  1. UPBGE: Implement template intantiation switch utility.

    The display array templates classes need a switch to create
    the proper display array instance corresponding on the format
    given.
    
    This was proceded thanks to macros but these macro were duplicated
    for regular display array and batch display array. As new
    classes using format to get template paramater will be used
    later a general function is implemented.
    
    This function is named CM_InstantiateTemplateSwitch,
    it receives as explicit template parameters the base class to down
    cast to, the up class using templates and a tuple of all the
    template parameters possible for the up class. Also the function
    receive a key to select compare with the tuple element instantiated
    and a list of arguments passed to the up class constructor.
    
    For display array classes purpose, a tuple is defined in RAS_VertexFormat.h
    containing all RAS_VertexFormatType possible: RAS_VertexFormatTuple.
    RAS_VertexFormatType now have a comparaison operator with RAS_VertexFormat
    to be working properly in CM_InstantiateTemplateSwitch when compared
    with the key.
    panzergame committed Dec 15, 2017
    Configuration menu
    Copy the full SHA
    f47a2dc View commit details
    Browse the repository at this point in the history

Commits on Dec 17, 2017

  1. Configuration menu
    Copy the full SHA
    ef6c5b4 View commit details
    Browse the repository at this point in the history
  2. Added more soft body parameters

    sdfgeoff authored and panzergame committed Dec 17, 2017
    Configuration menu
    Copy the full SHA
    b4b0e4c View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    65ab238 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    2bb2675 View commit details
    Browse the repository at this point in the history
  5. UPBGE: Expose all soft body solver iterations and improve UI.

    This commit expose all solver iterations for position, velocity, cluster
    and drift solvers.
    In the same time the RNA definition of new parameters is a bit cleaned and
    the UI defined in python is simplified to fit in two columns insteasd of
    three.
    panzergame committed Dec 17, 2017
    Configuration menu
    Copy the full SHA
    45f9385 View commit details
    Browse the repository at this point in the history
  6. BGE: Fix softbody cluster collision: set mass before creating cluster.

    Previously the mass of the soft body was set after creating the cluster,
    causing incorrect mass in the clusters and incorrect behavior in collision.
    ben2610 authored and panzergame committed Dec 17, 2017
    Configuration menu
    Copy the full SHA
    4a45419 View commit details
    Browse the repository at this point in the history
  7. UPBGE: Use BL_ConvertObjectInfo to store object conversion data.

    Previously the game objects were all storing a constraint list used for
    the creation of physics constraint from user settings, but once the object
    created, this list has no interest and over all it can be shared between
    duplicated objects.
    
    To solve this situation a BL_ConvertObjectInfo struct is introduced, this struct
    store a pointer to the blender object which was converted and a list of the
    blender constraints. These convert info are created in BL_BlenderSceneConverter
    and kept in BL_BlenderConverter after conversion, as promissed they are shared
    between game objects under a pointer member: m_convertInfo.
    
    Getter GetBlenderObject and GetConstraints are rewritten to return data from
    the convert info.
    
    A special case is dedicated in GetBlenderObject to default camera which doesn't
    have any convert info.
    panzergame committed Dec 17, 2017
    Configuration menu
    Copy the full SHA
    fe801b4 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    fa9079f View commit details
    Browse the repository at this point in the history
  9. UPBGE: Move ReplicateConstrains function in KX_GameObject.

    Always try to not see ketsji from other parts.
    panzergame committed Dec 17, 2017
    Configuration menu
    Copy the full SHA
    4b4259c View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    491ed27 View commit details
    Browse the repository at this point in the history
  11. UPBGE: Replace SetProg by BindProg and UnbindProg in shaders.

    Using a function like SetProg and an argument to decide to bind or
    not obligate to use a condition. This condition can be totally
    avoided if we the enable argument is not dynamic as in our case.
    
    This function is split in two, BindProg and UnbindProg. For
    BL_Shader the BindProg function is override non virtually as the only
    caller is KX_BlenderMaterial which has a BL_Shader pointer.
    panzergame committed Dec 17, 2017
    Configuration menu
    Copy the full SHA
    ec62b3e View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    45f9b46 View commit details
    Browse the repository at this point in the history
  13. UPBGE: Fix m_convertInfo not initialized to nullptr.

    This operation is important for the default camera.
    panzergame committed Dec 17, 2017
    Configuration menu
    Copy the full SHA
    149f33e View commit details
    Browse the repository at this point in the history
  14. 1 Configuration menu
    Copy the full SHA
    e8a9322 View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    ab265f6 View commit details
    Browse the repository at this point in the history
  16. UPBGE: Fix reference counting of module items.

    The item passed to PyDict_SetItemString will be incref, so if the item
    is constructed in the current scope and not stored in an external data,
    the item must be decref.
    
    These rules are applied to KX_PythonInit.cpp and remove the usage of
    PyDict_Clear in LA_Launcher.
    panzergame committed Dec 17, 2017
    Configuration menu
    Copy the full SHA
    77464fb View commit details
    Browse the repository at this point in the history
  17. UPBGE: Cleanup python initialization.

    Previously python was created and initialized the same way for the
    blenderplayer through the function setupGamePython. This caused that
    when reloading the launcher because of game reload (same file or other file)
    we had to take care to not call anything related to python, and the
    management of the global dict in blenderplayer was harder.
    Because of this difficulties the global dict wasn't shared between game
    reload contrary to the shared behaviour in embedded player.
    
    To solve this issue the python initialization and module initialization
    is split in two functions: initPlayerPython for constructing python and
    initGamePython to initialize a context with all the modules and the
    previous global dict.
    
    In the same time the prefix bpy_ is removed in BL_BlenderConverter, and
    python joysticks, keyboard and mouse are now using std::unique_ptr
    in KX_PythonInit.cpp.
    panzergame committed Dec 17, 2017
    Configuration menu
    Copy the full SHA
    c83d50e View commit details
    Browse the repository at this point in the history

Commits on Dec 19, 2017

  1. UPBGE: Use aligned allocator for RAS_BoundingBox::DisplayArraySlot.

    Struct DisplayArraySlot contains mt::vec3 which must be aligned on
    16 bytes, in consideration RAS_BoundingBox::m_slots uses
    mt::simd_allocator to allocate with the proper alignement.
    panzergame committed Dec 19, 2017
    Configuration menu
    Copy the full SHA
    a99d456 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    3aa9b76 View commit details
    Browse the repository at this point in the history

Commits on Dec 22, 2017

  1. Configuration menu
    Copy the full SHA
    a3957d7 View commit details
    Browse the repository at this point in the history

Commits on Dec 23, 2017

  1. Configuration menu
    Copy the full SHA
    92af8d6 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    6a5f431 View commit details
    Browse the repository at this point in the history

Commits on Dec 24, 2017

  1. UPBGE: Implement mesh duplication in python.

    The user is now able to duplicate a KX_Mesh using the python function
    mesh.copy().
    
    Internally this function copy construct KX_Mesh and RAS_Mesh and its
    RAS_MeshMaterial, then the mesh conversion is finalized and registered
    to the converter.
    For this last operation it was needed to store a KX_Scene pointer into
    KX_Mesh and to be able to replace it in case of lib loading.
    panzergame committed Dec 24, 2017
    Configuration menu
    Copy the full SHA
    1df87c0 View commit details
    Browse the repository at this point in the history

Commits on Dec 25, 2017

  1. Configuration menu
    Copy the full SHA
    ba6ae87 View commit details
    Browse the repository at this point in the history

Commits on Dec 27, 2017

  1. Configuration menu
    Copy the full SHA
    48ad207 View commit details
    Browse the repository at this point in the history
  2. UPBGE: Rename BL_Blender* to BL_*.

    "BL_" and "Blender" is redundant.
    panzergame committed Dec 27, 2017
    Configuration menu
    Copy the full SHA
    271407c View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    95774a1 View commit details
    Browse the repository at this point in the history
  4. UPBGE: Cleanup BL_ScalarInterpolator.[h/cpp].

    This cleanup includes:
    - uncrustify pass
    - remove extra class/struct keyword
    - move function definition to .cpp.
    panzergame committed Dec 27, 2017
    Configuration menu
    Copy the full SHA
    a972f04 View commit details
    Browse the repository at this point in the history

Commits on Dec 28, 2017

  1. UPBGE: Cleanup SG_Controller and subclasses.

    This commits add an empty SetOption function in SG_Controller to avoid redefinition
    in subclasses, also the attributes m_modified and m_ipotime which are used in all
    controller classes are moved into the base class SG_Controller, in consideration
    the function SetSimulationTime is de-virtualized and moved into SG_Controller.
    panzergame committed Dec 28, 2017
    Configuration menu
    Copy the full SHA
    ad70ea4 View commit details
    Browse the repository at this point in the history

Commits on Dec 29, 2017

  1. UPBGE: Move interpolator into SG_Controller.

    Interpolator list was a common attribut of all the classes derived from
    SG_Controller, in consideration this attribut is moved into SG_Controller
    and the function Update iterate over all the interpolators and call for
    update.
    
    In the same time the function UpdateSpatialData always call for parent
    relation update as before all the controller subclasses were returning
    false in function Update.
    panzergame committed Dec 29, 2017
    Configuration menu
    Copy the full SHA
    7dfc5e2 View commit details
    Browse the repository at this point in the history
  2. UPBGE: Factorize code in KX_IpoSGController::Update().

    The code in Update function could be simplified by using loops for check
    on all axis.
    panzergame committed Dec 29, 2017
    Configuration menu
    Copy the full SHA
    a8d9f40 View commit details
    Browse the repository at this point in the history
  3. UPBGE: Unify SG_COntroller subclasses replication.

    m_ipo_xform is not a pointer in KX_IpoSGController and using this
    instead of its addresse will end in the same result.
    panzergame committed Dec 29, 2017
    Configuration menu
    Copy the full SHA
    0ba4f91 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    6d876f1 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    3c8e4c4 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    bfebcec View commit details
    Browse the repository at this point in the history
  7. UPBGE: Remove redundant check in KX_IpoController::Update.

    After the begining of the Update function we know that variables
    m_ipo_start_initialized and m_ipo_euler_initialized are set to
    true and then the check later of these two variables is useless.
    panzergame committed Dec 29, 2017
    Configuration menu
    Copy the full SHA
    6141fa3 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    ab74372 View commit details
    Browse the repository at this point in the history
  9. UPBGE: Unify replication of interpolator in SG_Controller.

    A function ProcessReplica is introduced in SG_Controller to duplicate the
    interpolator and set a correct target. To have this function we needed first
    to make SG_ScalarInterpolator and merge KX_ScalarInterpolator to SG_Interpolator.
    panzergame committed Dec 29, 2017
    Configuration menu
    Copy the full SHA
    cf48458 View commit details
    Browse the repository at this point in the history

Commits on Dec 30, 2017

  1. UPBGE: Use std::unique_ptr in KX_GameObject.

    Some pointer in KX_GameObject corresponded to data owned by the
    game object or inexistant. In this case std::unique_ptr could be used
    to ensure the free of data.
    
    The only drawback is the requierment of a copy constructor to duplicate
    the data or set they to nullptr.
    
    Also m_clientInfo is now not anymore a pointer as it is never nullptr
    and owned by the game object.
    panzergame committed Dec 30, 2017
    Configuration menu
    Copy the full SHA
    5a546f6 View commit details
    Browse the repository at this point in the history

Commits on Dec 31, 2017

  1. Configuration menu
    Copy the full SHA
    cd9fa2b View commit details
    Browse the repository at this point in the history
  2. UPBGE: Use VBO and VAO for debug drawing.

    Using VBO and VAO allow to render all the lines in one command
    and to render all the AABB and frustum using instancing in one
    command too.
    
    The usage of VBO request that all the structs for lines, aabbs,
    frustum and boxes use array instead of mathfu types to avoid
    SSE padding and alignement.
    
    Four shaders are introduced to help debug drawing using instancing.
    The first is just for drawing lines using a flat color, the second
    is for wire boxes, the third for solid boxes with in and out color
    and the fourth for 2d boxes.
    All the these geometry type use geometry instancing.
    
    For each type RAS_OpenGLDebugDraw allocate a VAO and multiples VBOs,
    they are stored into m_vbos and m_vaos and accessed thanks to enums.
    The VAO are initialized in RAS_OpenGlDebugDraw constructor pointing
    to the uninitialized VBOs, some VBOs as unit 3d and 2d box and IBOs
    are initialized in the same time.
    
    At each render step the VBO containing data about instancing or
    geometry are updated from the data list contained into RAS_DebugDraw.
    Then the render is procceed binding the VAO and calling the proper
    draw call.
    
    2d boxes receive a special treatment. The boxes are rendered using
    a vertically inverted ortho matrix because the Y axis is from the
    top of the screen.
    
    All these modification ends in a significant speedup for debug drawing
    and makes the code easier to move to blender 2.8.
    panzergame committed Dec 31, 2017
    2 Configuration menu
    Copy the full SHA
    a23e65c View commit details
    Browse the repository at this point in the history
  3. UPBGE: Remove duplication of sg controllers.

    The duplication of sg controller is useless as the controllers
    duplicated are finally used by no one because the action manager
    of the new object is inexistant.
    panzergame committed Dec 31, 2017
    Configuration menu
    Copy the full SHA
    863d1ce View commit details
    Browse the repository at this point in the history
  4. UPBGE: Don't allocate SG_Interpolator on heap.

    Allocating SG_Interpolator on heap is useless as only SG_Controller see
    and modify they.
    panzergame committed Dec 31, 2017
    Configuration menu
    Copy the full SHA
    c0d24cf View commit details
    Browse the repository at this point in the history
  5. UPBGE: Fix empty profiler box.

    We should use at least box of one pixel.
    panzergame committed Dec 31, 2017
    Configuration menu
    Copy the full SHA
    14105f3 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    b4324ae View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    986e236 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    48e2862 View commit details
    Browse the repository at this point in the history

Commits on Jan 1, 2018

  1. UPBGE: Use std::unique_ptr for event managers in SCA_LogicManager.

    In the same time the replacement of the logic manager into the event manager
    is removed in the scene merging as the event manager are deleted just after
    the merge of the scene.
    panzergame committed Jan 1, 2018
    Configuration menu
    Copy the full SHA
    0414529 View commit details
    Browse the repository at this point in the history
  2. UPBGE: Use ARB OpenGL for functions higher than 3.0.

    Functions like glVertexAttribDivisor and glDraw[Arrays/Elements]Instanced
    are requiering OpenGL 3.0/3, but some GPU could not offer it and so they
    must use the ARB extension instead.
    panzergame committed Jan 1, 2018
    Configuration menu
    Copy the full SHA
    ae062f8 View commit details
    Browse the repository at this point in the history
  3. UPBGE: Reset mouse look actuator position on negative event.

    Previously when the mouse actuator was deactivated then activated
    the mouse gap from the mouse position on the last activation was taken
    causing a high movement. This behaviour is unconsistent with the first
    activation of the mouse actuator which ignore the last mouse position
    (set to -1) and then just init the mouse position for the next frame.
    This commit mimic this behaviour when the actuator is deactived by setting
    the previous mouse position to -1.
    
    Fix issue: #663.
    panzergame committed Jan 1, 2018
    Configuration menu
    Copy the full SHA
    c36bc67 View commit details
    Browse the repository at this point in the history

Commits on May 19, 2018

  1. UPBGE: Rework the way of load the game controller database

    This way we can update gamecontrollerdb.txt file easier than before
    (only it is necessary overwrite the file)
    lordloki committed May 19, 2018
    4 Configuration menu
    Copy the full SHA
    03e07a5 View commit details
    Browse the repository at this point in the history
  2. UPBGE: Update Readme

    lordloki committed May 19, 2018
    2 Configuration menu
    Copy the full SHA
    2aafdc1 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    f18f47e View commit details
    Browse the repository at this point in the history

Commits on May 21, 2018

  1. Update Readme.md

    Put a less stressful development cycle
    lordloki authored May 21, 2018
    2 Configuration menu
    Copy the full SHA
    f18255b View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    143dcb3 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    fd44f38 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    230eae6 View commit details
    Browse the repository at this point in the history
  5. 4 Configuration menu
    Copy the full SHA
    c960fe0 View commit details
    Browse the repository at this point in the history

Commits on May 22, 2018

  1. UPBGE: Compile fixes for last clean up.

    @panzergame : Please, give a look to check if my fixes are ok.
    lordloki committed May 22, 2018
    1 Configuration menu
    Copy the full SHA
    b9468df View commit details
    Browse the repository at this point in the history
  2. UPBGE: Start step to remove Blender logo and trademarks

    As is indicated in the Blender web (https://www.blender.org/about/
    logo/), 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, we would have to move Blender logo and trademark to UPBGE
    ones before next release, pointing out in a clear way that this is fork
    of Blender-BGE to avoid any future issues.
    lordloki committed May 22, 2018
    2 Configuration menu
    Copy the full SHA
    1e5c590 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    9181356 View commit details
    Browse the repository at this point in the history

Commits on May 24, 2018

  1. UPBGE: Add the option to disable component execution on game start

    The new option is at user preferences under system tab. The component
    execution is disable by default (similar to scripts).
    lordloki committed May 24, 2018
    Configuration menu
    Copy the full SHA
    a98a2bd View commit details
    Browse the repository at this point in the history

Commits on May 25, 2018

  1. Configuration menu
    Copy the full SHA
    92cefc1 View commit details
    Browse the repository at this point in the history

Commits on May 26, 2018

  1. UPBGE: Remove SG word in SG_Node function.

    It is not necessary to repeat that a function is from a scene graph
    class when we call it from a scene graph class.
    panzergame committed May 26, 2018
    Configuration menu
    Copy the full SHA
    06e8f2a View commit details
    Browse the repository at this point in the history
  2. UPBGE: Simplify SG_Controller interaction with SG_Node.

    Previously the SG_Controller were helding a pointer to the node owning them,
    but this pointer was used only in Update function called by the node.
    So the member is removed and the function Update receive the node pointer
    instead.
    
    Also BL_Action use an helper function AddController to add a valid controller,
    controllers without any interpolators (Empty()) are ignored.
    panzergame committed May 26, 2018
    Configuration menu
    Copy the full SHA
    96567f2 View commit details
    Browse the repository at this point in the history

Commits on May 27, 2018

  1. UPBGE: Rework component auto-exec disable

    Now it uses the same DEFINE as the python script auto-exec disable.
    
    As blend component executation on loading as component registration or
    component reloading are disable by default.
    
    Warning notifications were added to top-bar and console.
    lordloki committed May 27, 2018
    Configuration menu
    Copy the full SHA
    b0e3a39 View commit details
    Browse the repository at this point in the history
  2. UPBGE: Fix copy&paste error

    lordloki committed May 27, 2018
    Configuration menu
    Copy the full SHA
    c80501f View commit details
    Browse the repository at this point in the history
  3. Merge pull request #694 from UPBGE/experimental-component-security

    UPBGE: Add the option to disable component execution on game start
    lordloki authored May 27, 2018
    Configuration menu
    Copy the full SHA
    a8f9cf3 View commit details
    Browse the repository at this point in the history
  4. UPBGE: Re-enable 8th UV and color layer in ConstructArray.

    Somehow the case in RAS_IDisplayArray::ConstructArray was ignoring the
    vertex formats with an 8th UV or color layer.
    
    Intent to fix issue #699.
    panzergame committed May 27, 2018
    Configuration menu
    Copy the full SHA
    351f778 View commit details
    Browse the repository at this point in the history

Commits on May 30, 2018

  1. UPBGE: Pointing blender-addons out to our own blender-addons repository

    This way we can modify current game engine addons and to add a new ones
    lordloki committed May 30, 2018
    Configuration menu
    Copy the full SHA
    7188624 View commit details
    Browse the repository at this point in the history
  2. UPBGE: Use template function for PyObjectFrom.

    PyObjectFrom is now a template function to adapt on different vector
    size and matrix sizes.
    Support of vecX_mapped is addded.
    panzergame committed May 30, 2018
    Configuration menu
    Copy the full SHA
    8b68754 View commit details
    Browse the repository at this point in the history

Commits on May 31, 2018

  1. UPBGE: Fix ray cast with xray and property filtering.

    A check of prop.size() == 0 was rewritten in prop.size() instead of prop.empty().
    
    In the same time the function CheckRayCastObject is implemented to factorise the
    proprety and mask check made in RayHit and NeedRayCast.
    CheckRayCastObject also add a little optimization by not getting the object collision
    group when the mask accept all objects.
    
    Fix issue #671.
    panzergame authored May 31, 2018
    Configuration menu
    Copy the full SHA
    2c93233 View commit details
    Browse the repository at this point in the history
  2. UPBGE: Add component scritp generation.

    To ease the definition of a component a button named "Create Component" is added.
    This button ask for a path module.Class and generates a script named module.py
    with a component class Class inside.
    This template class contains a start and update function commented
    and a definition block before the class for global game engine variable.
    
    If the file already exists an error is raised.
    
    The previous button named Add Component is now renamed Register Component.
    panzergame committed May 31, 2018
    Configuration menu
    Copy the full SHA
    fba7bd3 View commit details
    Browse the repository at this point in the history

Commits on Jun 1, 2018

  1. UPBGE: Fix parenting.

    panzergame committed Jun 1, 2018
    Configuration menu
    Copy the full SHA
    4b6dca0 View commit details
    Browse the repository at this point in the history
  2. UPBGE: Fix early bail for object activity culling.

    X & 0 means nothing contrary to X == 0.
    panzergame committed Jun 1, 2018
    Configuration menu
    Copy the full SHA
    69d9d10 View commit details
    Browse the repository at this point in the history

Commits on Jun 3, 2018

  1. UPBGE: Use member function in EXP_ListWrapper.

    EXP_ListWrapper is now a template class based upon EXP_BaseListWraper.
    The template parameter are the Object and its memeber functions to call.
    These memeber fuctions are encapsulated in static function defined in EXP_ListWrapper.
    panzergame committed Jun 3, 2018
    Configuration menu
    Copy the full SHA
    99455b2 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    096e566 View commit details
    Browse the repository at this point in the history
  3. UPBGE: Simplificate PHY_GetActiveEnvironment().

    This function is placed in KX_Globals.h under the name KX_GetPhysicsEnvironment
    and directly call for KX_Scene::GetPhysicsEnvironment().
    panzergame committed Jun 3, 2018
    Configuration menu
    Copy the full SHA
    9bbdb6b View commit details
    Browse the repository at this point in the history
  4. UPBGE: Fix component auto script in blenderplayer.

    From blenderplayer the user pref flags are not copied to
    Global. To do so we mimic wm_init_userdef by checking and copying
    USER_SCRIPT_AUTOEXEC_DISABLE flag.
    panzergame committed Jun 3, 2018
    Configuration menu
    Copy the full SHA
    33c6583 View commit details
    Browse the repository at this point in the history

Commits on Jun 4, 2018

  1. UPBGE: Fix weak reference creation in EXP_BaseListWrapper.

    In the same time any call to GetProxy implictly incref the proxy,
    so if we don't return it as for attributes or methods we must decref
    the proxy after.
    panzergame committed Jun 4, 2018
    Configuration menu
    Copy the full SHA
    0b4da63 View commit details
    Browse the repository at this point in the history

Commits on Jun 13, 2018

  1. UPBGE: Fix deletion of mathutils types in blenderplayer python.

    The blenderplayer was not calling explicit initialization of mathutils and other
    modules and let the user calls the initialization when importing them.
    But some of the types defined on these modules can be returned by a python
    function without requering to import the module, for example KX_GameObject.worldPosition
    return a mathutils.Vector and some scripts don't import mathutils.
    
    To solve this issue the initialization of the modules are explicitly called into
    initPlayerPython by looping over bge_internal_modules and calling
    PyImport_ImportModuleLevel.
    
    It fix a major issue in blenderplayer scripts.
    panzergame committed Jun 13, 2018
    Configuration menu
    Copy the full SHA
    646ae9d View commit details
    Browse the repository at this point in the history

Commits on Jun 14, 2018

  1. UPBGE: Move camera zoom setting in BL_Converter and RAS_CameraData.

    The camera zoom setting was previously only stored into the ketsji engine,
    to avoid storing a setting only for override camera, this zoom is stored
    in RAS_CameraData. Then the override camera zoom is initialized easily
    from LA_BlenderPlayer and for other camera, the zoom is copied from
    BL_Converter global zoom variable (m_camZoom) initialized at the converter
    construction from the launcher.
    panzergame committed Jun 14, 2018
    Configuration menu
    Copy the full SHA
    3257be1 View commit details
    Browse the repository at this point in the history

Commits on Jun 15, 2018

  1. UPBGE: Improve frustum culling performance. (#701)

    * UPBGE: Improve frustum culling performance.
    
    Frustum culling was improved in two ways. First, simplificate the bounding
    box update. Second the test are parallelized using TBB range loop.
    
    The bounding box update is simplified by adding the call to RAS_Deformer::UpdateBuckets
    in KX_GameObject::UpdateBounds after we checked that the objects as a
    bounding box. By doing this we avoid a call to GetDeformer for all objects
    without a bounding box, with an unmodified bounding box or without auto
    update.
    
    All the computation of culling objects is moved into KX_CullingHandler,
    this class construct it's own objects list and returns it in Process function.
    Process function build a CullTask and launch it usign tbb::parallal_reduce.
    
    Each CullTask have an operator() to test a range of object, any objects passing
    the culling test is added in a task local objects list. Once the tests
    finished the CullTask merge these objects list in function join to end
    up with the list of all non-culled objects.
    This technique of reduce of list is way better than using a shared object
    list for all tasks and lock a mutex before adding an object. The method
    with mutex was always slower than without parallelization.
    
    This patch was tested with cube meshes :
    number of object | previous time | new time
    1000 | 0.06 | 0.07
    8000 | 1.04 | 0.55
    27000 | 3.81 | 1.90
    125000 | 16.16 | 8.31
    panzergame authored Jun 15, 2018
    Configuration menu
    Copy the full SHA
    20e9ff0 View commit details
    Browse the repository at this point in the history

Commits on Jun 17, 2018

  1. UPBGE: Don't directly allocate on heap RAS_MeshSlot.

    RAS_MeshSlot are owned by RAS_MeshUser, there's no need to allocate them on
    heap to after hold their pointers in a list, just allocate in the list
    directly.
    
    Tested with sintel desert level.
    panzergame committed Jun 17, 2018
    Configuration menu
    Copy the full SHA
    822bd35 View commit details
    Browse the repository at this point in the history
  2. UPBGE: Use debug draw directly in KX_Scene and KX_KetsjiEngine.

    Previously the debug draw (RAS_DebugDraw) was get from the rasterizer with
    a scene as identifier, but the scene could simply store an instance of
    RAS_DebugDraw and avoid lookup in rasterizer.
    In the same time the ketsji engine request a debug draw only for profiling
    render.
    panzergame committed Jun 17, 2018
    Configuration menu
    Copy the full SHA
    e613636 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    6cc0ea0 View commit details
    Browse the repository at this point in the history

Commits on Jun 22, 2018

  1. UPBGE: Use SoA for vertices in RAS_DisplayArray. (#715)

    The principle of AoS (array of structure) is to store an element structure in a
    array e.g:
    
    struct Vertex
    {
    	mt::vec3_packed pos;
    	mt::vec3_packed nor;
    };
    
    std::vector<Vertex> vertices;
    
    This kind of structure is very easy to use and totally tolerated for big
    structure or small amount of elements, also a reference or a pointer to a Vertex
    can be passed to any functions.
    Unfortunatly the memory cache usage is most of the time not efficient. Imagining
    a function modifying only the position of vertices, at each iteration the Vertex
    struct will be loaded in cache and only the member pos will be used, so 12 bytes
    on 24, the left 12 bytes will pollute the cache and cause more cache loads. If
    our function is modifying all the member of Vertex the cache isn't an issue.
    
    The opposite way SoA (structure of array) stores in a structure an array for
    each member, e.g:
    
    struct Vertices
    {
    	std::vector<mt::vec3_packed> pos;
    	std::vector<mt::vec3_packed> nor;
    };
    
    With this method passing a vertex to an other function is quite complicated as
    it ends up passing the Vertices instance and the vertex index to sample pos and
    nor. But on the cache side, if we back to our function modifying the positions,
    this function will load cache pages of only position and not waste memory at
    loading other unused data. Also for the case of modifying positions and normals,
    the both array will be stored in different cache pages without performance
    decrease compared to AoS.
    
    For CPU using SoA is generally an improvement, for GPU too, excepted for old GPU
    which might prefer interleaved data but nothing really confirms it.
    
    Previously in UPBGE and BGE, the vertices were stored in AoS idiom, UPBGE make
    more complex the vertices by adding different vertex struct for each combination
    of UV and color layer. All was accessed through an interface RAS_Vertex which
    hold a pointer to a RAS_IVertexData, the base class of any vertex data of any
    format. In the same time RAS_IDisplayArray was an interface to
    RAS_DisplayArray<VertexData>.
    By using SoA, RAS_DisplayArray owns a VertexData struct with a list for all
    vertex members (position, normal, tangent, 8 uv and 8 color), depending on the
    format some UV and color array are left empty. In the same time function for
    getting and setting all the member data are added, these function takes a vertex
    index, UV/color index for uv and color, and for setter a value too.
    By this way BL_SkinDeformer update the position just by calling
    RAS_DisplayArray::SetPosition(i, pos) instead of getting the RAS_Vertex via
    RAS_DisplayArray::GetVertex(i) and calling RAS_Vertex::SetXYZ.
    
    With these modifications RAS_DisplayArray<>, RAS_VertexData<> are removed and
    RAS_BatchDisplayArray doesn't need anymore virtual inheritance.
    
    On the conversion side, without RAS_VertexData the structure
    BL_SharedVertexPredicate used to find similar vertices is now copying the
    normal, tangent, uv and color data inside. Once a vertex is unique, it is added
    to the display array through RAS_DisplayArray::AddVertex(pos, nor, tan, uvs,
    colors, origIndex, flag) which append the vertex data to m_vertexData and
    construct the vertex info.
    
    VBO don't try to re-interleave the data as the time cost is too expensive,
    instead each member are sent to the VBO one by one, this is proceeded in
    RAS_StorageVbo::CopyVertexData. An other advantage of SoA is allowing to update
    only one kind of data, if the positions are modified these data are just copied
    to the beginning of the VBO without touching of the other data. This technique
    is used in RAS_StorageVbo::CopyVertexData by checking a modification flag.
    OpenGL attributes (VAO) are changed too because of the new VBO layout. The
    RAS_VertexDataMemoryFormat is replaced by RAS_DisplayArrayLayout which is not
    constant after the display array creation as modifying the size of the array
    change the offset of each data type in the VBO. In consideration
    RAS_DisplayArray::GetLayout return a new RAS_DisplayArrayLayout with the proper
    offsets. To recreate the attributes, RAS_AttributeArray::Clear is called when
    detecting a size update in RAS_DisplayArrayBucket::UpdateActiveMeshSlots.
    
    To summarize the advantages of using SoA are the cache friendly load, the
    possibility to update only modified data in VBO and the simplification of
    storing multiple vertex formats. But the inconveniences could be some old GPU
    limitation and the recreation of the VAO at each display array size update in
    modifier deformers.
    
    This patch was tested with 3 files :
    
    The first file is 1600 cubes of 384 faces deformed by an armature.
    If the cube have only the default UV and color layer :
    			Previous	Current
    Animation	9.6			6.3
    Rasterizer	17.5		10.8
    
    With 8 UV and color layers :
    			Previous	Current
    Animation	17.5		6.7
    Rasterizer	42.7		11.9
    
    The second and third files are about modification of vertex position from python
    or rendering a mesh with a huge amount of vertices, both files didn't show a
    time difference.
    panzergame authored Jun 22, 2018
    Configuration menu
    Copy the full SHA
    b6123cc View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    ed78298 View commit details
    Browse the repository at this point in the history
  3. UPBGE: Simplify RAS_Rasterizer::SetViewMatrix.

    Previously SetViewMatrix requested view matrix, position and scale. Position
    is useless at it could be found in the inverse view matrix which is computed
    anyway. Scale is not needed for users of this function not using any scale
    for example shadow and texture renderers.
    
    In consideration the user could call :
    SetViewMatrix(viewmat)
    SetViewMatrix(viewmat, scale)
    
    The second function test if the scale is negative and negate the rows of the
    view matrix.
    panzergame committed Jun 22, 2018
    Configuration menu
    Copy the full SHA
    11be475 View commit details
    Browse the repository at this point in the history
  4. UPBGE: Move RAS_Deformer in RAS_MeshUser. (#717)

    Previously the deformers were owned in BL_DeformableGameObject. But this place
    was not optimal for two reasons : first by design deformers are directly linked
    to the display array of the obejct mesh slots, RAS_MeshUser is the nearest level
    to the mesh slots of the object. Second a futur patch will allow fast mesh replace
    by switching of mesh user, to do so the mesh user must include its deformer to avoid
    recreating the current deformer for the current mesh user.
    
    By moving the the deformer in RAS_MeshUser, only a last frame variable stays in
    BL_DeformabelGameObject, this variable is then moved into BL_MeshDeformer and
    BL_DeformableGameObject is removed.
    Because this class is removed the function LoadDeformer is changed in BL_ConvertDeformer
    which returns a deformer for the given mesh and object, could be null.
    This last function is called in AddMeshUser and makes obsolete the replication
    of deformers as it is called after any object creation.
    The only drawback of avoid replication is to let all modifier deformers using
    unique derived mesh, this impact only non-dynamic derived mesh.
    
    Tested with sintel desert_level.
    panzergame authored Jun 22, 2018
    Configuration menu
    Copy the full SHA
    d2e0374 View commit details
    Browse the repository at this point in the history

Commits on Jun 27, 2018

  1. Configuration menu
    Copy the full SHA
    9b34b86 View commit details
    Browse the repository at this point in the history

Commits on Jun 28, 2018

  1. Configuration menu
    Copy the full SHA
    abbd135 View commit details
    Browse the repository at this point in the history

Commits on Jun 29, 2018

  1. Configuration menu
    Copy the full SHA
    aef8773 View commit details
    Browse the repository at this point in the history
  2. UPBGE: Fix group replication.

    The function AddInstanceObjects and SetDupliGroupObject must be called
    for every objects replicated by the group.
    panzergame committed Jun 29, 2018
    Configuration menu
    Copy the full SHA
    af34951 View commit details
    Browse the repository at this point in the history

Commits on Jun 30, 2018

  1. UPBGE: Avoid passing mat4 by value for windows compiler. (#722)

    Windows compiler doesn't support align specifier for function parameters,
    then use a reference and copy in the function body.
    panzergame committed Jun 30, 2018
    Configuration menu
    Copy the full SHA
    c157a52 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    06e4dd9 View commit details
    Browse the repository at this point in the history

Commits on Jul 1, 2018

  1. UPBGE: Fix UV and color update for deformer display array.

    RAS_DisplayArray::UpdateFrom should notify itself that some channels are
    modified.
    panzergame committed Jul 1, 2018
    Configuration menu
    Copy the full SHA
    f17538d View commit details
    Browse the repository at this point in the history

Commits on Jul 2, 2018

  1. UPBGE: Fix object auto bounds update.

    The clearing of the bounding box modified flag must
    happen after the function UpdateBounds is called indirectly
    in the culling pass.
    panzergame committed Jul 2, 2018
    Configuration menu
    Copy the full SHA
    ba30dbb View commit details
    Browse the repository at this point in the history

Commits on Jul 4, 2018

  1. UPBGE: Fix FuzzyZero for very small vectors. (#664)

    Previously FuzzyZero for vectors was comparing the squared length
    of the vector, but as it is a squared length the value are even
    more low for small values. To solve this issue the function should
    compare the length directly but this is too expensive.
    Instead the sum of all the absolute vector components and comparing
    the sum to float epsilon.
    panzergame committed Jul 4, 2018
    Configuration menu
    Copy the full SHA
    aac6b53 View commit details
    Browse the repository at this point in the history
  2. UPBGE: Move SG_Controller entirely in BL_Action. (#708)

    Previously SG_Controller were owned and updated by SG_Node. This class
    is not the best place for it as SG_Controller are not always modifying spatial,
    for example Light or Camera controllers.
    The best place is in BL_Action as this class was setting the simulation time
    and updating the controllers indirectly.
    
    In the same time the option "child" in action actuator which enabled recursive
    time update for controllers is removed. Indeed every call to SetSimulatedTime
    was followed by Update for the controllers in BL_Action.
    panzergame committed Jul 4, 2018
    Configuration menu
    Copy the full SHA
    8df1a72 View commit details
    Browse the repository at this point in the history

Commits on Jul 5, 2018

  1. UPBGE: Avoid updating polygon offset if the previous state is same.

    A state struct is introduced in RAS_Rasterizer and checked for functions
    SetPolygonOffset and SetFrontFace to reduce the OpenGL calls.
    panzergame committed Jul 5, 2018
    Configuration menu
    Copy the full SHA
    462e36b View commit details
    Browse the repository at this point in the history

Commits on Jul 7, 2018

  1. UPBGE: Replace LA_System by a simple clock.

    The only goal of this class was to provide the timing but STD clock
    do the same without carring about the platform. m_system in KX_KetsjiEngine
    is replaced by m_clock an instance of CM_Clock which exposes two functions
    one for second time and an other for nanosecond time.
    
    In the same time KX_TimeCategoryLogger is constructed with a reference
    to the engine clock to avoid passing the time for each log start / end
    function.
    panzergame committed Jul 7, 2018
    Configuration menu
    Copy the full SHA
    3ed74ca View commit details
    Browse the repository at this point in the history
  2. UPBGE: Use bullet 3 and support multithreading physics. (#721)

    The bullet library used by blender and game engine is update to the latest bullet 3
    version. Only minor modification were requeired for the switch.
    
    This bullet version allow multi threading for rigid body collision and constraints,
    the main world for this prupose is btDiscretDynamicsWorldMt. Unfortunatly this
    class doesn't manage soft bodies and to fill this gap btSoftRigidDynamicsWorldMt
    which is a copy of btSoftRigidDynamics on top of btDiscretDynamicsWorldMt.
    Once these modification the world is initialised with a special dispatcher and
    a constraint solver pool for multi threading. The solver pool own as many regular
    solver by threads available.
    
    A compatiblity issue is introduced in KX_CharacterWrapper, bullet now supports vector
    for the gravity instead of simple float, then a vector is exposed into the API.
    
    Tests:
    2700 spheres on two planes :
    		Previous	Current
    Begining	100ms		70ms
    Stable		21ms		7.5ms
    
    16000 point constraints on 10 cube chains.
    		Previous	Current
    		141ms		75ms
    panzergame authored Jul 7, 2018
    3 Configuration menu
    Copy the full SHA
    96148a6 View commit details
    Browse the repository at this point in the history

Commits on Jul 8, 2018

  1. UPBGE: Add debugbreak library.

    This library is useful in debugging to stop the debuger without raising a kill
    signal. This library try to as much as possible raise a trap signal.
    
    Its usage is simple:
    // First import the library, visible from alsmot anywhere.
    // Call a break
    debug_break();
    panzergame committed Jul 8, 2018
    Configuration menu
    Copy the full SHA
    fb9d84f View commit details
    Browse the repository at this point in the history

Commits on Jul 16, 2018

  1. Configuration menu
    Copy the full SHA
    f37a3f0 View commit details
    Browse the repository at this point in the history

Commits on Jul 17, 2018

  1. UPBGE: Fix for bug #746 Navmesh related (#752)

    Previously when the navmesh was removed from the object this one kept
    the OB_NAVMESH flag set and the engine tried without success to process
    it as a navmesh.
    
    Now OB_NAVMESH flag is removed.
    
    Additionally, Name for button "Navmesh Clear Data" is modified to
    "Remove Navmesh" to avoid possible misunderstandings.
    lordloki authored Jul 17, 2018
    Configuration menu
    Copy the full SHA
    8c94a3f View commit details
    Browse the repository at this point in the history

Commits on Jul 20, 2018

  1. Configuration menu
    Copy the full SHA
    7a791c9 View commit details
    Browse the repository at this point in the history

Commits on Jul 21, 2018

  1. Configuration menu
    Copy the full SHA
    1851639 View commit details
    Browse the repository at this point in the history

Commits on Jul 22, 2018

  1. UPBGE: Add scene.onRemove callback list

    The callback list is executed when the scene is removed.
    
    ```py
    def example(controller):
      scene = controller.owner.scene
    
      @scene.onRemove.append
      def callback(scene):
        print('removing scene "%s"' % scene.name)
    ```
    paul-marechal committed Jul 22, 2018
    2 Configuration menu
    Copy the full SHA
    f62dca6 View commit details
    Browse the repository at this point in the history

Commits on Jul 24, 2018

  1. UPBGE: Change default directories (#758)

    Changed `GHOST_SystemPaths::getSystemDir` and `GHOST_SystemPaths::getUserDir` implementations to use UPBGE specific folders.
    
    commit by @marechal-p 
    
    Fix #755.
    paul-marechal authored and lordloki committed Jul 24, 2018
    Configuration menu
    Copy the full SHA
    155b83a View commit details
    Browse the repository at this point in the history

Commits on Jul 25, 2018

  1. UPBGE: Avoid calling glGetUniformLocation while setting a uniform thr…

    …ough BL_Shader. (#733)
    
    All the setUniform functions in BL_Shader are using name to identify the uniform,
    these functions call RAS_Shader::GetUniformLocation.
    
    This last function was naively calling indirectly glGetUniformLocation, but even
    simple OpenGL calls cost more than caching.
    Fortunatly OpenGL allows to enumerate all active uniforms thanks to glGetActiveUniform,
    this function is used in GPUShader side inside function GPU_shader_get_uniform_infos
    constructing a list of GPUUniformInfo storing the uniform location, size, type and
    name.
    
    These uniform info are used in RAS_Shader::ExtractUniformInfos which insert the
    info in a map associating to the name the location, size and type> This map is then
    used into GetUniformLocation.
    
    Tested with a 4 uniforms shader and 1000 updates :
    Previous : 3.26ms
    Current : 2.88ms
    panzergame authored Jul 25, 2018
    Configuration menu
    Copy the full SHA
    18e5a96 View commit details
    Browse the repository at this point in the history
  2. UPBGE: Additional fixes to can compile under MacOS X (#761)

    Additional fixes to can compile under MacOS X related to TBB library detection and use abs instead of std::abs (not working right in Mac) for all OS
    lordloki authored Jul 25, 2018
    Configuration menu
    Copy the full SHA
    a18c4ac View commit details
    Browse the repository at this point in the history

Commits on Jul 28, 2018

  1. Configuration menu
    Copy the full SHA
    8f3ae99 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    f72f4c0 View commit details
    Browse the repository at this point in the history

Commits on Jul 30, 2018

  1. UPBGE: Implement BVH generation from KX_Mesh. (#736)

    The python function KX_Mesh.constructBvh now returns a new BVH Tree
    based on the mesh geometry where every indices elements of the tree
    correspond to the polygons indices.
    panzergame authored Jul 30, 2018
    8 Configuration menu
    Copy the full SHA
    59d33db View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    727c1fb View commit details
    Browse the repository at this point in the history

Commits on Jul 31, 2018

  1. 12 Configuration menu
    Copy the full SHA
    ce3a765 View commit details
    Browse the repository at this point in the history

Commits on Aug 2, 2018

  1. UPBGE: Implement dynamic object ligthing layer. (#734)

    Previously the ligthing of the objects based on a layer was fixed
    at the conversion time by the construction of BL_BlenderShader
    with the member m_lightLayer. Also because of the blender
    material managment the object layer was used only when binding
    the material and not when binding object dependent uniforms.
    
    The situation is changed firstly because the usage of one
    layer for all the object using the same material is totally wrong.
    Secondly the layers were not dynamic per object.
    
    To solve this situation the fastest way is to expose a layer into
    the shader, the function lamp_visible is designed for. It receives
    the lamp layer, object layer, lamp color and lamp energy and
    updates out color and energy if the lamp layer mask the object
    layer, to avoid branching the test computes a value of 0 or 1
    and multiply the color and energy by it.
    
    The object layer is defined as a material builtin uniform and
    each GPULamp holds a dynlayer used as a dynamic uniform.
    At each call to GPU_material_bind_uniforms the object layer
    is updated. Concerning the lamps the dynlayer value is updated
    in a preparing stage before rendering any material, this stage
    intents to update the textures and the lamps. The main caller
    is RAS_BucketManager::PrepareBuckets calling for each material
    the Prepare function redirected to BL_BlenderShader::UpdateLights.
    This last function is calling GPU_material_update_lamps which
    over all lamps update the "dyn" value for color and matrices.
    
    Inside GPU_material_bind the lamp layer is computed. As it is
    not the only way to decide of the visibility of a lamp, if the
    lamp is hidden or the layer is set to 0, else if the lamp is not
    using a "layer only" option then all layers are enabled, else if
    the layer is not in the scene layer the layer is set to 0
    else to the actual lamp object layer.
    
    As GPU_material_bind_uniforms now use the object layer,
    RAS_MeshUser store the layer of the object to allow BL_BlenderShader
    to get this value and send it to the GPU_ function.
    In the same time the calls to SetFrontFace are reduced to
    only updating when the object node transform changed.
    
    No performance win neither loss were noticed.
    panzergame authored Aug 2, 2018
    Configuration menu
    Copy the full SHA
    c024480 View commit details
    Browse the repository at this point in the history

Commits on Aug 5, 2018

  1. UPBGE: Use mathfu types in KX_MouseActuator.

    The usage of float array is replaced by mt::vec2 to have a better
    support of assignement and math operation, also the python attributes
    are modified to support mt::vec2.
    panzergame committed Aug 5, 2018
    Configuration menu
    Copy the full SHA
    8a844d9 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    11e3f98 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    44186f7 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    432ec8f View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    179edd8 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    1e658ce View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    3e11751 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    3f0e7b8 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    32a6eaa View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    b53c8bf View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    99feb54 View commit details
    Browse the repository at this point in the history

Commits on Aug 7, 2018

  1. UPBGE: Implement new Lamp Falloff (#768)

    * UPBGE: Implement new Lamp Falloff
    
    - Inverse Square Cutoff for Lamps. Describes here:
    https://imdoingitwrong.wordpress.com/2011/01/31/light-attenuation/
    
    Original code by @DCubix. Slightly modified by me to add light preview.
    
    New Radius & CutOff parameters exposed in UI when you select "Inverse Square CutOff" falloff type in point and spot lamps
    
    For feature request #728
    lordloki authored Aug 7, 2018
    Configuration menu
    Copy the full SHA
    b87fe29 View commit details
    Browse the repository at this point in the history

Commits on Aug 8, 2018

  1. UPBGE: Fix merging of bucket manager and text material.

    All texts are using a unique material per scene and so a unique
    material bucket and display array bucket. They both are owned
    by the bucket manager (RAS_BucketManager). In case of libload
    all the material buckets of the loaded scene are moved into the
    destination scene bucket manager.
    
    In case of text material the material bucket of the loaded was
    moved but also destructed when the loaded was freed at the end
    of the libload, this created an illegal memory access.
    
    To solve this issue, the only proper way found is to discard
    the material bucket dedicated to text when mergin the bucket
    manager and when merging the objects, for font objects force
    the recreation of the text user (RAS_TextUser) to be sure that
    this one is linked to the display array bucket for texts of the
    destination scene.
    
    Tested with valgrind.
    panzergame committed Aug 8, 2018
    Configuration menu
    Copy the full SHA
    bea452b View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    70f563e View commit details
    Browse the repository at this point in the history

Commits on Aug 10, 2018

  1. UPBGE: Use mt::mat4 for RAS_MeshUser::m_matrix.

    Previously it was a float array but some code is converting it
    back to mt::mat4. As mt::mat4 has a direct array acces the cost
    is the same as a float array.
    panzergame committed Aug 10, 2018
    Configuration menu
    Copy the full SHA
    ca264cb View commit details
    Browse the repository at this point in the history
  2. UPBGE: Fix compilation with MSVC2015

    Workaround for weird MSVC2015 compiler
    lordloki authored Aug 10, 2018
    Configuration menu
    Copy the full SHA
    be57887 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    9955dcd View commit details
    Browse the repository at this point in the history
  4. UPBGE: Fix mathutils callbacks registration.

    The assertion in Mathutils_RegisterCallback was raised when all the callbacks
    were registered (freestyle and bmesh too).
    But this assertion introduced in 1b74ec9 is wrong. The test i + 1 < MAX
    suppose that the last callback is a null sentinel. But this is not the
    case as no one is using this to stop a loop and the loop in
    Mathutils_RegisterCallback must stop when it find a null slot or that the
    slot is already containing the callback, otherwise it's an error.
    It's impossible to stop the loop with all regular slots registered and
    and different from the one intenting to register.
    
    Fix a part of issue #785.
    panzergame committed Aug 10, 2018
    Configuration menu
    Copy the full SHA
    f30d10d View commit details
    Browse the repository at this point in the history
  5. UPBGE: Fix gl_Color.

    gl_Color is set as the vertex color of the first color layer,
    this was broken by the addressu sage of RAS_DisplayArrayLayout::colors
    instead of RAS_DisplayArrayLayout::colors[0].
    
    Fix issue #784.
    panzergame committed Aug 10, 2018
    Configuration menu
    Copy the full SHA
    26c128f View commit details
    Browse the repository at this point in the history
  6. UPBGE: Fix switch warning.

    panzergame committed Aug 10, 2018
    Configuration menu
    Copy the full SHA
    b461aeb View commit details
    Browse the repository at this point in the history
  7. UPBGE: Remove regrettable tracked modification.

    These's modifications were pulled for unknown reason, sorry…
    panzergame committed Aug 10, 2018
    Configuration menu
    Copy the full SHA
    1dc0fc1 View commit details
    Browse the repository at this point in the history

Commits on Aug 12, 2018

  1. UPBGE: Refactor exit code managment.

    In the interest of futur way to start a game from a memory file,
    the exit information should not track only the file name but also
    more data.
    
    To do so the exit informations are standardized into the struct
    KX_ExitInfo which holds the exit code and the file name for the
    moment. This struct is stored into the ketsji engine and returned
    by KX_KetsjiEngine::GetExitInfo.
    
    Inside LA_Launcher::EngineNextFrame an exit code can be generated
    (only for window exit or exit key) and the exit info is returned.
    This same exit info is checked in LA_Launcher::EngineMainLoop
    when it contains a exit code different from NO_REQUESTS this function
    returns and so abort the launcher. Finally the creator of the
    launcher is using this exit info in case or restart or start to get
    the file name.
    
    In the same time the restoration of cursor visibility is moved into
    GPG_ghost and BL_KetsjiEmbedStart instead of the launcher.
    panzergame committed Aug 12, 2018
    Configuration menu
    Copy the full SHA
    2413cd4 View commit details
    Browse the repository at this point in the history

Commits on Aug 16, 2018

  1. Configuration menu
    Copy the full SHA
    2fdcf10 View commit details
    Browse the repository at this point in the history
  2. UPBGE: Avoid redundant state call to GL_CULL_FACE.

    The function SetCullFace now use a state from RAS_Rasterizer to skip
    unecessary opengl calls. Also the rendering of plane to screen is now
    using the function SetFrontFace instead disabling and renabling the
    face culling.
    panzergame committed Aug 16, 2018
    Configuration menu
    Copy the full SHA
    9fb0a3b View commit details
    Browse the repository at this point in the history
  3. UPBGE: Simplify texture blurring.

    The shader used to blur a texture was using ftransform for gl_Position
    and so it needed the modelview/prjection matrix to be set.
    This can be avoided by using gl_Vertex directly.
    panzergame committed Aug 16, 2018
    Configuration menu
    Copy the full SHA
    f1e625c View commit details
    Browse the repository at this point in the history

Commits on Aug 19, 2018

  1. UPBGE: Fix python main loop.

    The python main loop is using PythonMainLoopState struct to get the launcher
    and set the exit info, but the launcher wasn't set.
    panzergame committed Aug 19, 2018
    Configuration menu
    Copy the full SHA
    4a5055c View commit details
    Browse the repository at this point in the history
  2. UPBGE: Fix parallel creation of KX_Scene.

    Previously KX_Scene was parallelly created when libloading in asynchronous mode.
    But the constructor of KX_Scene is not adapted contrary to the conversion
    of the scene data.
    The first issue was related to the debug drawer that was initializing VBOs
    and VAOs, which is totally forbidden in a thread without OpenGL context.
    The second issue is the creation of the task pool using the engine task
    scheduler.
    
    To prevent any futur issues and as the constructor of the scene is cheap,
    its construction is moved in BL_Converter::LinkBlendFile when preparing
    the libload status. All the scenes are created via KX_KetsjiEngine::CreateScene
    and put in a list in KX_LibLoadStatus, this same list is read back in
    async_convert to call the conversion.
    
    Even if the debug draw (RAS_DebugDraw) construction is safe, its implementation
    RAS_OpenGLDebugDraw is not needed per scene as for each update all the
    VBOs are updated. To avoid duplicating simple VBO (e.g cube vertices and
    indices) per scene, only one implementation is stored in the rasterizer
    and the function FlushDebug permit to update the implementation VBO with
    the debug draw to render.
    panzergame committed Aug 19, 2018
    Configuration menu
    Copy the full SHA
    1acbbf7 View commit details
    Browse the repository at this point in the history
  3. UPBGE: Fix mesh user useless recreation.

    Previously both function AddReplicaObject and AddNodeReplicaObject
    (or DupliGroupRecurse and AddNodeReplicaObject) were calling
    AddMeshUser on the same objects. This led to a recreation
    of the RAS_MeshUser without freeing the previous one and also
    two bounding box were registered for the same object and the first
    was never freed.
    panzergame committed Aug 19, 2018
    Configuration menu
    Copy the full SHA
    a7c5a5f View commit details
    Browse the repository at this point in the history
  4. UPBGE: Handle non-threadable libloading data.

    As python is badly managing threading, it is better to delay any python call
    to the main thread. This situation happen in case of libload is python
    components are registered.
    
    The component conversion is moved into the function BL_PostConvertBlenderObjects
    which can later manage more than just the components. This function is
    called by BL_Converter::PostConvertScene based on a scene converter.
    Because the post conversion needs to iterate over all the objects, the scene
    converter expose a list of all the objects registered (active and inactive).
    
    The introduction of this new function helped to clarify the process of scene
    or data conversion.
    For a simple scene conversion without merge:
    - scene creation
    - conversion (BL_Converter::ConvertScene)
    - post conversion (BL_Converter::PostConvertScene)
    - finalizing data (BL_Converter::FinalizeSceneData)
    
    This procedure can be find in KX_KetsjiEngine::ConvertScene, FinalizeSceneData
    does less work than before as it is calling KX_BlenderMaterial::InitShader
    to create the shaders and so assume that all the data are using the correct
    scene. In consideration during a merge of scene an extra step is required
    to set the destination scene in the mesh and material. This is an effect of
    the BL_Converter::MergeSceneData which also merge to the destination SceneSlot
    the scene converter of the scene to merge.
    
    To summarize, in case of libload, the procedure is:
    - scene creation (optional)
    - conversion
    - post conversion (optional)
    - merging data (BL_Converter::MergeSceneData)
    - merging scene (KX_Scene::MergeScene) (optional)
    - finalizing data
    
    FinalizeSceneData is still called after the merging of the scene because the
    material shaders are depending of the scene state and especially the lamps
    contained by the scene used to generate the shader.
    panzergame committed Aug 19, 2018
    Configuration menu
    Copy the full SHA
    8765a15 View commit details
    Browse the repository at this point in the history

Commits on Aug 21, 2018

  1. UPBGE: Disable Cycles OpenCL for MacOSX

    This way we avoid crashes. It is a temporary solution.
    lordloki committed Aug 21, 2018
    Configuration menu
    Copy the full SHA
    8192377 View commit details
    Browse the repository at this point in the history

Commits on Aug 22, 2018

  1. UPBGE: Rename RAS_IPoly[gon]Material to RAS_IMaterial.

    There's no reasons to precise material to be for polygons, also the name
    was incorrect between file and class.
    panzergame committed Aug 22, 2018
    Configuration menu
    Copy the full SHA
    fcbde82 View commit details
    Browse the repository at this point in the history

Commits on Aug 23, 2018

  1. UPBGE: Load scripts and actions before converting scene during libload.

    Previously the scripts where loaded after the scene was converted and
    caused the python component conversion to failed because the script wasn't
    reachable at the import.
    
    This is fixed by moving the call to addImportMain before the scene conversion.
    Similar behaviour is applied for the actions.
    panzergame committed Aug 23, 2018
    1 Configuration menu
    Copy the full SHA
    7f35889 View commit details
    Browse the repository at this point in the history

Commits on Aug 25, 2018

  1. UPBGE: Clarify globalDict setting.

    Previously the "GameLogic" was get using PyDict_GetItemString inside initGamePython
    but decref at the end of the function. This is unsafe as the documentation of
    PyDict_GetItemString says that no incref is proceeded.
    In the same time PyModule_AddObject is used intead of manual insert in the
    module dictionnary.
    panzergame committed Aug 25, 2018
    Configuration menu
    Copy the full SHA
    3ce5565 View commit details
    Browse the repository at this point in the history

Commits on Aug 26, 2018

  1. UPBGE: Enable more compatible GLSL versions.

    This commit with the condition of ARB_compatiblity allow to select an higher GLSL version
    in the function gpu_shader_version.
    ARB_compatibility is needed as > GLSL 150 doesn't support builtin natives.
    panzergame committed Aug 26, 2018
    Configuration menu
    Copy the full SHA
    bf69125 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    2f49836 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    f1bae4d View commit details
    Browse the repository at this point in the history

Commits on Aug 27, 2018

  1. UPBGE: Add UPBGE version infos to bpy.app

    UPBGE version infos access from bpy (can be useful for addons)
    
    Feature request from Momel on discord
    youle31 committed Aug 27, 2018
    Configuration menu
    Copy the full SHA
    1450832 View commit details
    Browse the repository at this point in the history

Commits on Aug 28, 2018

  1. UPBGE: Set audiorate to 48000Hz by default

    48000Hz is the newer standard used in professional audio recording as it
    "works" better with multiple frame rates.
    
    Additionally, it solves the frequent "Error AL lib: UpdateDeviceParams:
    Failed to set 44100hz, got 48000hz instead" raised in a lot realtek,
    intel, nvidia integrated sound cards (some of them even with crash).
    
    And it seems to works better with HRTF binaural sound (in me own TODO
    list)
    
    TODO: To make this value configurable by user
    lordloki committed Aug 28, 2018
    Configuration menu
    Copy the full SHA
    6e8870b View commit details
    Browse the repository at this point in the history

Commits on Aug 30, 2018

  1. UPBGE: Fix orthographic camera getScreenRay.

    Previously the function getScreenRay was adapted to only perspective
    cameras because the ray cast was always starting from the center of
    the camera.
    In case of orthographic the ray cast should start from a point unprojected
    from the near plane and continue to in the direction of the camera
    (-Z orientation axis).
    This is proceeded in getScreenRay and the indirect call to getScreenVect
    is removed.
    
    Fix issue #765.
    panzergame committed Aug 30, 2018
    Configuration menu
    Copy the full SHA
    229ff4e View commit details
    Browse the repository at this point in the history

Commits on Aug 31, 2018

  1. Readme Updated

    I added an image in the readme, made some adjustments and added a release notes link.
    UnidayStudio committed Aug 31, 2018
    Configuration menu
    Copy the full SHA
    86460ea View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    1f94f02 View commit details
    Browse the repository at this point in the history

Commits on Sep 1, 2018

  1. UPBGE: Enable occluder for invisible objects. (#808)

    Previously objects were considered as occluder if the occluder option
    was checked and that the object was visible. The last constraint is
    bothering for the user that could define a simplified mesh for occlusion
    that naturally will not be visible.
    
    This commit is introducing the condition "visible || occluder" for the
    call activating the graphic controller in KX_GameObject::SetVisible/
    SetOccluder and the initialization of the graphic controller.
    
    Fix issue #807.
    panzergame authored Sep 1, 2018
    Configuration menu
    Copy the full SHA
    fa68fed View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    7cf667d View commit details
    Browse the repository at this point in the history
  3. UPBGE: Improve component UI. (#795)

    Previously the components name was exposed by a property non-editable which
    was rendered in light gray and the component box was always expanded.
    Also the module name was inaccesible from bpy.
    
    The last issue is simply solved by exposing the "module" string to RNA.
    The name property is replaced by a label in the UI. To expanse the box
    the property "show_expanded" similar to the logic brick is implemented,
    when this property is True, an inner box is generated containing all the
    properties.
    
    Fix issue #793.
    panzergame authored Sep 1, 2018
    Configuration menu
    Copy the full SHA
    af46b84 View commit details
    Browse the repository at this point in the history
  4. UPBGE: Cleanup UI. (#772)

    Some unused options/entities are removed from the UI in game engine mode:
    - scene keying set
    - speaker and force field in add menu
    
    The game engine is renamed UPBGE and the audio panel under scene tab is siplified
    to expose only the speed of sound, doppler factor and the distance model, these
    attributes are used by LA_Launcher to initialize the AUD_Device.
    
    Fix issue #756.
    panzergame authored Sep 1, 2018
    Configuration menu
    Copy the full SHA
    6065fbd View commit details
    Browse the repository at this point in the history
  5. UPBGE: Fix cmake error on windows

    code picked from BF sources
    youle31 committed Sep 1, 2018
    Configuration menu
    Copy the full SHA
    0279840 View commit details
    Browse the repository at this point in the history
  6. UPBGE: Allow constructing mesh BVH with a transform. (#810)

    The function KX_Mesh.constructBvh can now use as first argument
    a transform 4x4 matrix used over all the vertices. This allow
    the user to create a BVH in world space by passing the object
    world transform.
    
    Fix issue #786.
    panzergame authored Sep 1, 2018
    Configuration menu
    Copy the full SHA
    b7105d0 View commit details
    Browse the repository at this point in the history

Commits on Sep 2, 2018

  1. UPBGE: Fix default auto exec option for new created user prefs. (#809)

    When the user pref config isn't saved, blender load one from memory and
    call the function BLO_update_defaults_userpref_blend to initialize properly
    the preferences such as the auto exec script option defaulted to true.
    
    Unfortunatly this function is called after the check of the option
    and so for blender auto exec is always false until the user saves the
    preferences and reload.
    
    Also the cmake option WITH_PYTHON_SECURITY is defaulted to OFF to avoid
    new users compiling the software been blocked by this it.
    panzergame authored Sep 2, 2018
    Configuration menu
    Copy the full SHA
    3883d6a View commit details
    Browse the repository at this point in the history
  2. UPBGE: Change startup file and default theme. (#814)

    Since ever UPBGE was starting a startup file from blender that was adapted only
    to blender with the selection of "Blender Render" and the shading to solid (non-GLSL).
    
    As UPBGE is designed for game, the new startup include:
    - select the proper render engine to "Blender Game"
    - logic editor is exposed with component tab expanded
    - default component in Cube
    - physics static for Plane and Cube
    - shadow PCF from sun light
    - back lighting with 2 hemi
    - environment lighting
    - blue color on Cube
    - MSAA 4x
    - script editor exposed at bottom
    - world background
    - framerate and profiler
    
    The theme is also changed to a flat dark theme proposed by @Momel15.
    This theme is named "upbge" and select by default in the startup.
    
    Fix issue: #742.
    panzergame authored Sep 2, 2018
    1 Configuration menu
    Copy the full SHA
    08b0874 View commit details
    Browse the repository at this point in the history
  3. UPBGE: Implement color management option. (#777)

    Previously the color management was always of sRGB and the user had no control
    over it. To fill this gap the user should have the ability to define the final
    color space, linear or sRGB.
    
    First of all an option named "Color Management" in a new tab under Render panel
    is added, it can be "Linear" or "sRGB", the default is "sRGB", When game engine
    is selected changing this option will force the recompilation of all shaders and
    they will add or remove color space conversion at the end of the shader.
    
    In game the color space is not managed at the shader level, but at the final
    copy of the offscreen to the screen. Firstly the material in game must disable
    the color management, this is done by a new set of flags passed to
    GPU_material_from_blender or GPU_material_world and the flag
    GPU_MATERIAL_NO_COLOR_MANAGEMENT.
    Secondly the three shaders used to copy the offscreen to screen (normal, stipple
    stereo, anaglyph stereo) now have a sRGB version including a call to
    linearrgb_to_srgb enabled by the macro COLOR_MANAGEMENT.
    The color space used is stored in the rasterizer in enum variable
    m_colorManagement for linear and sRGB, this variable is used to select the
    correct shader to bind before flushing to screen.
    
    Because the linear to sRGB conversion is not anymore using a float value with
    the highest precision at the output of the fragment shader, the texture
    format GL_RGBA8 is introducing bands because of its poor resolution. Replacing
    it by GL_RGBA12 prevents the bands.
    
    In the same time the color management used in KX_FontObject or KX_WorldInfo is
    now obsolete and removed, also KX_WorldInfo is getting GPUMaterial only in new
    function ReloadMaterial called by the FinalizeSceneData such as material shaders
    and by setMaterialGLSL.
    panzergame authored Sep 2, 2018
    Configuration menu
    Copy the full SHA
    552bf8e View commit details
    Browse the repository at this point in the history
  4. UPBGE: Fix scene replacement.

    The commit f62dca6 introduced a remove of the replaced
    scene in the scene list, this call is unnecessary as
    EXP_ListValue::SetValue is swapping the values.
    The drawback of RemoveValue was to reduce the size of the
    container by actually erasing the item.
    
    This is fixed by not removing the scene but only replacing
    its pointer.
    
    Fix issue: #819.
    panzergame committed Sep 2, 2018
    1 Configuration menu
    Copy the full SHA
    60b5dc4 View commit details
    Browse the repository at this point in the history

Commits on Sep 5, 2018

  1. Configuration menu
    Copy the full SHA
    04b7275 View commit details
    Browse the repository at this point in the history

Commits on Sep 9, 2018

  1. UPBGE: Rename async parameter from LibLoad as is a reserved word (#827)

    Rename async parameter from LibLoad as is a reserved word in Python 3.7
    
    A note will be included in Release notes as this breaks compatibility with old scripts.
    lordloki authored Sep 9, 2018
    Configuration menu
    Copy the full SHA
    1959ed2 View commit details
    Browse the repository at this point in the history

Commits on Sep 10, 2018

  1. UPBGE: Renable Cycles in startup file.

    The option in user prefs enabling cycles UI wasn't checked in startup.
    
    Fix issue: #823.
    panzergame committed Sep 10, 2018
    Configuration menu
    Copy the full SHA
    a6dd6cc View commit details
    Browse the repository at this point in the history
  2. UPBGE: Fix startup theme.

    The noodle curving is set to 5 (like default themes) and regular inner widget color
    is set to a darker color to avoid invisible box in layer popup.
    
    Fix issue: #823.
    panzergame committed Sep 10, 2018
    Configuration menu
    Copy the full SHA
    30b4e06 View commit details
    Browse the repository at this point in the history
  3. UPBGE: Fix RNA for object logic states.

    The function rna_GameObjectSettings_used_state_get and rna_GameObjectSettings_state_get
    were previously using an array of ints, a blender commit changed it to an array
    of bools but forgotten to change the initialization of the arrays on these two
    functions. The initialization is using memset and using the previous size for
    int is creating a overflow smashing the program stack.
    
    This issue is fixed by using sizeof(bool).
    panzergame committed Sep 10, 2018
    Configuration menu
    Copy the full SHA
    b5ae732 View commit details
    Browse the repository at this point in the history

Commits on Sep 11, 2018

  1. UPBGE: Fix lamp layer.

    Previously the layer send to the shader is non-zero and so checked with object
    layer when:
    The lamp is visible OR the lamp is in view layers.
    
    But the correct behaviour is:
    The lamp is visible AND the lamp is in view layers.
    
    So that all lamps in layers not selected by view will not affect any objects
    even one sharing a layer with the lamp.
    
    To restore this behaviour the dynlayer is set to 0 also when
    lamp->lay & viewlay is 0.
    
    Fix issue: #831.
    panzergame committed Sep 11, 2018
    Configuration menu
    Copy the full SHA
    0f27b92 View commit details
    Browse the repository at this point in the history

Commits on Sep 14, 2018

  1. UPBGE: Sleep when frame time is smaller than fixed frame time. (#803)

    Previously when the frame time was too fast the function KX_KetsjiEngine::NextFrame
    concluded that 0 frames have to be proceeded and done nothing. This function was
    called until the elapsed time was suffisent to process a frame.
    
    This approch is naive, robust and precise but introduce an high CPU usage because
    of the extra calls to KX_KetsjiEngine::NextFrame setting the CPU to it's maximum.
    
    To avoid this high usage, the elapsed time to the next frame is computed and the
    main thread sleep of this time.
    panzergame authored Sep 14, 2018
    Configuration menu
    Copy the full SHA
    0f395ce View commit details
    Browse the repository at this point in the history

Commits on Sep 16, 2018

  1. Configuration menu
    Copy the full SHA
    1f2d587 View commit details
    Browse the repository at this point in the history

Commits on Sep 19, 2018

  1. Configuration menu
    Copy the full SHA
    327a40b View commit details
    Browse the repository at this point in the history

Commits on Sep 21, 2018

  1. UPBGE: Fix planar world background render.

    Previously the world background render was disabling the culling face
    to render te background triangle without caring about face settings.
    This was changed into setting front face to CCW.
    But the side effect of using front face setting, RAS_Rasterizer::SetFrontFace,
    was that this function is inversing the face if m_invertFrontFace or
    m_camnegscale is true and this was the case for m_invertFrontFace when
    rendering a plane texture.
    
    Practically, the front face was CW and the world background wasn't rendered.
    
    To fix this issue SetFrontFace is replaced back to SetCullFace and a
    comment is left.
    panzergame committed Sep 21, 2018
    Configuration menu
    Copy the full SHA
    1ae2bb8 View commit details
    Browse the repository at this point in the history
  2. UPBGE: Fix color management of realtime texture map.

    Realtime texture map (planar, cube map) were supporting conversion from
    sRGB to linear as they were treated like textures (always using sRGB space).
    
    But as the material used by the game engine now left the color management
    conversion, the realtime map were directly impacted. The results was wrong
    as the realtime textures were supposed sRGB.
    
    To solve this issue the gpu node srgb_to_linearrgb should be deactivated
    also for game materials in case of realtime env map. Theses conditions
    are written in new function tex_do_color_management.
    panzergame committed Sep 21, 2018
    Configuration menu
    Copy the full SHA
    ec47029 View commit details
    Browse the repository at this point in the history

Commits on Sep 23, 2018

  1. UPBGE: Fix for compiling under Ubuntu 16.04

    Avoid non defined operator "*=" for Mathfu. It expects Math vector and
    float
    lordloki committed Sep 23, 2018
    Configuration menu
    Copy the full SHA
    fcac531 View commit details
    Browse the repository at this point in the history

Commits on Sep 24, 2018

  1. Configuration menu
    Copy the full SHA
    ea47f66 View commit details
    Browse the repository at this point in the history

Commits on Sep 28, 2018

  1. UPBGE: Fix uninitialized angular boolean variable for motion actuator

    Maybe was deleted in a old merge
    lordloki committed Sep 28, 2018
    Configuration menu
    Copy the full SHA
    a034f28 View commit details
    Browse the repository at this point in the history

Commits on Sep 29, 2018

  1. UPBGE: Fix compilation of builtin sobel filter.

    "sample" is now reserved by OpenGL and so renamed "samples".
    panzergame committed Sep 29, 2018
    Configuration menu
    Copy the full SHA
    14cbaf0 View commit details
    Browse the repository at this point in the history
  2. UPBGE: Fix uniform caching of arrays. (#844)

    Since uniform caching the user was unable to precise the name of
    an uniform array item such as colors[42].
    
    This is caused by an ambiguity in the OpenGL function glGetActiveUniform
    regarding arrays. If the arrays is of struct type then all the items are
    returned by glGetActiveUniform. Else for simple array in main program
    of in struct but of primitive type, then only the first element is
    returned e.g colors[0].
    
    Two choices were proposed:
    - Detecting the array name format and discard caching mechanism while
    asking for a location.
    - Simulating all item names and store all theirs locations.
    
    The second option is selected in this commit for multiple advantages
    over the first:
    - Detecting the format of an array name could be complicated as the
    program have to manage the case the user is provinding syntaxically
    erronous name.
    - The current cache is currently getting the location manually for
    active uniforms, doing it for arrays is in average not a big amount
    of extra work.
    - GLSL is limiting big native arrays (rarely up to 100) which limit
    the number of locations to retrieve.
    - GLSL allow getting the location for "colors" which is an ignored
    alias for "colors[0]" by glGetActiveUniform, so this case needed
    to be taken in account to ignore caching.
    
    In consideration the caching look up it optimized by using a sorted
    vector and a binary search. std::unordered_map is doing an similar
    work but do more like caching the uniform name where for searching
    only the name hash matter.
    
    This is applied in RAS_Shader::ExtractUniformInfos. If an active
    uniform is suppoed array from OpenGL information, the base name is
    generated (e.g "colors") and then all the names from indices
    (e.g "colors[1]", "colors[2]"). Non-array uniforms are proceeded
    as before.
    UniformInfo is constructed using the name and shader, the constructor
    hash the name and obtain the uniform location.
    Then the uniforms are sorted using the name hash value in UniformInfo.
    
    RAS_Shader::GetUniformLocation now uses std::lower_bound to process
    a binary search.
    
    Fix issue: #822.
    panzergame committed Sep 29, 2018
    Configuration menu
    Copy the full SHA
    9ec06bb View commit details
    Browse the repository at this point in the history
  3. Revert "UPBGE: Fix default threshold for alpha clipping."

    This reverts commit 2f49836.
    
    Alpha blending (alpha blend or alpha sort) is insensible to user preference
    alpha threshold which is used only for alpha clip.
    panzergame committed Sep 29, 2018
    Configuration menu
    Copy the full SHA
    8726deb View commit details
    Browse the repository at this point in the history
  4. UPBGE: Set frame step to elapsed time in case of external clock. (#840)

    Previously the time step (base of frame step) was set to the
    fixed frame step (1 / FPS * scale) when the user was using external
    clock (setting the clock manually).
    
    This commit introduces a different behaviour: the timestep is the
    elapsed time bewteen two clock set of the user.
    panzergame authored Sep 29, 2018
    Configuration menu
    Copy the full SHA
    b9001b9 View commit details
    Browse the repository at this point in the history
  5. UPBGE: Fix navmesh rebuild after mesh replacement. (#778)

    Previously the navmesh rebuilding was failing because of two issues,
    first the mesh used as source was always the one from the blender object
    secondly the navmesh itself wasn't updated in the obstacle simulation.
    
    To solve this first issue the function BuildVertIndArrays is calling
    two sub functions, BuildFromDerivedMesh for creating from a derived
    mesh and benefit from CD_RECAST layer, if this function fails to get
    the recast layer BuildFromMesh is called and generate information from
    a RAS_Mesh without detailed meshes.
    In this last function the indices computation is solved by the requirement
    of Detour library to use 6 indices per polygon, the unused indices are
    discarded by value 0xFFFF.
    
    The second issue is solved by calling AddObstaclesForNavMesh only from
    KX_NavMeshObject::BuildNavMesh, this call is preceded by a call to
    DestroyObstacleForObj intenting to remove the previous obstacle
    associated to this navmesh.
    
    Fix issue #633.
    panzergame authored Sep 29, 2018
    Configuration menu
    Copy the full SHA
    5b8cb1e View commit details
    Browse the repository at this point in the history
  6. UPBGE: Fix geometry instancing ligthing. (#847)

    In recent commit material object layer was introduced as an uniform used
    to compute light visibility. But the geometry instancing wasn't defaulting
    this layer (bad option) or setting it with an instance attribute (best option).
    
    In consideration RAS_InstancingBuffer must prepare a buffer with layer data
    packed in.
    The instancing attributes could be just extended but this will introduce
    performance decrease for all other cases not using layer (shadow/wire) same
    as the object color attribute is doing currently.
    To avoid this drawback, RAS_InstancingBuffer is configured for a combination
    of attributes and uniquelly stored per drawing mode.
    
    The attributes deserve object color (COLOR_ATTRIB) or object layer
    (LAYER_ATTRIB). Position and matrix attributes are defaulted (DEFAULT_ATTRIBUTE).
    The attributes is determined by RAS_IMaterial::GetInstancingAttrib forwarding
    to BL_BlenderShader::GetInstancingAttrib.
    Each of these instancing buffers are stored into an array in RAS_DisplayArrayBucket.
    UpdateActiveMeshSlots is selecting the instancing buffer according the
    current drawing mode and link it in render node data.
    
    In the shader part, the binding of attributes is simplified by passing
    RAS_InstancingBuffer directly to RAS_IMaterial or RAS_Rasterizer instead
    of each offsets.
    GPU_material_instancing_bind_attrib and GPU_shader_bind_instancing_attrib
    now receive an offset for layer attribute.
    Finally calls to GPU_bultin are replaced by material_builtin which check
    if the material is using instancing and if so translate attributes depending
    on object transform, color or layer.
    
    Concerning memory packing, RAS_InstancingBuffer is now using a SoA pattern,
    the offsets are computing in Update function.
    
    Fix issue #830.
    panzergame authored Sep 29, 2018
    Configuration menu
    Copy the full SHA
    e2fde22 View commit details
    Browse the repository at this point in the history
  7. UPBGE: Fix batching.

    The function RAS_DisplayArray::GetLayout must not guess m_vertexInfos
    has as many items as vertices because batching arrays are not using this
    memeber.
    m_vertexData.positions is prefered to get the vertices count.
    panzergame committed Sep 29, 2018
    Configuration menu
    Copy the full SHA
    e1b316a View commit details
    Browse the repository at this point in the history
  8. UPBGE: Fix bge.render.[get/set]Vsync. (#834)

    Previously bge.render.getVsync wasn't returning the value set by setVsync when
    VSYNC_ADAPTIVE was used. It can be justified by the fact that adaptive is set
    by using a negative swap interval value but the GLX get function still returns
    a positive swap interval value and the flag GLX_LATE_SWAPS_TEAR_EXT meaning
    adaptive is enabled.
    
    In any case GLX could refuse a swap interval and the user should be able to do
    setVsync(getVsync()) with no change on the swap control. To achieve this behaviour
    RAS_ICanvas store the current swap control in a enum variable m_controlSwap,
    this variable is used in getter GetSwapControl used by bge.render.getVsync().
    The setter is virtual and overloaded in each canvas implementation, they use
    a common table to find the swap interval associated to the swap control mode:
    RAS_ICanvas::swapInterval.
    
    Finally KX_PythonInit is using swap control enum value from RAS_ICanvas instead
    of the one from DNA to avoid conversions.
    
    Fix issue #820.
    panzergame authored Sep 29, 2018
    Configuration menu
    Copy the full SHA
    dbff6df View commit details
    Browse the repository at this point in the history

Commits on Oct 1, 2018

  1. Update splashscreen.

    Update splash screen with unidaystudio car game image.
    panzergame committed Oct 1, 2018
    Configuration menu
    Copy the full SHA
    1ce41ee View commit details
    Browse the repository at this point in the history
  2. UPBGE: Fix get uniform location.

    std::lower_bound is returning the element just lower or equal. We must
    check that the element is not an invalid iterator and that the element
    is equal to the value searched and not just lower.
    panzergame committed Oct 1, 2018
    Configuration menu
    Copy the full SHA
    bde85e2 View commit details
    Browse the repository at this point in the history
  3. UPBGE: Fix and simplify frame time management. (#852)

    Previously a commit introduce for external clock the targeting of one frame
    at every call to NextFrame, not more.
    The original behaviour is if the user enabled fixed framerate then compute
    as many as frame possible respecting the FPS value (m_ticrate).
    This behaviour is restored in the refactor.
    
    The refactor is simplyfing the time calculation and isolating it.
    The function KX_KetsjiEngine::GetFrameTimes is returning a struct FrameTimes
    with the number of frames to proceed and the time/frame step.
    Inside this function we first update the clock time if the user isn't (case
    of external clock) then the elapsed time is computed. Next the timestep and
    frame number are computed using fixed value or elapsed time. The number of frame
    is clamped by max logic/physics frame using the simple method: If the
    number of frame is higher than the maximum for logic or physics, then clamp
    it and set timestep to the elasped time (which is always greater than fixed
    time step 1/FPS) divided by the maximum number of frames.
    Finally if the user is not using fixed framerate update the previous clock
    else if the number of frames to proceed is zero sleep.
    Issue were noticed using a sleep, they were caused by the resolution of the
    sleep which is about some ~10us, to fix this a part of the sleep is consumed
    with std::this_thread::sleep_for and the rest is busy wait.
    
    CM_Clock has now a function Reset to ensure it starts from 0, this is useful
    for external clock starting at 0.
    panzergame authored Oct 1, 2018
    1 Configuration menu
    Copy the full SHA
    e9b0780 View commit details
    Browse the repository at this point in the history
  4. UPBGE: Fix issues on LibFree/LibLoad. (#824)

    The issue #805 reported a bug relative to LibLoad and LibFree. This bug is
    reproduced by using two scenes which both use meshes without material (so using
    defmaterial) and the first scene LibLoad and merge the second. What is happening
    is that the new created scene will contain a RAS_MaterialBucket of defmaterial
    which is also used by the host scene, but defmaterial is not owned by any file
    as it's a global default material.
    The technique used by LibFree was to tag all ID structs (data, e.g Mesh,
    Material, Object) of a Main (the file loaded) and remove them from scenes and
    users. In the situation of defmaterial, this struct is never tagged and so never
    removed during LibFree. This resulted in a material always existing but all the
    light objects used were removed and the function GPU_material_update_lamps
    called in material preparation before rendering raise an illegal memory access
    as it was iterating on freed lamps.
    
    To solve this issue we have to find a way to remove all game engine data that
    were created during the conversion of a libloaded scene. And the minor task is
    avoiding end up with only a part of scene materials using all present lights.
    
    The first point is solved by the introduction of a resource base class:
    BL_Resource. The goal of this class is to store an identifier of the library
    source of converted data. This identifier is opaque type Bl_Resource::Library
    and the function BL_Resource::Belong(Library) returns true when the passed
    library identifier match the one of the resource.
    The classes inheriting from BL_Resource are:
    - BL_ConvertObjectInfo
    - KX_Mesh
    - KX_BlenderMaterial
    - BL_ActionData
    
    All these resource types are registered in BL_SceneConverter where all
    registering function set the library identifier from the one passed to
    BL_SceneConverter constructor. From LinkBlendFile, ConvertMeshSpecial and
    ConvertScene(KX_Scene *scene) (the functions creating a scene converter)
    BL_SceneConverter is created using as library identifier the Main pointer of the
    current file or the loaded file, this way we also ensure that all linked data of
    a file will be owned by the same library. Other than that the loading changed by
    the call of the function ReloadShaders to reload all shaders of a merged scene:
    the new and old shaders, to benefit of all existing lights.
    
    Concerning LibFree, the first modification is to delay the free to the end of
    the frame instead doing it instantly. To achieve it, FreeBlendFile(const
    std::string& path) stores the library path to free in m_freeQueue if the library
    exists and the function ProcessScheduledLibraries process the merging of the
    libloads and the free of libraries, this final function is called in
    KX_KetsjiEngine::NextFrame at the end of each logic frame.
    The actual library free takes place in FreeBlendFileData. It iterates over all
    scenes and objects, if the object convert object info belongs to the free
    library the object is removed else KX_GameObject::RemoveResources is called.
    Finally the materials, meshes and actions of the library are removed from scene
    data slots (m_sceneSlots). KX_GameObject::RemoveResources is removing all the
    meshes that belong to the library or using materials from the library, and do
    the same for actions currently played.
    Previously BL_ActionManager was also impacted by LibFree as it was using
    bAction, now the actuator is using a action name to remove this complexity when
    freeing an action.
    
    Some modifications were introduced to ease the libfree. The class BL_ActionData
    is used to wrap bAction and link the BL_ScalarInterpolator of the action. All
    the actions are converted and registered during scene conversion as the cost is
    negligeable.
    When a RAS_Texture is free (indirectly by material free while lib free) if the
    renderer is non null, then the texture unregister itself from the renderer, this
    mechanism of texture users is near to be obsolete.
    
    Shader are now recompiled when merging and freeing a library to ensure that the
    lights are properly used, the function BL_Covnerter::ReloadShaders is dedicated
    for and call KX_BlenderMaterial::ReloadMaterial that can reload the shader or
    create a new one if it wasn't initialized.
    
    While reviewing and testing #805, two bugs were noticed. First the animations
    were not merged in the targeted scene, second the textures could be initialized
    in the conversion thread whithout opengl context.
    
    The first report is fixed by in case of scenes merging creating a converter
    which aim the conversion of animations of all scenes to merge, the function
    BL_ConvertActions is called with this converter and convert all actions
    from a library.
    The second issue is resolved by moving the call to InitTextures in
    KX_BlenderMaterial::ReloadShader which is the only place called synchronously
    during material conversion.
    
    Fix issue #805.
    panzergame authored Oct 1, 2018
    Configuration menu
    Copy the full SHA
    b225cb5 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    a678430 View commit details
    Browse the repository at this point in the history

Commits on Oct 2, 2018

  1. UPBGE: Fix capsule shape dimensions.

    The height in new version of bullet changed from height including radius on corners
    to height of the cylinder part.
    
    The hiehg tis adapted by removing the radius from the half extend bounds.
    panzergame committed Oct 2, 2018
    Configuration menu
    Copy the full SHA
    607351f View commit details
    Browse the repository at this point in the history

Commits on Oct 3, 2018

  1. UPBGE: Fix conversion of realtime maps. (#857)

    The issue #855 reports a bug related to the cube and planar map, this is explained
    by the fact that the texture renderers try to convert before the textures are
    available.
    The texture are converted in reload material step which is proceeded after conversion
    and post conversion. In the same time leaving texture renderer conversion the ability
    to be mutlithread could be very dangerous as they could create FBO and manipulate
    any other OpenGL setting for initialization.
    
    The issue is solved by making KX_BlenderMaterial::InitTextures public and call it
    into post conversion step and move after in the same step the conversion of
    texture renderers.
    
    As the scene converter is constant in post conversion (it's forbidden to create
    data but allowed to modify) the function starting with Find are now constant and
    their bodies is adapted to avoid implicit insert in std::map.
    
    Fix issue #855.
    panzergame authored Oct 3, 2018
    Configuration menu
    Copy the full SHA
    eebb46f View commit details
    Browse the repository at this point in the history

Commits on Oct 4, 2018

  1. UPBGE: Disable SNDIO library

    This way we can build good static libs under Ubuntu 16.04
    lordloki committed Oct 4, 2018
    Configuration menu
    Copy the full SHA
    ad24de4 View commit details
    Browse the repository at this point in the history

Commits on Oct 5, 2018

  1. UPBGE: Fix character collision detection. (#866)

    Chracter controller is using a ghost object and in particular
    a ghost object caching collision pairs named btPairCachingGhostObject.
    But with the recent update of bullet, we realized after some bug
    reported around character that the caching of collision is not
    anymore supported in a safe way.
    
    Instead of fixing the caching mechanism, it was choose to replace
    btPairCachingGhostObject by btGhostObject.
    
    The btGhostObject is already maintaining a cache of object overlapping
    the only step added is asking the pair cache in the world dispatcher
    for the character ghost and one of its overlapping objects.
    By this way the character is just reading and not managing duplication
    or deletion of manifold in its own cache which is the safest solution.
    
    In the same time the function btSequentialImpulseConstraintSolver::getOrInitSolverBody
    is not handling ghost object but only soft, rigid, kinematic and multibody.
    An assert is disabled with the adjonction of ghost type check.
    
    Fix issue #838.
    panzergame authored Oct 5, 2018
    Configuration menu
    Copy the full SHA
    8d97bab View commit details
    Browse the repository at this point in the history
  2. UPBGE: Set blenderplayer python stdout encoding to UTF-8.

    Follow stdout utf-8 setting in BPY_python_start.
    panzergame committed Oct 5, 2018
    Configuration menu
    Copy the full SHA
    ae8e12a View commit details
    Browse the repository at this point in the history

Commits on Oct 6, 2018

  1. UPBGE: Fix "value in inputs[x].[queue/values/status]"

    EXP_ListWrapper wasn't constructed with flag FLAG_FIND_VALUE which is
    allowing to do python comparaison when searching for a value in a container.
    
    List such as queue, values and status are most of the times used this
    way.
    The flag is restored.
    
    Fix issue #873.
    panzergame committed Oct 6, 2018
    Configuration menu
    Copy the full SHA
    0513b96 View commit details
    Browse the repository at this point in the history

Commits on Oct 9, 2018

  1. Configuration menu
    Copy the full SHA
    006d60e View commit details
    Browse the repository at this point in the history
  2. UPBGE: Fix for #797 (#869)

    Introduce a new array of GPUType sizes to avoid a buffer overrun when we introduce new elements in GPUType.
    The new array will allow make the system extensible easier.
    More comments added.
    
    P.D. It fixes the win32 crash.
    lordloki authored Oct 9, 2018
    Configuration menu
    Copy the full SHA
    683c104 View commit details
    Browse the repository at this point in the history

Commits on Oct 12, 2018

  1. UPBGE: Downgrade bullet to 2.87.

    After some issues in recent UPBGE version, it was prefered to use a release
    of bullet instead of its master version. The latest release is 2.87.
    
    In the same time the patches are updated in extern/bullet/patches with
    the adjonction of a patch for character fix and an other for soft rigid
    multithread world.
    panzergame committed Oct 12, 2018
    Configuration menu
    Copy the full SHA
    3f296eb View commit details
    Browse the repository at this point in the history
  2. UPBGE: Fix property and file name string size for components.

    Attributes PythonComponentProperty::[name/strval] and
    PythonComponent::[module/name] were not of the size they handle
    for maximum, whether 1024 for file name and 128 for property
    string.
    
    These size are properly set in this commit.
    
    Fix issue: #883.
    panzergame committed Oct 12, 2018
    Configuration menu
    Copy the full SHA
    086255e View commit details
    Browse the repository at this point in the history

Commits on Oct 14, 2018

  1. UPBGE: Additional fix for #797

    We use GPU_DATATYPE_SIZE to avoid pass info from outside of array
    lordloki committed Oct 14, 2018
    Configuration menu
    Copy the full SHA
    f169853 View commit details
    Browse the repository at this point in the history
  2. UPBGE: Add documentation example for mouse center normalization. (#889)

    The issue #865 reported a recurrent user issue concerning the normalization
    of mouse coordinates. The user must be aware to use floor division and normalized
    by dividing by width or height minus 1.
    
    Fix issue: #865.
    panzergame authored Oct 14, 2018
    Configuration menu
    Copy the full SHA
    914c82e View commit details
    Browse the repository at this point in the history
  3. UPBGE: Fix bullet ghost constraint solver.

    The function btSequentialImpulseConstraintSolver::getOrInitSolverBody
    wasn't managing the case of ghost object. The same function
    from recent bullet master has a better management but extra condition
    for ghost object is needed to disable an assert.
    
    The code of this function is copied from recent bullet master. It will
    be changed with the potential next bullet release.
    panzergame committed Oct 14, 2018
    Configuration menu
    Copy the full SHA
    3366966 View commit details
    Browse the repository at this point in the history

Commits on Oct 15, 2018

  1. UPBGE: Fix object render settings for batching groups. (#861)

    Previously object render settings such as light layer or object color
    were not managed for batching groups.
    
    For attribute like layers we can choose to make an union of all objects
    layers, but in case of color there's no meaning of union.
    
    To solve this issue one object should be used as reference for the group.
    The attribute KX_BatchGroup.referenceObject is defined and initialized
    to the first merged object when creating a batch group.
    Later the user can change it to an other object of the same group.
    
    Internally this object is set in KX_BatchGroup and RAS_BatchGroup,
    KX_BatchGroup see a KX_GameObject and RAS_BatchGroup only the RAS_MeshUser
    of this object. This mesh user is retrieved in RAS_DisplayArrayBucket::RunBatchingNode
    from the first mesh slot mesh user and passed to RAS_IMaerial::ActivateMeshUser
    which aims the update of material uniforms from object settings.
    panzergame authored Oct 15, 2018
    Configuration menu
    Copy the full SHA
    263b6a8 View commit details
    Browse the repository at this point in the history

Commits on Oct 17, 2018

  1. UPBGE: Fix mesh polygon count.

    The number of polygons was based on number of triangle
    indices but wasn't divided by 3.
    
    Fix issue #893.
    panzergame committed Oct 17, 2018
    Configuration menu
    Copy the full SHA
    8c8b8db View commit details
    Browse the repository at this point in the history

Commits on Oct 18, 2018

  1. UPBGE: Make Python 3.7 by default in MacOSX

    To be inline with dependencies built
    lordloki committed Oct 18, 2018
    Configuration menu
    Copy the full SHA
    2fd8501 View commit details
    Browse the repository at this point in the history

Commits on Oct 19, 2018

  1. UPBGE: Fix UniformInfo < operator.

    operator < for UniformInfo wasn't const and failed compilation
    on MacOS.
    
    Fix reported by @lordloki.
    
    Fix issue #894.
    panzergame committed Oct 19, 2018
    Configuration menu
    Copy the full SHA
    ac5a84d View commit details
    Browse the repository at this point in the history

Commits on Oct 20, 2018

  1. UPBGE: Fix color space of ImageRender textures. (#891)

    With the introduction of color management, every scene render is
    in linear color space and the final draw to the screen (potentially
    after filters) might be in sRGB space.
    
    This behvaiour has the side effect of leaving ImageRender/ImageViewport
    images in linear spaces as they result from a scene render. But all
    blender textures were before supposed to be sRGB space and converted
    back into linear in material shaders. Now it is partially the case.
    
    The way of fixing this issue is to leave an option in material texture
    panel to select color space of the image. The default is sRGB and
    texture sapped with ImageRender in game must select Linear space.
    Realtime envmap always ignore this setting as they are in linear
    space in any cases.
    
    The option color space from the image panel in texture tab is
    disabled to not make ambiguity with the new option. This option is
    only left in the UV editor.
    panzergame authored Oct 20, 2018
    Configuration menu
    Copy the full SHA
    0d30856 View commit details
    Browse the repository at this point in the history

Commits on Oct 21, 2018

  1. UPBGE: Fix color space for world texture.

    Color space wasn't exposed for world texture slot, now they are
    the same than material texture slot.
    panzergame committed Oct 21, 2018
    Configuration menu
    Copy the full SHA
    5ac1856 View commit details
    Browse the repository at this point in the history
  2. UPBGE: Fix batching uvs and colors.

    The uvs and colors were merged at the wrong place (begining of the vector)
    before.
    panzergame committed Oct 21, 2018
    Configuration menu
    Copy the full SHA
    ea1ffff View commit details
    Browse the repository at this point in the history
  3. UPBGE: Fix modifier deformer normal recalculation.

    Before if an object was using a modifier and armature deformation
    the deformer BL_ModifierDeformer was created and during an Update
    the armature mesh was first updated. But the function responsible
    to update the armature mesh is also recalculating the normals. But
    the derived mesh can have an higher number of vertices and so the
    update of normals was based on an incorrect number of vertices which
    induced memory overflow.
    
    When updating a derived mesh, then normals don't need to be updated.
    In this case BL_SkinDeformer::UpdateInternal should informs
    BGEDeformVerts or BlenderDeformVerts to not update normals.
    This is achieve by introducing a "recalcNormal" argument to functions
    UpdateInternal in BL_SkinDeformer and BL_ShapeDeformer levels.
    When the update is directly proceeded from one of these classes,
    recalcNormal is to true, if they are updated through top BL_ModifierDeformer
    recalcNormal is to false.
    
    Fix issue: #862.
    panzergame committed Oct 21, 2018
    Configuration menu
    Copy the full SHA
    9f54aab View commit details
    Browse the repository at this point in the history

Commits on Oct 30, 2018

  1. UPBGE: Fix mouse release event with multiple logic step per frame.

    Previously when the frame was slow enough to trigger multiple logic
    step, then the mouse movement events were wrongs, activated and
    deactived everytime.
    
    The release events are faked when the event consumer didn't receive
    an event for the current frame, this is proceeded in function
    SCA_IInputDevice::ReleaseMoveEvent.
    But this function was called at every logic step and the dispatch of
    events is produce between every frame not logic step.
    This caused to always set fake release events because it was impossible
    for the second logic step to get new mouse events.
    
    To fix this issue, ReleaseMoveEvent is called only once per frame.
    panzergame committed Oct 30, 2018
    Configuration menu
    Copy the full SHA
    dfb83b5 View commit details
    Browse the repository at this point in the history

Commits on Oct 31, 2018

  1. UPBGE: Fix for mouse actuator return value (#907)

    Now it works perfectly when activating from an always sensor.
    
    Additionally, it introduces a boolean check for initial skipping instead the modifying the oldposition.
    lordloki authored Oct 31, 2018
    Configuration menu
    Copy the full SHA
    51e8bf4 View commit details
    Browse the repository at this point in the history

Commits on Nov 4, 2018

  1. UPBGE: Fix KX_SteeringActuator.navmesh assignement.

    The type check for the assigned object is fixed.
    panzergame committed Nov 4, 2018
    Configuration menu
    Copy the full SHA
    d138c81 View commit details
    Browse the repository at this point in the history

Commits on Nov 8, 2018

  1. UPBGE: Fix duplication of navigation mesh objects.

    The duplication of navigation mesh was processing a regeneration of the mesh
    and a registration to the scene in the function BuildNavMesh. But the caller
    (ProcessReplica) is on an object without a scene graph node and so an access
    to its scene, this mean that the try to register the nav mesh in the scene
    obstacle simulation failed in BuildNavMesh because the scene is unreachable.
    
    To fix this issue the management of obstacle simulation for nav mesh and
    obstacles is fully moved into KX_Scene::AddNodeReplicaObject after the new
    object ensure a scene graph node.
    
    Fix issue #926.
    panzergame committed Nov 8, 2018
    Configuration menu
    Copy the full SHA
    b387a7f View commit details
    Browse the repository at this point in the history

Commits on Nov 21, 2018

  1. UPBGE: Expose vertex indices checkbox by default under "N" lateral pa…

    …nel (#833)
    
    Before it is only accesible under Debug mode
    lordloki authored Nov 21, 2018
    Configuration menu
    Copy the full SHA
    a861b9d View commit details
    Browse the repository at this point in the history
  2. UPBGE: expose World Space Shading under UPBGE shading tab

    When this option is actived we will use the world space interpretation
    of light data for node materials. Basically you will be able to change
    normals from camera space to world space.
    
    Thanks to @ethicalfive for the code and investigation.
    lordloki committed Nov 21, 2018
    Configuration menu
    Copy the full SHA
    44fb0ae View commit details
    Browse the repository at this point in the history

Commits on Nov 30, 2018

  1. UPBGE: Allow KX_LibLoadStatus.onFinish to call python method. (#896)

    Previously KX_LibLoadStatus finish callback was only permitted to be
    python function not method.
    
    To allow calling a method, work from EXP_RunPythonCallBackList is reused
    and the calling of a python function is moved into new function
    EXP_RunPythonCallback. This function is in charge of checking that the
    python object is callable and construct a tuple of the arguments.
    
    EXP_RunPythonCallback is now called into KX_LibLoadStatus::RunFinishCallback.
    panzergame authored Nov 30, 2018
    Configuration menu
    Copy the full SHA
    f4b465f View commit details
    Browse the repository at this point in the history
  2. UPBGE: Support backtrace file writing for blenderplayer. (#895)

    Blenderplayer now supports backtrace write into text file of the
    name of the current loaded file or default "blender".
    This file contain the backtrace constructed during a SIGSEGV.
    Useful for bug report.
    
    GPG_ghost.cpp mimic creator part by setting up a signal function
    sigHandleCrash (or windowsExceptionHandler for windows which call
    sigHandleCrash at the end) calling sigHandleCrashBacktrace
    in responsible of writing the file using BLI_system_backtrace.
    
    Fix issue: #739.
    panzergame authored Nov 30, 2018
    Configuration menu
    Copy the full SHA
    1024d63 View commit details
    Browse the repository at this point in the history

Commits on Dec 1, 2018

  1. UPBGE: Fix header for signal enum.

    Import csignal to provide SIG_* values.
    panzergame committed Dec 1, 2018
    Configuration menu
    Copy the full SHA
    6eb5811 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    9f19357 View commit details
    Browse the repository at this point in the history
  3. UPBGE: Fix geometry instancing mesh sort.

    Third argument of std::transform must be the beginning of the list to transform.
    panzergame committed Dec 1, 2018
    Configuration menu
    Copy the full SHA
    4cf7122 View commit details
    Browse the repository at this point in the history

Commits on Dec 2, 2018

  1. UPBGE: Remove scene exemple in python component template file.

    Previously a small python code was provided in the python
    component template file. This exemple was using the __component__
    attribute to define a global variable. But at the end the exemple
    of scene global variable is unstable.
    Indeed the scene during loading of the python script might be
    undefined or wrong, also if the script is imported from multiple
    objects but from different scenes, the global variable is unknown,
    could be the first or the second scene depending on import order.
    
    To avoid confusion this block is erased and a comment is let in
    start() and update() precising to use self.object.scene to get the
    current scene.
    
    Startup file is updated too.
    panzergame committed Dec 2, 2018
    Configuration menu
    Copy the full SHA
    39f8897 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    abf0a36 View commit details
    Browse the repository at this point in the history

Commits on Dec 15, 2018

  1. UPBGE: Expose parallax component for material texture. (#841)

    Peviously parallax node was able to select an other texture component
    than alpha thanks to a enum option.
    
    This option is ported to material texture and so visible in material
    texture parallax panel.
    
    The value is defaulted to alpha for versioning and new textures.
    panzergame authored Dec 15, 2018
    Configuration menu
    Copy the full SHA
    fec68ed View commit details
    Browse the repository at this point in the history

Commits on Dec 16, 2018

  1. UPBGE: Restore object info node. (#790)

    Previously the object info node was doing nothing directly by the fact
    that GPU_material_bind_uniforms was using nullptr for the last argument
    corresponding to the float array of object info.
    
    The object info node is using 4 values
    - location
    - material index
    - object index
    - random
    
    location is directly accessible from the object model matrix, concerning
    material index, object index and random, theses values are stored into
    a 3 float array.
    
    In case of non-instancing drawing this array is passed as argument of
    GPU_material_bind_uniforms.
    The array is built in BL_BlenderShader::Update using the material index
    passed to this Update function, the object index stored into the mesh user
    and also the random stored into the mesh user (which is computed at the
    construction of a mesh user based on its client pointer).
    
    In case of instancing the array is packed to the instancing buffer.
    This data attribute is named INFO_ATTRIB. The vertex shader (similar
    to object layer) receives an instancing attribute and copy it to a varying
    for the fragment shader. Function GPU_material_builtin is responsible of
    selecting the varying instead of the uniform if the material is using
    instancing. This function GPU_material_builtin is also used everywhere
    in material nodes to avoid futur issues with instancing masterials.
    
    The material and object index is taken directly from the UI named as
    "Pass Index". Its value is stored in both KX_GameObject and
    KX_BlenderMaterial under the variable name m_passIndex.
    
    The pass index is exposed in python too under attributes:
    KX_BlenderMaterial.passIndex
    KX_GameObject.passIndex
    
    This commit is used as an example documentation :
    https://github.com/UPBGE/blender/wiki/Implementing-pass-index
    panzergame authored Dec 16, 2018
    Configuration menu
    Copy the full SHA
    9ec0894 View commit details
    Browse the repository at this point in the history
  2. init

    temp
    
    temp
    
    temp
    
    temp
    
    temp
    
    temp
    
    temp
    
    Add name support.
    
    Make uvs and colors name optional.
    panzergame committed Dec 16, 2018
    Configuration menu
    Copy the full SHA
    52319fe View commit details
    Browse the repository at this point in the history
  3. Add KX_Mesh.destruct().

    panzergame committed Dec 16, 2018
    Configuration menu
    Copy the full SHA
    4752c6f View commit details
    Browse the repository at this point in the history
  4. temp

    panzergame committed Dec 16, 2018
    Configuration menu
    Copy the full SHA
    c857fbb View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    c072135 View commit details
    Browse the repository at this point in the history
  6. Add recalculateNormals.

    panzergame committed Dec 16, 2018
    Configuration menu
    Copy the full SHA
    c99ef97 View commit details
    Browse the repository at this point in the history
  7. Add comments.

    panzergame committed Dec 16, 2018
    Configuration menu
    Copy the full SHA
    270958b View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    90f8165 View commit details
    Browse the repository at this point in the history
  9. temp

    panzergame committed Dec 16, 2018
    Configuration menu
    Copy the full SHA
    dccc9cf View commit details
    Browse the repository at this point in the history