Commit Graph

123 Commits

Author SHA1 Message Date
Benoit Bolsee
3e59a88450 Fix compilation problem in Windows and update project files 2009-09-24 09:29:59 +00:00
Andrea Weikert
2c871f722d 2.5 MSVC projectfiles
* maintenance (added poseSlide.c)
2009-09-20 11:13:57 +00:00
Benoit Bolsee
a911fd88af Update MSVC project files. 2009-09-17 11:17:49 +00:00
Benoit Bolsee
971e984b08 Update MSVC project files 2009-09-15 13:28:36 +00:00
Andrea Weikert
9a25d22326 2.5 filebrowser
Appending and Linking 
* Linking Operator, invokes filebrowser for Append/Link
* Separated the append/link function into three parts:
** BLO_library_append_begin finds main for appending
** BLO_library_append_named_part appends one Object,Group, Material, ...
** BLO_library_append_end actually reads and expands the libraries

NOTE 1:
I also changed the returned properties for the filebrowser operators to the following convention:
"path" - the full path to a file or directory, means what is in directory + filename buttons in filebrowser
"directory" - the content of the directory button in filebrowser
"filename" - the content of the filename button in filebrowser
Usually only path should be required, but in some cases it might be more convenient to retrieve the parts separately.

Ton, Brecht: If you have time to take a look, let me know if anything needs to be fixed.
2009-09-12 19:54:39 +00:00
Andrea Weikert
0bc8fd08e7 Blender 2.5 MSVC 9 projectfiles
* maintenance: 
** nodes/intern/CMP_nodes/CMP_colorMatte.c
** nodes/intern/CMP_nodes/CMP_distanceMatte.c
** nodes/intern/CMP_nodes/CMP_levels.c
* smoke include dir added to GL_gpu library
2009-09-12 12:34:33 +00:00
Andrea Weikert
ace94617c7 2.5 MSVC projectfiles
* small maintenance for split files in editors/object
2009-09-09 18:18:09 +00:00
Brecht Van Lommel
3daa283604 2.5: Object module
* Split object_edit.c into multiple files:
  object_add.c, object_edit.c, object_hook.c, object_relations.c,
  object_select.c, object_transform.c.
* Rename files to have consistent object_ and mball_ prefix:
  object_shapekey.c, object_lattice.c, object_vgroup.c, mball_edit.c.
* Added operators:
  * vertex group menu and set active
  * apply location, rotation, scale, visual transform (location is new)
  * make local
  * make vertex parent
  * move to layer
  * convert to curve/mesh (not finished yet)
* Many small fixes for marked issues, but still much code to be cleaned
  up here...
