Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2009-05-07BGE performance, 3rd round: culling and rasterizer.Benoit Bolsee
This commit extend the technique of dynamic linked list to the mesh slots so as to eliminate dumb scan or map lookup. It provides massive performance improvement in the culling and in the rasterizer when the majority of objects are static. Other improvements: - Compute the opengl matrix only for objects that are visible. - Simplify hash function for GEN_HasedPtr - Scan light list instead of general object list to render shadows - Remove redundant opengl calls to set specularity, shinyness and diffuse between each mesh slots. - Cache GPU material to avoid frequent call to GPU_material_from_blender - Only set once the fixed elements of mesh slot - Use more inline function The following table shows the performance increase between 2.48, 1st round and this round of improvement. The test was done with a scene containing 40000 objects, of which 1000 are in the view frustrum approximately. The object are simple textured cube to make sure the GPU is not the bottleneck. As some of the rasterizer processing time has moved under culling, I present the sum of scenegraph(includes culling)+rasterizer time Scenegraph+rasterizer(ms) 2.48 1st round 3rd round All objects static, 323.0 86.0 7.2 all visible, 1000 in the view frustrum All objects static, 219.0 49.7 N/A(*) all invisible. All objects moving, 323.0 105.6 34.7 all visible, 1000 in the view frustrum Scene destruction 40min 40min 4s (*) : this time is not representative because the frame rate was at 60fps. In that case, the GPU holds down the GE by frame sync. By design, the overhead of the rasterizer is 0 when the the objects are invisible. This table shows a global speed up between 9x and 45x compared to 2.48a for scenegraph, culling and rasterizer overhead. The speed up goes much higher when objects are invisible. An additional 2-4x speed up is possible in the scenegraph by upgrading the Moto library to use Eigen2 BLAS library instead of C++ classes but the scenegraph is already so fast that it is not a priority right now. Next speed up in logic: many things to do there...
2009-05-07python3 compatibility for the BGE api, this only works with scons when ↵Campbell Barton
WITH_BF_NOBLENDER is enabled. Mathutils, Geometry and BGL modules are currently disabled with python3
2009-05-04print BGE Py api warnings only once to avoid flooding the terminal and ↵Campbell Barton
slowing the game down too much, resets on loading scenes/blendfiles and restarting the game engine.
2009-05-03on second thought its less trouble to make a python script that makes all ↵Campbell Barton
the getset's in the array, apologies to Alex for suggesting this be dynamic :/ included python script to print out getsets as a comment
2009-05-03[#18678] Swizzle properties for Mathutils.VectorCampbell Barton
patch from Alex Fraser (z0r) eg. - vec.xyz = vec.zyx - vec.xy = vec.zw - vec.xxy = vec.wzz - vec.yzyz = vec.yxyx See http://en.wikipedia.org/wiki/Swizzling_(computer_graphics) made some minor modifications to this patch. tested access times and adding 336 attributes to vectors doesn't make a noticeable differences to speed of existing axis attributes (x,y,z,w) - thanks to python dict lookups.
2009-05-03fixes for bugs submitted by BGE users, fixes by myself and Mitchell StokesCampbell Barton
- when the attribute check function failed it didnt set an error raising a SystemError instead - Rasterizer.getMaterialMode would never return KX_BLENDER_MULTITEX_MATERIAL - PropertySensor value attribute checking function was always returning a fail. - Vertex Self Shadow python script didnt update for meshes with modifiers.
2009-05-02BGE Py API patch from Mitchell Stokes, adds extra attributes and docsCampbell Barton
2009-05-01BGE: New function GameLogic.setMaxLogicFrame() to allow better control over ↵Benoit Bolsee
the time spent on logic. This function sets the maximum number of logic frame executed per render frame. Valid values: 1..5 This function is useful to control the amount of processing consumed by logic. By default, up to 5 logic frames can be executed per render frame. This is fine as long as the time spent on logic is negligible compared to the render time. If it's not the case, the default value will drag the performance of the game down by executing unnecessary logic frames that take up most of the CPU time. You can avoid that by lowering the value with this function. The drawback is less precision in the logic system to physics and I/O activity. Note that it does not affect the physics system: physics will still run at full frame rate (actually up to 5 times the ticrate). You can further control the render frame rate with GameLogic.setLogicTicRate().
2009-05-01add blendfile dirs to the sys.path without the scripts subdirCampbell Barton
2009-04-30added Geometry as a BGE module, removed its dependency on gen_utils.cCampbell Barton
2009-04-30BGE Python sys.path for the blenderplayer and blenderCampbell Barton
sys.path is the search path for python modules. This is useful so people making games can put all their scripts in a folder and be sure they will always load into the BGE. for each blend file a scripts directory is added to the path /home/me/foo.blend will look for modules in... /home/me/scripts/*.py It could also default to look for modules in the same directory as the blend file but I think this is messy. Added a note in the tooltip about //scripts so its not such a hidden feature. This works by storing the original sys.path, then adding the paths for the blendfile and all its libs, when a new blendfile is loaded, the original sys.path is restored before adding the blendfiles paths again so the sys.path wont get junk in it. One problem with this - when using linked libs the module names must be unique else it will load the wrong module for one of the controllers. also fixed 2 bugs - sys.path in the blenderplayer was growing by 1 for every file load in blenderplayer - the relative path (gp_GamePythonPath), wasnt being set when loading files in the blenderlayer (as I wrongly said in the last commit).
2009-04-30python modules in the game engine could point to builtin modules like ↵Campbell Barton
GameLogic that was cleared. I added module clearing before there was checks for invalid python objects, so now its not needed for BGE Builtin types at least. also made the builtin modules get re-used if they already exist and clear all user modules when the game engine finishes so with Module-Py-Controllers the referenced modules are at least up to date when pressing Pkey.
2009-04-29ifdef's for future py3 support, after this adding py3 can mostly be done ↵Campbell Barton
with defines or batch renaming funcs (with the exception of CListValue slicing) . No changes for py2.x.
2009-04-25BGE API - small changesCampbell Barton
- print CListValue errors only once. - bge_api_validate_py.txt now validates modules as well as types. - added missing functions and consts for epydoc modules. some of these in GameLogic.py still need sorting.
2009-04-23BGE Rasterizer methods to handle Screen Space - (getScreenPosition, ↵Dalai Felinto
getScreenVect, getScreenRay) getScreenPosition(obj): - Gets the position of an object projected on screen space. getScreenVect(x, y): - Gets the vector from the camera position in the screen coordinate direction. getScreenRay(x, y, dist, property): - Look towards a screen coordinate (x,y) and find first object hit within dist that matches prop. - The ray is a call to KX_GameObject->rayCastTo from the KX_Camera object. Patch [#18589] test files can be found there. Patch reviewed by Campbell
2009-04-23BGE bug #17670: Python controlled mist doesnt work in textured mode.Benoit Bolsee
2009-04-21use PyList_SET_ITEM instead of PyList_SetItem,Campbell Barton
PyList_SetItem does error checking and decref's existing values, PyList_SET_ITEM is a macro for direct assignment, only for use on new lists.
2009-04-20BGE Python APICampbell Barton
- initialize pythons sys.argv in the blenderplayer - ignore all arguments after a single " - " in the blenderplayer (like in blender), so args can be passed to the game. - add a utility function PyOrientationTo() - to take a Py euler, quat or 3x3 matrix and convert into a C++ MT_Matrix3x3. - add utility function ConvertPythonToMesh to get a RAS_MeshObject from a KX_MeshProxy or a name. - Added error prefix arguments to ConvertPythonToGameObject, ConvertPythonToMesh and PyOrientationTo so the error messages can include what function they came from. - deprecated brick.getOwner() for the "owner" attribute.
2009-04-20BGE Python APICampbell Barton
- More verbose error messages. - BL_Shader wasnt setting error messages on some errors - FilterNormal depth attribute was checking for float which is bad because scripts often expect ints assigned to float attributes. - Added a check to PyVecTo for a tuple rather then always using a generic python sequence. On my system this is over 2x faster with an optmized build.
2009-04-19BGE Python APICampbell Barton
removed redundant (PyObject *self) argument from python functions that are not exposed to python directly.
2009-04-19BGE Python APICampbell Barton
This changes how the BGE classes and Python work together, which hasnt changed since blender went opensource. The main difference is PyObjectPlus - the base class for most game engine classes, no longer inherit from PyObject, and cannot be cast to a PyObject. This has the advantage that the BGE does not have to keep 2 reference counts valid for C++ and Python. Previously C++ classes would never be freed while python held a reference, however this reference could be problematic eg: a GameObject that isnt in a scene anymore should not be used by python, doing so could even crash blender in some cases. Instead PyObjectPlus has a member "PyObject *m_proxy" which is lazily initialized when python needs it. m_proxy reference counts are managed by python, though it should never be freed while the C++ class exists since it holds a reference to avoid making and freeing it all the time. When the C++ class is free'd it sets the m_proxy reference to NULL, If python accesses this variable it will raise a RuntimeError, (check the isValid attribute to see if its valid without raising an error). - This replaces the m_zombie bool and IsZombie() tests added recently. In python return values that used to be.. return value->AddRef(); Are now return value->GetProxy(); or... return value->NewProxy(true); // true means python owns this C++ value which will be deleted when the PyObject is freed
2009-04-16bpy_internal_import.c should build with py2.3 now, also gave ↵Campbell Barton
bpy_internal_import functions better names.
2009-04-15BGE Python APICampbell Barton
Free python modules defined within the blendfile between loading scenes since they would end up accessing old GameLogic, Rasterizer modules as well as old game engine data in the module namespace which can cause problems.
2009-04-15BGE Py ApiCampbell Barton
importing modules wasnt returning the error from the blender text if it failed.
2009-04-10BGE API cleanup: ConstraintActuator.Benoit Bolsee
2009-04-10BGE API cleanup: StateActuator.Benoit Bolsee
2009-04-10BGE API cleanup: sound actuator.Benoit Bolsee
2009-04-09Added GameKeys.EventToCharacter(event, is_shift) so you can get the ↵Campbell Barton
character that would be types when pressing a key. Last commit was made in the pydocs folder only, so this includes changes mentioned in rev 19620.
2009-04-09BGE API cleanup: 2DFilterActuator.Benoit Bolsee
2009-04-08small bge editsCampbell Barton
- Only try and remove light objects from the light list. - Only loop over mesh verts once when getting the bounding box - dont return None from python attribute localInertia when theres no physics objects. better return a vector still. - add names to send message PyArg_ParseTuple functions.
2009-04-08BGE patch #18350: Add sendMessage() to GameLogic. Added sendMessage to both ↵Benoit Bolsee
GameLogic and KX_GameObject.
2009-04-07BGE Py APICampbell Barton
- Added OpenGL access to the game engine as a module so you can import BGL directly.
2009-04-06BGE Python APICampbell Barton
- added a module for the BGE - GameTypes, only contains types. - added KX_PYATTRIBUTE_DUMMY attributes for KX_Light, KX_PolyProxy, KX_VertexProxy, so all types should give correct results from a dir(). - added a script to check for missing methods in the epydocs - bge_api_validate_py.txt
2009-04-06- remove debug printfCampbell Barton
- remove test for importing the module rather then creating a new one (didnt mean to commit) - added constants for the mouse sensor to use.
2009-04-06Python ref-counting fixesCampbell Barton
2009-04-05BGE PyAPI can now import text (within the blend-file)Campbell Barton
Previously this only worked with the Blender API. - bpy_internal_import small C file that Blender scripting and the game engine use. - Tested with blender, blenderplayer, loading files - Needed to use a hack to override the Main struct since the game engine doesn't set G.main - when the sandbox is set, only internal scripts can be imported.
2009-04-03Python BGE APICampbell Barton
- Initialize python types with PyType_Ready, which adds methods to the type dictionary. - use Pythons get/setattro (uses a python string for the attribute rather then char*). Using basic C strings seems nice but internally python converts them to python strings and discards them for most functions that accept char arrays. - Method lookups use the PyTypes dictionary (should be faster then Py_FindMethod) - Renamed __getattr -> py_base_getattro, _getattr -> py_getattro, __repr -> py_base_repr, py_delattro, py_getattro_self etc. From here is possible to put all the parent classes methods into each python types dictionary to avoid nested lookups (api has 4 levels of lookups in some places), tested this but its not ready yet. Simple tests for getting a method within a loop show this to be between 0.5 and 3.2x faster then using Py_FindMethod()
2009-04-01BGE API cleanup: DynamicActuator, ReplaceMeshActuator, TrackToActuator.Benoit Bolsee
2009-03-31BGE API cleanup, patch from Moguri: RaySensor, NetworkMessageActuator, ↵Benoit Bolsee
NetworkMessageSensor.
2009-03-26Added attributes for Ipo Actuator settings (replacing all methods)Campbell Barton
2009-03-01BGE API cleanup: apply patch from Moguri: Near, Radar, Touch sensor updated.Benoit Bolsee
2009-02-28BGE Python APICampbell Barton
* Scene's and GameObjects can now be printed (raised an exception) * Added GameLogic.getSceneList()
2009-02-25remove warnings for the BGECampbell Barton
- variables that shadow vers declared earlier - Py_Fatal print an error to the stderr - gcc was complaining about the order of initialized vars (for classes) - const return values for ints and bools didnt do anything. - braces for ambiguous if statements
2009-02-23BGE Python APICampbell Barton
* fixed segfaults in CListValue.index(val) and CListValue.count(val) when the pyTypes could not be converted into a CValue. * added scene.objects to replace scene.getObjectList() * added function names to PyArg_ParseTuple() so errors will include the function names * removed cases of PyArg_ParseTuple(args,"O",&pyobj) where METH_O ensures a single argument. * Made PyObjectFrom use ugly python api rather then Py_BuildValue(), approx %40 speedup for functions that return Python vector and matrix types like ob.orientation.
2009-01-22BGE API cleanup: shape action actuator.Benoit Bolsee
2008-11-01Preparation to VideoTexture: everything but the VideoTexture module itself.Benoit Bolsee
Rename PHY_GetActiveScene() to KX_GetActiveScene(): more logical name Add KX_GetActiveEngine() new KX_KetsjiEngine::GetClockTime(void) to return current render frame time: if the CPU does not keep up with the frame rate, up to 5 consecutive logic frames are processed between each render frame, so that the logic system stays accurate even if the graphic system is slow. For the video texture module, it is important to stay in sync with the render frame: no need to update the texture for logic frame. BL_Texture::swapTexture(): texture id manipulation BL_Texture::getTex() : return material texture Enable video support in ffmpeg for Linux.
2008-10-11Fix for a relative paths issue in the game engine. G.sce was beingBrecht Van Lommel
kept as the original file, but that can't work correct for solving relative paths once a .blend in another directory is loaded. The reason it went OK with the apricot tech demo is that the images there were lib linked into the level file, which still worked. Now it sets G.sce to the current loaded .blend file. Note that the python config file path still uses the first loaded .blend file so it looks in the same location each time. Also added some NULL pointer checks in the joystick code because it was crashing there on Mac, there's similar checks in related functions so I'm assuming this was just a missed case.
2008-10-03Blender works with python 2.6, our own import functions that replace pythons ↵Campbell Barton
internal function needed updating for an extra in argument in 2.6. if importing is not working blender should not crash (was crashing on exit)
2008-10-03error with GameLogic.globalDict loading. It would replace the dictionary ↵Campbell Barton
rather then updating it. This meant the BGE would load in an old dictonary replacing the loaded dict, loosing settings. was also missing a decref for marshal data
2008-10-02Python 2.4 should build with the game engine now, no thanks to python for ↵Campbell Barton
switching from char to const char