2009-09-09 11:52:56 +00:00
Andrea Weikert
01eaf4fd5f 2.5 MSVC 9 projectfiles
* maintenance
2009-09-07 18:44:01 +00:00
Benoit Bolsee
af85ee01f8 Update MSVC project files. 2009-08-28 13:42:58 +00:00
Andrea Weikert
0ff90bb258 blender 2.5 MSVC projectfiles
* update for bpy_array.c
2009-08-25 17:32:01 +00:00
Andrea Weikert
7288bacad9 blender 2.5 MSVC projectfiles
* update for volume rendering
* update for audaspace jack
* update for rna: animation_api.c, scene_api.c
2009-08-25 17:05:04 +00:00
Andrea Weikert
977a50ad77 2.5 MSVC projectfiles maintenance
* AUD_filefactory added.
* imbuf added to RNA include dirs.
2009-08-22 08:35:39 +00:00
Benoit Bolsee
6dbadb23ce update MSVC project files. 2009-08-20 09:18:55 +00:00
Andrea Weikert
92cfad965d 2.5 MSVC 9 projectfiles maintenance
* rev. 22367: splitting of anim_channels.c
* rev. 22383: units.c in blenkernel added
* Fix include paths was intern/audaspace, code expected intern/audaspace/intern
2009-08-12 18:06:30 +00:00
Benoit Bolsee
578000b2ca MSVC project files: removed SoundSystem completely 2009-08-10 21:53:19 +00:00
Benoit Bolsee
c2239abdbd MSVC project files: add audaspace project, upgrade to Python 3.1 2009-08-10 18:36:12 +00:00
Benoit Bolsee
b6abeca2fe Update MSVC projects files 2009-08-01 10:13:32 +00:00
Andrea Weikert
3d096c2712 blender 2.5 MSVC9 projectfiles
fix renamed rna_vpaint.c -> rna_sculpt_paint.c
2009-07-26 09:35:40 +00:00
Andrea Weikert
3ecb88fc76 2.5 MSVC 9 projectfiles
* maintenance: console_space, physics_boids, rna_render
2009-07-22 18:06:59 +00:00
Andrea Weikert
f787712cbb 2.5 MSVC projectfiles
* update for NLA merge from Aligorith
2009-07-11 17:29:53 +00:00
Andrea Weikert
66ca86b40b 2.5 file browser
* directory button enabled again, c code for now, can later become nicer operator
* filename button enabled (pattern match for selection)
* RNA completed (title, file and directory)
* some unused code removal.
2009-07-10 17:05:04 +00:00
Andrea Weikert
e3661aac9a 2.5 MSVC9 projectfiles
* small maintenance: keyval.c removed, some headers in editors/include renamed.
2009-07-08 17:40:42 +00:00
Andrea Weikert
79633056ac 2.5
* fix for RNA generation dependency in MSVC projectfiles
* added missing include
2009-07-06 17:29:32 +00:00
Andrea Weikert
d390ee1b60 2.5 MSVC9 projectfiles
* RNA project cleanup. Better file naming and first attempt at deleting files before rebuilding.
* editors/object/object_vgroup.c added
2009-07-05 19:11:29 +00:00
Andrea Weikert
60c2599a1a 2.5 filebrowser
* show only name of the last directory for the bookmark
* small fix of projectfile: header BLI_fileops.h was moved
Note: full path should appear in tool tip later, also for renaming bookmarks later on.
2009-06-30 20:34:00 +00:00
Andrea Weikert
406b16e7d1 2.5 MSVC projectfiles
* small maintenance: editors/info_header.c removed, editors/info_ops.c added
2009-06-30 20:31:58 +00:00
Andrea Weikert
3b0fafa393 2.5 MSVC projectfiles
* moving projectfiles to python 2.6 to avoid recurring issues with python migration
2009-06-30 18:20:45 +00:00
Andrea Weikert
5e20f57431 2.5 filebrowser
* start of filebrowser RNA 
* system files, bookmarks, etc. now nicely inside panels to allow collapsing etc.
* filebrowser header now defined in space_filebrowser.py

TODO:
* button type for bookmarks etc. not final yet, at least should get centered still. Suggestions welcome here.
2009-06-29 20:23:40 +00:00
Andrea Weikert
2fac3f3550 2.5 MSVC 9 projectfiles
* added missing include to KX_blenderhook project
2009-06-28 07:26:16 +00:00
Andrea Weikert
2293347af8 2.5 MSVC9 projectfiles
* RNA: move of rna_*_api.c files
* removed deleted projects ODE, SUMO etc.
* Added new files to editors/space_logic
2009-06-22 22:39:28 +00:00
Campbell Barton
a1cf7988c1 svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r20855:20928
Sequencer changes from source/blender/src coming next
2009-06-16 14:21:58 +00:00
Dalai Felinto
8ab502b894 MSVC fix for rev. #20909 (reported/patched by moguri) 2009-06-16 03:27:57 +00:00
Andrea Weikert
32cf82dbb3 2.5 UI
* RNA enum for icons to allow specifying icons as string
* example: row.itemR(st, "line_numbers", text="", icon='ICON_LINENUMBERS_OFF')
2009-06-15 20:28:49 +00:00
Benoit Bolsee
297329b75b Update MSVC9 project files. Use pthreadVC2 instead of pthreadVSE2 to match scons (don't know why we were using VSE2 in the first place). 2009-06-14 19:59:59 +00:00
Andrea Weikert
069c13c9ea 2.5 MSVC9 projectfiles
* enabled game engine in regular build
Note1: blenderplayer hasn't been looked at yet and is not linking
Note2: KX_blenderhook and KX_converter need windowmanager include, this dependency should probably be removed.
2009-06-14 15:14:17 +00:00
Brecht Van Lommel
c8b4cf9206 2.50:
svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r19820:HEAD

Notes:
* Game and sequencer RNA, and sequencer header are now out of date
  a bit after changes in trunk.
* I didn't know how to port these bugfixes, most likely they are
  not needed anymore.
  * Fix "duplicate strip" always increase the user count for ipo.
  * IPO pinning on sequencer strips was lost during Undo.
2009-06-08 20:08:19 +00:00
Andrea Weikert
35914d8ca2 2.5 MSVC projectfiles
* added file editors/space_buttons/buttons_context.c
* removed BRE_yafray project
2009-06-04 20:05:08 +00:00
Andrea Weikert
3159f4a243 2.5 MSVC projectfiles update
- file editors/space_image/image_panels.c -> image_buttons.c (renamed)
- file editors/interface/interface_templates.c added

Also added small fix for crash in filebrowser.
2009-05-26 18:54:39 +00:00
Andrea Weikert
ba6bec56f9 2.5 filebrowser
- drawing code cleanup
- use of BLF_font in own string drawing, needs to be aligned with uiStyles still.
- thumbnail scaling now done on graphics card via new glaDrawPixelsTexScaled (slightly modified glaDrawPixelsTex)
2009-05-14 18:08:14 +00:00
Benoit Bolsee
d95a109990 BGE modifier: generate correct physic shape, share static derived mesh, share display list.
This commit completes the support for modifiers in the BGE.
- The physic shape is generated according to the derived mesh. 
  This is true for all types of shapes and all types of 
  objects except soft body.
- Optimization for static derived mesh (mesh with modifiers
  but no armature and no shape keys). Replicas will share
  the derived mesh and the display list: less memory and
  faster rendering. With this optimization, the static 
  derived mesh will render as fast as if the modifiers were
  applied.

Known Limits:
- Sharing of mesh and display list is only possible between
  in-game replicas or dupligroup. If you want to instantiate
  multiple objects with modifiers, use dupligroup to ensure
  best memory and GPU utilization.
- rayCast() will interact with the derived mesh as follow:
  Hit position and hit normal are the real values according
  to the derived mesh but the KX_PolyProxy object refers to
  the original mesh. You should use it only to retrieve the
  material.
- Dynamic derived mesh have very poor performance:
  They use direct openGL calls for rendering (no support
  for display list and vertex array) and they dont't share
  the derived mesh memory. Always apply modifiers on dynamic
  mesh for best performance.
- Time dependent modifiers are not supported.
- Modifiers are not supported for Bullet soft body.
2009-05-14 13:47:08 +00:00
Benoit Bolsee
ee1c29028d BGE: Add MT_Vector3 support for Py attribute macro system. See KX_PYATTRIBUTE_VECTOR_... 2009-05-11 12:41:48 +00:00
Benoit Bolsee
386122ada6 BGE performance, 4th round: logic
This commit extends the technique of dynamic linked list to the logic
system to eliminate as much as possible temporaries, map lookup or 
full scan. The logic engine is now free of memory allocation, which is
an important stability factor. 

The overhead of the logic system is reduced by a factor between 3 and 6
depending on the logic setup. This is the speed-up you can expect on 
a logic setup using simple bricks. Heavy bricks like python controllers
and ray sensors will still take about the same time to execute so the
speed up will be less important.

The core of the logic engine has been much reworked but the functionality
is still the same except for one thing: the priority system on the 
execution of controllers. The exact same remark applies to actuators but
I'll explain for controllers only:

Previously, it was possible, with the "executePriority" attribute to set
a controller to run before any other controllers in the game. Other than
that, the sequential execution of controllers, as defined in Blender was
guaranteed by default.

With the new system, the sequential execution of controllers is still 
guaranteed but only within the controllers of one object. the user can
no longer set a controller to run before any other controllers in the
game. The "executePriority" attribute controls the execution of controllers
within one object. The priority is a small number starting from 0 for the
first controller and incrementing for each controller.

If this missing feature is a must, a special method can be implemented
to set a controller to run before all other controllers.

Other improvements:
- Systematic use of reference in parameter passing to avoid unnecessary data copy
- Use pre increment in iterator instead of post increment to avoid temporary allocation
- Use const char* instead of STR_String whenever possible to avoid temporary allocation
- Fix reference counting bugs (memory leak)
- Fix a crash in certain cases of state switching and object deletion
- Minor speed up in property sensor
- Removal of objects during the game is a lot faster
2009-05-10 20:53:58 +00:00
Benoit Bolsee
42557f90bd BGE performance, 3rd round: culling and rasterizer.
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-07 09:13:01 +00:00
Andrea Weikert
ee4e89ec53 Blender 2.5
MSVC projectfiles updates
* removed WITH_FREETYPE2
* update for several missing or moved files rna_fcurve.c, gpencil.c,...
2009-05-06 18:51:58 +00:00
Benoit Bolsee
3abb8e8e68 BGE performance: second round of scenegraph improvement.
Use dynamic linked list to handle scenegraph rather than dumb scan
of the whole tree. The performance improvement depends on the fraction
of moving objects. If most objects are static, the speed up is 
considerable. The following table compares the time spent on 
scenegraph before and after this commit on a scene with 10000 objects
in various configuratons:

Scenegraph time (ms)              Before         After
(includes culling)

All objects static,               8.8            1.7  
all visible but small fraction          
in the view frustrum

All objects static,               7,5            0.01
all invisible.

All objects moving,               14.1           8.4
all visible but small fraction
in the view frustrum

This tables shows that static and invisible objects take no CPU at all
for scenegraph and culling. In the general case, this commit will 
speed up the scenegraph between 2x and 5x. Compared to 2.48a, it should
be between 4x and 10x faster. Further speed up is possible by making
the scenegraph cache-friendly.

Next round of performance improvement will be on the rasterizer: use
the same dynamic linked list technique for the mesh slots.
2009-05-03 22:29:00 +00:00
Benoit Bolsee
ba563216e9 BGE: Fix Orthographic mode and viewport scaling
- the BGE now uses correct glOrtho projection whe camera is in orthographic mode
-
2009-04-26 12:23:30 +00:00
Benoit Bolsee
d11a5bbef2 BGE: Support mesh modifiers in the game engine.
Realtime modifiers applied on mesh objects will be supported in 
the game engine with the following limitations:

- Only real time modifiers are supported (basically all of them!)
- Virtual modifiers resulting from parenting are not supported: 
  armature, curve, lattice. You can still use these modifiers 
  (armature is really not recommended) but in non parent mode. 
  The BGE has it's own parenting capability for armature.
- Modifiers are computed on the host (using blender modifier
  stack).
- Modifiers are statically evaluated: any possible time dependency
  in the modifiers is not supported (don't know enough about
  modifiers to be more specific).
- Modifiers are reevaluated if the underlying mesh is deformed
  due to shape action or armature action. Beware that this is 
  very CPU intensive; modifiers should really be used for static
  objects only.
- Physics is still based on the original mesh: if you have a 
  mirror modifier, the physic shape will be limited to one half
  of the resulting object. Therefore, the modifiers should 
  preferably be used on graphic objects.
- Scripts have no access to the modified mesh. 
- Modifiers that are based on objects interaction (boolean,..)
  will not be dependent on the objects position in the GE.
  What you see in the 3D view is what you get in the GE regardless
  on the object position, velocity, etc.

Besides that, the feature is compatible with all the BGE features
that affect meshes: armature action, shape action, relace mesh, 
VideoTexture, add object, dupligroup.

Known problems:
- This feature is a bit hacky: the BGE uses the derived mesh draw 
  functions to display the object. This drawing method is a
  bit slow and is not 100% compatible with the BGE. There may
  be some problems in multi-texture mode: the multi-texture
  coordinates are not sent to the GPU. 
  Texface and GLSL on the other hand should be fully supported.
- Culling is still based on the extend of the original mesh. 
  If you have a modifer that extends the size of the mesh, 
  the object may disappear while still in the view frustrum.
- Derived mesh is not shared between replicas.
  The derived mesh is allocated and computed for each object
  with modifiers, regardless if they are static replicas.
- Display list are not created on objects with modifiers.
  
I should be able to fix the above problems before release.
However, the feature is already useful for game development.
Once you are ready to release the game, you can apply the modifiers
to get back display list support and mesh sharing capability.

MSVC, scons, Cmake, makefile updated.

Enjoy
/benoit
2009-04-21 11:01:09 +00:00
Brecht Van Lommel
874c29cea8 2.50: svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r19323:HEAD
Notes:
* blenderbuttons and ICON_SNAP_PEEL_OBJECT were not merged.
2009-04-20 15:06:46 +00:00
Andrea Weikert
629c4bf8bf 2.5 MSVC9 projectfiles
* long time due: copy the executables to the install/msvc9 or install/msvc9d dir instead of keeping them in the source tree in the bin folder!
* copy the new ui scripts to the install dir
2009-04-18 10:08:19 +00:00